-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request, show green checkmarks in feedback when partial feedback is hidden but answers are all correct. #1096
Comments
Here is what I came up with to show all green checkmarks when all parts are correct, but to keep the feedback hidden when diff --git a/macros/PG.pl b/macros/PG.pl
index e3f4a802..dfef13e4 100644
--- a/macros/PG.pl
+++ b/macros/PG.pl
@@ -1035,6 +1035,13 @@ sub ENDDOCUMENT {
&& !$rh_envir->{showAttemptPreviews}
&& !$rh_envir->{showMessages};
+ # Compute $numCorrect here, since we need to know if everything is correct when deciding
+ # to display correct feedback when $showPartialCorrectAnswers is false.
+ for my $answerLabel (@answerNames) {
+ my $answerScore = $PG->{PG_ANSWERS_HASH}{$answerLabel}{ans_eval}{rh_ans}{score} // 0;
+ ++$numCorrect if $answerScore >= 1;
+ }
+
for my $answerLabel (@answerNames) {
my $response_obj = $PG->{PG_ANSWERS_HASH}{$answerLabel}->response_obj;
my $ansHash = $PG->{PG_ANSWERS_HASH}{$answerLabel}{ans_eval}{rh_ans};
@@ -1080,8 +1087,13 @@ sub ENDDOCUMENT {
push(@{ $options{feedbackElements} }, @$elements);
}
- if (($rh_envir->{showAttemptResults} && $PG->{flags}{showPartialCorrectAnswers})
- || $rh_envir->{forceShowAttemptResults})
+ if (
+ (
+ $rh_envir->{showAttemptResults}
+ && ($PG->{flags}{showPartialCorrectAnswers} || $numCorrect == @answerNames)
+ )
+ || $rh_envir->{forceShowAttemptResults}
+ )
{
if ($showCorrectOnly) {
$options{resultClass} = 'correct-only';
@@ -1107,7 +1119,6 @@ sub ENDDOCUMENT {
# Update the counts. This should be after the custom feedback_options call as that method can change
# some of the options. (The draggableProof.pl macro changes the answerGiven option, and the
# PGessaymacros.pl macro changes the manuallyGraded and needsGrading options.)
- ++$numCorrect if $answerScore >= 1;
++$numManuallyGraded if $options{manuallyGraded};
$needsGrading = 1 if $options{needsGrading};
++$numBlank unless $options{manuallyGraded} || $options{answerGiven} || $answerScore >= 1; |
Note that how you are describing what happens is actually how it was designed to work. With the previous attempts table that is how it worked, and I didn't change the behavior with the new feedback. No per problem feedback is ever given when you set |
@drgrice1 I thought the older feedback table would show green in all the rows when they were all correct, and the feedback was only hidden when the status for the full problem was less than 1. I don't have a 2.18 server I can quickly test for this though. |
I got a 2.18 server up just to remind myself how it worked. I see, it would only show a green message that everything was correct below the table, but still no feedback in the table. I was just use to seeing this more from an instructor side, and confused myself that everything being correct was part of the table. I do notice that the correct message is a bit brighter in 2.18 with the old feedback table than the success message is now. Not an issue, just didn't stand out as much. The reason it is orange is due to my BSU theme using orange for secondary buttons in other places. I'll go look into that, thanks. The orange color is probably what threw me off. |
Anyways, I'll close this unless others think this could be a feature request. |
I have a problem with
$showPartialCorrectAnswers=0
which contains four drop down menus. I expected to see green checkmarks if everything was correct, but instead these were also hidden. Here is the result, with the submit earning 100%.The text was updated successfully, but these errors were encountered: