--- loncom/homework/templates/examupload.problem 2010/04/20 23:29:27 1.11 +++ loncom/homework/templates/examupload.problem 2011/05/01 17:17:09 1.14 @@ -11,7 +11,16 @@ if ((!defined($weight)) || ($weight eq ' $awarded=&EXT('user.resource.resource.0.awarded'); if (!defined($awarded)) { $awarded=0; } $scoreformat=&EXT('resource.0.scoreformat'); -if (!defined($scoreformat) || $scoreformat eq '') { $scoreformat="0f"; } +if (!defined($scoreformat) || $scoreformat eq '') { $scoreformat="2f"; } +$display=''; +if (&EXT('resource.0.problemstatus')!~/^no/) { + if (!defined($awarded)) { + $display=$weight.' possible points.'; + } else { + $display='You have '.&format($awarded*$weight,$scoreformat).' out of '. + $weight.' possible points.'; + } +} $comment=&EXT('user.resource.resource.0.comment'); if (!defined($comment) || $comment!~/\w/) { $comment=''; @@ -22,17 +31,17 @@ $gradeinfo=&EXT('user.resource.resource. if (!defined($gradeinfo) || $gradeinfo!~/\w/) { $gradeinfo=''; } else { - $gradeinfo='
'.$gradeinfo.'
'; + $gradeinfo='
'.$gradeinfo.'
'; } -You have &format($awarded*$weight,$scoreformat) out of $weight possible points. +$display -
If non-integer points are used (e.g., 3.5), make sure to change the -display format in "Modify parameter settings for this resource" (clock symbol), or the result will be displayed in rounded form. +
You can modify the rounding of the score display using the "scoreformat" setting. +You can upload comments and grade information with this resource when uploading CSV files. Feedback on grades can be controlled using the problemstatus parameter.
$gradeinfo $comment