File:  [LON-CAPA] / loncom / html / adm / help / tex / Custom_Response_Problems.tex
Revision 1.2: download - view: text, annotated - select for diffs
Tue Jul 18 18:56:11 2006 UTC (18 years, 1 month ago) by albertel
Branches: MAIN
CVS tags: version_2_3_X, version_2_3_2, version_2_3_1, version_2_3_0, version_2_2_X, version_2_2_99_1, version_2_2_99_0, version_2_2_2, version_2_2_1, version_2_2_0, version_2_1_99_3, version_2_1_99_2, version_2_1_99_1, HEAD
 attempting to possibly make the english clearer?

    1: \label{Custom_Response_Problems}
    2: Custom Response is a way to have a problem graded based on an algorithm. The use of this response type is
    3: generally discouraged, since the responses will not be analyzable by the LON-CAPA statistics tools.
    4: 
    5: The student answer is stored in the
    6: variable \$submission, and needs to be evaluated by Perl code inside the <answer>-tag. Custom Response needs to return a standard LON-CAPA grading code:
    7: \begin{itemize}
    8: \item EXACT\_ANS: return if solved exactly correctly
    9: \item APPROX\_ANS: return if solved approximately
   10: \item INCORRECT: return if not correct, uses up a try
   11: \item SIG\_FAIL, NO\_UNIT, ANS\_CNT\_NOT\_MATCH, BAD\_FORMULA, 
   12: WANTED\_NUMERIC: return if not correct for different reasons, does not use up a try
   13: \end{itemize}
   14: The answer display is shown instead of the student response in 'show answer' mode.
   15: The following example illustrates this:
   16: \begin{verbatim}
   17: <problem>
   18: <startouttext />Accept an answer of around 90 or -90<endouttext />
   19:   <customresponse answerdisplay="something near 90 or -90">
   20:     <answer type="loncapa/perl">
   21: # We do not want a vector
   22: if ($submission=~/\,/) { return 'ANS_CNT_NOT_MATCH'; }
   23: # Need a numerical answer here
   24: if ($submission!~/^[\d\.\-\e]+$/i) { return 'WANTED_NUMERIC'; }
   25: $difference=abs(90-abs($submission));
   26: if ($difference==0) { return 'EXACT_ANS'; }
   27: if ($difference < 0.1) { return 'APPROX_ANS'; }
   28: return 'INCORRECT';</answer>
   29:     <textline readonly="no" />
   30:   </customresponse>
   31: </problem>
   32: \end{verbatim}

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