.
This commit is contained in:
@@ -28,11 +28,13 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Candidate ID</th>
|
<th>Candidate ID</th>
|
||||||
<th>Score</th>
|
<th>Score</th>
|
||||||
|
<th>Normalised score</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for user, value in user_answers_marks.items %}
|
{% for user, value in user_answers_marks.items %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'cid_scores' user %}">{{user}}</a></td>
|
<td><a href="{% url 'cid_scores' user %}">{{user}}</a></td>
|
||||||
<td>{{user_scores|get_item:user}}</td>
|
<td>{{user_scores|get_item:user}}</td>
|
||||||
|
<td>{{user_scores_normalised|get_item:user}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
<br /> Total mark: {{ total_score }} / {{max_score}}
|
<br /> Total mark: {{ total_score }} / {{max_score}}
|
||||||
|
<br /> Normalised score: {{normalised_score}}
|
||||||
<div>
|
<div>
|
||||||
<h4>Answers</h4>
|
<h4>Answers</h4>
|
||||||
<ul class="long-answer">{% for a,b,c,d,e in answer_text %}
|
<ul class="long-answer">{% for a,b,c,d,e in answer_text %}
|
||||||
|
|||||||
@@ -75,6 +75,26 @@ import os
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
def normaliseScore(score):
|
||||||
|
if score >= 25.5 and score <= 28:
|
||||||
|
return 4.5
|
||||||
|
elif score >= 28.5 and score <= 31:
|
||||||
|
return 5
|
||||||
|
elif score >= 31.5 and score <= 34:
|
||||||
|
return 5.5
|
||||||
|
elif score >= 34.5 and score <= 37:
|
||||||
|
return 6
|
||||||
|
elif score >= 37.5 and score <= 40:
|
||||||
|
return 6.5
|
||||||
|
elif score >= 40.5 and score <= 43:
|
||||||
|
return 7
|
||||||
|
elif score >= 43.5 and score <= 46:
|
||||||
|
return 7.5
|
||||||
|
elif score >= 46.5 and score <= 48:
|
||||||
|
return 7.5
|
||||||
|
|
||||||
|
return 4
|
||||||
|
|
||||||
|
|
||||||
class AuthorOrCheckerRequiredMixin(object):
|
class AuthorOrCheckerRequiredMixin(object):
|
||||||
def get_object(self, *args, **kwargs):
|
def get_object(self, *args, **kwargs):
|
||||||
@@ -822,10 +842,13 @@ def exam_scores_cid(request, pk):
|
|||||||
by_question[q].append((ans, answer_score))
|
by_question[q].append((ans, answer_score))
|
||||||
|
|
||||||
user_scores = {}
|
user_scores = {}
|
||||||
|
user_scores_normalised = {}
|
||||||
for user in user_answers_marks:
|
for user in user_answers_marks:
|
||||||
user_scores[user] = sum(
|
user_scores[user] = sum(
|
||||||
[i for i in user_answers_marks[user] if i != ""]
|
[i for i in user_answers_marks[user] if i != ""]
|
||||||
)
|
)
|
||||||
|
user_scores_normalised = normaliseScore(user_scores[user])
|
||||||
|
|
||||||
|
|
||||||
user_scores_list = list(user_scores.values())
|
user_scores_list = list(user_scores.values())
|
||||||
|
|
||||||
@@ -867,6 +890,7 @@ def exam_scores_cid(request, pk):
|
|||||||
#"user_answers": dict(user_answers),
|
#"user_answers": dict(user_answers),
|
||||||
"user_answers_marks": dict(user_answers_marks),
|
"user_answers_marks": dict(user_answers_marks),
|
||||||
"user_scores": user_scores,
|
"user_scores": user_scores,
|
||||||
|
"user_scores_normalised": user_scores_normalised,
|
||||||
"user_scores_list": user_scores_list,
|
"user_scores_list": user_scores_list,
|
||||||
"user_names": user_names,
|
"user_names": user_names,
|
||||||
#"user_answers_and_marks": user_answers_and_marks,
|
#"user_answers_and_marks": user_answers_and_marks,
|
||||||
@@ -924,6 +948,7 @@ def exam_scores_cid_user(request, pk, sk):
|
|||||||
total_score = "{} ({} unmarked)".format(total_score, unmarked_number)
|
total_score = "{} ({} unmarked)".format(total_score, unmarked_number)
|
||||||
else:
|
else:
|
||||||
total_score = sum(answered)
|
total_score = sum(answered)
|
||||||
|
normalised_score = normaliseScore(total_score)
|
||||||
|
|
||||||
max_score = len(questions) * 2
|
max_score = len(questions) * 2
|
||||||
|
|
||||||
@@ -937,6 +962,7 @@ def exam_scores_cid_user(request, pk, sk):
|
|||||||
#"answers": answers,
|
#"answers": answers,
|
||||||
"answers_marks": answers_marks,
|
"answers_marks": answers_marks,
|
||||||
"total_score": total_score,
|
"total_score": total_score,
|
||||||
|
"normalised_score": normalised_score,
|
||||||
"max_score": max_score,
|
"max_score": max_score,
|
||||||
"answer_text": answer_text
|
"answer_text": answer_text
|
||||||
#"answers_and_marks": answers_and_marks,
|
#"answers_and_marks": answers_and_marks,
|
||||||
|
|||||||
+1
-1
@@ -102,7 +102,7 @@ def normaliseScore(score):
|
|||||||
elif score in [59]:
|
elif score in [59]:
|
||||||
return 7.5
|
return 7.5
|
||||||
elif score in [60]:
|
elif score in [60]:
|
||||||
return 7.5
|
return 8
|
||||||
|
|
||||||
return 4
|
return 4
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user