private string GetRubricPoints(Rubric rub, int subID) { Rubrics rubda = new Rubrics(Globals.CurrentIdentity); Result.ResultList ress = rubda.GetResults(rub.ID, subID); if (ress.Count == 0 && rub.EvalID >= 0) { return("??"); } else { return(rubda.GetPoints(rub.ID, subID).ToString()); } }
private DataTable TabulateUsers(User.UserList users) { DataTable resulttab = new DataTable(); int asstID = GetAsstID(); Rubrics rubda = new Rubrics(Globals.CurrentIdentity); Principals prinda = new Principals(Globals.CurrentIdentity); Rubric asstrub = new Assignments(Globals.CurrentIdentity).GetRubric(asstID); //Add rubric columns to data grid Rubric.RubricList flatrub = rubda.Flatten(asstrub); resulttab.Columns.Add("UserName"); resulttab.Columns.Add("Status"); resulttab.Columns.Add("Total"); foreach (Rubric rub in flatrub) { AddRubricColumn(rub.Name, rub.Name); resulttab.Columns.Add(rub.Name); } //Add user data to the datatable foreach (User user in users) { Components.Submission sub = prinda.GetLatestSubmission(user.PrincipalID, asstID); DataRow row = resulttab.NewRow(); if (sub == null) { continue; } row["UserName"] = user.UserName; row["Status"] = sub.Status; row["Total"] = rubda.GetPoints(asstrub.ID, sub.ID).ToString() + "/" + asstrub.Points.ToString(); foreach (Rubric rub in flatrub) { row[rub.Name] = GetRubricPoints(rub, sub.ID) + "/" + rub.Points.ToString(); } resulttab.Rows.Add(row); } return(resulttab); }