feat: add exam mode URL handling and update user scores template
This commit is contained in:
@@ -1149,6 +1149,9 @@ class ExamBase(ExamOrCollectionGenericBase):
|
||||
def get_take_url(self):
|
||||
return f"{settings.REMOTE_URL}/rts"
|
||||
|
||||
def get_take_url_exam_mode(self):
|
||||
return f"{settings.REMOTE_URL}/rts?exam_mode=true"
|
||||
|
||||
def get_exam_name(self):
|
||||
return str(self)
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ class UserSearchSelectMultipleWidget:
|
||||
f'<span>{u.get_full_name() or u.username} <small class="text-muted">{u.email}</small>'
|
||||
)
|
||||
if grade_text:
|
||||
selected_html += f' <span class="badge bg-light text-muted ms-2 small border">{grade_text}</span>'
|
||||
selected_html += f' <span class="badge bg-light text-dark text-muted ms-2 small border">{grade_text}</span>'
|
||||
selected_html += (
|
||||
'</span>'
|
||||
f'<button type="button" class="btn btn-sm btn-outline-danger ms-2" onclick="removeUserFromField(\'{self.name}\', {u.pk})">Remove</button>'
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<div class="btn-group btn-group-sm" role="group">
|
||||
{% if exam.active %}
|
||||
<a href="{{ exam.get_take_url }}" target="_blank" title="Click to take exam">
|
||||
<a href="{{ exam.get_take_url_exam_mode }}" target="_blank" title="Click to take exam">
|
||||
<button class="btn btn-primary start-button">Start</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
User answer compaction should only be available to admin users and on an exam wide basis.
|
||||
User answer compaction should only be available to admin users and on an exam wide basis.
|
||||
|
||||
We need to update tests so that they can handle the new format of answer submission from rts: res = client.post(reverse("global_exam_answers_submit"), data=post_json)
|
||||
json_res = json.loads(res.content)
|
||||
assert json_res["success"] == False
|
||||
> assert json_res["error"] == "Invalid data"
|
||||
E AssertionError: assert 'user / cid mismatch' == 'Invalid data'
|
||||
E
|
||||
E - Invalid data
|
||||
E + user / cid mismatch
|
||||
|
||||
Reference in New Issue
Block a user