From: rkingdon Date: Fri, 5 Dec 2003 17:55:54 +0000 (+0000) Subject: Added the setting of League Table options to the Administration page. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bfd68abc581abd5559c6d8bfa870a32c4dfee477;p=moodle.git Added the setting of League Table options to the Administration page. --- diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index fc0a2a753b..09d4d28d5a 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -2203,6 +2203,36 @@ function workshop_list_submissions_for_admin($workshop, $order) { print_simple_box_end(); } + echo "
"; + print_simple_box_start("center"); + print_heading_with_help(get_string("leaguetable", "workshop"), "leaguetable", "workshop"); + echo "
\n"; + echo "id\">\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

".get_string("numberofentries", "workshop").":

"; + unset($numbers); + $numbers[22] = 'All'; + $numbers[21] = 50; + for ($i=20; $i>=0; $i--) { + $numbers[$i] = $i; + } + $nentries = $workshop->showleaguetable; + if ($nentries == 99) { + $nentries = 'All'; + } + choose_from_menu($numbers, "nentries", "$nentries", ""); + echo "

".get_string("hidenamesfromstudents", "workshop", $course->students)."

\n"; + $options[0] = get_string("no"); $options[1] = get_string("yes"); + choose_from_menu($options, "anonymous", $workshop->anonymous, ""); + echo "

\n"; + echo "\n"; + echo "
\n"; + print_simple_box_end(); + // list any teacher submissions $table->head = array (get_string("title", "workshop"), get_string("submittedby", "workshop"), get_string("action", "workshop")); $table->align = array ("left", "left", "left"); diff --git a/mod/workshop/submissions.php b/mod/workshop/submissions.php index ed55dcb28b..1cdc641b02 100644 --- a/mod/workshop/submissions.php +++ b/mod/workshop/submissions.php @@ -1372,6 +1372,29 @@ } + /*************** update (league table options teacher) ***************************/ + elseif ($action == 'updateleaguetable') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + $form = (object)$_POST; + + // save number of entries in showleaguetable option + if ($form->nentries == 'All') { + $form->nentries = 99; + } + set_field("workshop", "showleaguetable", $form->nentries, "id", "$workshop->id"); + + // save the anonymous option + set_field("workshop", "anonymous", $form->anonymous, "id", "$workshop->id"); + add_to_log($course->id, "workshop", "league table", "view.php?id=$cm->id", $form->nentries); + + redirect("submissions.php?action=adminlist&id=$cm->id"); + } + + /*************** update over allocation (by teacher) ***************************/ elseif ($action == 'updateoverallocation') {