File:  [LON-CAPA] / loncom / html / adm / help / tex / Custom_Response_Problems.tex
Revision 1.4: download - view: text, annotated - select for diffs
Thu May 10 21:04:02 2007 UTC (17 years, 3 months ago) by albertel
Branches: MAIN
CVS tags: version_2_8_X, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_X, version_2_5_99_1, version_2_5_99_0, version_2_5_2, version_2_5_1, version_2_5_0, version_2_4_X, version_2_4_99_0, version_2_4_2, version_2_4_1, version_2_4_0, version_2_3_99_0, HEAD, GCI_1, BZ5434-fox
- fix latex error

    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. The most common response are:
    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, EXTRA\_ANSWER, MISSING\_ANSWER, 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 'EXTRA_ANSWER'; }
   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}
   33: 
   34: 
   35: Full list of possible return codes:
   36: \begin{itemize}
   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
   51: \item INCORRECT: answer was wrong
   52: \item SUBMITTED: submission wasn't graded
   53: \item DRAFT: submission only stored
   54: \item MISORDERED\_RANK: student submitted a poorly order rank response
   55: \item ERROR: unable to get a grade
   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
   60: 
   61: \end{itemize}

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