Fixed bug #1952; fixed bug in upload form; and assessment form now

displays the correct grade.
This commit is contained in:
rkingdon 2004-09-20 14:59:41 +00:00
parent 7f02f534d0
commit aa8f2d1ec1
4 changed files with 8 additions and 6 deletions

View File

@ -1183,9 +1183,11 @@ function workshop_compare_assessments($workshop, $assessment1, $assessment2) {
//////////////////////////////////////////////////////////////////////////////////////
function workshop_count_ungraded_assessments($workshop) {
// function returns the number of ungraded assessments (ANY assessments)
// function returns the number of ungraded assessments (assessments must be warm or cold)
return count_records("workshop_assessments", "workshopid", $workshop->id, "timegraded", 0) ;
$timenow = time();
return count_records_select("workshop_assessments", "workshopid = $workshop->id AND
timecreated < $timenow AND timegraded = 0") ;
}

View File

@ -1819,7 +1819,8 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
// only show the grade if grading strategy > 0 and the grade is positive
if ($showgrades and $workshop->gradingstrategy and $assessment->grade >= 0) {
echo "<center><b>".get_string("thegradeis", "workshop").": ".number_format($assessment->grade, 2)." (".
echo "<center><b>".get_string("thegradeis", "workshop").": ".
number_format($assessment->grade * $workshop->grade / 100, 2)." (".
get_string("maximumgrade")." ".number_format($workshop->grade, 0).")</b></center><br clear=\"all\" />\n";
}
}
@ -2688,7 +2689,7 @@ function workshop_print_upload_form($workshop) {
}
echo "<div align=\"center\">";
echo "<form enctype=\"multipart/form-data\" method=\"POST\" action=\"upload\".php>";
echo "<form enctype=\"multipart/form-data\" method=\"POST\" action=\"upload.php\">";
echo " <input type=\"hidden\" name=\"id\" value=\"$cm->id\" />";
require_once($CFG->dirroot.'/lib/uploadlib.php');
upload_print_form_fragment(1,array('newfile'),null,true,array('title'),$course->maxbytes,$workshop->maxbytes,false);

View File

@ -341,7 +341,6 @@
<input type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" name="cancel" value="<?php print_string("cancel") ?>" />
<p>
<p><?php notify(get_string("noteonassessmentelements", "workshop")); ?>
</center>
</form>

View File

@ -56,7 +56,7 @@
$action = "teachersview";
}
else {
redirect("assessments.php?action=editelements&amp;id=$cm->id");
redirect("assessments.php?action=editelements&id=$cm->id");
}
}
}