[LON-CAPA-users] Creative Authoring - number correct

Guy Albertelli II lon-capa-users@mail.lon-capa.org
Tue, 9 Oct 2007 17:54:04 -0400


> A Course Coordinator wants to show the students how many options are
> correct in an optionresponse question. He does not want them to know
> which ones, just how many.

The per foil grading information is stored to the '.submissiongrading' 
data, as

foilname1=grade1&foilname2=grade2

Here's an example the that uses the info in the submission grading 
to count the number of foils graded as correct.

Then displays this in the hint.


<problem>
  <script type="loncapa/perl">
$grade = &EXT('user.resource.resource.0.opt.submissiongrading');
$correct = 0;
if ($grade ne '') {
   foreach $pair (split('&',$grade)) {
      ($name,$foil_grade) = split('=',$pair);
      $correct += $foil_grade;
   }
}

  </script>
  <optionresponse id="opt" max="10" randomize="yes">
    <foilgroup options="('Green','Red')">
      <foil location="random" value="Green" name="Foil1">
        <startouttext />
This is foil One. It is currently set to "Green."
        <endouttext />
      </foil>
      <foil location="random" value="Red" name="Foil2">
        <startouttext />
This is foil Two. It is currently set to  "Red."
        <endouttext />
      </foil>
      <foil location="random" value="Green" name="Foil3">
        <startouttext />
This is foil Three. It is currently set to "Green."
        <endouttext />
      </foil>
      <foil location="random" value="Red" name="Foil4">
        <startouttext />
This is foil Two. It is currently set to "Red."
        <endouttext />
      </foil>
    </foilgroup>
    <hintgroup>
       <startouttext />
You have gotten $correct statement(s) correct.
       <endouttext />
    </hintgroup>
  </optionresponse>
</problem>

> 
> Arguments about whether this should be done aside, is there a creative
> way to do this? Does the problem have enough information about the last
> choices to build this information up?
> 
> It would certainly be ugly, and the last thing you want hardcoded into a
> problem.
> 
> Any thoughts on the matter?
> 
> Thanks!
> Mark
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

-- 
guy@albertelli.com   0-7-0-9-27,137