Skip to content

Commit 5db706c

Browse files
committed
save questions as we go for audit page
1 parent 28e78ab commit 5db706c

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

ceuk-marking/urls.py

+5
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@
232232
audit.AuthorityAuditSectionQuestions.as_view(),
233233
name="authority_audit",
234234
),
235+
path(
236+
"authorities/<name>/audit/section/<section_title>/questions/<question>/",
237+
audit.AuthorityAuditSectionJSONQuestion.as_view(),
238+
name="authority_audit_json_question_edit",
239+
),
235240
# audit progress
236241
path(
237242
"audit_authority_assignments/",

crowdsourcer/templates/crowdsourcer/authority_audit_questions.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
{% load django_bootstrap5 %}
44
{% load neighbourhood_filters %}
5+
{% load static %}
56

67
{% block content %}
78
<h1 class="mb-3 mb-md-4">
@@ -205,7 +206,7 @@ <h3 class="h5 text-muted mb-3 mb-lg-4">Audited response</h3>
205206
{% endfor %}
206207

207208
<div class="sticky-bottom py-3 bg-white border-top" style="margin-top: -1px;">
208-
<input type="submit" class="btn btn-primary" value="Save answers">
209+
<input id="save_all_answers" type="submit" class="btn btn-primary" value="Save answers">
209210
</div>
210211
</form>
211212

@@ -232,3 +233,7 @@ <h3 class="h5 text-muted mb-3 mb-lg-4">Audited response</h3>
232233
</script>
233234

234235
{% endblock %}
236+
237+
{% block script %}
238+
<script src="{% static 'js/questions.esm.js' %}"></script>
239+
{% endblock %}

crowdsourcer/views/audit.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
from crowdsourcer.forms import AuditResponseFormset
44
from crowdsourcer.models import Response, ResponseType
5-
from crowdsourcer.views.base import BaseQuestionView, BaseSectionAuthorityList
5+
from crowdsourcer.views.base import (
6+
BaseQuestionView,
7+
BaseResponseJSONView,
8+
BaseSectionAuthorityList,
9+
)
610

711
logger = logging.getLogger(__name__)
812

@@ -87,3 +91,7 @@ def get_context_data(self, **kwargs):
8791
context = super().get_context_data(**kwargs)
8892
context["audit_user"] = True
8993
return context
94+
95+
96+
class AuthorityAuditSectionJSONQuestion(BaseResponseJSONView):
97+
response_type = "Audit"

0 commit comments

Comments
 (0)