[LON-CAPA-cvs] cvs: loncom /homework/templates DropBox.problem

www lon-capa-cvs-allow@mail.lon-capa.org
Sun, 20 May 2007 22:04:02 -0000


www		Sun May 20 18:04:02 2007 EDT

  Modified files:              
    /loncom/homework/templates	DropBox.problem 
  Log:
  Score display
  
  
Index: loncom/homework/templates/DropBox.problem
diff -u loncom/homework/templates/DropBox.problem:1.4 loncom/homework/templates/DropBox.problem:1.5
--- loncom/homework/templates/DropBox.problem:1.4	Thu May 18 13:05:08 2006
+++ loncom/homework/templates/DropBox.problem	Sun May 20 18:04:01 2007
@@ -1,6 +1,23 @@
 <problem>
+<script type="loncapa/perl">
+$weight=&EXT('resource.0.weight');
+if ((!defined($weight)) || ($weight eq '')) { $weight=1; }
+$awarded=&EXT('user.resource.resource.0.awarded');
+$scoreformat=&EXT('resource.0.scoreformat');
+if (!defined($scoreformat) || $scoreformat eq '') { $scoreformat="0f"; }
+if (!defined($awarded)) {
+   $display='$weight possible points.';
+} else {
+   $display='You have '.&format($awarded*$weight,$scoreformat).' out of '.
+            $weight.' possible points.';
+}
+</script>
+<startouttext />
 <displaytitle />
-<instructorcomment><font color="red">To change the allowed file types for
+$display
+<instructorcomment><font color="red">If non-integer points are used (e.g., 3.5), make sure to change the
+display format in PPRM, or the result will be displayed in rounded form.
+To change the allowed file types for
 submissions, change the "uploadedfiletypes" parameter in
 PPRM.</font></instructorcomment>
 <essayresponse id="upload">