Calculation of mark for formulas question with mutiple answer box

Calculation of mark for formulas question with mutiple answer box

by ali rosta -
Number of replies: 4

I have a formulas question which a part has several answer boxes. To calculate the mark I use the following code in "Grading variables" section:

dabs = map("abs",_d);
rawmark = map("<",dabs,.01);
mark = sum(rawmark)/len(rawmark);

This is fine as long as student enters a number in all boxes. Let's say I have three boxes and a   student answers two of them correctly, but leaves one box empty (or enters something other than a valid input e.g. a letter or uses / for decimal instead of .). Then the above code fails to account for the correct answers and gives zero mark.

Is there an easy way to fix this issue? thanks

Average of ratings: -
In reply to ali rosta

Re: Calculation of mark for formulas question with mutiple answer box

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Ali,

The easiest way is to set "How question behave" to "Interactive with multiple tries" in the quiz settings. In this way, students are reminded to fill in all the answers.
Average of ratings: Useful (2)
In reply to Dominique Bauer

Re: Calculation of mark for formulas question with mutiple answer box

by ali rosta -
Thanks Dominique, yes it seem a good solution. But will it catch errors e.g. if student uses / instead of . (or enters letters) and make the student to fix this?
In reply to ali rosta

Re: Calculation of mark for formulas question with mutiple answer box

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Ali,

There shouldn't be a difference. You should still make sure of this by previewing the quiz or better yet by taking the quiz with a test student account.
In reply to Dominique Bauer

Re: Calculation of mark for formulas question with mutiple answer box

by ali rosta -
Thanks Dominique, I'll try and let you know.