Annotation of loncom/html/adm/help/tex/Custom_Response_Problems.tex, revision 1.4

1.1       www         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
1.3       albertel    6: variable \$submission, and needs to be evaluated by Perl code inside the <answer>-tag. Custom Response needs to return a standard LON-CAPA. The most common response are:
1.1       www         7: \begin{itemize}
                      8: \item EXACT\_ANS: return if solved exactly correctly
                      9: \item APPROX\_ANS: return if solved approximately
1.2       albertel   10: \item INCORRECT: return if not correct, uses up a try
1.3       albertel   11: \item SIG\_FAIL, NO\_UNIT, EXTRA\_ANSWER, MISSING\_ANSWER, BAD\_FORMULA, 
1.2       albertel   12: WANTED\_NUMERIC: return if not correct for different reasons, does not use up a try
1.1       www        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
1.3       albertel   22: if ($submission=~/\,/) { return 'EXTRA_ANSWER'; }
1.1       www        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}
1.3       albertel   33: 
                     34: 
                     35: Full list of possible return codes:
                     36: \begin{itemize}
1.4     ! albertel   37: \item EXACT\_ANS: student is exactly correct
        !            38: \item APPROX\_ANS:  student is approximately correct
        !            39: \item NO\_RESPONSE: student submitted no response
        !            40: \item MISSING\_ANSWER: student submitted some but not all parts of a response
        !            41: \item EXTRA\_ANSWER: student submitted a vector of values when a scalar was expected
        !            42: \item WANTED\_NUMERIC: expected a numeric answer and didn't get one
        !            43: \item SIG\_FAIL: incorrect number of Significant Figures
        !            44: \item UNIT\_FAIL: incorrect unit
        !            45: \item UNIT\_NOTNEEDED: Submitted a unit when one shouldn't
        !            46: \item UNIT\_INVALID\_INSTRUCTOR: the unit provided by the author of the problem is unparsable
        !            47: \item UNIT\_INVALID\_STUDENT: the unit provided by the student is unparasable
        !            48: \item UNIT\_IRRECONCIBLE: the unit from the student and the instructor are of different types
        !            49: \item NO\_UNIT: needed a unit but none was submitted
        !            50: \item BAD\_FORMULA: syntax error in submitted formula
1.3       albertel   51: \item INCORRECT: answer was wrong
                     52: \item SUBMITTED: submission wasn't graded
                     53: \item DRAFT: submission only stored
1.4     ! albertel   54: \item MISORDERED\_RANK: student submitted a poorly order rank response
1.3       albertel   55: \item ERROR: unable to get a grade
1.4     ! albertel   56: \item ASSIGNED\_SCORE: there is a resource.partid.responseid.awarded the real awarded should be set to the average of the individual awards
        !            57: \item TOO\_LONG: answer submission to CAPA engine longer than 500 characters
        !            58: \item INVALID\_FILETYPE: student tried to upload a file that was of an extension that was not specifically allowed 
        !            59: \item COMMA\_FAIL: answer requires the use of comma grouping and it wasn't provided or was incorrect
1.3       albertel   60: 
                     61: \end{itemize}

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