This commit is contained in:
Ross
2021-02-17 14:33:22 +00:00
parent 67ad358f2b
commit 7e3c9bf933
2 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -807,7 +807,7 @@ def exam_scores_cid(request, pk):
user_scores = {}
for user in user_answers_marks:
user_scores[user] = sum(
[float(i) for i in user_answers_marks[user] if i != ""]
[i for i in user_answers_marks[user] if i != ""]
)
user_scores_list = list(user_scores.values())
@@ -894,13 +894,13 @@ def exam_scores_cid_user(request, pk, sk):
answers_marks.append(answer_score)
#answers_and_marks.append((ans, answer_score, correct_answer))
answered = [i for i in answers_marks if i != ""]
if "" in answers_marks:
answered = [int(i) for i in answers_marks if i != ""]
total_score = sum(answered)
unmarked_number = len(answers_marks) - len(answered)
total_score = "{} ({} unmarked)".format(total_score, unmarked_number)
else:
total_score = sum(answers_marks)
total_score = sum(answered)
max_score = len(questions) * 2