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.2 3.2.3 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / shared / components / quiz / attempt-details / review-answers.php
tutor / templates / shared / components / quiz / attempt-details Last commit date
questions 1 month ago question-header.php 1 month ago question.php 1 month ago questions-sidebar.php 1 month ago review-answers.php 1 month ago summary.php 1 month ago
review-answers.php
86 lines
1 <?php
2 /**
3 * Tutor learning area attempt details review answers list.
4 *
5 * @package Tutor\Templates
6 * @subpackage LearningArea\Quiz\AttemptDetails
7 * @since 4.0.0
8 */
9
10 defined( 'ABSPATH' ) || exit;
11
12 use Tutor\Quiz;
13
14 $questions = isset( $questions ) && is_array( $questions ) ? $questions : array();
15 $attempt_data = isset( $attempt_data ) && is_object( $attempt_data ) ? $attempt_data : null;
16 $back_url = isset( $back_url ) ? (string) $back_url : '';
17 $context = isset( $context ) ? (string) $context : '';
18 ?>
19
20 <div class="tutor-quiz tutor-quiz-questions">
21 <?php foreach ( $questions as $index => $question ) : ?>
22 <?php
23 $question_type = $question->question_type ?? '';
24
25 $question_id = (int) ( $question->question_id ?? 0 );
26
27 $is_dnd = in_array( $question_type, array( 'image_answering', 'ordering', 'matching', 'image_matching' ), true );
28 $is_true_false = 'true_false' === $question_type;
29 $is_multiple_choice = in_array( $question_type, array( 'single_choice', 'multiple_choice' ), true );
30 $is_open_ended = in_array( $question_type, array( 'open_ended', 'short_answer' ), true );
31 $is_fill_in_the_blanks = 'fill_in_the_blank' === $question_type;
32 $is_draw_image = 'draw_image' === $question_type;
33 $is_pin = 'pin_image' === $question_type;
34 $is_scale = 'scale' === $question_type;
35 $is_coordinates = 'coordinates' === $question_type;
36 $is_puzzle = 'puzzle' === $question_type;
37
38 $question_template = '';
39
40 if ( $is_dnd ) {
41 $question_template = 'review-answer-dnd';
42 } elseif ( $is_true_false ) {
43 $question_template = 'true-false';
44 } elseif ( $is_multiple_choice ) {
45 $question_template = 'multiple-choice';
46 } elseif ( $is_open_ended ) {
47 $question_template = 'open-ended';
48 } elseif ( $is_fill_in_the_blanks ) {
49 $question_template = 'fill-in-the-blank';
50 } elseif ( $is_scale ) {
51 $question_template = 'scale';
52 } elseif ( $is_pin ) {
53 $question_template = 'pin-image';
54 } elseif ( $is_draw_image ) {
55 $question_template = 'draw-image';
56 } elseif ( $is_coordinates ) {
57 $question_template = 'coordinates';
58 } elseif ( $is_puzzle ) {
59 $question_template = 'puzzle';
60 }
61 ?>
62
63 <div id="question-<?php echo esc_attr( $question_id ); ?>">
64 <?php
65 if ( ! empty( $question_template ) ) {
66 tutor_load_template(
67 'shared.components.quiz.attempt-details.question',
68 array(
69 'question' => $question,
70 'index' => (int) $index + 1,
71 'question_template' => $question_template,
72 'attempt_id' => (int) ( $attempt_data->attempt_id ?? 0 ),
73 'is_manually_reviewed' => ! empty( $attempt_data->is_manually_reviewed ),
74 'back_url' => $back_url,
75 'context' => $context,
76 'is_instructor_review' => $is_instructor_review,
77 'review_field_name' => "review_statuses[{$question_id}]",
78 )
79 );
80 }
81 do_action( 'tutor_review_answer_after_question_template', $question, $index, $is_instructor_review );
82 ?>
83 </div>
84 <?php endforeach; ?>
85 </div>
86