Skip to content
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

Open
somiaj opened this issue Aug 16, 2024 · 7 comments

Comments

@somiaj
Copy link
Contributor

somiaj commented Aug 16, 2024

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%.

image

@somiaj
Copy link
Contributor Author

somiaj commented Aug 16, 2024

Here is what I came up with to show all green checkmarks when all parts are correct, but to keep the feedback hidden when $showPartialCorrectAnswers is false.

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;

@drgrice1
Copy link
Member

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 $showPartialCorrectAnswers = 0. Only the message at the top of the problem gives more information telling you how many (in this case all) are correct.

@somiaj
Copy link
Contributor Author

somiaj commented Aug 16, 2024

@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.

@drgrice1
Copy link
Member

No it didn't. It wouldn't say correct or incorrect.

Now that I look at your screenshot closer I see that something is incorrect with your claim. If you submitted the answer it should not show the red incorrect or green correct buttons. It should show the black info buttons as in the following screenshot:
show-partial-correct
That is what a student working the problem will also see.

Also, if you click "Check Answers" as an instructor (when working the problem in a set or in the problem editor) it will show the red incorrect and green correct feedback buttons.

@somiaj
Copy link
Contributor Author

somiaj commented Aug 16, 2024

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.

@somiaj
Copy link
Contributor Author

somiaj commented Aug 16, 2024

Anyways, I'll close this unless others think this could be a feature request.

@somiaj somiaj changed the title Inproblem feedback doesn't show green checkmarks when partial feedback is hidden but answers are all correct. Feature request, show green checkmarks in feedback when partial feedback is hidden but answers are all correct. Aug 16, 2024
@drgrice1
Copy link
Member

By the way, here is a screen shot of the attempts table and what it did here from 2.17.
show-partial-correct-attempts-table

I think that you should leave this issue open. I wasn't saying that I liked the old behavior. I am just saying that is the way it worked, and was designed to work. We should discuss this, because I think there are other issues with the $showPartialCorrectAnswers = 0 behavior as well as this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants