[Aimmath-commit] AIM/WEB-INF/maple/aim TextQuestion.mpl,1.12,1.13
Brought to you by:
gustav_delius,
npstrick
From: Greg G. <gr...@us...> - 2004-04-14 18:49:17
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4637 Modified Files: TextQuestion.mpl Log Message: Make use of the new possibility of a parse report 'Status' of "Evaluation Error" in `aim/TextQuestion/BasicValidation`, which ran into error if an expression parsed ok but could not be evaluated. This function now completes cleanly in this case and gives a meaningful error message to the student ... they might not understand it, but that's another story. - GG Index: TextQuestion.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/TextQuestion.mpl,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TextQuestion.mpl 12 Jan 2004 06:15:55 -0000 1.12 --- TextQuestion.mpl 14 Apr 2004 18:49:08 -0000 1.13 *************** *** 510,514 **** parsereport := `aim/SafeParse`(rawans); status := parsereport['Status']; - val := parsereport['Value']; if (status = "Parse error") then --- 510,513 ---- *************** *** 534,537 **** --- 533,549 ---- t['Hint']); fi; + elif (status = "Evaluation error") then + attempt['ValidationNote'] := __("evaluation error"); + t := `aim/ParseReport`(rawans); + attempt['ValidationMessage'] := + cat(t['MarkedString'], + "\n<br/>\n", + "Your answer while syntactically correct Maple cannot be evaluated, ", + "and evokes the following error:\n", + "<blockquote><font color=red>\n", + parsereport['ErrorMessage'], + "</font></blockquote>\n", + "You might try asking your friendly quiz administrator for a ", + "further explanation."); elif (status = "Assignment") then attempt['ValidationNote'] := __("assignment"); *************** *** 582,585 **** --- 594,598 ---- try + val := parsereport['Value']; ans := timelimit(tlimit,eval(val)); catch "time expired": |