Skip to content

Commit

Permalink
Removed most changelogs. Fixed resume quiz button text filter (llms v…
Browse files Browse the repository at this point in the history
…s lifterlms). Removed filters to change resumability (except for resume expiration time).
  • Loading branch information
brianhogg committed Aug 22, 2024
1 parent 648884e commit 8e62964
Show file tree
Hide file tree
Showing 20 changed files with 3 additions and 81 deletions.
3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-1.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-10.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-11.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-12.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-13.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .changelogs/feature_quiz-resume-14.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-2.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .changelogs/feature_quiz-resume-3.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-5.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-6.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .changelogs/feature_quiz-resume-7.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-8.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-9.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .changelogs/feature_quiz-resume-akash-1.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-akash-2.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .changelogs/feature_quiz-resume-akash-4.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .changelogs/feature_quiz-resume-akash.yml

This file was deleted.

12 changes: 1 addition & 11 deletions includes/models/model.llms.quiz.attempt.php
Original file line number Diff line number Diff line change
Expand Up @@ -813,17 +813,7 @@ public function is_passing() {
*/
public function can_be_resumed() {

$can_be_resumed = 1 === (int) $this->get( 'can_be_resumed' ) && 'incomplete' === $this->get( 'status' ) && ! $this->has_resume_attempt_time_expired();

/**
* Filters the attempt resumable status.
*
* @since [version]
*
* @param bool $can_be_resumed Whether or not the attempt can be resumed.
* @param LLMS_Quiz_Attempt $attempt The quiz attempt object.
*/
return apply_filters( 'llms_quiz_attempt_can_be_resumed', $can_be_resumed, $this );
return 1 === (int) $this->get( 'can_be_resumed' ) && 'incomplete' === $this->get( 'status' ) && ! $this->has_resume_attempt_time_expired();
}

/**
Expand Down
14 changes: 1 addition & 13 deletions includes/models/model.llms.quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,7 @@ public function is_orphan( $deep = false ) {
*/
public function can_be_resumed() {

$can_be_resumed_status = llms_parse_bool( $this->get( 'can_be_resumed' ) ) && ! $this->has_time_limit();

/**
* Filters the quiz resumable status.
*
* @since [version]
*
* @param bool $can_be_resumed Whether or not the quiz can be resumed.
* @param LLMS_Quiz $quiz The LLMS_Quiz instance.
*/
$can_be_resumed = apply_filters( 'llms_quiz_can_be_resumed', $can_be_resumed_status, $this );

return $can_be_resumed;
return llms_parse_bool( $this->get( 'can_be_resumed' ) ) && ! $this->has_time_limit();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion templates/quiz/start-button.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
* @param LLMS_Quiz $quiz The current quiz instance.
* @param LLMS_Lesson $lesson The parent lesson instance.
*/
echo esc_html( apply_filters( 'llms_resume_quiz_button_text', esc_html__( 'Resume Quiz', 'lifterlms' ), $quiz, $lesson ) );
echo esc_html( apply_filters( 'lifterlms_resume_quiz_button_text', esc_html__( 'Resume Quiz', 'lifterlms' ), $quiz, $lesson ) );
?>
</button>

Expand Down

0 comments on commit 8e62964

Please sign in to comment.