--- doc/help/codingmath.tex 2008/09/10 02:12:09 1.1 +++ doc/help/codingmath.tex 2008/09/12 02:22:23 1.2 @@ -21,9 +21,64 @@ symbolic math system is implemented. \$l \subsection{{\tt }-interface} -\input{Math_Response_Problems.tex} +{\tt } is a way to have a problem graded based on an algorithm that is executed inside of a computer algebra system. +The documentation of \LC points out that use of this response type is +generally discouraged, since the responses will not be analyzable by the LON-CAPA statistics tools. Yet, it can be useful. + +Which computer algebra system is to be used is specified in the cas argument of the mathresponse tag; currently, only Maxima is available. +LON-CAPA sets up two arrays inside the computer algebra system: RESPONSE and LONCAPALIST. RESPONSE contains the student input by component, for example, if "3,42,17" is entered, RESPONSE[2] would be 42. LONCAPALIST contains the arguments passed in the args of mathresponse. + +The answerdisplay is what is displayed when the problem is in "Show Answer" mode. + +The following example illustrates this. It is a simplified version of \begin{verbatim} /res/msu/kashy/physicsLib02/02_Math_2_Trig/LinethroughPt2.problem\end{verbatim}. + +\begin{verbatim} + + + + +State a function y(x) which passes through the point ($x, $y) +and which has a constant slope with absolute value > 1.
+ + + + +y(x):=RESPONSE[1]; +thrupoint:is(abs(y(LONCAPALIST[1]) - LONCAPALIST[2]) <= 0.000000001); +islinear:is(diff(y(x),x,2) = 0); +AbsSlopeGT1:is(abs(diff(y(x),x,1)) > 1); +thrupoint and islinear and AbsSlopeGT1; + + +y(x) = + + +
+ +\end{verbatim} -{\bf a simpler example might be more appriopriate here} \section{Interface to maxima} \LC servers run several maxima sessions in parallel. There is a queue which distributes CAS calls to these sessions. When processing a new CAS call one has to be sure that maxima is reset to some default state. In particular functions, variables etc.\ defined in previous calls should be removed. LON-CAPA automatically takes care of that by means of the following sequence of commands which is executed every time before a maxima code snippet supplied by an author will be executed: \begin{quote} 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.