course)) { error("Course is misconfigured"); } if (! $workshop = get_record("workshop", "id", $cm->instance)) { error("Course module is incorrect"); } } else { if (! $workshop = get_record("workshop", "id", $a)) { error("Course module is incorrect"); } 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"); } } require_login($course->id); if ($course->category) { $navigation = "id\">$course->shortname ->"; } $strworkshops = get_string("modulenameplural", "workshop"); $strworkshop = get_string("modulename", "workshop"); $strsubmissions = get_string("submissions", "workshop"); // ... print the header and... print_header("$course->shortname: $workshop->name", "$course->fullname", "$navigation id>$strworkshops -> id\">$workshop->name -> $strsubmissions", "", "", true); //...get the action or set up an suitable default optional_variable($action); if (empty($action)) { $action = "listallsubmissions"; } /******************* admin amend title ************************************/ if ($action == 'adminamendtitle' ) { if (!isteacher($course->id)) { error("Only teachers can look at this page"); } if (empty($_GET['sid'])) { error("Admin Amend Title: submission id missing"); } $submission = get_record("workshop_submissions", "id", $_GET['sid']); print_heading(get_string("amendtitle", "workshop")); ?>
\n"; echo " \n"; echo "

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

\n"; echo " title\">\n"; echo "
\n"; echo "\n"; echo "
\n"; } /******************* admin confirm delete ************************************/ elseif ($action == 'adminconfirmdelete' ) { if (!isteacher($course->id)) { error("Only teachers can look at this page"); } if (empty($_GET['sid'])) { error("Admin confirm delete: submission id missing"); } notice_yesno(get_string("confirmdeletionofthisitem","workshop", get_string("submission", "workshop")), "submissions.php?action=admindelete&id=$cm->id&sid=$_GET[sid]", "submissions.php?id=$cm->id&action=adminlist"); } /******************* admin delete ************************************/ elseif ($action == 'admindelete' ) { if (!isteacher($course->id)) { error("Only teachers can look at this page"); } if (empty($_GET['sid'])) { error("Admin delete: submission id missing"); } if (!$submission = get_record("workshop_submissions", "id", $_GET['sid'])) { error("Admin delete: can not get submission record"); } print_string("deleting", "workshop"); // first get any assessments... if ($assessments = workshop_get_assessments($submission, 'ALL')) { foreach($assessments as $assessment) { // ...and all the associated records... delete_records("workshop_comments", "assessmentid", $assessment->id); delete_records("workshop_grades", "assessmentid", $assessment->id); echo "."; } // ...now delete the assessments... delete_records("workshop_assessments", "submissionid", $submission->id); } // ...and the submission record... delete_records("workshop_submissions", "id", $submission->id); // ..and finally the submitted file workshop_delete_submitted_files($workshop, $submission); print_continue("submissions.php?id=$cm->id&action=adminlist"); } /******************* list all submissions ************************************/ elseif ($action == 'adminlist' ) { if (!isteacher($course->id)) { error("Only teachers can look at this page"); } if (empty($_GET['order'])) { $order = "name"; } else { $order = $_GET['order']; } workshop_list_submissions_for_admin($workshop, $order); print_continue("view.php?id=$cm->id"); } /******************* admin update title ************************************/ elseif ($action == 'adminupdatetitle' ) { if (!isteacher($course->id)) { error("Only teachers can look at this page"); } if (empty($_POST['sid'])) { error("Admin Update Title: submission id missing"); } if (set_field("workshop_submissions", "title", $_POST['title'], "id", $_POST['sid'])) { print_heading(get_string("amendtitle", "workshop")." ".get_string("ok")); } print_continue("submissions.php?id=$cm->id&action=adminlist"); } /*************** calculate final grades (by teacher) ***************************/ elseif ($action == 'calculatefinalgrades') { $form = (object)$_POST; if (!isteacher($course->id)) { error("Only teachers can look at this page"); } // Get all the students in surname order if (!$users = get_course_students($course->id, "u.firstname, u.lastname")) { print_heading(get_string("nostudentsyet")); print_footer($course); exit; } // set up the weights from the calculate final grades form... if (isset($form->teacherweight)) { $teacherweight = $form->teacherweight; // ...and save them set_field("workshop", "teacherweight", $teacherweight, "id", "$workshop->id"); } if (isset($form->peerweight)) { $peerweight = $form->peerweight; // ...and save them set_field("workshop", "peerweight", $peerweight, "id", "$workshop->id"); } // get the include teachers grade flag if (isset($form->includeteachersgrade)) { $includeteachersgrade = $form->includeteachersgrade; set_field("workshop", "includeteachersgrade", $includeteachersgrade, "id", "$workshop->id"); } if (isset($form->biasweight)) { $biasweight = $form->biasweight; // ...and save them set_field("workshop", "biasweight", $biasweight, "id", "$workshop->id"); } if (isset($form->reliabilityweight)) { $reliabilityweight = $form->reliabilityweight; // ...and save them set_field("workshop", "reliabilityweight", $reliabilityweight, "id", "$workshop->id"); } if (isset($form->gradingweight)) { $gradingweight = $form->gradingweight; // ...and save them set_field("workshop", "gradingweight", $gradingweight, "id", "$workshop->id"); } // work out what to show in the final grades tables and what to include in the calculation of the final grade // teacher grades? if ($workshop->gradingstrategy and $teacherweight) { $useteachersgrades = 1; } else { $useteachersgrades = 0; } // peergrades? if ($workshop->gradingstrategy and $workshop->nsassessments and $peerweight) { $usepeergrades = 1; } else { $usepeergrades = 0; } // bias grades? if ((($workshop->ntassessments >= 3) or ($workshop->nsassessments >= 3)) and ($useteachersgrades or $usepeergrades) and $biasweight ) { $usebiasgrades = 1; } else { $usebiasgrades = 0; } // reliability grades? if ((($workshop->ntassessments >= 3) or ($workshop->nsassessments >= 3)) and ($useteachersgrades or $usepeergrades) and $reliabilityweight ) { $usereliabilitygrades = 1; } else { $usereliabilitygrades = 0; } // grading grades? if (($workshop->ntassessments or $workshop->nsassessments) and $gradingweight ) { $usegradinggrades = 1; } else { $usegradinggrades = 0; } // start to calculate the grand means $sumallteachergrades = 0.0; $nallteachergrades = 0; $sumallpeergrades = 0.0; $nallpeergrades = 0; // get the grades of each student's submission... // the method used allowed a submission to be graded by more than one teacher if (workshop_count_student_submissions($workshop)) { echo "
".get_string("studentsubmissions", "workshop", $course->student); echo "
\n"; echo "\n"; echo "\n"; if ($useteachersgrades) { echo "\n"; echo "\n"; } if ($usepeergrades) { echo "\n"; echo "\n"; } if ($useteachersgrades or $usepeergrades) { echo "\n"; } // display weights echo "\n"; echo "\n"; if ($useteachersgrades) { echo "\n"; } if ($usepeergrades) { echo "\n"; } if ($useteachersgrades or $usepeergrades) { echo "\n"; } echo "\n"; // go through the submissions in "user" order, makes comparing the two tables easier foreach ($users as $user) { if ($submissions = workshop_get_user_submissions($workshop, $user)) { foreach ($submissions as $submission) { $sumteachergrades = 0.0; $nteachergrades = 0; $sumpeergrades = 0.0; $npeergrades = 0; // have a look at each assessment and add to arrays if ($assessments = workshop_get_assessments($submission)) { foreach ($assessments as $assessment) { if (isteacher($workshop->course, $assessment->userid)) { // it's a teacher's $sumteachergrades += $assessment->grade; $nteachergrades++; if ($includeteachersgrade) { // add it to the student grades $sumpeergrades += $assessment->grade; $npeergrades++; } } else { // its' a student's $sumpeergrades += $assessment->grade; $npeergrades++; } } } if ($nteachergrades) { $teachergrade = intval($sumteachergrades / $nteachergrades + 0.5); $sumallteachergrades += $teachergrade; $nallteachergrades++; } else { $teachergrade = 0; } if ($npeergrades) { $peergrade = intval($sumpeergrades / $npeergrades + 0.5); $sumallpeergrades += $peergrade; $nallpeergrades++; } else { $peergrade = 0; } if ($teacherweight + $peerweight > 0) { $grade = intval((($useteachersgrades * $teachergrade * $WORKSHOP_FWEIGHTS[$teacherweight] + $usepeergrades * $peergrade * $WORKSHOP_FWEIGHTS[$peerweight]) / ($useteachersgrades * $WORKSHOP_FWEIGHTS[$teacherweight] + $usepeergrades * $WORKSHOP_FWEIGHTS[$peerweight])) + 0.5); } else { $grade = 0; } // display the grades... echo "\n"; echo "\n"; if ($useteachersgrades) { echo "\n"; echo "\n"; } if ($usepeergrades) { echo "\n"; echo "\n"; } if ($useteachersgrades or $usepeergrades) { echo "\n"; } // ...and save in the database set_field("workshop_submissions", "teachergrade", $teachergrade, "id", $submission->id); set_field("workshop_submissions", "peergrade", $peergrade, "id", $submission->id); } } } echo "
cellheading2\">$course->studentcellheading2\">".get_string("submissions","workshop")."cellheading2\">".get_string("assessmentsby", "workshop", $course->teachers)."cellheading2\">".get_string("numberofassessments", "workshop")."cellheading2\">".get_string("assessmentsby", "workshop", $course->students)."cellheading2\">".get_string("numberofassessments", "workshop")."cellheading2\">".get_string("gradeofsubmission", "workshop")."
cellheading2\">".get_string("weights","workshop")."cellheading2\"> cellheading2\">
$WORKSHOP_FWEIGHTS[$teacherweight]
cellheading2\">
$WORKSHOP_FWEIGHTS[$peerweight]
cellheading2\"> 
$user->firstname $user->lastname".workshop_print_submission_title($workshop, $submission)."$teachergrade[$nteachergrades]$peergrade[$npeergrades]$grade
\n"; } // now display the overall teacher and peer means if ($nallteachergrades) { $grandteachergrade = $sumallteachergrades / $nallteachergrades; } else { $grandteachergrade = 0; } if ($nallpeergrades) { $grandpeergrade = $sumallpeergrades / $nallpeergrades; } else { $grandpeergrade = 0; } if ($useteachersgrades) { echo "

".get_string("overallteachergrade", "workshop", number_format($grandteachergrade, 2))." [$nallteachergrades]\n"; } if ($usepeergrades) { echo "

".get_string("overallpeergrade", "workshop", number_format($grandpeergrade, 2))." [$nallpeergrades]
\n"; } // run thru each users and see how their assessments faired, we may junk the grading stats but what the heck! foreach ($users as $user) { // we need to calculate a user bias before we can calculate their reliability $sumbias = 0.0; // nbias is used later to show how many peer assessments the user has done $nbias[$user->id] = 0; if ($workshop->nsassessments) { // peer assessments? // run thru this user's assessments on the STUDENT submissions if ($assessments = workshop_get_student_assessments($workshop, $user)) { foreach ($assessments as $assessment) { $submission = get_record("workshop_submissions", "id", $assessment->submissionid); // calculate the sum of "validity" values, the bias in a user's grading... $sumbias += $submission->peergrade - $assessment->grade; $nbias[$user->id]++; } } } if ($nbias[$user->id] > 1) { // we could divide by n-1 to remove own score from calculation of mean but we don't because we re-use bias // values in the calculation of reliability, and it's all relative anyway $bias[$user->id] = $sumbias / $nbias[$user->id]; } else { $bias[$user->id] = 0.0; } // now look at all the user's assessments of both the TEACHER's submissions and the STUDENT submissions // to calculate their overall grading grade $sumgradinggrade = 0.0; $ngradinggrades = 0; if ($workshop->ntassessments or $workshop->nsassessments) { // worth looking? if ($assessments = workshop_get_user_assessments($workshop, $user)) { foreach ($assessments as $assessment) { if ($assessment->timegraded > 0) { $sumgradinggrade += $assessment->gradinggrade; $ngradinggrades++; } } } } if ($ngradinggrades) { $gradinggrade[$user->id] = $sumgradinggrade / $ngradinggrades; } else { $gradinggrade[$user->id] = 0.0; } } // calculate the mean value of "reliability", the accuracy of a user's grading (disregarding bias) // use a linear function rather than a squared function for reliability // at the same time calculate a reliability of a "dumb user" whose grades everything at the grand mean value $sumdumbreliability = 0.0; $ndumbreliability =0; foreach ($users as $user) { $sumreliability = 0.0; $nreliability = 0; if ($workshop->nsassessments) { // worth a look? // look only at the user's assessment of STUDENT submissions if ($assessments = workshop_get_student_assessments($workshop, $user)) { foreach ($assessments as $assessment) { $submission = get_record("workshop_submissions", "id", $assessment->submissionid); $sumreliability += abs($submission->peergrade - $assessment->grade - $bias[$user->id]); $nreliability++; $sumdumbreliability += abs($submission->peergrade - $grandpeergrade); $ndumbreliability++; } } } // calculate the mean reliability values if ($nreliability) { $reliability[$user->id] = $sumreliability / $nreliability; } else { $reliability[$user->id] = 999999; // big number } } if ($ndumbreliability) { $dumbreliability = $sumdumbreliability / $ndumbreliability; } else { $dumbreliability = 999999; // big number } // convert bias and reliability values into scales where 1 is prefect, 0 is no grading done... // ...but first find the largest (absolute) value of the bias measures if (max($bias) > abs(min($bias))) { $maxbias = max($bias); } else { $maxbias = abs(min($bias)); } echo "

".get_string("studentgrades", "workshop", $course->student)."
\n"; echo "
\n"; if ($useteachersgrades) { echo "\n"; } if ($usepeergrades) { echo "\n"; } if ($usebiasgrades) { echo "\n"; } if ($usereliabilitygrades) { echo "\n"; } if ($usegradinggrades) { echo "\n"; } echo "\n"; // now display the weights echo "\n"; if ($useteachersgrades) { echo "\n"; } if ($usepeergrades) { echo "\n"; } if ($usebiasgrades) { echo "\n"; } if ($usereliabilitygrades) { echo "\n"; } if ($usegradinggrades) { echo "\n"; } echo "\n"; foreach ($users as $user) { // get user's best submission $bestgrade = -1; $teachergrade = 0; $peergrade = 0; if ($submissions = workshop_get_user_submissions($workshop, $user)) { foreach ($submissions as $submission) { $grade = ($submission->teachergrade * $WORKSHOP_FWEIGHTS[$teacherweight] + $submission->peergrade * $WORKSHOP_FWEIGHTS[$peerweight]) / ($WORKSHOP_FWEIGHTS[$teacherweight] + $WORKSHOP_FWEIGHTS[$peerweight]); if ($grade > $bestgrade) { $bestgrade = $grade; $teachergrade = $submission->teachergrade; $peergrade = $submission->peergrade; $bestsubmission = $submission; } } } else { // funny this user did not submit - create a dummy submission to hold any grades they might have $bestsubmission->workshopid = $workshop->id; $bestsubmission->userid = $user->id; $bestsubmission->title = "No Submission"; $bestsubmission->timecreated = 0; if (!$bestsubmission->id = insert_record("workshop_submissions", $bestsubmission)) { error("Unable to create dummy submission record"); } } // biasgrade is scaled between zero and one NEED TO ADD TEST FOR NO PEER ASSESSMENTS OF SUBMITTED WORK if ($maxbias) { $biasgrade = max(($nbias[$user->id] / $workshop->nsassessments) - (abs($bias[$user->id]) / $maxbias), 0.0); } else { $biasgrade = 0; } // reliabilitygrade is scaled between zero and one if ($dumbreliability and $workshop->nsassessments) { // nbias used here as it contains the number of assessments the user has done $reliabilitygrade = max(($nbias[$user->id] / $workshop->nsassessments) - ($reliability[$user->id] / $dumbreliability), 0.0); } else { $reliabilitygrade = 0; } $biasscaled = intval($biasgrade * $workshop->grade + 0.5); $reliabilityscaled = intval($reliabilitygrade * $workshop->grade + 0.5); $gradingscaled = intval($gradinggrade[$user->id] * $workshop->grade / COMMENTSCALE + 0.5); $finalgrade = intval((($teachergrade * $WORKSHOP_FWEIGHTS[$teacherweight] * $useteachersgrades) + ($peergrade * $WORKSHOP_FWEIGHTS[$peerweight] * $usepeergrades) + ($biasscaled * $WORKSHOP_FWEIGHTS[$biasweight] * $usebiasgrades) + ($reliabilityscaled * $WORKSHOP_FWEIGHTS[$reliabilityweight] * $usereliabilitygrades) + ($gradingscaled * $WORKSHOP_FWEIGHTS[$gradingweight] * $usegradinggrades) + 0.5) / (($WORKSHOP_FWEIGHTS[$teacherweight] * $useteachersgrades) + ($WORKSHOP_FWEIGHTS[$peerweight] * $usepeergrades) + ($WORKSHOP_FWEIGHTS[$biasweight] * $usebiasgrades) + ($WORKSHOP_FWEIGHTS[$reliabilityweight] * $usereliabilitygrades) + ($WORKSHOP_FWEIGHTS[$gradingweight] * $usegradinggrades))); echo ""; if ($useteachersgrades) { echo ""; } if ($usepeergrades) { echo ""; } if ($usebiasgrades) { echo ""; } if ($usereliabilitygrades) { echo ""; } if ($usegradinggrades) { echo ""; } echo "\n"; // save the grades set_field("workshop_submissions", "biasgrade", $biasscaled, "id", $bestsubmission->id); set_field("workshop_submissions", "reliabilitygrade", $reliabilityscaled, "id", $bestsubmission->id); set_field("workshop_submissions", "gradinggrade", $gradingscaled, "id", $bestsubmission->id); set_field("workshop_submissions", "finalgrade", $finalgrade, "id", $bestsubmission->id); } echo "
cellheading2\">$course->studentcellheading2\">".get_string("assessmentsby", "workshop", $course->teachers)."cellheading2\">".get_string("assessmentsby", "workshop", $course->students)."cellheading2\">".get_string("gradeforbias", "workshop")."cellheading2\">".get_string("gradeforreliability", "workshop")."cellheading2\">".get_string("gradeforassessments", "workshop")."cellheading2\">".get_string("overallgrade", "workshop")."
cellheading2\">".get_string("weights","workshop")."cellheading2\">$WORKSHOP_FWEIGHTS[$teacherweight]cellheading2\">$WORKSHOP_FWEIGHTS[$peerweight]cellheading2\">$WORKSHOP_FWEIGHTS[$biasweight]cellheading2\">$WORKSHOP_FWEIGHTS[$reliabilityweight]cellheading2\">$WORKSHOP_FWEIGHTS[$gradingweight]cellheading2\"> 
$user->firstname $user->lastname$teachergrade$peergrade$biasscaled$reliabilityscaled$gradingscaled$finalgrade

\n"; print_string("allgradeshaveamaximumof", "workshop", $workshop->grade); echo "

\n"; print_continue("view.php?a=$workshop->id"); } /*************** display final grades (by teacher) ***************************/ elseif ($action == 'displayfinalgrades') { // Get all the students if (!$users = get_course_students($course->id, "u.firstname, u.lastname")) { print_heading(get_string("nostudentsyet")); print_footer($course); exit; } // get the final weights from the database $teacherweight = get_field("workshop","teacherweight", "id", $workshop->id); $peerweight = get_field("workshop","peerweight", "id", $workshop->id); $includeteachersgrade = get_field("workshop","includeteachersgrade", "id", $workshop->id); $biasweight = get_field("workshop","biasweight", "id", $workshop->id); $reliabilityweight = get_field("workshop","reliabilityweight", "id", $workshop->id); $gradingweight = get_field("workshop","gradingweight", "id", $workshop->id); // work out what to show in the final grades tables and what to include in the calculation of the final grade // teacher grades? if ($workshop->gradingstrategy and $teacherweight) { $useteachersgrades = 1; } else { $useteachersgrades = 0; } // peergrades? if ($workshop->gradingstrategy and $workshop->nsassessments and $peerweight) { $usepeergrades = 1; } else { $usepeergrades = 0; } // bias grades? if ((($workshop->ntassessments >= 3) or ($workshop->nsassessments >= 3)) and ($useteachersgrades or $usepeergrades) and $biasweight ) { $usebiasgrades = 1; } else { $usebiasgrades = 0; } // reliability grades? if ((($workshop->ntassessments >= 3) or ($workshop->nsassessments >= 3)) and ($useteachersgrades or $usepeergrades) and $reliabilityweight ) { $usereliabilitygrades = 1; } else { $usereliabilitygrades = 0; } // grading grades? if (($workshop->ntassessments or $workshop->nsassessments) and $gradingweight ) { $usegradinggrades = 1; } else { $usegradinggrades = 0; } // show the final grades as stored in the tables... print_heading_with_help(get_string("displayoffinalgrades", "workshop"), "finalgrades", "workshop"); echo "
"; echo ""; if ($useteachersgrades) { echo ""; } if ($usepeergrades) { echo ""; } echo ""; if ($usebiasgrades) { echo ""; } if ($usereliabilitygrades) { echo ""; } if ($usegradinggrades) { echo ""; } echo "\n"; // now the weights echo ""; echo "\n"; if ($useteachersgrades) { echo "\n"; } if ($usepeergrades) { echo "\n"; } echo "\n"; if ($usebiasgrades) { echo "\n"; } if ($usereliabilitygrades) { echo "\n"; } if ($usegradinggrades) { echo "\n"; } echo "\n"; foreach ($users as $user) { if ($submissions = workshop_get_user_submissions($workshop, $user)) { foreach ($submissions as $submission) { echo ""; echo "\n"; if ($useteachersgrades) { echo ""; } if ($usepeergrades) { echo ""; } echo ""; if ($usebiasgrades) { echo ""; } if ($usereliabilitygrades) { echo ""; } if ($usegradinggrades) { echo ""; } echo "\n"; } } } echo "
cellheading2\">".$course->student."cellheading2\">".get_string("submissions", "workshop")."cellheading2\" align=\"center\">".get_string("assessmentsby", "workshop", $course->teachers)."cellheading2\" align=\"center\">".get_string("assessmentsby", "workshop", $course->students)."cellheading2\" align=\"center\">".get_string("assessmentsdone", "workshop")."cellheading2\" align=\"center\">".get_string("gradeforbias", "workshop")."cellheading2\" align=\"center\">".get_string("gradeforreliability", "workshop")."cellheading2\" align=\"center\">".get_string("gradeforassessments", "workshop")."cellheading2\" align=\"center\">".get_string("overallgrade", "workshop")."
cellheading2\">".get_string("weights", "workshop")."cellheading2\" align=\"center\"> cellheading2\" align=\"center\">$WORKSHOP_FWEIGHTS[$teacherweight]cellheading2\" align=\"center\">$WORKSHOP_FWEIGHTS[$peerweight]cellheading2\" align=\"center\"> cellheading2\" align=\"center\">$WORKSHOP_FWEIGHTS[$biasweight]cellheading2\" align=\"center\">$WORKSHOP_FWEIGHTS[$reliabilityweight]cellheading2\" align=\"center\">$WORKSHOP_FWEIGHTS[$gradingweight]cellheading2\"> 
$user->firstname $user->lastname".workshop_print_submission_title($workshop, $submission)."".workshop_print_submission_assessments($workshop, $submission, "teacher")."".workshop_print_submission_assessments($workshop, $submission, "student")."".workshop_print_user_assessments($workshop, $user)."$submission->biasgrade$submission->reliabilitygrade$submission->gradinggrade$submission->finalgrade

\n"; workshop_print_league_table($workshop); echo "
\n"; print_string("allgradeshaveamaximumof", "workshop", $workshop->grade); print_continue("view.php?a=$workshop->id"); } /*************** display final weights (by teacher) ***************************/ elseif ($action == 'displayfinalweights') { if (!isteacher($course->id)) { error("Only teachers can look at this page"); } if ($workshop->phase != 3) { // is this at the expected phase? print_heading(get_string("assignmentnotinthecorrectphase", "workshop")); print_continue("view.php?a=$workshop->id"); } else { ?>
id); $peerweight = get_field("workshop","peerweight", "id", $workshop->id); $includeteachersgrade = get_field("workshop","includeteachersgrade", "id", $workshop->id); $biasweight = get_field("workshop","biasweight", "id", $workshop->id); $reliabilityweight = get_field("workshop","reliabilityweight", "id", $workshop->id); $gradingweight = get_field("workshop","gradingweight", "id", $workshop->id); // now show the weights used in the final grades print_heading_with_help(get_string("calculationoffinalgrades", "workshop"), "calculatingfinalgrade", "workshop"); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
cellheading2\">
". get_string("weightsusedforfinalgrade", "workshop")."
".get_string("weightforteacherassessments", "workshop", $course->teacher).":"; workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "teacherweight", $teacherweight, ""); echo "
".get_string("weightforpeerassessments", "workshop").":"; workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "peerweight", $peerweight, ""); echo "
".get_string("weightforbias", "workshop").":"; workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "biasweight", $biasweight, ""); echo "
".get_string("weightforreliability", "workshop").":"; workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "reliabilityweight", $reliabilityweight, ""); echo "
".get_string("weightforgradingofassessments", "workshop").":"; workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "gradingweight", $gradingweight, ""); echo "
cellheading2\">
". get_string("optionforpeergrade", "workshop")."
".get_string("includeteachersgrade", "workshop").":"; $options[0] = get_string("no"); $options[1] = get_string("yes"); choose_from_menu($options, "includeteachersgrade", $includeteachersgrade, ""); helpbutton("includeteachersgrade", get_string("includeteachersgrade", "workshop"), "workshop"); echo "
\n"; echo "\n"; echo "
"; echo "
\n"; } } /******************* list all submissions ************************************/ elseif ($action == 'listallsubmissions' ) { if (!$users = get_course_students($course->id)) { print_heading(get_string("nostudentsyet")); print_footer($course); exit; } print_heading(get_string("listofallsubmissions", "workshop").":", "CENTER"); workshop_list_all_submissions($workshop, $USER); print_continue("view.php?id=$cm->id"); } /******************* list for assessment student (submissions) ************************************/ elseif ($action == 'listforassessmentstudent' ) { if (!$users = get_course_students($course->id)) { print_heading(get_string("nostudentsyet")); print_footer($course); exit; } workshop_list_unassessed_student_submissions($workshop, $USER); print_continue("view.php?id=$cm->id"); } /******************* list for assessment teacher (submissions) ************************************/ elseif ($action == 'listforassessmentteacher' ) { if (!$users = get_course_students($course->id)) { print_heading(get_string("nostudentsyet")); print_footer($course); exit; } workshop_list_unassessed_teacher_submissions($workshop, $USER); print_continue("view.php?id=$cm->id"); } /******************* user confirm delete ************************************/ elseif ($action == 'userconfirmdelete' ) { if (empty($_GET['sid'])) { error("User Confirm Delete: submission id missing"); } notice_yesno(get_string("confirmdeletionofthisitem","workshop", get_string("submission", "workshop")), "submissions.php?action=userdelete&id=$cm->id&sid=$_GET[sid]", "view.php?id=$cm->id"); } /******************* user delete ************************************/ elseif ($action == 'userdelete' ) { if (empty($_GET['sid'])) { error("User Delete: submission id missing"); } if (!$submission = get_record("workshop_submissions", "id", $_GET['sid'])) { error("User Delete: can not get submission record"); } print_string("deleting", "workshop"); // first get any assessments... if ($assessments = workshop_get_assessments($submission, 'ALL')) { foreach($assessments as $assessment) { // ...and all the associated records... delete_records("workshop_comments", "assessmentid", $assessment->id); delete_records("workshop_grades", "assessmentid", $assessment->id); echo "."; } // ...now delete the assessments... delete_records("workshop_assessments", "submissionid", $submission->id); } // ...and the submission record... delete_records("workshop_submissions", "id", $submission->id); // ..and finally the submitted file workshop_delete_submitted_files($workshop, $submission); print_continue("view.php?id=$cm->id"); } /*************** no man's land **************************************/ else { error("Fatal Error: Unknown Action: ".$action."\n"); } print_footer($course); ?>