-
Notifications
You must be signed in to change notification settings - Fork 865
Multiple question with a single custom item without answer #161546
base: master
Are you sure you want to change the base?
Changes from all commits
1d464d2
bbed991
266870b
face5a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1216,6 +1216,7 @@ Khan.answerTypes = $.extend(Khan.answerTypes, { | |
// otherwise correct or not before forwarding on the | ||
// message. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment here should probably be changed to reflect the new semantics of what is going on. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems to be still valid (the unsimplified fraction is the only case that the branch is taken that I'm aware of). If a student enters "2/4" into a proper fraction field a "your answer is almost correct" message is normally displayed. (Under the default mode of simplification.) Such an answer does not fall under any of the three usual categories of "empty", "correct", or "incorrect", thus the framework uses a special score for it -- the score is marked as "empty", but carries the message. Now the multiple exercise has a surprising semantic: if any subscore is "empty", but not all are, then the combined score is incorrect (even if all nonempty parts are actually correct; this happens as empty scores have If we were to let multiple be empty whenever at least one of its parts is empty and all nonempty parts are correct, then this special case would be unnecessary -- a single unsimplified fraction would cause the combined score to be empty. And an empty score is treated as unanswered, displaying the message it carries. That's the content of wrwrwr@9a25e47 (not part of this PR). |
||
blockGradingMessage = pass.message; | ||
score.empty = false; | ||
} else { | ||
score.empty = score.empty && pass.empty; | ||
score.correct = score.correct && pass.correct; | ||
|
@@ -1232,7 +1233,6 @@ Khan.answerTypes = $.extend(Khan.answerTypes, { | |
guess: guess | ||
}; | ||
} else { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checking my understanding... Is this the big killer that was keeping everything from being marked empty? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was keeping some things from being empty / unanswered. First, at line 1196 there is the Second, if the multiple happens to have a rational-accepting subproblem (such as the default Third, there is the case of an empty score with an empty-string message, due to an unanswered custom subproblem (that is graded incorrect -- see below). |
||
score.empty = false; | ||
return score; | ||
} | ||
}; | ||
|
@@ -1877,7 +1877,7 @@ Khan.answerTypes = $.extend(Khan.answerTypes, { | |
return { | ||
empty: pass === "", | ||
correct: pass === true, | ||
message: typeof pass === "string" ? pass : null, | ||
message: typeof pass === "string" && pass !== "" ? pass : null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this wasn't here, would the "there are still more parts..." prompt not appear? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider the simplest case of a custom-in-multiple (there actually are a few exercises with just this structure): <div class="solution" data-type="multiple">
<div class="sol" data-type="custom">
<div class="instruction">Always unanswered</div>
<div class="guess">[2]</div>
<div class="validator-function">return '';</div>
</div>
</div> (here's a minimum working exercise: test-custom-in-multiple.html). As the validator function always returns an empty string the problem should be considered unanswered. The current custom exercise code first checks that the result is not an object and then returns a score that looks like this: Further, the score is processed in |
||
guess: guess | ||
}; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this have ever fired without that slice there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case the guess has 5 elements, so no. A simpler fix is to add
null
as the fifth element to the array, but this is still not how I'd see it.Logically, this exercise consists of two parts, a graph and a radio selection. It would be nice to reflect this in its structure. I imagine it could look something like this:
This is what drove the changes on the other branch (including making the problem unanswered when no part or just one part is answered). At least the two changes related to radio-in-multiple (the third commit) are needed to make it work.