Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix minor bug in Administration page.

  • Loading branch information...
commit 6a6f95c3cb85979ff11837c86f56627549179cef 1 parent f01e431
rkingdon authored
Showing with 69 additions and 6 deletions.
  1. +57 −0 mod/exercise/assessments.php
  2. +12 −6 mod/exercise/lib.php
View
57 mod/exercise/assessments.php
@@ -5,6 +5,7 @@
adminconfirmdelete
admindelete
+ adminedit
adminlist
adminlistbystudent
assessresubmission
@@ -101,6 +102,46 @@
}
+ /******************* admin amend Grading Grade ************************************/
+ if ($action == 'adminamendgradinggrade' ) {
+
+ if (!isteacher($course->id)) {
+ error("Only teachers can look at this page");
+ }
+ if (empty($_GET['aid'])) {
+ error("Admin Amend Grading grade: assessment id missing");
+ }
+
+ if (!$assessment = get_record("exercise_assessments", "id", $_GET['aid'])) {
+ error("Amin Amend Grading grade: assessment not found");
+ }
+ print_heading(get_string("amend", "exercise")." ".get_string("gradeforstudentsassessment",
+ "exercise", $course->student));
+ echo "<form name=\"amendgrade\" method=\"post\" action=\"assessments.php\">\n";
+ echo "<input type=\"hidden\" name=\"aid\" value=\"$_GET[aid]\">\n";
+ echo "<input type=\"hidden\" name=\"action\" value=\"updategradinggrade\">\n";
+ echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\">\n";
+ echo "<table width=\"50%\" align=\"center\" border=\"1\">\n";
+ echo "<tr><td align=\"right\"><b>".get_string("gradeforstudentsassessment", "exercise",
+ $course->student)." :</td><td>\n";
+ // set up coment scale
+ for ($i=COMMENTSCALE; $i>=0; $i--) {
+ $num[$i] = $i;
+ }
+ choose_from_menu($num, "gradinggrade", $assessment->gradinggrade, "");
+ echo "</td></tr>\n";
+ echo "<tr><td colspan=\"2\" align=\"center\">";
+ echo "<INPUT TYPE=submit VALUE=\"".get_string("amend", "exercise")."\">\n";
+ echo "</td></tr>\n";
+ echo "</table>\n";
+ echo "</CENTER>";
+ echo "</FORM>\n";
+
+
+
+ }
+
+
/*********************** admin list of asssessments (of a submission) (by teachers)**************/
elseif ($action == 'adminlist') {
@@ -1006,6 +1047,22 @@
}
+ /****************** update grading grade(by teacher) ***************************/
+ elseif ($action == 'updategradinggrade') {
+
+ if (!isteacher($course->id)) {
+ error("Only teachers can look at this page");
+ }
+
+ require_variable($aid);
+ if (!set_field("exercise_assessments", "gradinggrade", $_POST['gradinggrade'], "id",
+ $_POST['aid'])) {
+ error("Update grading grade: asseesment not updated");
+ }
+ redirect("submissions.php?id=$cm->id&action=adminlist", get_string("savedok", "exercise"), 1);
+ }
+
+
/****************** user confirm delete ************************************/
elseif ($action == 'userconfirmdelete' ) {
View
18 mod/exercise/lib.php
@@ -1534,11 +1534,13 @@ function exercise_list_submissions_for_admin($exercise) {
}
}
}
- print_heading(get_string("studentsubmissions", "exercise", $course->student)." [$nsubmissions]",
+ if (isset($table->data)) {
+ print_heading(get_string("studentsubmissions", "exercise", $course->student)." [$nsubmissions]",
"center");
- print_table($table);
- echo "<center><p>".get_string("resubmitnote", "exercise", $course->student)."</p>\n";
- echo "<p>".get_string("allgradeshaveamaximumof", "exercise", $exercise->grade)."</p></center>\n";
+ print_table($table);
+ echo "<p align=\"center\">".get_string("resubmitnote", "exercise", $course->student)."</p>\n";
+ }
+ echo "<p align=\"center\">".get_string("allgradeshaveamaximumof", "exercise", $exercise->grade)."</p></center>\n";
}
}
@@ -2556,7 +2558,10 @@ function exercise_print_assessments_by_user_for_admin($exercise, $user) {
foreach ($assessments as $assessment) {
echo "<p><center><b>".get_string("assessmentby", "exercise", $user->firstname." ".$user->lastname)."</b></center></p>\n";
exercise_print_assessment_form($exercise, $assessment);
- echo "<p align=\"right\"><a href=\"assessments.php?action=adminconfirmdelete&id=$cm->id&aid=$assessment->id\">".
+ echo "<p align=\"right\"><a href=\"assessments.php?action=adminamendgradinggrade&id=$cm->id&aid=$assessment->id\">".
+ get_string("amend", "exercise")." ".get_string("gradeforstudentsassessment","exercise",
+ $course->student)."</a>\n";
+ echo " | <a href=\"assessments.php?action=adminconfirmdelete&id=$cm->id&aid=$assessment->id\">".
get_string("delete", "exercise")."</a></p><hr>\n";
}
}
@@ -3075,10 +3080,11 @@ function exercise_print_dual_assessment_form($exercise, $assessment, $submission
}
}
echo "&nbsp;</td>\n";
- echo "</tr>\n";
+ echo "</tr></table>\n";
// the teacher's comment on the assessment
// always allow the teacher to change/add their comment and grade if it's not their assessment!
+ echo "<p><center><table cellpadding=\"5\" border=\"1\">\n";
if (isteacher($course->id) and ($assessment->userid != $USER->id)) {
echo "<tr valign=\"top\">\n";
echo " <td colspan=\"2\" bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".
Please sign in to comment.
Something went wrong with that request. Please try again.