--- loncom/html/adm/help/tex/Custom_Response_Problems.tex 2006/07/18 17:24:45 1.1 +++ loncom/html/adm/help/tex/Custom_Response_Problems.tex 2017/01/23 20:29:42 1.8 @@ -1,32 +1,2 @@ -\label{Custom_Response_Problems} -Custom Response is a way to have a problem graded based on an algorithm. The use of this response type is -generally discouraged, since the responses will not be analyzable by the LON-CAPA statistics tools. - -The student answer is stored in the -variable \$submission, and needs to be evaluated by Perl code inside the -tag. Custom Response needs to return a standard LON-CAPA grading code: -\begin{itemize} -\item EXACT\_ANS: return if solved exactly correctly -\item APPROX\_ANS: return if solved approximately -\item INCORRECT: return if not correct, loose try -\item SIG\_FAIL, NO\_UNIT, ANS\_CNT\_NOT\_MATCH, BAD\_FORMULA, -WANTED\_NUMERIC: return if not correct for different reasons, do not loose try -\end{itemize} -The answer display is shown instead of the student response in 'show answer' mode. -The following example illustrates this: -\begin{verbatim} - -Accept an answer of around 90 or -90 - - -# We do not want a vector -if ($submission=~/\,/) { return 'ANS_CNT_NOT_MATCH'; } -# Need a numerical answer here -if ($submission!~/^[\d\.\-\e]+$/i) { return 'WANTED_NUMERIC'; } -$difference=abs(90-abs($submission)); -if ($difference==0) { return 'EXACT_ANS'; } -if ($difference < 0.1) { return 'APPROX_ANS'; } -return 'INCORRECT'; - - - -\end{verbatim} +\label{Custom_Response_Problems}\index{Custom Response} +Custom Response is a way to have a problem graded based on an algorithm constructed in the perl script. The use of this response type is generally discouraged, since the responses will not be analyzable by the LON-CAPA statistics tools.