fix: redirect after quiz submission

This commit is contained in:
Jannat Patel
2023-06-22 10:52:57 +05:30
parent 7d18e1d928
commit bb0abe27cd
4 changed files with 11 additions and 9 deletions
+2 -2
View File
@@ -263,10 +263,10 @@
{{ _("To create a new assignment or quiz for this class, click on the buttons below. Once you have created the new assignment or quiz you can come back and add it from here.") }}
</p>
<div class="flex">
<a class="btn btn-secondary btn-sm" href="/assignments/new-assignment">
<a class="btn btn-default btn-sm" href="/assignments/new-assignment">
{{ _("Create Assignment") }}
</a>
<a class="btn btn-secondary btn-sm ml-2" href="/assignments/new-quiz">
<a class="btn btn-default btn-sm ml-2" href="/assignments/new-quiz">
{{ _("Create Quiz") }}
</a>
</div>
+2 -1
View File
@@ -17,6 +17,8 @@ def get_context(context):
if submission == "new-submission":
context.submission = frappe._dict()
context.no_of_attempts = 0
context.hide_quiz = False
else:
context.submission = frappe.db.get_value(
"LMS Quiz Submission",
@@ -45,4 +47,3 @@ def get_context(context):
context.hide_quiz = (
context.is_moderator and context.submission.member != frappe.session.user
)
print(context.no_of_attempts)