File:  [LON-CAPA] / loncom / homework / templates / custompartial.problem
Revision 1.5: download - view: text, annotated - select for diffs
Sat Aug 25 17:46:47 2018 UTC (6 years, 4 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_12_X, version_2_11_X, version_2_11_5_msu, version_2_11_5, version_2_11_4_uiuc, version_2_11_4_msu, version_2_11_4, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3, HEAD
- Required change omitted from rev. 1.4 commit.

<problem>
 <parameter name="retrypartial" type="string_yesno" description="Partially correct is answerable" 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>