more improvements
This commit is contained in:
+7
-8
@@ -350,13 +350,7 @@ def mark(request, pk, sk):
|
||||
# i.answer.lower() for i in question.incorrect_answers.all()
|
||||
#]
|
||||
|
||||
# It's probably better to do some processing/checking in the model
|
||||
unmarked_user_answers = (set([
|
||||
i.answer.lower()
|
||||
for i in question.cid_user_answers.all() if i.answer.strip() != ""
|
||||
]) - marked_answers_set) # .filter(user=User)
|
||||
|
||||
|
||||
unmarked_user_answers = question.GetUnmarkedAnswers()
|
||||
|
||||
if request.method == "POST":
|
||||
|
||||
@@ -686,7 +680,12 @@ def exam_scores_cid_user(request, pk, sk):
|
||||
answers_marks.append(answer_score)
|
||||
answers_and_marks.append((ans, answer_score, correct_answer))
|
||||
|
||||
total_score = sum(answers_marks)
|
||||
if "unmarked" in answers_marks:
|
||||
total_score = sum(i for i in answers_marks if type(i) == int)
|
||||
unmarked_number = len(answers_marks) - len(total_score)
|
||||
total_score = "{} ({} unmarked)".format(total_score, unmarked_number)
|
||||
else:
|
||||
total_score = sum(answers_marks)
|
||||
|
||||
max_score = len(questions) * 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user