I have the following snippet of code in a problem, expecting that the hint will be shown after 2 attempts by the student
$showHint = 2; #webwork seems to add 1!
BEGIN_PGML
If you don't get this in [$showHint] tries, you can get a hint.
END_PGML
BEGIN_PGML_HINT
Do you need to produce one example or do you need to prove something for all possible values? Read the definitions carefully!
END_PGML_HINT
However, the result is
The hint is shown after 3 attempts, not 2. I found reference to this behaviour in https://webwork.maa.org/moodle/mod/forum/discuss.php?d=3983
I can `fix' this by doing the following, but that's not really dealing with the issue, and might cause problems later. Any tips appreciated!
$showHint = 1; #webwork seems to add 1!
BEGIN_PGML
If you don't get this in [$showHint +1] tries, you can get a hint.
END_PGML