Xiong,
Thanks for a very clear bug report -- it is indeed a bug. The chief culprit is an off-by-one error between the $numOfAttempts internal to the problem which controls when the hint appears and the $numOfAttempts variable external to the problem which determines when the checkbox appears. The expected behavior is that the hint will appear one submit after the showHint checkbox appears. A better behavior would be that pressing the preview button would show the hint if the checkbox is checked.
A robust fix will require reworking more than just a few lines of code so it will
not appear in the forthcoming release 2.4.7 which should be out in a few days.
It should be fixed in the next flurry of bug fixes posted to the rel-2-4-patches branch later this summer.
--Mike
WeBWorK Problems
hints show, but not after the specified number of times
This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 10 posting(s) in 1 day