You could consider using MATLAB code to develop a custom Test. The assessment code can create new variables that you could test with conditional statements. For example:
How to assess solutions with multiple correct answers in MATLAB Grader?
10 views (last 30 days)
Show older comments
Francesco Ciriello
on 13 Aug 2020
Commented: Cris LaPierre
on 13 Aug 2020
I recently received the following question about Grader assessments:
"I wasn't able to test a variable when there are two possible answers. So we have situations where depending on what assumptions the student makes they can have two possible correct answers for a variable. Both are correct as you can assume either way but matlab grader would only let me have one variable as correct."
0 Comments
Accepted Answer
Francesco Ciriello
on 13 Aug 2020
1 Comment
Cris LaPierre
on 13 Aug 2020
One caution - this approach does not incorporate any tolerance, though it could be modified so it does.
solutionChecker = abs(abs(x)-2) < 0.0001;
Still, if the student does get this problem wrong, they will get a default error message that variable solutionChecker has an incorrect value. This may cause some alarm on their part since their solution does not contain that variable.
To avoid having to worry about these issues, I would probably recommend using a try-catch. A couple examples can be seen here (checking 2 common values of an intermediate variable) and here (using for or while loop in solution, but not both). For this example it could be
try
assessVariableEqual('x', 2);
catch
assessVariableEqual('x', -2);
end
Now default tolerances are incorporated, and the student variable name is used in the default error message.
Acknowledging that this is just an example, I have one final observation. The test description (Is x == +/-2?) is giving away the answer to students. Better would be a description like "Is x correct?".
More Answers (0)
Communities
More Answers in the Distance Learning Community
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!