Make the avg_problem_grader
just be the weighted grader.
#1160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The weighted grader really is just a more advanced version of the average problem grader that allows weights and "credit". If weights are not assigned then a weight of 1 is assumed for each answer. So if no weights are assigned then the weighted grader returns exactly the same thing as the previous average problem grader.
The
weightedGrader.pl
macro should be considered deprecated. TheWEIGHTED_ANS
,NAMED_WEIGHTED_ANS
, andCREDIT_ANS
methods should no longer be used (although they will still work even with the new average problem grader). Instead of callingWEIGHTED_ANS
orNAMED_WEIGHTED_ANS
, passweight => n
to thecmp
method to assign a weight to an answer. Instead of callingCREDIT_ANS
passcredit => $answer1
orcredit => [ $answer1, $answer2, ... ]
to thecmp
method. That is effectively what those methods do anyway. Note that the other answers need to be assigned a name using theNEW_ANS_NAME
method.Note that if the
weightedGrader.pl
macro is loaded andinstall_weighted_grader
is not called, then using theWEIGHTED_ANS
,NAMED_WEIGHTED_ANS
, andCREDIT_ANS
methods will work with this since the implementation is completely compatible with theweighted_grader
defined in the macro. Also if the macro is loaded andinstall_weighted_grader
is called, then the macro will continue to work as before. The options can either be set using the macro method, or as described in the previous paragraph (except thecredit
option must be an array reference with the macro weighted grader).There is one essential difference in this implementation from the previous weighted grader when the
credit
option is used. The previous weighted grader would mark optional answers correct, but not change their scores. This results in the feedback for those answers showing them as incorrect and the message shown above the problem stating that not all answers are correct, even though the overall problem score for the attempt is reported as 100%. The documentation in theweightedGrader.pl
macro states that "When credit IS given, the blank answer is still marked as incorrect in the grey answer report at the top of the page, but the student gets awarded the points for that answer anyway (with no other indication). It is possible to cause the blank to be marked as correct, but this seemed confusing to the students." However, perhaps due to changes in feedback, it actually seemed much more confusing to me for the answers to be marked incorrect and have the red incorrect feedback and message above stating not all answers correct with the message way below that is often ignored by students stating that the score for the attempt is 100%. So this does what is suggested in the documentation and actually changes the scores for the optional answers. Furthermore, a message is added to those answers stating, "This answer was marked correct because the primary answer is correct." I am not sold on that wording, but this seems much clearer to me. Another option would be to not set the scores of the optional parts, but set the$problem_result{msg}
informing the user what is going on. That message is displayed immediately below the problem as "Note: $problem_result{msg}". Since that is closer to the problem and not way down below all of the submit buttons that might be enough?Both
avg_problem_grader
methodslib/WeBWorK/PG/Translator.pm
andmacros/core/PGanswermacros.pl
were updated. However, only the one inmacros/core/PGanswermacros.pl
is actually used.