More information to teachers on resubmissions. Add submission entry to log only if upload is successful.

This commit is contained in:
rkingdon 2003-10-16 17:35:01 +00:00
parent 7c54bd509a
commit 32a2b23f43
3 changed files with 36 additions and 2 deletions

View File

@ -7,6 +7,7 @@
admindelete
adminlist
adminlistbystudent
assessresubmission
assesssubmission
displaygradingform
editelements (teachers only)

View File

@ -546,6 +546,7 @@ function exercise_user_outline($course, $user, $mod, $exercise) {
return NULL;
}
/*******************************************************************/
function exercise_get_participants($exerciseid) {
//Returns the users with data in one exercise
@ -1723,6 +1724,11 @@ function exercise_list_unassessed_student_submissions($exercise, $user) {
foreach ($assessments as $assessment) {
if (isteacher($course->id, $assessment->userid)) {
$teacherassessed = true;
if (!$teacher = get_record("user", "id", $assessment->userid)) {
error("List unassessed student submissions: teacher record not found");
}
$comment = get_string("resubmissionfor", "exercise",
"$teacher->firstname $teacher->lastname");
if ($assessment->timecreated > $timenow - $CFG->maxeditingtime) {
$warm = true;
}
@ -1739,6 +1745,34 @@ function exercise_list_unassessed_student_submissions($exercise, $user) {
}
if (!$teacherassessed) {
// no teacher's assessment
// find who did the previous assessment
if (!$submissions = exercise_get_user_submissions($exercise, $submissionowner)) {
error("List unassessed student submissions: submission records not found");
}
// get the last but one submission (prevsubmission)
$n = 0;
foreach ($submissions as $tempsubmission) {
if ($n == 1) {
$prevsubmission = $tempsubmission;
break;
}
$n++;
}
// get the teacher's assessment of the student's previous submission
if ($assessments = get_records("exercise_assessments", "submissionid",
$prevsubmission->id)) {
foreach ($assessments as $assessment) {
if (isteacher($course->id, $assessment->userid)) {
if (!$teacher = get_record("user", "id", $assessment->userid)) {
error("List unassessed student submissions: teacher record not found");
}
$comment = get_string("resubmissionfor", "exercise",
"$teacher->firstname $teacher->lastname");
break; // no need to look further
}
}
}
$action = "<A HREF=\"assessments.php?action=assessresubmission&id=$cm->id&sid=$submission->id\">".
get_string("assess", "exercise")."</A>";
$table->data[] = array(exercise_print_submission_title($exercise, $submission),

View File

@ -22,8 +22,6 @@
require_login($course->id);
add_to_log($course->id, "exercise", "submit", "view.php?id=$cm->id", "$exercise->id");
if ($course->category) {
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
}
@ -64,6 +62,7 @@
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")) {
add_to_log($course->id, "exercise", "submit", "view.php?id=$cm->id", "$exercise->id");
print_heading(get_string("uploadsuccess", "assignment", $newfile_name) );
}
else {