[Aimmath-commit] AIM/WEB-INF/maple/aim Compile.mpl,1.4,1.5
Brought to you by:
gustav_delius,
npstrick
From: <gus...@us...> - 2003-08-29 19:41:38
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1:/tmp/cvs-serv20546/WEB-INF/maple/aim Modified Files: Compile.mpl Log Message: This is just a temporary fix of the "ignored s> tag" bug. I replaced the call to Neil's new ConvertMPROC function with the old code. Index: Compile.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Compile.mpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Compile.mpl 26 Aug 2003 18:38:48 -0000 1.4 --- Compile.mpl 29 Aug 2003 19:41:34 -0000 1.5 *************** *** 635,639 **** fi; ! mproc := `aim/Compile/ModifyMPROC`(eval(x[1])); setans := --- 635,697 ---- fi; ! mproc := eval(x[1]); ! ! # At this point, mproc is a function like f(ans). The following block ! # of code converts it to the function g(attempt,ans) = f(ans). Later ! # blocks will modify g so that it no longer ignores the first argument. ! err := ! traperror( ! codegen[swapargs]( ! codegen[makeparam](attempt,mproc), 1 = 2)); ! if err = lasterror then ! RETURN([ ! cat( ! __("Error while manipulating marking procedure:"), ! "\n<br/>\n",`HTML/Escape`(lasterr),"\n<br/>\n", ! "mproc = \n", ! "<pre>\n",`HTML/Escape`(sprintf("%a",mproc)),"\n</pre>\n"), ! nam,0,lines]); ! else ! mproc := eval(err); ! fi; ! ! # The mproc function will typically contain calls to printf(), ! # `aim/t` and so on, to 'print' feedback strings to be shown to ! # the student. The next block of code modifies mproc so that the ! # strings are captured in attempt['Feedback'] or ! # attempt['AnswerNote'] rather than being printed immediately. ! mproctext := sprintf("%a",eval(mproc)); ! mproctext := ! `aim/Compile/RedirectOutput`("attempt['Feedback']",mproctext); ! mproctext := ! `aim/Compile/Replace`( ! "`aim/SetAnswerNote`(" = "`aim/SetAnswerNote`(attempt,", ! "`aim/SetInvalid`(" = "`aim/SetInvalid`(attempt,", ! mproctext); ! ! y := traperror(`Util/Parse`(mproctext,err,0)); ! ! if err <> NULL then ! RETURN([ ! cat( ! __("Problem while reparsing marking procedure:"), ! "\n<br/>\n",err[1], ! "\n<pre>\n",err[3],"\n</pre>\n"), ! nam,0,lines]); ! else ! mproc := eval(y); ! fi; ! ! # At this point, the function mproc expects two arguments (attempt ! # and ans) and returns the appropriate raw mark. We next modify it ! # so that it only needs one argument (called attempt), it takes ans ! # to be attempt['Answer'], and it inserts the raw mark in the ! # attempt['RawAnswer'] field. ! question['MProc'] := ! subs(MPROC_ = eval(mproc), ! proc(attempt::`aim/Question/Attempt`) ! attempt['RawMark'] := MPROC_(attempt,attempt['Answer']); ! end); ! setans := *************** *** 1811,1815 **** if type(x,function) then if member(op(0,x), {_Inert_LOCAL,_Inert_PARAM, ! _Inert_LEXICAL_LOCAL,_Inert_LEXICAL_PARAM}) then return(t[x]); elif op(0,x) = _Inert_PROC then --- 1869,1873 ---- if type(x,function) then if member(op(0,x), {_Inert_LOCAL,_Inert_PARAM, ! _Inert_LEXICAL_LOCAL,_Inert_LEXICAL_PARAM}) then return(t[x]); elif op(0,x) = _Inert_PROC then |