cppquiz
cppquiz copied to clipboard
Check correctly_answered questions for retracted questions
Do you check correctly_answered questions for retracted questions? (training mode)
Will this scenario work correctly?
- User correctly answered the question #X. His score is
n+1/allnow - Question #X was retracted
- His score is should be
n/all-1(I think)
UPD: I check this on question №176, and:
I'm sorry I missed this one, this is indeed a bug. UserData::get_correctly_answered_questions() in game_data.py probably needs to consult models.Question.objects and filter out any questions which are not published. We should also add a test in session_test.py.
We do Question.objects.filter(state='PUB') quite a few places, so maybe we should extract a helper method published_questions() or something.