cppquiz icon indicating copy to clipboard operation
cppquiz copied to clipboard

Check correctly_answered questions for retracted questions

Open vsklamm opened this issue 7 years ago • 1 comments

Do you check correctly_answered questions for retracted questions? (training mode) Will this scenario work correctly?

  1. User correctly answered the question #X. His score is n+1/all now
  2. Question #X was retracted
  3. His score is should be n/all-1 (I think)

UPD: I check this on question №176, and:

vsklamm avatar Sep 06 '18 23:09 vsklamm

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.

knatten avatar Oct 14 '19 12:10 knatten