}
} else if ($gradingtype > 0) {
for ($i=$gradingtype; $i>=0; $i--) {
- $grades[$i] = $i;
+ $grades[$i] = "$i / $gradingtype";
}
return $grades;
}
choose_from_menu($minutes, $minute, $currentdate['minutes'], "");
}
+function print_grade_menu($courseid, $name, $current) {
+/// Prints a grade menu (as part of an existing form) with help
+/// Showing all possible numerical grades and scales
+
+ global $CFG, $THEME;
+
+ $strscale = get_string("scale");
+ $strscales = get_string("scales");
+
+ $scales = get_scales_menu($course->id);
+ foreach ($scales as $i => $scalename) {
+ $grades[-$i] = "$strscale: $scalename";
+ }
+ $grades[0] = get_string("nograde");
+ for ($i=100; $i>=1; $i--) {
+ $grades[$i] = $i;
+ }
+ choose_from_menu($grades, "$name", "$current", "");
+
+ if (empty($THEME->custompix)) {
+ $helpicon = "$CFG->wwwroot/pix/help.gif";
+ } else {
+ $helpicon = "$CFG->wwwroot/theme/$CFG->theme/pix/help.gif";
+ }
+ $linkobject = "<img align=\"absmiddle\" border=0 height=17 width=22 alt=\"$strscales\" src=\"$helpicon\">";
+ link_to_popup_window ("/course/scales.php?id=$courseid&list=true", "ratingscales",
+ $linkobject, 400, 500, $strscales);
+}
+
function print_scale_menu($courseid, $name, $current) {
/// Prints a scale menu (as part of an existing form) including help button
+/// Just like print_grade_menu but without the numerical grades
global $CFG, $THEME;
<td align=right><p><b><?php print_string("grade") ?>:</b></p></td>
<td>
<?php
- $scales = get_scales_menu($course->id);
- $strscale = get_string("scale");
- foreach ($scales as $i => $scalename) {
- $grades[-$i] = "$strscale: $scalename";
- }
- $grades[0] = get_string("nograde");
- for ($i=100; $i>=1; $i--) {
- $grades[$i] = $i;
- }
- choose_from_menu($grades, "grade", "$form->grade", "");
+ print_grade_menu($course->id, "grade", "$form->grade");
?>
</td>
</tr>
"eachuser" => get_string("eachuserforum", "forum"),
"single" => get_string("singleforum", "forum") );
-$FORUM_POST_RATINGS = array ("3" => get_string("postrating3", "forum"),
- "2" => get_string("postrating2", "forum"),
- "1" => get_string("postrating1", "forum") );
$FORUM_OPEN_MODES = array ("2" => get_string("openmode2", "forum"),
"1" => get_string("openmode1", "forum"),
choose_from_menu($options, "assessed", $form->assessed, "");
helpbutton("ratings", get_string("allowratings", "forum"), "forum");
- echo "<p><b>";
- print_string("scale");
- echo ":</b> ";
+ echo "<br />";
print_scale_menu($course->id, "scale", $form->scale);
- echo "</p>";
-
?>
</td>
</tr>