More unit testing
This commit is contained in:
parent
5ab0b8c837
commit
ff050cc141
4 changed files with 36 additions and 9 deletions
|
|
@ -14,13 +14,7 @@ def check_answer(request, answerid, questionid):
|
|||
Check whether answerid is the correct answer for questionid.
|
||||
Returns a boolean in 'result'
|
||||
"""
|
||||
|
||||
question = Question.objects.get(id=int(questionid))
|
||||
|
||||
result = False
|
||||
for answer in question.correct_answers():
|
||||
print type(answer.id)
|
||||
if answer.id == int(answerid):
|
||||
result = True
|
||||
result = question.check_answer(answerid)
|
||||
|
||||
return simplejson.dumps({'result': result})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue