Change threshold to raw points and add custom points per question
This commit is contained in:
+4
-4
@@ -142,11 +142,11 @@ def assignment_detail(request, pk):
|
||||
if q.correct_answer:
|
||||
correct = strip_tags(q.correct_answer).strip().lower()
|
||||
answer_obj.is_correct = (val.strip().lower() == correct)
|
||||
answer_obj.points = 1 if answer_obj.is_correct else 0
|
||||
answer_obj.points = q.points if answer_obj.is_correct else 0
|
||||
total_points += answer_obj.points
|
||||
else:
|
||||
all_auto = False
|
||||
max_points += 1
|
||||
max_points += q.points
|
||||
elif q.question_type == 'TABLE_AUTO':
|
||||
rows = getattr(q, 'table_rows', 2) or 2
|
||||
table_data = []
|
||||
@@ -171,11 +171,11 @@ def assignment_detail(request, pk):
|
||||
is_correct = False
|
||||
break
|
||||
answer_obj.is_correct = is_correct
|
||||
answer_obj.points = 1 if is_correct else 0
|
||||
answer_obj.points = q.points if is_correct else 0
|
||||
total_points += answer_obj.points
|
||||
else:
|
||||
all_auto = False
|
||||
max_points += 1
|
||||
max_points += q.points
|
||||
else:
|
||||
all_auto = False
|
||||
val = form.cleaned_data.get(f'file_{q.id}')
|
||||
|
||||
Reference in New Issue
Block a user