File:  [LON-CAPA] / loncom / homework / templates / custompartial.problem
Revision 1.3: download - view: text, annotated - select for diffs
Tue Nov 29 13:24:41 2011 UTC (12 years, 5 months ago) by raeburn
Branches: MAIN
CVS tags: language_hyphenation_merge, language_hyphenation, HEAD
- Bug 2802.
  - optionresponse::is_nonlenient() moved to inputtags::grading_is_nonlenient()
    to facilitate re-use.
  - where solved is "correct", awarded value < 1 permits new submission,
    only if lenient grading applies.
  - add lenient parameter to custompartial.problem template.

<problem>
 <parameter name="lenient" type="string_lenient" description="Lenient Grading (Partial Credit)" default="yes" />

<startouttext />
Complete the sentence:
<endouttext />

<customresponse id="11">
    <notsolved>
        <startouttext />
The q<textline readonly="no" size="5" /> brown fox jum<textline readonly="no" size="3" /> over the <textline readonly="no" size="3" />zy d<textline readonly="no" size="3" />.
        <endouttext />
    </notsolved>
    <solved>
        <startouttext />
The q<b>uick</b> brown fox jum<b>ps</b> over the <b>la</b>zy d<b>og</b>.
        <endouttext />
    </solved>
    <answer type="loncapa/perl">
@answer=('uick','ps','la','og');
$correct=0;
for ($i=0;$i<=$#$submission;$i++) {
    $$submission[$i]=~s/\s//gs;
    if ($$submission[$i] eq $answer[$i]) { $correct++; }
}
if ($correct==$#answer+1) { return 'EXACT_ANS'; }
if ($correct==0) { return 'INCORRECT'; }
return('ASSIGNED_SCORE',$correct/($#answer+1));
    </answer>
</customresponse>

</problem>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>