Hello again!
I've coded up a version of the ChoiceResponse class that gives two different kinds of partial credit. I'm hoping to eventually get this into edX. I opened a Jira ticket for this (
https://openedx.atlassian.net/browse/CRI-17 ), but I figured I'd also post here to get commentary.
There are two kinds of grading implemented. One (EDC) gives you equal credit for each checkbox; the other (Halves) gives you 100% for a completely correct answer and takes half off for each error you make (with some adjustment for the number of choices in the problem). I may add more depending on feedback within HX. The standard type is still present unchanged. The type is chosen by adding partial-credit="whatever" as an attribute on the checkboxgroup tag.
Full code attached. It's just that class, drawn from responsetypes.py. Most of the changes have been in the get_score function, and there's one small addition in setup_response so that I can get a more complete list of what students did and didn't answer.
I'm especially looking for comments about:
- Optimization - am I doing anything unnecessarily slow here?
- Unexpected Consequences - is there somewhere else that may have trouble because of what I wrote here?
Also: the comments in the code seem to be wrong about some things. Should we take this opportunity to fix those up as well?