diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index 6c25ff0585c..ed7172f4547 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -2,6 +2,9 @@ include_once("$CFG->dirroot/files/mimetypes.php"); +// reset error reporting +error_reporting($CFG->debug); + /*** Constants **********************************/ $WORKSHOP_TYPE = array (0 => get_string("notgraded", "workshop"), @@ -707,7 +710,7 @@ function workshop_list_user_submissions($workshop, $user) { function workshop_print_assessment($workshop, $assessment, $allowchanges, $showcommentlinks) function workshop_print_assessments_by_user_for_admin($workshop, $user) { function workshop_print_assessments_for_admin($workshop, $submission) { -function workshop_print_assignment_info($workshop) { +function workshop_print_assignment_info($cm, $workshop) { function workshop_print_difference($time) { function workshop_print_feedback($course, $submission) { function workshop_print_league_table($workshop) { @@ -2593,8 +2596,21 @@ function workshop_print_assessments_for_admin($workshop, $submission) { function workshop_print_assignment_info($workshop) { + + if (! $course = get_record("course", "id", $workshop->course)) { + error("Course is misconfigured"); + } + if (! $cm = get_coursemodule_from_instance("workshop", $workshop->id, $course->id)) { + error("Course Module ID was incorrect"); + } + // print standard assignment heading + $strdifference = format_time($workshop->deadline - time()); + if (($workshop->deadline - time()) < 0) { + $strdifference = "$strdifference"; + } + $strduedate = userdate($workshop->deadline)." ($strdifference)"; print_simple_box_start("center"); - print_heading($workshop->name); + print_heading($workshop->name, "center"); print_simple_box_start("center"); echo "".get_string("duedate", "assignment").": $strduedate
"; echo "".get_string("maximumgrade").": $workshop->grade
"; @@ -2605,7 +2621,7 @@ function workshop_print_assignment_info($workshop) { echo "
"; echo format_text($workshop->description, $workshop->format); print_simple_box_end(); - echo "
"; + echo "
"; } diff --git a/mod/workshop/view.php b/mod/workshop/view.php index 54cf52ad7c1..3e3277254da 100644 --- a/mod/workshop/view.php +++ b/mod/workshop/view.php @@ -64,6 +64,7 @@ "", "", true, update_module_button($cm->id, $course->id, $strworkshop), navmenu($course, $cm)); // ...and if necessary set default action + optional_variable($action); if (isteacher($course->id)) { if (empty($action)) { // no action specified, either go straight to elements page else the admin page @@ -273,25 +274,7 @@ /*********************** student's view could be in 1 of 4 stages ***********************/ elseif ($action == 'studentsview') { - // print standard assignment heading - $strdifference = format_time($workshop->deadline - time()); - if (($workshop->deadline - time()) < 0) { - $strdifference = "$strdifference"; - } - $strduedate = userdate($workshop->deadline)." ($strdifference)"; - print_simple_box_start("CENTER"); - print_heading($workshop->name, "CENTER"); - print_simple_box_start("CENTER"); - echo "".get_string("duedate", "assignment").": $strduedate
"; - echo "".get_string("maximumgrade").": $workshop->grade
"; - echo "".get_string("detailsofassessment", "workshop").": - id&action=displaygradingform\">". - get_string("specimenassessmentform", "workshop")."
"; - print_simple_box_end(); - echo "
"; - echo format_text($workshop->description, $workshop->format); - print_simple_box_end(); - echo "
"; + workshop_print_assignment_info($workshop); // in Stage 1? - are there any teacher's submissions? and... // ...has student assessed the required number of the teacher's submissions ("satisfactory level" dropped 14/8/03) if ($workshop->ntassessments and (!workshop_test_user_assessments($workshop, $USER))) {