Handling input errors via startup codes



  • Hi, Math app questions facilitate a nice automatic 'communication' with the student via MapleTA, concerning e.g. the syntactical correctness of the student's input before evaluation and grading. I have managed to use the try-catch statement on parsed string versions of the students input in startup codes for this purpose, but in simple cases only. The procedure will disclose simple syntax errors (wrong number of parentheses etc.) without creating halting error messages at the student's front end and at the same time allowing the student to reset and correct his/her input. My question is this: Is there a general way to set up a Maple procedure in the startup code which in the same way will take in an expression (including errors) from the student and return - not the error statement, but a last exception type statement, that can then be communicated from the math app startup code in a controlled way  to the student to be used effectively for resetting and correcting his/her input? I hope it makes sense? Thank you in advance for any suggestions in this direction! Best, Steen


  • administrators

    Hi @steen. Do you have a minimal example of a math app that you want this for. I think this is possible if you deal with everything as strings and use try/catch. We had some luck parsing maple errors a few weeks ago so that might be useful to you, but I need to understand the exact use case a little more.



  • Hi @jmtrik, Thank you for your interest in this question! I know that you have been working on this for the other types of MapleTA questions. In MathApp questions we seem to have a good opportunity to sort of 'communicate' via the startup code with the student and have his/her input automatically guided in the direction of the correct solution. The correction of syntax of an answer given into e.g. a TextArea box  is one first important issue. Another is the use of 'forbidden' operators in the answer box, i.e. like int(x^3, x)  when asked to hand in the value of the integral etc. A third issue is the possibility of communicating adaptive guidance towards the correct answer. All within the same single (possibly even randomized) question. I have uploaded two MathApps to the Maple Cloud as illustrations. You will see from the startup codes, that the syntax check there (by try/catch) is still somewhat ad hoc, and that in fact this particular check cannot catch the error stemming from the missing comma in e.g. [[8,9] [4,5]]. Moreover, some error messages are not particularly informative to the student. An example is obtained when you miss a parenthesis in e.g. [[8, 9], [4,5] .Other error messages are quite informative, for example the one you get when you write int(x, x = ...). I know that you can, of course, just count the parentheses etc. and communicate errors of such type easily to the student, but it would be very nice to have a general descriptive 'unfold' of all possible errors like for the int(x, x= ...). Do you know if such a list exists? And if it exists how can then the try/catch machine be used to show the 'unfolding' of a given error? I enclose here links to the two mentioned examples in the Maple Cloud (direct uploads of *.mw to the present platform seems to be impossible from this end): Input_Check_01 and  Input_Check_02 , Best, Steen