Annotation of loncom/homework/templates/CustomResponse.problem, revision 1.1
1.1 ! www 1: <problem>
! 2: <startouttext />Accept an answer of around 90 or -90<endouttext />
! 3: <customresponse answerdisplay="something near 90 or -90">
! 4: <answer type="loncapa/perl">
! 5: # We do not want a vector
! 6: if ($submission=~/\,/) { return 'ANS_CNT_NOT_MATCH'; }
! 7: # No units needed
! 8: if ($submission=~/^\d+\s+\w+$/) { return 'UNIT_NOTNEEDED'; }
! 9: # Need a numerical answer here
! 10: if ($submission!~/^\d+$/) { return 'WANTED_NUMERIC'; }
! 11: $difference=abs(90-abs($submission));
! 12: if ($difference==0) { return 'EXACT_ANS'; }
! 13: if ($difference < 0.001) { return 'APPROX_ANS'; }
! 14: return 'INCORRECT';
! 15: </answer>
! 16: <textline />
! 17: </customresponse>
! 18: </problem>
! 19:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>