# [LON-CAPA-users] questions about our first exam - partial marks

Peter Dencker dencker at math.uni-luebeck.de
Mon Feb 3 10:36:05 EST 2014

```Hi.

Rough workaround ideas.

Grading depending on the number of tries.
You can download a file with number of tries for each part of the problem:
'View the course assessment progress chart', Output-Data 'Tries'.
Now merge this with the 'scores per problem' file and compute your own
grading in the excel format file.

Modify the problem: Don't take an optionresponse with - lets say 3 -
foils but 3 different parts. If you download the 'scores per problem'
file you can use the score for each part: 0.5 for correct (if the weight
for the part is 0.5 like in the example below) and 0 for incorrect. Now
you can change 0 to -0.5 (this could be done in new columns using
functions in the excel format file) and summing up.

I give a simple 'template' problem below that shows, how to randomly
choose and randomize the statements and corresponding values for the
parts.  You can use statements with latex formulas using the xmlparse
function, if needed.

If you need more parts: 1. Set the variable '\$number_of_parts' to the
new value. 2. Simply copy the part with id p0 and replace p0 with p3 and
so on.

- Peter

<problem>
<parameter name="ordered" id="ordered" type="string_yesno"
default="yes" description="Show Parts One-at-a-Time" />
<parameter name="maxtries" id="maxtries" type="int_pos" default="1"
description="Maximum Number of Tries" />

<script type="loncapa/perl">
# could be cut and past into a library and imported
our @COLLECTION = (
[ 'Statement A.', 'true'  ],
[ 'Statement B.', 'false' ],
[ 'Statement C.', 'false' ],
[ 'Statement D.', 'false' ],
[ 'Statement E.', 'true'  ],
[ 'Statement F.', 'true'  ],
[ 'Statement G.', 'true'  ],
[ 'Statement H.', 'false' ],
[ 'Statement I.', 'true'  ],
[ 'Statement J.', 'false' ],
[ 'Statement K.', 'true'  ],
[ 'Statement L.', 'true'  ],
[ 'Statement M.', 'false' ],
[ 'Statement N.', 'false' ],
);
</script>

<script type="loncapa/perl">
# Number of Parts:
my \$number_of_parts = 3;
#

sub rand_element { return \$_[ random( 0, \$#_, 1 ) ] }
my @indices    = ();
my %is_choosen = ();
for ( 1 .. \$number_of_parts ) {
my \$index
= rand_element grep { !\$is_choosen{\$_} } 0 .. \$#COLLECTION;
push @indices, \$index;
\$is_choosen{\$index} = 1;
}
our %question
= map {; "p\$_" => \$COLLECTION[ \$indices[\$_] ][0] } 0 .. \$#indices;
our %value
= map {; "p\$_" => \$COLLECTION[ \$indices[\$_] ][1] } 0 .. \$#indices;
</script>

<startouttext />
Are the following statements true or false?
<br /> <br />
<endouttext />

<part id="p0">
<parameter name="weight" id="p0weight" type="int_pos" default="0.5"
description="Points for Part p0" />
<optionresponse max="1" id="p0r0">
<foilgroup options="('true','false')">
<foil value="\$value{p0}" name="p0r0foil0">
<startouttext />
\$question{'p0'}

( <drawoptionlist /> )
<endouttext />
</foil>
</foilgroup>
</optionresponse>
</part>

<part id="p1">
<parameter name="weight" id="p1weight" type="int_pos" default="0.5"
description="Points for Part p1" />
<optionresponse max="1" id="p1r0">
<foilgroup options="('true','false')">
<foil value="\$value{p1}" name="p1r0foil0">
<startouttext />
\$question{'p1'}

( <drawoptionlist /> )
<endouttext />
</foil>
</foilgroup>
</optionresponse>
</part>

<part id="p2">
<parameter name="weight" id="p2weight" type="int_pos" default="0.5"
description="Points for Part p2" />
<optionresponse max="1" id="p2r0">
<foilgroup options="('true','false')">
<foil value="\$value{p2}" name="p2r0foil0">
<startouttext />
\$question{'p2'}

( <drawoptionlist /> )
<endouttext />
</foil>
</foilgroup>
</optionresponse>
</part>

</problem>

On 02/03/2014 04:48 AM, Joseph Mingrone wrote:
> Hello,
>
> I've been asked to write an exam and I'm struggling with the request to
> assign students partial marks under certain conditions.
>
> The first condition is based on the number of tries the student takes to
> get the correct answer.  For example, if the student gets the correct
> answer on the second try (after a hint has been displayed) we would like
> to give her half the weight of the question.  Maybe the custom response
> problem is the way to go?  Maybe we're trying to force a square block
> into a round hole?  If you've done this, example code would be great.
> I've seen the post below, but the solution isn't clear to me.
> http://mail.lon-capa.org/pipermail/lon-capa-users/2012-August/004127.html
>
> The second condition is for an Option Response with a foil group.  The
> professor would like to assign 0.5 for each correct option chosen and
> -0.5 for each incorrect option chosen.
>
> After reading the author manual, this is my best guess.
>
>   <part id="assumptions">
>     <parameter name="maxtries" id="75" type="int_pos" default="1" description="Maximum Number of Tries" />
>     <parameter name="problemstatus" id="78" type="string_problemstatus" default="answer" description="Show Problem Status" />
>     <startouttext />(g) Indicate the correct statements<endouttext />
>     <customresponse>
>       <optionresponse max="6" id="80" randomize="no" TeXlayout="horizontal">
> 	<foilgroup checkboxvalue="True" options="('True','False')" noprompt="1" checkboxoptions="nochoice">
> 	  <foil location="bottom" value="True" name="foil-ev">
> 	    <parameter name="weight" id="94" type="float_pos" default="0.5" description="Weight" />
>             <startouttext />Statement 1<endouttext />
> 	  </foil>
> 	  <foil location="bottom" value="False" name="foil-es">
>             <startouttext />Statement 2<endouttext />
> 	  </foil>
> 	  <foil location="bottom" value="False" name="foil-n8">
>             <startouttext />Statement 3<endouttext />
> 	  </foil>
> 	  <foil location="bottom" value="True" name="foil-nd">
>             <startouttext />Statement 3<endouttext />
> 	  </foil>
> 	</foilgroup>
>       </optionresponse>
>        ### code here to check the indices of \$\$submission and add .5 for
>     each correct option chosen and subtract 0.5 for each incorrect option chosen... ###
> 	return(ASSIGNED_SCORE,0.3);
>     </customresponse>
>   </part>
>
> Thanks for any tips,
>
> Joseph
>
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users at mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>

--
Dr. Peter Dencker
wissenschaftl. Mitarbeiter

UNIVERSITÄT ZU LÜBECK
INSTITUT FÜR MATHEMATIK

Ratzeburger Allee 160
23562 Lübeck

Tel +49 451 500 4254
Fax +49 451 500 3373
dencker at math.uni-luebeck.de

www.math.uni-luebeck.de
```