Group Abstract Group Abstract

Message Boards Message Boards

How to Use QuestionObject with AssessmentResultObject?

I asked this question on StackExchange, but got no useful replies.

The documentation is very unclear as to how QuestionObject should be combined with AssessmentResultObject to generate a result for further processing.

For example, we have (from the documentation):

QuestionObject["How many career home runs did Hank Aaron hit?", 
x = AssessmentFunction[{714 -> False, 755 -> True, 868 -> False}]]

which produces a nice graphic, but no output one can capture for further processing:

enter image description here

So how do we get the result (True or False in this case)?

x is the AssessmentFunction:

AssessmentFunction[{714 -> False, 755 -> True, 868 -> False}]

The documentation appears to imply that an AssessmentResultObject is automatically created and should be accessible using:

x["property"], where "property is, for instance, "AnswerCorrect".

But this doesn't work, nor do any of the other possibilities, giving an error:

AssessmentFunction::invans: The provided answer is not supported by the comparison method of the assessment function.

The documentation is very unclear as to how these should be combined to generate a result for further processing.

For example, we have:

QuestionObject["How many career home runs did Hank Aaron hit?", 
x = AssessmentFunction[{714 -> False, 755 -> True, 868 -> False}]]

which produces the following:

enter image description here

But how to get the result (True or False in this case)?

x is the AssessmentFunction:

AssessmentFunction[{714 -> False, 755 -> True, 868 -> False}]

The documentation appears to imply that an AssessmentResultObject is automatically created and should be accessible using:

x["property"], where "property is, for instance, "AnswerCorrect".

But this doesn't work, nor do any of the other possibilities, giving an error:

AssessmentFunction::invans: The provided answer is not supported by the comparison method of the assessment function.

So how should QuestionObject be used to generate a result for further processing?

POSTED BY: Jonathan Kinlay
4 Replies
POSTED BY: Bob Sandheinrich

Thanks Bob.

Two excellent solutions here.

Much appreciated.

POSTED BY: Jonathan Kinlay
Posted 4 years ago

It also sounds like you want to you QuestionObject and AssessmentFunction together, but get access to the result programmatically. The documentation examples of nesting QuestionObject["label", AssessmentFunction[...]] seem to be created a self-contained Q&A interface, where the student simply gets visual feedback (green checkmark or red x). I also don't know how to hook into this correctly for sure.

But I think if you use QuestionObject['label", f] and tell QuestionObject your input UI type, you might be able to write a function f that uses AssessmentFunction to do the job.

POSTED BY: Joel Klein
Posted 4 years ago

First problem, I think AssessmentFunction, x in your case, needs to be applied to the "student" input to get the AssessmentResultObject. Second problem, which becomes more obvious when you realize the first, is that x["property"] is supplying a string to an AssessmentFunction expecting a number.

I think what you want is this: (* student supplies answer: *) result = x[715] (* retrieve properties from AssessmentResultObject: *) {result["GivenAnswer"], result["AnswerCorrect"]}

POSTED BY: Joel Klein
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard