numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
197 stars 118 forks source link

No "You did not enter a valid expression" when using adaptive marking #1068

Closed Spruce8913 closed 6 months ago

Spruce8913 commented 6 months ago

Typically when one tries to submit an empty answer, there's a brown popup with a reminder that "You did not enter a valid number/expression/...". In this example question, with two parts, each with a gapfill with a single gap, no popup is shown. image The first gap asks for a number, second gap asks for mathematical expression with adaptive marking using the first gap. For the adaptive marking, "always replace variables" and "must be answered" for the previous part is ticked on.

After some experimenting, I found the warning is included on the bottom right: image And also if "must be answered" is not ticked on, the warning is included in the same way: image

Would it be possible to give these warning messages the same layout as the others? This way students ask for help during the exam, rather than afterwards being unhappy about their grade.

christianp commented 6 months ago

Can you give me a link to this question in the editor, please?

Spruce8913 commented 6 months ago

https://numbas.mathcentre.ac.uk/question/share/edit/9ddb7c27-e936-464f-8e9f-c483275e52cf is the dummy question I made

The original question I cannot share as it's part of an exam in use.

christianp commented 6 months ago

There is indeed an error here, and Numbas is doing the right thing to show it. In the gap-fill part b, you have adaptive marking set to replace the value of x0 with the answer to part a. Part a is a gap-fill, so its answer value will be a list. x0 is used in the definition of y0, so the error first occurs when trying to multiply x0 by a number.

There's also a warning in the editor that since you've replaced x0, y0 will be re-evaluated, and since its definition includes some randomisation you'll end up with inconsistent values.

Since part a is being used to replace both x0 in the gap-fill, and slope in the mathematical expression gap, there's definitely an authoring error in your example.

After fixing that, I see your point about the warning box when "must be answered?" is ticked. I'll make it also show the warning next to the input box.