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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 27 Jan 2004 20:45:11 -0000


albertel		Tue Jan 27 15:45:11 2004 EDT

  Modified files:              
    /loncom/homework/templates	examupload.problem 
                              	examupload.problem.meta 
  Log:
  - allow formatting of the shown grade in the score upload
  
  
Index: loncom/homework/templates/examupload.problem
diff -u loncom/homework/templates/examupload.problem:1.3 loncom/homework/templates/examupload.problem:1.4
--- loncom/homework/templates/examupload.problem:1.3	Mon Jul 21 13:51:24 2003
+++ loncom/homework/templates/examupload.problem	Tue Jan 27 15:45:11 2004
@@ -1,13 +1,16 @@
 <problem>
 <displaytitle />
+<parameter name="scoreformat" description="Format for display of score" default="0f" type="string" />
 <script type="loncapa/perl">
 $weight=&EXT('resource.0.weight');
 if ((!defined($weight)) || ($weight eq '')) { $weight=1; }
 $awarded=&EXT('user.resource.resource.0.awarded');
 if (!defined($awarded)) { $awarded=0; }
+$scoreformat=&EXT('resource.0.scoreformat');
+if (!defined($scoreformat) || $scoreformat eq '') { $scoreformat="2f"; }
 </script>
 <startouttext />
-You have <display>$awarded*$weight</display> out of $weight possible points.
+You have <display>&format($awarded*$weight,$scoreformat)</display> out of $weight possible points.
 <endouttext />
 <notsolved><numericalresponse id='score' /></notsolved>
 </problem>
Index: loncom/homework/templates/examupload.problem.meta
diff -u loncom/homework/templates/examupload.problem.meta:1.1 loncom/homework/templates/examupload.problem.meta:1.2
--- loncom/homework/templates/examupload.problem.meta:1.1	Sat Jul  5 06:07:11 2003
+++ loncom/homework/templates/examupload.problem.meta	Tue Jan 27 15:45:11 2004
@@ -13,6 +13,7 @@
 <owner>templates@lib</owner>
 <parameter part="0" id="score" package="numericalresponse"></parameter>
 <parameter part="0" package="part"></parameter>
+<parameter part="0" name="scoreformat" type="string" default="0f" display="Format for display of score [Part: 0]"></parameter>
 <stores part="0" name="awarded" type="float" display="Partial Credit Factor [Part: 0]"></stores>
 <stores part="0" name="solved" type="string" display="Problem Status [Part: 0]"></stores>
 <stores part="0" name="tries" type="int_zeropos" display="Number of Attempts [Part: 0]"></stores>