Permalink
Browse files

Minor tidy of "not graded" workshops to supress grades appearing in

student pages.
  • Loading branch information...
1 parent 4f11bf2 commit b514883a042426f611c93c3a183c1c6bf1395163 rkingdon committed Sep 29, 2004
Showing with 26 additions and 12 deletions.
  1. +12 −7 mod/workshop/lib.php
  2. +11 −5 mod/workshop/locallib.php
  3. +3 −0 mod/workshop/mod.html
View
@@ -612,11 +612,13 @@ function workshop_delete_instance($id) {
///////////////////////////////////////////////////////////////////////////////
function workshop_grades($workshopid) {
/// Must return an array of grades, indexed by user, and a max grade.
-/// only retruns grades in phase 2 or greater
-global $CFG;
+/// only returns grades in phase 2 or greater
+/// returns nothing if workshop is not graded
+ global $CFG;
+ $return = null;
if ($workshop = get_record("workshop", "id", $workshopid)) {
- if ($workshop->phase > 1) {
+ if ($workshop->phase > 1 and $workshop->gradingstrategy) {
if ($students = get_course_students($workshop->course)) {
foreach ($students as $student) {
if ($workshop->wtype) {
@@ -641,10 +643,13 @@ function workshop_grades($workshopid) {
}
}
}
- if ($workshop->wtype) {
- $return->maxgrade = $workshop->grade + $workshop->gradinggrade;
- } else { // ignore grading grades for simple assignemnts
- $return->maxgrade = $workshop->grade;
+ // set maximum grade if graded
+ if ($workshop->gradingstrategy) {
+ if ($workshop->wtype) {
+ $return->maxgrade = $workshop->grade + $workshop->gradinggrade;
+ } else { // ignore grading grades for simple assignemnts
+ $return->maxgrade = $workshop->grade;
+ }
}
}
return $return;
View
@@ -908,9 +908,11 @@ function workshop_list_assessed_submissions($workshop, $user) {
}
// has assessment been graded?
if ($assessment->timegraded and ($timenow - $assessment->timegraded > $CFG->maxeditingtime)) {
- $comment .= "; ".get_string("thegradeforthisassessmentis", "workshop",
+ if ($workshop->gradingstrategy) { // supress grading grade if not graded
+ $comment .= "; ".get_string("thegradeforthisassessmentis", "workshop",
number_format($assessment->gradinggrade * $workshop->gradinggrade / 100, 0)).
" / $workshop->gradinggrade";
+ }
}
// if peer agreements show whether agreement has been reached
if ($workshop->agreeassessments) {
@@ -969,8 +971,10 @@ function workshop_list_peer_assessments($workshop, $user) {
get_string("view", "workshop")."</a>";
$comment = get_string("assessedon", "workshop", userdate($assessment->timecreated));
$grade = number_format($assessment->grade * $workshop->grade / 100, 1);
- $comment .= "; ".get_string("gradeforsubmission", "workshop").
- ": $grade / $workshop->grade";
+ if ($workshop->gradingstrategy) { // supress grade if not graded
+ $comment .= "; ".get_string("gradeforsubmission", "workshop").
+ ": $grade / $workshop->grade";
+ }
if ($assessment->timegraded) {
if (!$assessment->gradinggrade) {
// it's a bad assessment
@@ -1561,10 +1565,12 @@ function workshop_list_teacher_submissions($workshop, $user) {
}
// see if the assessment is graded
if ($assessment->timegraded) {
- // show grading grade
- $comment = get_string("thegradeforthisassessmentis", "workshop",
+ // show grading grade (supressed if workshop not graded)
+ if ($workshop->gradingstrategy) {
+ $comment = get_string("thegradeforthisassessmentis", "workshop",
number_format($assessment->gradinggrade * $workshop->gradinggrade / 100, 1))." / ".
$workshop->gradinggrade;
+ }
} elseif ($assessment->timecreated < $timenow) {
$comment = get_string("awaitinggradingbyteacher", "workshop", $course->teacher);
}
View
@@ -58,6 +58,9 @@
if (empty($form->anonymous)) {
$form->anonymous = 0;
}
+ if (empty($form->usepassword)) {
+ $form->usepassword = 0;
+ }
if (empty($form->maxbytes)) {
$form->maxbytes = "";
}

0 comments on commit b514883

Please sign in to comment.