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

Changes to https://github.com/e-valuation/EvaP/pull/2040 No. 1 #1

Merged
merged 2 commits into from
Oct 23, 2023
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
6 changes: 3 additions & 3 deletions evap/grades/templates/grades_semester_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ <h3 class="col-8 mb-0">
{% include 'confirmation_modal.html' with modal_id='confirmNouploadModal' title=title question=question action_text=action_text btn_type='primary' %}
<script type="text/javascript">
function confirmNouploadModalAction(dataId) {
confirmUploadModalAction(dataId, true);
updateGradeStatusOfCourse(dataId, true);
}

function confirmUploadModalAction(dataId, status) {
function updateGradeStatusOfCourse(dataId, status) {
fetch("{% url 'grades:set_no_grades'%}", {
body: new URLSearchParams({course_id: dataId, status: `${Number(status)}` }),
headers: CSRF_HEADERS,
Expand All @@ -128,7 +128,7 @@ <h3 class="col-8 mb-0">
{% include 'confirmation_modal.html' with modal_id='confirmLateruploadModal' title=title question=question action_text=action_text btn_type='primary' %}
<script type="text/javascript">
function confirmLateruploadModalAction(dataId) {
confirmUploadModalAction(dataId, false);
updateGradeStatusOfCourse(dataId, false);
};
</script>
{% endblock %}
Expand Down
9 changes: 9 additions & 0 deletions evap/grades/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ def test_set_no_grades(self):
evaluation = Evaluation.objects.get(id=evaluation.id)
self.assertFalse(evaluation.course.gets_no_grade_documents)

self.app.post(
"/grades/set_no_grades",
params={"course_id": evaluation.course.id, "status": "0"},
user=self.grade_publisher,
status=200,
)
evaluation = Evaluation.objects.get(id=evaluation.id)
self.assertFalse(evaluation.course.gets_no_grade_documents)

def test_grade_document_download_after_archiving(self):
# upload grade document
self.helper_upload_grades(self.course, final_grades=False)
Expand Down