Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save questions as we go for audit page #214

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ceuk-marking/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@
audit.AuthorityAuditSectionQuestions.as_view(),
name="authority_audit",
),
path(
"authorities/<name>/audit/section/<section_title>/questions/<question>/",
audit.AuthorityAuditSectionJSONQuestion.as_view(),
name="authority_audit_json_question_edit",
),
# audit progress
path(
"audit_authority_assignments/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

{% load django_bootstrap5 %}
{% load neighbourhood_filters %}
{% load static %}

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

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

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

{% endblock %}

{% block script %}
<script src="{% static 'js/questions.esm.js' %}"></script>
{% endblock %}
10 changes: 9 additions & 1 deletion crowdsourcer/views/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

from crowdsourcer.forms import AuditResponseFormset
from crowdsourcer.models import Response, ResponseType
from crowdsourcer.views.base import BaseQuestionView, BaseSectionAuthorityList
from crowdsourcer.views.base import (
BaseQuestionView,
BaseResponseJSONView,
BaseSectionAuthorityList,
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -87,3 +91,7 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["audit_user"] = True
return context


class AuthorityAuditSectionJSONQuestion(BaseResponseJSONView):
response_type = "Audit"
Loading