.
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user