]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed bug #1952; fixed bug in upload form; and assessment form now
authorrkingdon <rkingdon>
Mon, 20 Sep 2004 14:59:41 +0000 (14:59 +0000)
committerrkingdon <rkingdon>
Mon, 20 Sep 2004 14:59:41 +0000 (14:59 +0000)
displays the correct grade.

mod/workshop/lib.php
mod/workshop/locallib.php
mod/workshop/mod.html
mod/workshop/view.php

index 804b6eb9ba9cdb293438d1ab0238ddb1062d7408..90d5b476549b63b3a6f5873685f45beb070f4e19 100644 (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") ;
     }
 
 
index 0e6f9d5077d5a7731deb8ed18c5744bb8738cf52..7c18bf94c8eeab5c8ac5ace64799bc115fc3ca4c 100644 (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);
index 6f00dd47fdfbfc06312dc1fb5b83b138c2100635..e03142e0effb949806ff0e1dc7a4ab478a39b312 100644 (file)
 <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>
index 7d30f27421f73b56881702f584aa525abb450310..69fcfb8fc58ded24015e1b72538927f09a9af5ed 100644 (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");
                        }
                }
        }