+ $quiz->is_passing_score( $user_id );
+ $passing_percent = $quiz->get_passing_percent();
+
+ $start_date = $quiz->get_start_date( $user_id );
+
+ $grade = $quiz->get_user_grade( $user_id );
+
+ $is_passing_score = $quiz->is_passing_score( $user_id );
+ $best_grade = $quiz->get_best_grade( $user_id );
+ $time = $quiz->get_total_time( $user_id );
+ $start_date = date('M d, Y', strtotime( $quiz->get_start_date( $user_id ) ) );
+
+ $best = $quiz->get_best_quiz_attempt( $user_id );
+ $best_time = $quiz->get_total_time( $user_id, $best );
+ ?>
+
+
diff --git a/templates/quiz/return-to-lesson.php b/templates/quiz/return-to-lesson.php
index 09380a83dd..59e701873e 100644
--- a/templates/quiz/return-to-lesson.php
+++ b/templates/quiz/return-to-lesson.php
@@ -6,7 +6,7 @@
if ( ! defined( 'ABSPATH' ) ) exit;
-global $post, $quiz;
+global $quiz;
if ( ! $quiz ) {
@@ -17,15 +17,15 @@
$user_id = get_current_user_id();
$quiz_session = LLMS()->session->get( 'llms_quiz' );
-if ( $quiz ) {
- $lesson = $quiz->get_assoc_lesson( $user_id );
- $lesson_link = get_permalink( $quiz->get_assoc_lesson( $user_id ) );
-}
+
+$lesson = $quiz->get_assoc_lesson( $user_id );
if ( ! $lesson ) {
$quiz_session = LLMS()->session->get( 'llms_quiz' );
$lesson = $quiz_session->assoc_lesson;
$lesson_link = get_permalink( $lesson );
+} else {
+ $lesson_link = get_permalink( $lesson );
}
if ( $lesson ) {
diff --git a/templates/quiz/single-choice.php b/templates/quiz/single-choice.php
index 6441db1ac3..7bd15f96b4 100644
--- a/templates/quiz/single-choice.php
+++ b/templates/quiz/single-choice.php
@@ -35,7 +35,7 @@
}
}
?>
-
+
$value) :
diff --git a/templates/quiz/single-choice_ajax.php b/templates/quiz/single-choice_ajax.php
new file mode 100644
index 0000000000..f36e387b6b
--- /dev/null
+++ b/templates/quiz/single-choice_ajax.php
@@ -0,0 +1,65 @@
+get_options();
+$question_key = isset($quiz) ? $quiz->get_question_key : 0;
+
+$quiz_session = $quiz = LLMS()->session->get( 'llms_quiz' );
+
+$answer = '';
+if ( ! empty( $quiz_session->questions ) ) {
+ foreach ( $quiz_session->questions as $q ) {
+
+ if ( $q['id'] == $question->id ) {
+ $answer = $q['answer'];
+
+ }
+
+ }
+}
+?>
+
+
+ $value) :
+ if (isset($value)) :
+ $option = $value['option_text'];
+
+
+ if ( ( (int) $answer === (int) $key ) && $answer !== '' ) {
+ llms_log( 'this if statement triggered');
+ $checked = 'checked';
+ }
+
+ else {
+ $checked = '';
+ }
+
+ ?>
+
+
+
+
+
+
+
+
diff --git a/templates/quiz/start-button.php b/templates/quiz/start-button.php
index 82a1f2e83f..dd78d55457 100644
--- a/templates/quiz/start-button.php
+++ b/templates/quiz/start-button.php
@@ -11,7 +11,6 @@
if ( $quiz ) {
$attempts = $quiz->get_remaining_attempts_by_user( $user_id );
- $lesson_link = get_permalink( $quiz->get_assoc_lesson( $user_id ) );
}
?>
@@ -19,13 +18,14 @@
0 || $quiz->get_end_date( $user_id ) == '' ) :
+
+if ( empty( $quiz ) || $attempts === 'unlimited' || $attempts > 0 || $quiz->get_end_date( $user_id ) == '' ) :
?>
+
+
diff --git a/templates/quiz/time-limit.php b/templates/quiz/time-limit.php
new file mode 100644
index 0000000000..d5984adbd2
--- /dev/null
+++ b/templates/quiz/time-limit.php
@@ -0,0 +1,21 @@
+get_time_limit();
+
+?>
+
+
+
+ %s', 'lifterlms'), LLMS_Date::convert_to_hours_minutes_string( $time_limit ) ); ?>
+
+
+
+
diff --git a/templates/quiz/timer.php b/templates/quiz/timer.php
new file mode 100644
index 0000000000..4f40f34e7b
--- /dev/null
+++ b/templates/quiz/timer.php
@@ -0,0 +1,19 @@
+get_time_limit();
+
+if ( !empty( $time_limit ) ) :
+?>
+
+
\ No newline at end of file