quiz/views.py
changeset 39 0fa055b8ea98
parent 33 d28d0957a5ab
equal deleted inserted replaced
38:307c6887cc67 39:0fa055b8ea98
   159         try:
   159         try:
   160             answer = request.POST['answer']
   160             answer = request.POST['answer']
   161         except MultiValueDictKeyError:
   161         except MultiValueDictKeyError:
   162             answer = ""
   162             answer = ""
   163         new_answer = Answer(question=question)
   163         new_answer = Answer(question=question)
   164         new_answer.submitted_ans = answer
   164         new_answer.submitted_ans = answer.strip()
   165         new_answer.save()
   165         new_answer.save()
   166 
   166 
   167         quiz.que_answered.add(new_answer)
   167         quiz.que_answered.add(new_answer)
   168         remaining_que.remove(que_id)
   168         remaining_que.remove(que_id)
   169         quiz.que_remaining = "|".join(remaining_que)
   169         quiz.que_remaining = "|".join(remaining_que)