This commit is contained in:
Ross
2022-08-10 22:30:06 +01:00
parent 7032f890f9
commit 4c3b7d2e12
13 changed files with 534 additions and 45 deletions
+5 -6
View File
@@ -186,11 +186,9 @@ def user_scores(request):
},
)
def cid_scores(request, pk, passcode):
def cid_scores(request, cid, passcode):
# exam = get_object_or_404(Exam, pk=pk)
cid = pk
cid_user = CidUser.objects.filter(cid=cid).first()
print(cid_user)
if not cid_user or cid_user.passcode != passcode:
@@ -278,6 +276,7 @@ def active_exams_unbased(request, cid=None, passcode=None):
@csrf_exempt
def exam_submit(request):
print(request)
if request.is_ajax and request.method == "POST":
print(request.POST)
exam_type, exam_id = request.POST.get("eid").split("/")
@@ -478,7 +477,7 @@ def view_feedback(request):
# HTTP Error 400
def page_not_found(request, exception):
response = render(request, "404.html", {})
response = render(request, "404.html")
response.status_code = 404
@@ -486,7 +485,7 @@ def page_not_found(request, exception):
def page_forbidden(request, exception):
response = render(request, "403.html", {})
response = render(request, "403.html")
response.status_code = 403
@@ -494,7 +493,7 @@ def page_forbidden(request, exception):
def server_error(request):
response = render(request, "500.html", {})
response = render(request, "500.html")
response.status_code = 500