choice-box.php
1 year ago
fill-in-the-blank.php
3 years ago
image-answer.php
3 years ago
image-matching.php
1 year ago
matching.php
1 year ago
meta.php
1 month ago
open-ended.php
2 years ago
ordering.php
3 years ago
question.php
1 month ago
short-answer.php
1 year ago
fill-in-the-blank.php
55 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Fill in blank |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @subpackage Single\Quiz\Parts |
| 7 | * @author Themeum <support@themeum.com> |
| 8 | * @link https://themeum.com |
| 9 | * @version 1.0.0 |
| 10 | */ |
| 11 | |
| 12 | ?> |
| 13 | |
| 14 | <div id="quiz-matching-ans-area" |
| 15 | class="quiz-question-ans-choice-area tutor-mt-40 question-type-<?php echo esc_attr( $question_type ); ?> <?php echo $answer_required ? 'quiz-answer-required' : ''; ?> "> |
| 16 | <?php |
| 17 | if ( is_array( $answers ) && count( $answers ) ) { |
| 18 | foreach ( $answers as $answer ) { |
| 19 | $answer_title = stripslashes( $answer->answer_title ); |
| 20 | $answer->is_correct ? $quiz_answers[] = $answer->answer_id : 0; |
| 21 | ?> |
| 22 | <div class="fill-in-the-gap tutor-fs-6 tutor-body-color"> |
| 23 | <?php |
| 24 | $count_dash_fields = substr_count( $answer_title, '{dash}' ); |
| 25 | if ( $count_dash_fields ) { |
| 26 | |
| 27 | $dash_string = array(); |
| 28 | $input_data = array(); |
| 29 | for ( $i = 1; $i <= $count_dash_fields; $i ++ ) { |
| 30 | $dash_string[] = '{dash}'; |
| 31 | $input_data[] = "<span class='fill-blank'> |
| 32 | <input type='text' name='attempt[{$is_started_quiz->attempt_id}][quiz_question][{$question->question_id}][]' /> |
| 33 | </span>"; |
| 34 | } |
| 35 | |
| 36 | echo wp_kses( |
| 37 | str_replace( $dash_string, $input_data, $answer_title ), |
| 38 | array( |
| 39 | 'span' => array( 'class' => true ), |
| 40 | 'input' => array( |
| 41 | 'type' => true, |
| 42 | 'name' => true, |
| 43 | 'class' => true, |
| 44 | ), |
| 45 | ) |
| 46 | ); |
| 47 | } |
| 48 | ?> |
| 49 | </div> |
| 50 | <?php |
| 51 | } |
| 52 | } |
| 53 | ?> |
| 54 | </div> |
| 55 |