But when you do this, that means once you have submitted answers, they will stay recorded, so you can't go back to earlier hints, even if you have changed the problem file. In order to overcome that (for testing purposes) you can add a test for a special "reset" answer in the grader so that you can reset the problem back to its initial values.
For example:
install_problem_grader(sub { my ($result,$state) = avg_problem_grader(@_); if ($inputs_ref->{AnSwEr1} eq 'reset') { $state->{num_of_correct_ans} = 0; $state->{num_of_incorrect_ans} = 0; $state->{recorded_score} = 0; $result->{score} = 0; } elsif ($state->{num_of_correct_ans} == 0) { my $n = $state->{num_of_incorrect_ans} - 1; $n = $#hints if $n > $#hints; if ($n >= 0) { $result->{msg} .= '</i><p><b>Note:</b> <i>' if $result->{msg}; $result->{msg} .= $hints[$n]; } } ($result,$state); });Here, the first answer blank is checked to see if you have entered the word "reset", and if so, the problem is reset so that is appears like you are trying it for the first time.
See if that resolves your issue. (You will, of course, want to remove the reset code when you are done editing the problem.)
Davide