Exemple #1
0
        public void GetAssignmentByIDTest()
        {
            int ID = 1;

            var TheAssignment = _AS.GetAssignmentByID(ID);

            Assert.IsTrue("Assignment1" == TheAssignment.Name);
        }
Exemple #2
0
        public ActionResult CreateMilestone(int AssignmentID, int?CourseID)
        {
            if (AS.GetAssignmentByID(AssignmentID) == null)
            {
                throw new Exception();
            }
            if (CourseID != null)
            {
                if (!AS.CourseExist(CourseID))
                {
                    throw new Exception();
                }
            }
            var ViewModel = new MilestoneViewModel();

            ViewModel.UserModel = US.GetUserOverviewByUserName(User.Identity.GetUserName(), CourseID);
            return(View(ViewModel));
        }
Exemple #3
0
        public ActionResult StudentHome(int?id)
        {
            var ViewModel = US.GetUserOverviewByUserName(User.Identity.GetUserName(), id);

            if (ViewModel.Submissions != null)
            {
                foreach (var m in ViewModel.Submissions)
                {
                    m.AssignmentName = AS.GetAssignmentByID(m.AssignmentID).Name;
                }
            }

            if (ViewModel.Assignments != null)
            {
                foreach (var ass in ViewModel.Assignments)
                {
                    var submissions = ViewModel.Submissions.Where(x => x.AssignmentID == ass.ID).ToList();
                    ass.Grade = AS.GetGradeForAssignment(ass.Milestones, submissions);
                }
            }

            return(View(ViewModel));
        }
        public ActionResult Details(int id)
        {
            var model = _assignmentService.GetAssignmentByID(id);

            return(View(model));
        }