Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.

Commit e0db35b

Browse files
committed
remove the hinte_exercise recoded from the databse when student submit a correct answer (whether he will get credit for it or not)
1 parent a3a5042 commit e0db35b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

ODSA-django/opendsa/exercises.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,12 @@ def attempt_problem(user_data, user_exercise, attempt_number,completed, count_hi
287287
else:
288288
user_exercise.correct_exercises += ',%s' % ex_question
289289

290-
# when student answer an exercise correctly from first time then clear the hint
291-
if request_type == 'hint':
292-
user_exercise.hinted_exercise = ''
293290
else:
294291
user_exercise.progress = Decimal(user_exercise.streak) / Decimal(user_exercise.exercise.streak)
292+
293+
# when student answer an exercise correctly from first time then clear the hint
294+
if request_type != 'hint':
295+
user_exercise.hinted_exercise = ''
295296
else:
296297
if (int(count_hints) == 0) and (attempt_content!='hint') \
297298
and (int(attempt_number) == 1):

0 commit comments

Comments
 (0)