modals
4 days ago
questions
4 days ago
attempt-details.php
4 days ago
attempt.php
4 days ago
content.php
4 days ago
nav-item.php
4 days ago
progress-bar.php
4 days ago
question-header.php
4 days ago
question.php
4 days ago
question-header.php
61 lines
| 1 | <?php |
| 2 | /** |
| 3 | * True False |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @author Themeum <support@themeum.com> |
| 7 | * @link https://themeum.com |
| 8 | * @since 4.0.0 |
| 9 | */ |
| 10 | |
| 11 | defined( 'ABSPATH' ) || exit; |
| 12 | |
| 13 | global $tutor_is_started_quiz; |
| 14 | |
| 15 | $quiz_id = $quiz_id ?? ( $tutor_is_started_quiz->quiz_id ?? 0 ); |
| 16 | $quiz_options = $quiz_id ? tutor_utils()->get_quiz_option( (int) $quiz_id ) : array(); |
| 17 | $hide_question_number_overview = (string) ( $quiz_options['hide_question_number_overview'] ?? '0' ); |
| 18 | $show_question_number = '1' !== $hide_question_number_overview; |
| 19 | |
| 20 | $index = $question->index; |
| 21 | $question_title = $question->question_title ?? ''; |
| 22 | $question_description = $question->question_description ?? ''; |
| 23 | $question_mark = $question->question_mark ?? ''; |
| 24 | |
| 25 | ?> |
| 26 | |
| 27 | <div class="tutor-quiz-question-header"> |
| 28 | <?php if ( $show_question_number ) : ?> |
| 29 | <div class="tutor-quiz-question-number"> |
| 30 | <?php echo esc_html( $index ); ?> |
| 31 | </div> |
| 32 | <?php endif; ?> |
| 33 | |
| 34 | <div class="tutor-quiz-question-title"> |
| 35 | <?php echo esc_html( wp_unslash( $question_title ) ); ?> |
| 36 | |
| 37 | <?php if ( ! empty( $question_description ) ) : ?> |
| 38 | <?php |
| 39 | $description = apply_filters( 'tutor_filter_quiz_question_description', wp_unslash( $question_description ) ); |
| 40 | if ( $description ) { |
| 41 | $markup = "<div class='tutor-p2 tutor-text-secondary'>{$description}</div>"; |
| 42 | if ( function_exists( 'tutor' ) && tutor()->has_pro ) { |
| 43 | do_action( 'tutor_quiz_question_desc_render', $markup, $question ); |
| 44 | } else { |
| 45 | echo wp_kses_post( $markup ); |
| 46 | } |
| 47 | } |
| 48 | ?> |
| 49 | <?php endif; ?> |
| 50 | </div> |
| 51 | |
| 52 | <?php if ( $show_question_mark ) : ?> |
| 53 | <span class="tutor-badge tutor-badge-rounded tutor-text-secondary"> |
| 54 | <span class="tutor-text-subdued"> |
| 55 | <?php esc_html_e( 'Points: ', 'tutor' ); ?> |
| 56 | </span> |
| 57 | <?php echo esc_html( $question_mark ); ?> |
| 58 | </span> |
| 59 | <?php endif; ?> |
| 60 | </div> |
| 61 |