Version 2003100200: improved handling of resubmissions (new field added to workshop_assessments)
This commit is contained in:
@@ -694,12 +694,12 @@
|
||||
}
|
||||
|
||||
|
||||
/*********************** list teacher submissions ***********************/
|
||||
/****************** list teacher submissions ***********************/
|
||||
elseif ($action == 'listteachersubmissions') {
|
||||
|
||||
workshop_list_teacher_submissions($workshop, $USER);
|
||||
print_continue("view.php?a=$workshop->id");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************** update assessment (by teacher or student) ***************************/
|
||||
@@ -708,17 +708,17 @@
|
||||
require_variable($aid);
|
||||
if (! $assessment = get_record("workshop_assessments", "id", $aid)) {
|
||||
error("workshop assessment is misconfigured");
|
||||
}
|
||||
}
|
||||
|
||||
// first get the assignment elements for maxscores and weights...
|
||||
if (!$elementsraw = get_records("workshop_elements", "workshopid", $workshop->id, "elementno ASC")) {
|
||||
print_string("noteonassignmentelements", "workshop");
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach ($elementsraw as $element) {
|
||||
$elements[] = $element; // to renumber index 0,1,2...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$timenow = time();
|
||||
// don't fiddle about, delete all the old and add the new!
|
||||
@@ -738,8 +738,8 @@
|
||||
$element->feedback = $thefeedback;
|
||||
if (!$element->id = insert_record("workshop_grades", $element)) {
|
||||
error("Could not insert workshop element!");
|
||||
}
|
||||
}
|
||||
}
|
||||
$grade = 0; // set to satisfy save to db
|
||||
break;
|
||||
|
||||
@@ -764,10 +764,10 @@
|
||||
$weight = $WORKSHOP_EWEIGHTS[$elements[$key]->weight];
|
||||
if ($weight > 0) {
|
||||
$totalweight += $weight;
|
||||
}
|
||||
}
|
||||
$rawgrade += ($grade / $maxscore) * $weight;
|
||||
// echo "\$key, \$maxscore, \$weight, \$totalweight, \$grade, \$rawgrade : $key, $maxscore, $weight, $totalweight, $grade, $rawgrade<BR>";
|
||||
}
|
||||
}
|
||||
$grade = $workshop->grade * ($rawgrade / $totalweight);
|
||||
break;
|
||||
|
||||
@@ -783,11 +783,11 @@
|
||||
$element->grade = $form->grade[$i];
|
||||
if (!$element->id = insert_record("workshop_grades", $element)) {
|
||||
error("Could not insert workshop element!");
|
||||
}
|
||||
if (empty($form->grade[$i])){
|
||||
$error += $WORKSHOP_EWEIGHTS[$elements[$i]->weight];
|
||||
}
|
||||
}
|
||||
if (empty($form->grade[$i])){
|
||||
$error += $WORKSHOP_EWEIGHTS[$elements[$i]->weight];
|
||||
}
|
||||
}
|
||||
// now save the adjustment
|
||||
unset($element);
|
||||
$i = $workshop->nelements;
|
||||
@@ -797,8 +797,9 @@
|
||||
$element->grade = $form->grade[$i];
|
||||
if (!$element->id = insert_record("workshop_grades", $element)) {
|
||||
error("Could not insert workshop element!");
|
||||
}
|
||||
$grade = ($elements[intval($error + 0.5)]->maxscore + $form->grade[$i]) * $workshop->grade / 100;
|
||||
}
|
||||
$grade = ($elements[intval($error + 0.5)]->maxscore + $form->grade[$i]) *
|
||||
$workshop->grade / 100;
|
||||
echo "<P><B>".get_string("weightederrorcount", "workshop", intval($error + 0.5))."</B>\n";
|
||||
break;
|
||||
|
||||
@@ -811,7 +812,7 @@
|
||||
$element->grade = $form->grade[0];
|
||||
if (!$element->id = insert_record("workshop_grades", $element)) {
|
||||
error("Could not insert workshop element!");
|
||||
}
|
||||
}
|
||||
// now save the adjustment in element one
|
||||
unset($element);
|
||||
$element->workshopid = $workshop->id;
|
||||
@@ -820,7 +821,7 @@
|
||||
$element->grade = $form->grade[1];
|
||||
if (!$element->id = insert_record("workshop_grades", $element)) {
|
||||
error("Could not insert workshop element!");
|
||||
}
|
||||
}
|
||||
$grade = ($elements[$form->grade[0]]->maxscore + $form->grade[1]) * $workshop->grade / 100;
|
||||
break;
|
||||
|
||||
@@ -835,8 +836,8 @@
|
||||
$element->grade = $thegrade;
|
||||
if (!$element->id = insert_record("workshop_grades", $element)) {
|
||||
error("Could not insert workshop element!");
|
||||
}
|
||||
}
|
||||
}
|
||||
// now work out the grade...
|
||||
$rawgrade=0;
|
||||
$totalweight=0;
|
||||
@@ -845,55 +846,58 @@
|
||||
$weight = $WORKSHOP_EWEIGHTS[$elements[$key]->weight];
|
||||
if ($weight > 0) {
|
||||
$totalweight += $weight;
|
||||
}
|
||||
$rawgrade += ($grade / $maxscore) * $weight;
|
||||
}
|
||||
$rawgrade += ($grade / $maxscore) * $weight;
|
||||
}
|
||||
$grade = $workshop->grade * ($rawgrade / $totalweight);
|
||||
break;
|
||||
|
||||
} // end of switch
|
||||
} // end of switch
|
||||
|
||||
// update the time of the assessment record (may be re-edited)...
|
||||
set_field("workshop_assessments", "timecreated", $timenow, "id", $assessment->id);
|
||||
|
||||
if (!$submission = get_record("workshop_submissions", "id", $assessment->submissionid)) {
|
||||
error ("Updateassessment: submission record not found");
|
||||
}
|
||||
}
|
||||
|
||||
// if the workshop does need peer agreement AND it's self assessment then set timeagreed
|
||||
if ($workshop->agreeassessments and ($submission->userid == $assessment->userid)) {
|
||||
set_field("workshop_assessments", "timeagreed", $timenow, "id", $assessment->id);
|
||||
}
|
||||
}
|
||||
|
||||
set_field("workshop_assessments", "grade", $grade, "id", $assessment->id);
|
||||
// ...and clear any grading of this assessment
|
||||
// ...and clear any grading of this assessment...
|
||||
set_field("workshop_assessments", "timegraded", 0, "id", $assessment->id);
|
||||
set_field("workshop_assessments", "gradinggrade", 0, "id", $assessment->id);
|
||||
// ...and the resubmission flag
|
||||
set_field("workshop_assessments", "resubmission", 0, "id", $assessment->id);
|
||||
|
||||
// any comment?
|
||||
// any comment?
|
||||
if (!empty($form->generalcomment)) {
|
||||
set_field("workshop_assessments", "generalcomment", $form->generalcomment, "id", $assessment->id);
|
||||
}
|
||||
}
|
||||
|
||||
add_to_log($course->id, "workshop", "assess", "assessments.php?action=viewassessment&id=$cm->id&aid=$assessment->id", "$assessment->id");
|
||||
add_to_log($course->id, "workshop", "assess",
|
||||
"assessments.php?action=viewassessment&id=$cm->id&aid=$assessment->id", "$assessment->id");
|
||||
|
||||
// set up return address
|
||||
if (!$returnto = $form->returnto) {
|
||||
$returnto = "view.php?id=$cm->id";
|
||||
}
|
||||
}
|
||||
|
||||
// show grade if grading strategy is not zero
|
||||
if ($workshop->gradingstrategy) {
|
||||
redirect($returnto, get_string("thegradeis", "workshop").": ".number_format($grade, 2)."% (".get_string("maximumgrade").
|
||||
" ".number_format($workshop->grade)."%)");
|
||||
}
|
||||
redirect($returnto, get_string("thegradeis", "workshop").": ".number_format($grade, 2).
|
||||
"% (".get_string("maximumgrade")." ".number_format($workshop->grade)."%)");
|
||||
}
|
||||
else {
|
||||
redirect($returnto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************** update comment (by author, assessor or teacher) ***************************/
|
||||
/****************** update comment (by author, assessor or teacher) ********************/
|
||||
elseif ($action == 'updatecomment') {
|
||||
$timenow = time();
|
||||
|
||||
@@ -902,10 +906,10 @@
|
||||
// get the comment record...
|
||||
if (!$comment = get_record("workshop_comments", "id", $_POST['cid'])) {
|
||||
error("Update to Comment failed");
|
||||
}
|
||||
}
|
||||
if (!$assessment = get_record("workshop_assessments", "id", $comment->assessmentid)) {
|
||||
error("Update Comment: Assessment not found");
|
||||
}
|
||||
}
|
||||
//save the comment for the assessment...
|
||||
if (isset($form->comments)) {
|
||||
set_field("workshop_comments", "comments", $form->comments, "id", $comment->id);
|
||||
@@ -914,26 +918,27 @@
|
||||
set_field("workshop_comments", "mailed", 0, "id", $comment->id);
|
||||
echo "<CENTRE><B>".get_string("savedok", "workshop")."</B></CENTER><BR>\n";
|
||||
|
||||
add_to_log($course->id, "workshop", "comment", "assessments.php?action=viewassessment&id=$cm->id&aid=$assessment->id", "$comment->id");
|
||||
}
|
||||
add_to_log($course->id, "workshop", "comment",
|
||||
"assessments.php?action=viewassessment&id=$cm->id&aid=$assessment->id", "$comment->id");
|
||||
}
|
||||
|
||||
print_continue("assessments.php?action=viewassessment&id=$cm->id&aid=$assessment->id");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************** update grading (by teacher) ***************************/
|
||||
/****************** update grading (by teacher) ***************************/
|
||||
elseif ($action == 'updategrading') {
|
||||
$timenow = time();
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("Only teachers can look at this page");
|
||||
}
|
||||
}
|
||||
|
||||
$form = (object)$_POST;
|
||||
|
||||
if (!$assessment = get_record("workshop_assessments", "id", $_POST['aid'])) {
|
||||
error("Update Grading failed");
|
||||
}
|
||||
}
|
||||
//save the comment and grade for the assessment
|
||||
if (isset($form->teachercomment)) {
|
||||
set_field("workshop_assessments", "teachercomment", $form->teachercomment, "id", $assessment->id);
|
||||
@@ -942,8 +947,9 @@
|
||||
set_field("workshop_assessments", "mailed", 0, "id", $assessment->id);
|
||||
echo "<CENTRE><B>".get_string("savedok", "workshop")."</B></CENTRE><BR>\n";
|
||||
|
||||
add_to_log($course->id, "workshop", "grade", "assessments.php?action=viewassessment&id=$cm->id&aid=$assessment->id", "$assessment->id");
|
||||
}
|
||||
add_to_log($course->id, "workshop", "grade",
|
||||
"assessments.php?action=viewassessment&id=$cm->id&aid=$assessment->id", "$assessment->id");
|
||||
}
|
||||
switch ($form->stype) {
|
||||
case "student" :
|
||||
redirect("assessments.php?action=listungradedstudentsubmissions&id=$cm->id");
|
||||
@@ -951,28 +957,29 @@
|
||||
case "teacher" :
|
||||
redirect("assessments.php?action=listungradedteachersubmissions&id=$cm->id");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************* user confirm delete ************************************/
|
||||
/****************** user confirm delete ************************************/
|
||||
elseif ($action == 'userconfirmdelete' ) {
|
||||
|
||||
if (empty($_GET['aid'])) {
|
||||
error("User confirm delete: assessment id missing");
|
||||
}
|
||||
|
||||
notice_yesno(get_string("confirmdeletionofthisitem","workshop", get_string("assessment", "workshop")),
|
||||
"assessments.php?action=userdelete&id=$cm->id&aid=$_GET[aid]", "view.php?id=$cm->id");
|
||||
}
|
||||
|
||||
notice_yesno(get_string("confirmdeletionofthisitem","workshop",
|
||||
get_string("assessment", "workshop")),
|
||||
"assessments.php?action=userdelete&id=$cm->id&aid=$_GET[aid]", "view.php?id=$cm->id");
|
||||
}
|
||||
|
||||
|
||||
/******************* user delete ************************************/
|
||||
/****************** user delete ************************************/
|
||||
elseif ($action == 'userdelete' ) {
|
||||
|
||||
if (empty($_GET['aid'])) {
|
||||
error("User delete: assessment id missing");
|
||||
}
|
||||
}
|
||||
|
||||
print_string("deleting", "workshop");
|
||||
// first delete all the associated records...
|
||||
@@ -982,50 +989,50 @@
|
||||
delete_records("workshop_assessments", "id", $_GET['aid']);
|
||||
|
||||
print_continue("view.php?id=$cm->id");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*********************** view all assessments ***********************/
|
||||
/****************** view all assessments ***********************/
|
||||
elseif ($action == 'viewallassessments') {
|
||||
|
||||
if (!$submission = get_record("workshop_submissions", "id", $_GET['sid'])) {
|
||||
error("View All Assessments: submission record not found");
|
||||
}
|
||||
}
|
||||
|
||||
if ($assessments = workshop_get_assessments($submission)) {
|
||||
foreach ($assessments as $assessment) {
|
||||
workshop_print_assessment($workshop, $assessment);
|
||||
}
|
||||
}
|
||||
}
|
||||
// only called from list all submissions
|
||||
print_continue("submissions.php?action=listallsubmissions&id=$cm->id");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*********************** view assessment ***********************/
|
||||
/****************** view assessment *****************************/
|
||||
elseif ($action == 'viewassessment') {
|
||||
|
||||
optional_variable($allowcomments);
|
||||
if (!isset($allowcomments)) {
|
||||
$allowcomments = false;
|
||||
}
|
||||
}
|
||||
|
||||
// get the assessment record
|
||||
if (!$assessment = get_record("workshop_assessments", "id", $_GET['aid'])) {
|
||||
error("Assessment record not found");
|
||||
}
|
||||
}
|
||||
|
||||
// show assessment but don't allow changes
|
||||
workshop_print_assessment($workshop, $assessment, false, $allowcomments);
|
||||
|
||||
print_continue("view.php?a=$workshop->id");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************** no man's land **************************************/
|
||||
else {
|
||||
error("Fatal Error: Unknown Action: ".$action."\n");
|
||||
}
|
||||
/*************** no man's land **************************************/
|
||||
else {
|
||||
error("Fatal Error: Unknown Action: ".$action."\n");
|
||||
}
|
||||
|
||||
print_footer($course);
|
||||
|
||||
|
||||
@@ -57,6 +57,11 @@ function workshop_upgrade($oldversion) {
|
||||
execute_sql(" ALTER TABLE `{$CFG->prefix}workshop` ADD `overallocation` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `nsassessments`");
|
||||
|
||||
}
|
||||
if ($oldversion < 2003100200) {
|
||||
|
||||
execute_sql(" ALTER TABLE `{$CFG->prefix}workshop_assessments` ADD `resubmission` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `mailed`");
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,8 @@ CREATE TABLE `prefix_workshop_assessments` (
|
||||
`timeagreed` int(10) unsigned NOT NULL default '0',
|
||||
`grade` float NOT NULL default '0',
|
||||
`gradinggrade` int(3) NOT NULL default '0',
|
||||
`mailed` tinyint(2) unsigned NOT NULL default '0',
|
||||
`mailed` tinyint(3) unsigned NOT NULL default '0',
|
||||
`resubmission` tinyint(3) unsigned NOT NULL default '0',
|
||||
`generalcomment` text NOT NULL,
|
||||
`teachercomment` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
|
||||
@@ -120,6 +120,7 @@ CREATE TABLE prefix_workshop_assessments (
|
||||
grade float default '0' not null,
|
||||
gradinggrade number(3) default '0' not null,
|
||||
mailed number(2) default '0' not null,
|
||||
resubmission number(2) default '0' not null,
|
||||
generalcomment varchar2(255) NOT NULL,
|
||||
teachercomment varchar2(255) NOT NULL
|
||||
);
|
||||
|
||||
@@ -69,6 +69,7 @@ CREATE TABLE prefix_workshop_assessments (
|
||||
grade float NOT NULL default '0',
|
||||
gradinggrade INT NOT NULL default '0',
|
||||
mailed INT2 NOT NULL default '0',
|
||||
resubmission INT2 NOT NULL default '0',
|
||||
generalcomment text NOT NULL,
|
||||
teachercomment text NOT NULL
|
||||
);
|
||||
|
||||
+406
-191
File diff suppressed because it is too large
Load Diff
+44
-9
@@ -37,43 +37,78 @@
|
||||
}
|
||||
}
|
||||
****/
|
||||
$timenow = time();
|
||||
if (!$title = $_POST['title']) {
|
||||
notify(get_string("notitlegiven", "workshop") );
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (is_uploaded_file($newfile['tmp_name']) and $newfile['size'] > 0) {
|
||||
if ($newfile['size'] > $workshop->maxbytes) {
|
||||
notify(get_string("uploadfiletoobig", "assignment", $workshop->maxbytes));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$newfile_name = clean_filename($newfile['name']);
|
||||
if ($newfile_name) {
|
||||
// get the current set of submissions
|
||||
$submissions = workshop_get_user_submissions($workshop, $USER);
|
||||
// add new submission record
|
||||
$newsubmission->workshopid = $workshop->id;
|
||||
$newsubmission->userid = $USER->id;
|
||||
$newsubmission->title = $title;
|
||||
$newsubmission->timecreated = time();
|
||||
if (!$newsubmission->id = insert_record("workshop_submissions", $newsubmission)) {
|
||||
error("Workshop upload: Failure to create new submission record!");
|
||||
}
|
||||
}
|
||||
// see if this is a resubmission by looking at the previous submissions
|
||||
if ($submissions) {
|
||||
// find the last submission
|
||||
foreach ($submissions as $submission) {
|
||||
$lastsubmission = $submission;
|
||||
break;
|
||||
}
|
||||
// find all the possible assessments of this submission
|
||||
// ...and if they have been assessed give the assessor a new assessment
|
||||
// based on their old assessment, if the assessment has not be made
|
||||
// just delete it!
|
||||
if ($assessments = workshop_get_assessments($submission, 'ALL')) {
|
||||
foreach ($assessments as $assessment) {
|
||||
if ($assessment->timecreated < $timenow) {
|
||||
echo "Copying $assessment->id ...<br/>";
|
||||
// a Cold or Warm assessment - copy it with feedback..
|
||||
$newassessment = workshop_copy_assessment($assessment, $newsubmission,
|
||||
true);
|
||||
// set the resubmission flag so student can be emailed/told about
|
||||
// this assessment
|
||||
set_field("workshop_assessments", "resubmission", 1, "id",
|
||||
$newassessment->id);
|
||||
} else {
|
||||
// a hot assessment, was not used, just dump it
|
||||
delete_records("workshop_assessments", "id", $assessment->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
add_to_log($course->id, "workshop", "resubmit", "view.php?a=$workshop->id",
|
||||
"$workshop->id");
|
||||
}
|
||||
if (! $dir = workshop_file_area($workshop, $newsubmission)) {
|
||||
error("Sorry, an error in the system prevents you from uploading files: contact your teacher or system administrator");
|
||||
}
|
||||
}
|
||||
if (move_uploaded_file($newfile['tmp_name'], "$dir/$newfile_name")) {
|
||||
print_heading(get_string("uploadsuccess", "assignment", $newfile_name) );
|
||||
}
|
||||
}
|
||||
else {
|
||||
notify(get_string("uploaderror", "assignment") );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
notify(get_string("uploadbadname", "assignment") );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
notify(get_string("uploadnofilefound", "assignment") );
|
||||
}
|
||||
}
|
||||
}
|
||||
print_continue("view.php?a=$workshop->id");
|
||||
|
||||
print_footer($course);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// This fragment is called by /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2003092500;
|
||||
$module->version = 2003100200;
|
||||
$module->cron = 60;
|
||||
|
||||
?>
|
||||
|
||||
+75
-46
@@ -95,7 +95,7 @@
|
||||
}
|
||||
|
||||
|
||||
/*********************** alow peer assessments (move to phase 3) (for teachers)**/
|
||||
/************** allow peer assessments (move to phase 3) (for teachers)**/
|
||||
if ($action == 'allowpeerassessments') {
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
@@ -108,7 +108,7 @@
|
||||
}
|
||||
|
||||
|
||||
/******************* close workshop for student assessments and submissions (move to phase 4) (for teachers)**/
|
||||
/****************** close workshop for student assessments/submissions (move to phase 4) (for teachers)**/
|
||||
elseif ($action == 'closeworkshop') {
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
@@ -121,7 +121,7 @@
|
||||
}
|
||||
|
||||
|
||||
/******************* display final grade (for students) ************************************/
|
||||
/****************** display final grade (for students) ************************************/
|
||||
elseif ($action == 'displayfinalgrade' ) {
|
||||
|
||||
// get the final weights from the database
|
||||
@@ -174,10 +174,12 @@
|
||||
echo "<center><table border=\"1\" width=\"90%\"><tr>";
|
||||
echo "<td><b>".get_string("submissions", "workshop")."</b></td>";
|
||||
if ($useteachersgrades) {
|
||||
echo "<td align=\"center\"><b>".get_string("teacherassessments", "workshop", $course->teacher)."</b></td>";
|
||||
echo "<td align=\"center\"><b>".get_string("teacherassessments", "workshop",
|
||||
$course->teacher)."</b></td>";
|
||||
}
|
||||
if ($usepeergrades) {
|
||||
echo "<td align=\"center\"><b>".get_string("studentassessments", "workshop", $course->student)."</b></td>";
|
||||
echo "<td align=\"center\"><b>".get_string("studentassessments", "workshop",
|
||||
$course->student)."</b></td>";
|
||||
}
|
||||
echo "<td align=\"center\"><b>".get_string("assessmentsdone", "workshop")."</b></td>";
|
||||
if ($usebiasgrades) {
|
||||
@@ -212,10 +214,12 @@
|
||||
foreach ($submissions as $submission) {
|
||||
echo "<TR><td>".workshop_print_submission_title($workshop, $submission)."</td>\n";
|
||||
if ($useteachersgrades) {
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop, $submission, "teacher")."</td>";
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop,
|
||||
$submission, "teacher")."</td>";
|
||||
}
|
||||
if ($usepeergrades) {
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop, $submission, "student")."</td>";
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop,
|
||||
$submission, "student")."</td>";
|
||||
}
|
||||
echo "<td align=\"center\">".workshop_print_user_assessments($workshop, $USER)."</td>";
|
||||
if ($usebiasgrades) {
|
||||
@@ -238,7 +242,7 @@
|
||||
}
|
||||
|
||||
|
||||
/*********************** make final grades available (for teachers only)**************/
|
||||
/****************** make final grades available (for teachers only)**************/
|
||||
elseif ($action == 'makefinalgradesavailable') {
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
@@ -251,13 +255,13 @@
|
||||
}
|
||||
|
||||
|
||||
/*********************** assignment not available (for students)***********************/
|
||||
/****************** assignment not available (for students)***********************/
|
||||
elseif ($action == 'notavailable') {
|
||||
print_heading(get_string("notavailable", "workshop"));
|
||||
}
|
||||
|
||||
|
||||
/*********************** open workshop for student assessments and submissions (move to phase 2) (for teachers)**/
|
||||
/****************** open workshop for student assessments (move to phase 2) (for teachers)**/
|
||||
elseif ($action == 'openworkshop') {
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
@@ -276,7 +280,7 @@
|
||||
}
|
||||
|
||||
|
||||
/*********************** set up assignment (move back to phase 1) (for teachers)***********************/
|
||||
/****************** set up assignment (move back to phase 1) (for teachers)***********************/
|
||||
elseif ($action == 'setupassignment') {
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
@@ -288,24 +292,27 @@
|
||||
}
|
||||
|
||||
|
||||
/*********************** student's view could be in 1 of 4 stages ***********************/
|
||||
/****************** student's view could be in 1 of 4 stages ***********************/
|
||||
elseif ($action == 'studentsview') {
|
||||
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)
|
||||
// ...has student assessed the required number of the teacher's submissions
|
||||
if ($workshop->ntassessments and (!workshop_test_user_assessments($workshop, $USER))) {
|
||||
print_heading(get_string("pleaseassesstheseexamplesfromtheteacher", "workshop", $course->teacher));
|
||||
print_heading(get_string("pleaseassesstheseexamplesfromtheteacher", "workshop",
|
||||
$course->teacher));
|
||||
workshop_list_teacher_submissions($workshop, $USER);
|
||||
}
|
||||
// in stage 2? - submit own first attempt
|
||||
else {
|
||||
if ($workshop->ntassessments) { // show assessment the teacher's examples, there may be feedback from teacher
|
||||
print_heading(get_string("yourassessmentsofexamplesfromtheteacher", "workshop", $course->teacher));
|
||||
if ($workshop->ntassessments) {
|
||||
// show assessment the teacher's examples, there may be feedback from teacher
|
||||
print_heading(get_string("yourassessmentsofexamplesfromtheteacher", "workshop",
|
||||
$course->teacher));
|
||||
workshop_list_teacher_submissions($workshop, $USER);
|
||||
}
|
||||
if (!workshop_get_user_submissions($workshop, $USER)) {
|
||||
// print upload form
|
||||
print_heading(get_string("submitassignment", "assignment").":");
|
||||
print_heading(get_string("submitassignmentusingform", "workshop").":");
|
||||
workshop_print_upload_form($workshop);
|
||||
}
|
||||
// in stage 3? - grade other student's submissions, resubmit and list all submissions
|
||||
@@ -337,22 +344,32 @@
|
||||
// list previous submissions
|
||||
print_heading(get_string("submissions", "workshop"));
|
||||
workshop_list_user_submissions($workshop, $USER);
|
||||
if ($workshop->resubmit) {
|
||||
// if resubmissions allowed print upload form
|
||||
echo "<hr size=\"1\" noshade>";
|
||||
print_heading(get_string("submitassignment", "assignment").":");
|
||||
workshop_print_upload_form($workshop);
|
||||
echo "<hr size=\"1\" noshade>";
|
||||
}
|
||||
// are resubmissions allowed?
|
||||
if ($workshop->resubmit) {
|
||||
// see if there are any cold (warm included as well) assessments of the last submission
|
||||
// if there are then print upload form
|
||||
if ($submissions = workshop_get_user_submissions($workshop, $USER)) {
|
||||
foreach ($submissions as $submission) {
|
||||
$lastsubmission = $submission;
|
||||
break;
|
||||
}
|
||||
if (workshop_count_assessments($lastsubmission)) {
|
||||
echo "<hr size=\"1\" noshade>";
|
||||
print_heading(get_string("submitrevisedassignment", "workshop").":");
|
||||
workshop_print_upload_form($workshop);
|
||||
echo "<hr size=\"1\" noshade>";
|
||||
}
|
||||
}
|
||||
}
|
||||
// allow user to list their submissions and assessments in a general way????
|
||||
// print_heading("<A HREF=\"submissions.php?action=listallsubmissions&id=$cm->id\">".
|
||||
// get_string("listofallsubmissions", "workshop"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*********************** submission of assignment by teacher only***********************/
|
||||
/****************** submission of assignment by teacher only***********************/
|
||||
elseif ($action == 'submitassignment') {
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
@@ -378,19 +395,22 @@
|
||||
}
|
||||
|
||||
|
||||
/*********************** teacher's view - display admin page (current phase options) ************/
|
||||
/****************** teacher's view - display admin page (current phase options) ************/
|
||||
elseif ($action == 'teachersview') {
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("Only teachers can look at this page");
|
||||
}
|
||||
}
|
||||
|
||||
print_heading_with_help(get_string("managingassignment", "workshop"), "managing", "workshop");
|
||||
|
||||
workshop_print_assignment_info($workshop);
|
||||
|
||||
$tabs->names = array("1. ".get_string("phase1", "workshop"), "2. ".get_string("phase2", "workshop", $course->student),
|
||||
"3. ".get_string("phase3", "workshop"), "4. ".get_string("phase4", "workshop"), "5. ".get_string("phase5", "workshop"));
|
||||
$tabs->names = array("1. ".get_string("phase1", "workshop"),
|
||||
"2. ".get_string("phase2", "workshop", $course->student),
|
||||
"3. ".get_string("phase3", "workshop"),
|
||||
"4. ".get_string("phase4", "workshop"),
|
||||
"5. ".get_string("phase5", "workshop"));
|
||||
$tabs->urls = array("view.php?id=$cm->id&action=setupassignment",
|
||||
"view.php?id=$cm->id&action=openworkshop",
|
||||
"view.php?id=$cm->id&action=allowpeerassessments",
|
||||
@@ -409,15 +429,18 @@
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=editelements\">".
|
||||
get_string("amendassessmentelements", "workshop")."</a></b> \n";
|
||||
helpbutton("elements", get_string("amendassessmentelements", "workshop"), "workshop");
|
||||
if ($workshop->ntassessments) { // if teacher examples show submission and assessment links
|
||||
if ($workshop->ntassessments) {
|
||||
// if teacher examples show submission and assessment links
|
||||
echo "<p><b><a href=\"view.php?id=$cm->id&action=submitassignment\">".
|
||||
get_string("submitexampleassignment", "workshop")."</a></b> \n";
|
||||
helpbutton("submissionofexamples", get_string("submitexampleassignment", "workshop"), "workshop");
|
||||
helpbutton("submissionofexamples", get_string("submitexampleassignment", "workshop"),
|
||||
"workshop");
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentteacher\">".
|
||||
get_string("teachersubmissionsforassessment", "workshop",
|
||||
workshop_count_teacher_submissions_for_assessment($workshop, $USER)).
|
||||
"</a></b> \n";
|
||||
helpbutton("assessmentofexamples", get_string("teachersubmissionsforassessment", "workshop"), "workshop");
|
||||
helpbutton("assessmentofexamples", get_string("teachersubmissionsforassessment",
|
||||
"workshop"), "workshop");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -427,16 +450,19 @@
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=listungradedteachersubmissions\">".
|
||||
get_string("ungradedassessmentsofteachersubmissions", "workshop",
|
||||
workshop_count_ungraded_assessments_teacher($workshop))."</a></b> \n";
|
||||
helpbutton("ungradedassessments_teacher", get_string("ungradedassessmentsofteachersubmissions", "workshop"), "workshop");
|
||||
}
|
||||
helpbutton("ungradedassessments_teacher",
|
||||
get_string("ungradedassessmentsofteachersubmissions", "workshop"), "workshop");
|
||||
}
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=listungradedstudentsubmissions\">".
|
||||
get_string("ungradedassessmentsofstudentsubmissions", "workshop",
|
||||
workshop_count_ungraded_assessments_student($workshop))."</a></b> \n";
|
||||
helpbutton("ungradedassessments_student", get_string("ungradedassessmentsofstudentsubmissions", "workshop"), "workshop");
|
||||
helpbutton("ungradedassessments_student",
|
||||
get_string("ungradedassessmentsofstudentsubmissions", "workshop"), "workshop");
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentstudent\">".
|
||||
get_string("studentsubmissionsforassessment", "workshop",
|
||||
workshop_count_student_submissions_for_assessment($workshop, $USER))."</a></b> \n";
|
||||
helpbutton("gradingsubmissions", get_string("studentsubmissionsforassessment", "workshop"), "workshop");
|
||||
helpbutton("gradingsubmissions",
|
||||
get_string("studentsubmissionsforassessment", "workshop"), "workshop");
|
||||
break;
|
||||
|
||||
case 4: // calculate final grades
|
||||
@@ -444,16 +470,19 @@
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=listungradedteachersubmissions\">".
|
||||
get_string("ungradedassessmentsofteachersubmissions", "workshop",
|
||||
workshop_count_ungraded_assessments_teacher($workshop))."</a></b> \n";
|
||||
helpbutton("ungradedassessments_teacher", get_string("ungradedassessmentsofteachersubmissions", "workshop"), "workshop");
|
||||
}
|
||||
helpbutton("ungradedassessments_teacher",
|
||||
get_string("ungradedassessmentsofteachersubmissions", "workshop"), "workshop");
|
||||
}
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=listungradedstudentsubmissions\">".
|
||||
get_string("ungradedassessmentsofstudentsubmissions", "workshop",
|
||||
workshop_count_ungraded_assessments_student($workshop))."</a></b> \n";
|
||||
helpbutton("ungradedassessments_student", get_string("ungradedassessmentsofstudentsubmissions", "workshop"), "workshop");
|
||||
helpbutton("ungradedassessments_student",
|
||||
get_string("ungradedassessmentsofstudentsubmissions", "workshop"), "workshop");
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentstudent\">".
|
||||
get_string("studentsubmissionsforassessment", "workshop",
|
||||
workshop_count_student_submissions_for_assessment($workshop, $USER))."</a></b> \n";
|
||||
helpbutton("gradingsubmissions", get_string("studentsubmissionsforassessment", "workshop"), "workshop");
|
||||
helpbutton("gradingsubmissions",
|
||||
get_string("studentsubmissionsforassessment", "workshop"), "workshop");
|
||||
print_heading("<a href=\"submissions.php?id=$cm->id&action=displayfinalweights\">".
|
||||
get_string("calculationoffinalgrades", "workshop")."</a>");
|
||||
break;
|
||||
@@ -461,16 +490,16 @@
|
||||
case 5: // show final grades
|
||||
print_heading("<A HREF=\"submissions.php?id=$cm->id&action=displayfinalgrades\">".
|
||||
get_string("displayoffinalgrades", "workshop")."</A>");
|
||||
}
|
||||
}
|
||||
print_heading("<A HREF=\"submissions.php?id=$cm->id&action=adminlist\">".
|
||||
get_string("administration")."</A>");
|
||||
}
|
||||
|
||||
|
||||
/*************** no man's land **************************************/
|
||||
else {
|
||||
error("Fatal Error: Unknown Action: ".$action."\n");
|
||||
}
|
||||
/*************** no man's land **************************************/
|
||||
else {
|
||||
error("Fatal Error: Unknown Action: ".$action."\n");
|
||||
}
|
||||
|
||||
print_footer($course);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user