inequality problem with MapleTA

In the following qu file for a MapleTA question, if the RESPONSE is

{a<x and x<b} then after the question gets graded as correct, "Your Answer" appears incorrectly as {a<b}.
But if the RESPONSE is

{a< x and x<b} (note there is a blank space after the first inequality sign!) then "Your Answer" appears correctly as RESPONSE.

One could ask students to put the blank space in, but this should not be necessary. Any ideas?

.......

question=Enter this and see what happens.
<p>

$qml@
maple=evalb(($ANSWER)=($RESPONSE));@
maple_answer=$ans;@
type=maple@
mode=Maple@
name=a&lt; x&lt; b@
editing=useHTML@
algorithm=$a=range(-5,5);
$b=range(-4,5);
condition:lt($a,$b);
$ans=maple("{($a)<x and x<($b)}");
$qml=maple("printf(MathML:-ExportPresentation($ans))");@

Can you write the condition

Can you write the condition that you use to evaluate the correct answer?

inequality in MapleTA

I think the answer to your question is explained by the following two or three lines.

$ans=maple("{($a)<x and x<($b)}");

maple_answer=$ans;

evalb(($ANSWER)=($RESPONSE));

The problem is not with the grading. This is done correctly. The problem is with the feedback returned after the problem is graded. Without the blank space before the inequality, "Your Answer" becomes {($a)<($b)} instead of {($a)<x and x<($b)}.

My guess is that MapleTA is getting confused by html delimiters <something>...</something> and inequality signs.

Your guess is pretty

Your guess is pretty close!

The thing to note is that Maple TA just prints out exactly what was typed in the "Your Answer" area. For instance, if you enter the HTML <b>Hi</b> as your answer, then "Your Answer" shows up as Hi

So, when you enter {-5<x and x<2} for instance, this is printed out into the "Your Answer" area and your browser sees "<x" and thinks it's the start of an HTML tag. The reason it stops displaying there is that the "tag" is never closed, so it's broken HTML and the browser can't cope. If you actually view the source of the grading page, you'll see that the complete answer is there.

This is very bad on the part of Maple TA, since this would allow a malicious student to enter an answer like <iframe src="http://bbc.co.uk"></iframe> which would insert a frame in the page containing another website. This will also appear in the gradebook when you look at the student's responses. Imagine if the student didn't use bbc.co.uk, but some malicious website!

Edit: Amusingly, even this forum had some difficulty with me typing > and < - the answer is to use & then gt or lt, followed by a semicolon.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}