Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix bug in Workshops with no teacher submissions.

  • Loading branch information...
commit 553894ced6942ef8b7f24528a91d864a8cb0f3f4 1 parent 519d369
rkingdon authored
Showing with 14 additions and 15 deletions.
  1. +10 −12 mod/workshop/lib.php
  2. +4 −3 mod/workshop/view.php
View
22 mod/workshop/lib.php
@@ -1,4 +1,4 @@
-<?PHP // $Id: lib.php,v 1.0 14 Aug 2003
+<?PHP // $Id: lib.php,v 1.1 21 Aug 2003
include_once("$CFG->dirroot/files/mimetypes.php");
@@ -2760,22 +2760,20 @@ function workshop_test_user_assessments($workshop, $user) {
// see if user has assessed required number of assessments of teachers submissions...
global $CFG;
- $result = false;
+ $result = true;
$n = 0;
$timenow =time();
- if ($workshop->ntassessments) { // they have to pass some!
- if ($submissions = workshop_get_teacher_submissions($workshop)) {
- foreach ($submissions as $submission) {
- if ($assessment = workshop_get_submission_assessment($submission, $user)) {
- // ...the date stamp on the assessment should be in the past
- if ($assessment->timecreated < $timenow) {
- $n++;
- }
+ if ($submissions = workshop_get_teacher_submissions($workshop)) {
+ foreach ($submissions as $submission) {
+ if ($assessment = workshop_get_submission_assessment($submission, $user)) {
+ // ...the date stamp on the assessment should be in the past
+ if ($assessment->timecreated < $timenow) {
+ $n++;
}
}
}
- if ($n >= min($workshop->ntassessments, workshop_count_teacher_submissions($workshop))) {
- $result = true;
+ if ($n < min($workshop->ntassessments, workshop_count_teacher_submissions($workshop))) {
+ $result = false;
}
}
return $result;
View
7 mod/workshop/view.php
@@ -1,4 +1,4 @@
-<?PHP // $Id: view.php, v1.0 14 Aug 2003
+<?PHP // $Id: view.php, v1.1 21 Aug 2003
/*************************************************
ACTIONS handled are:
@@ -287,8 +287,9 @@
echo format_text($workshop->description, $workshop->format);
print_simple_box_end();
echo "<br />";
- // in Stage 1? - assess teacher's submissions ("satisfactory level" dropped 14/8/03)
- if (!workshop_test_user_assessments($workshop, $USER)) {
+ // 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))) {
print_heading(get_string("pleaseassesstheseexamplesfromtheteacher", "workshop", $course->teacher));
workshop_list_teacher_submissions($workshop, $USER);
}
Please sign in to comment.
Something went wrong with that request. Please try again.