Skip to content

Commit

Permalink
Prevent scaffolds from revealing correct answers when feedback is not…
Browse files Browse the repository at this point in the history
… permitted (really)

In openwebwork#986 I believed that this was set.  But either something has changed
since then, or I didn't have it right at that point.

In that pull request I claimed that when an answer preview occurs,
scaffolds will open but not receive the green color if all answers
within are correct.  In particular, if a preview occurs it should not
reveal that answers are correct.  Unfortunately, it still is.

This fixes that by only giving the correct colors when attempt results
are allowed.
  • Loading branch information
drgrice1 committed Dec 14, 2024
1 parent f6812e5 commit eeda98b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion macros/core/scaffold.pl
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,8 @@ sub add_container {
'div',
class => 'accordion-header'
. (
$iscorrect && ($main::envir{showFeedback} || $main::envir{forceShowAttemptResults})
$iscorrect && ($main::envir{showFeedback}
&& ($main::envir{showAttemptResults} || $main::envir{forceShowAttemptResults}))
? ' iscorrect'
: ' iswrong'
)
Expand Down

0 comments on commit eeda98b

Please # to comment.