Skip to content

Commit

Permalink
Simplified logic. Changelog.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhogg committed Feb 6, 2025
1 parent 2340d67 commit 06af484
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changelogs/fix_limit-plus-resume-quizzes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
significance: patch
type: fixed
links:
- "#2865"
entry: Allow quiz question to be retrieved even if attempt limit reached when
resuming a quiz.
2 changes: 1 addition & 1 deletion includes/class.llms.ajax.handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ public static function quiz_get_question( $request ) {
$attempt = $student_quizzes->get_attempt_by_key( $attempt_key );

// Don't allow the question to be retrieved if the attempt is not open or can't be resumed.
if ( ! $attempt || ( ( ! $attempt->can_be_resumed() || ! $attempt->get_quiz()->can_be_resumed() ) && ! $attempt->get_quiz()->is_open() ) || ( $attempt->get_quiz()->can_be_resumed() && ! $attempt->can_be_resumed() ) ) {
if ( ! $attempt || ( ! $attempt->get_quiz()->is_open() && ( ! $attempt->get_quiz()->can_be_resumed() || ! $attempt->can_be_resumed() ) ) ) {
$err->add( 500, __( 'There was an error retrieving the question. Please return to the lesson and try again.', 'lifterlms' ) );
return $err;
}
Expand Down

0 comments on commit 06af484

Please sign in to comment.