feat: Quiz attempt limits is configurable
- Added a 'no limit' check to `check_quiz_completion` in utils.py - Added disabled flag for questions in quiz component - Refactored `get_quiz_without_answers` to send attempt limit data to client
This commit is contained in:
@@ -135,7 +135,7 @@ def check_content_completion(content_name, content_type, enrollment_name):
|
||||
|
||||
def check_quiz_completion(quiz, enrollment_name):
|
||||
attempts = frappe.get_all("Quiz Activity", filters={'enrollment': enrollment_name, 'quiz': quiz.name}, fields=["name", "activity_date", "score", "status"])
|
||||
status = bool(len(attempts) == quiz.max_attempts)
|
||||
status = False if quiz.max_attempts == 0 else bool(len(attempts) == quiz.max_attempts)
|
||||
score = None
|
||||
result = None
|
||||
if attempts:
|
||||
|
||||
Reference in New Issue
Block a user