How to assess solutions with multiple correct answers in MATLAB Grader?

10 次查看(过去 30 天)
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."

采纳的回答

Francesco Ciriello
Francesco Ciriello 2020-8-13
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:
  1 个评论
Cris LaPierre
Cris LaPierre 2020-8-13
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?".

请先登录,再进行评论。

更多回答(0 个)

社区

类别

Help CenterFile Exchange 中查找有关 Create or Copy Coding Problems 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by