.
This commit is contained in:
+1
-1
@@ -77,7 +77,7 @@ urlpatterns = [
|
||||
path("accounts/profile/<str:slug>/", views.account_profile, name="account_profile"),
|
||||
path("", TemplateView.as_view(template_name="index.html"), name="home"),
|
||||
path("cid/results/<int:cid>/", views.cid_results, name="cid_results"),
|
||||
path("cid/<int:pk>/<str:passcode>", views.cid_scores, name="cid_scores"),
|
||||
path("cid/<int:cid>/<str:passcode>", views.cid_scores, name="cid_scores"),
|
||||
path("cid/<int:cid>/", views.cid_scores_admin, name="cid_scores_admin"),
|
||||
path("user/scores", views.user_scores, name="user_scores"),
|
||||
path("cid/", views.cid_selector, name="cid_selector"),
|
||||
|
||||
+5
-6
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user