Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change to the handling of Error Banded asessments; Removed percentages

from grades.
  • Loading branch information...
commit 178761415f62983a8e01c8161b0249c2e6346e5c 1 parent a50f447
rkingdon authored
View
21 mod/exercise/assessments.php
@@ -318,7 +318,7 @@
echo "<CENTER><TABLE cellpadding=5 border=1><TR><TD ALIGN=\"CENTER\">".
get_string("numberofnegativeresponses", "exercise");
echo "</TD><TD>". get_string("suggestedgrade", "exercise")."</TD></TR>\n";
- for ($j = 100; $j >= 0; $j--) {
+ for ($j = $exercise->grade; $j >= 0; $j--) {
$numbers[$j] = $j;
}
for ($i=0; $i<=$exercise->nelements; $i++) {
@@ -515,9 +515,7 @@
}
break;
} // end of switch
- echo "<P>\n";
- notice_yesno(get_string("amendassessmentelements","exercise")." ".get_string("again"),
- "assessments.php?id=$cm->id&action=editelements", "view.php?id=$cm->id");
+ redirect("view.php?id=$cm->id", get_string("savedok", "exercise"));
}
@@ -679,11 +677,12 @@
if (!$element->id = insert_record("exercise_grades", $element)) {
error("Could not insert exercise element!");
}
- $grade = $elements[intval($error + 0.5)]->maxscore + $form->grade[$i];
- // echo "<P><B>".get_string("weightederrorcount", "exercise", intval($error + 0.5)).
+ $grade = ($elements[intval($error + 0.5)]->maxscore + $form->grade[$i])
+ * 100.0 / $exercise->grade;
+ // echo "<P><B>".get_string("weightederrorcount", "exercise", intval($error + 0.5)).
// " ".get_string("adjustment", "exercise").": ".$form->grade[$i]."</B>\n";
// check the grade for sanity!
- if ($grade >100.0) {
+ if ($grade > 100.0) {
$grade = 100.0;
}
if ($grade < 0.0) {
@@ -785,8 +784,8 @@
// show grade if grading strategy is not zero
if ($exercise->gradingstrategy) {
redirect($returnto, "<p align=\"center\"><b>".get_string("thegradeis", "exercise").": ".
- number_format($grade * $exercise->grade / 100.0, 1)."% (".get_string("maximumgrade").
- " ".number_format($exercise->grade)."%)</b></p>", 1);
+ number_format($grade * $exercise->grade / 100.0, 1)." (".get_string("maximumgrade").
+ " ".number_format($exercise->grade).")</b></p>", 1);
}
else {
redirect($returnto);
@@ -998,8 +997,8 @@
// show grade if grading strategy is not zero
if ($exercise->gradingstrategy) {
redirect($returnto, "<p align=\"center\"><b>".get_string("thegradeis", "exercise").": ".
- number_format($grade * $exercise->grade / 100.0, 1)."% (".get_string("maximumgrade").
- " ".number_format($exercise->grade)."%)</b></p>", 1);
+ number_format($grade * $exercise->grade / 100.0, 1)." (".get_string("maximumgrade").
+ " ".number_format($exercise->grade).")</b></p>", 1);
}
else {
redirect($returnto);
View
44 mod/exercise/lib.php
@@ -1457,10 +1457,10 @@ function exercise_list_submissions_for_admin($exercise, $order) {
// test for allocated assesments which have not been done
if ($assessment->timecreated < $timenow) {
// show only warm or cold assessments
- $title .= " {".number_format($assessment->grade * $exercise->grade / 100.0, 0)."%";
+ $title .= " {".number_format($assessment->grade * $exercise->grade / 100.0, 0);
if ($assessment->timegraded) {
$title .= "/".number_format($assessment->gradinggrade * $exercise->grade /
- COMMENTSCALE, 0)."%";
+ COMMENTSCALE, 0);
}
$title .= "} ";
if ($realassessments = exercise_count_user_assessments_done($exercise, $user)) {
@@ -1546,7 +1546,7 @@ function exercise_list_submissions_for_admin($exercise, $order) {
count($submissions)."]", "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";
+ echo "<p>".get_string("allgradeshaveamaximumof", "exercise", $exercise->grade)."</p></center>\n";
}
}
@@ -2073,8 +2073,8 @@ function exercise_print_assessment_form($exercise, $assessment = false, $allowch
// only show the grade if grading strategy > 0 and the grade is positive
if ($exercise->gradingstrategy and $assessment->grade >= 0) {
echo "<CENTER><B>".get_string("thegradeis", "exercise").": ".
- number_format($assessment->grade * $exercise->grade / 100.0, 2)."% (".
- get_string("maximumgrade")." ".number_format($exercise->grade, 0)."%)</B></CENTER><BR CLEAR=ALL>\n";
+ number_format($assessment->grade * $exercise->grade / 100.0, 2)." (".
+ get_string("maximumgrade")." ".number_format($exercise->grade, 0).")</B></CENTER><BR CLEAR=ALL>\n";
}
}
@@ -2437,10 +2437,10 @@ function exercise_print_assessment_form($exercise, $assessment = false, $allowch
}
echo "<TD>".text_to_html($rubrics[$j]->description)."</TD>\n";
}
- echo "<TR valign=top>\n";
- echo " <TD align=right><P><B>". get_string("feedback").":</B></P></TD>\n";
+ echo "<TR valign=top>\n";
+ echo " <TD align=right><P><B>". get_string("feedback").":</B></P></TD>\n";
echo " <TD>\n";
- if ($allowchanges) {
+ if ($allowchanges) {
echo " <textarea name=\"feedback[]\" rows=3 cols=75 wrap=\"virtual\">\n";
if (isset($grades[$i]->feedback)) {
echo $grades[$i]->feedback;
@@ -2449,11 +2449,11 @@ function exercise_print_assessment_form($exercise, $assessment = false, $allowch
}
else {
echo text_to_html($grades[$i]->feedback);
- }
- echo " </td>\n";
- echo "</tr>\n";
- echo "<tr valign=\"top\">\n";
- echo " <td colspan=\"2\" bgcolor=\"$THEME->cellheading2\">&nbsp;</TD>\n";
+ }
+ echo " </td>\n";
+ echo "</tr>\n";
+ echo "<tr valign=\"top\">\n";
+ echo " <td colspan=\"2\" bgcolor=\"$THEME->cellheading2\">&nbsp;</TD>\n";
echo "</tr>\n";
}
}
@@ -2465,13 +2465,13 @@ function exercise_print_assessment_form($exercise, $assessment = false, $allowch
switch ($exercise->gradingstrategy) {
case 0:
case 1:
- case 4 : // no grading, accumulative and rubic
+ case 4 : // no grading, accumulative and rubic
echo " <td align=\"right\"><P><B>". get_string("generalcomment", "exercise").":</B></P></TD>\n";
break;
default :
echo " <td align=\"right\"><P><B>". get_string("reasonforadjustment", "exercise").":</B></P></TD>\n";
- }
- echo " <td>\n";
+ }
+ echo " <td>\n";
if ($allowchanges) {
echo " <textarea name=\"generalcomment\" rows=5 cols=75 wrap=\"virtual\">\n";
if (isset($assessment->generalcomment)) {
@@ -2680,8 +2680,8 @@ function exercise_print_dual_assessment_form($exercise, $assessment, $submission
// only show the grade if grading strategy > 0 and the grade is positive
if ($exercise->gradingstrategy and $assessment->grade >= 0) {
echo "<CENTER><B>".get_string("thegradeis", "exercise").": ".
- number_format($assessment->grade * $exercise->grade / 100.0, 2)."% (".
- get_string("maximumgrade")." ".number_format($exercise->grade, 0)."%)</B></CENTER><BR CLEAR=ALL>\n";
+ number_format($assessment->grade * $exercise->grade / 100.0, 2)." (".
+ get_string("maximumgrade")." ".number_format($exercise->grade, 0).")</B></CENTER><BR CLEAR=ALL>\n";
}
// now print the student's assessment form with the teacher's comments if any
@@ -3148,8 +3148,8 @@ function exercise_print_dual_assessment_form($exercise, $assessment, $submission
// only show the grade if grading strategy > 0 and the grade is positive
if ($exercise->gradingstrategy and $assessment->grade >= 0) {
echo "<CENTER><B>".get_string("thegradeis", "exercise").": ".
- number_format($assessment->grade * $exercise->grade / 100.0, 2)."% (".
- get_string("maximumgrade")." ".number_format($exercise->grade, 0)."%)</B></CENTER><BR CLEAR=ALL>\n";
+ number_format($assessment->grade * $exercise->grade / 100.0, 2)." (".
+ get_string("maximumgrade")." ".number_format($exercise->grade, 0).")</B></CENTER><BR CLEAR=ALL>\n";
}
echo "<center><table cellpadding=\"2\" border=\"1\">\n";
@@ -3641,10 +3641,10 @@ function exercise_print_submission_assessments($exercise, $submission) {
if ($assessments = exercise_get_assessments($submission)) {
foreach ($assessments as $assessment) {
if (isteacher($exercise->course, $assessment->userid)) {
- $str .= "[".number_format($assessment->grade * $exercise->grade / 100.0, 0)."%] ";
+ $str .= "[".number_format($assessment->grade * $exercise->grade / 100.0, 0)."] ";
}
else { // assessment by student - shouldn't happen!
- $str .= "{".number_format($assessment->grade * $exercise->grade / 100.0, 0)."%} ";
+ $str .= "{".number_format($assessment->grade * $exercise->grade / 100.0, 0)."} ";
}
}
}
View
2  mod/exercise/submissions.php
@@ -234,7 +234,7 @@
exercise_print_league_table($exercise);
echo "<br \>\n";
}
- print_string("allgradeshaveamaximumof", "exercise", $exercise->grade)."%\n";
+ print_string("allgradeshaveamaximumof", "exercise", $exercise->grade)."\n";
print_continue("view.php?id=$cm->id");
}
View
2  mod/exercise/view.php
@@ -144,7 +144,7 @@
if ($exercise->showleaguetable) {
exercise_print_league_table($exercise);
}
- echo "<br />".get_string("allgradeshaveamaximumof", "exercise", $exercise->grade)."%<br />\n";
+ echo "<br />".get_string("allgradeshaveamaximumof", "exercise", $exercise->grade)."<br />\n";
}
Please sign in to comment.
Something went wrong with that request. Please try again.