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.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 / views / modal / question_answer_form.php
tutor / views / modal Last commit date
edit-lesson.php 3 years ago edit_quiz.php 3 years ago login.php 3 years ago question_answer_form.php 3 years ago question_answer_list.php 3 years ago question_form.php 3 years ago review.php 3 years ago topic-form.php 3 years ago
question_answer_form.php
290 lines
1 <?php
2 /**
3 * Template for single answer editor
4 *
5 * @package Tutor\Views
6 * @author Themeum <support@themeum.com>
7 * @link https://themeum.com
8 * @since 1.0.0
9 */
10
11 if ( 'open_ended' === $question_type || 'short_answer' === $question_type ) {
12 echo '<p class="open-ended-notice" style="color: #ff0000;">' .
13 esc_html__( 'No option is necessary for this answer type', 'tutor' ) .
14 '</p>';
15 return '';
16 }
17
18 empty( $old_answer ) ? $old_answer = (object) array() : 0;
19 $answer_title = ! empty( $old_answer->answer_title ) ? stripslashes( $old_answer->answer_title ) : '';
20 $image_id = ! empty( $old_answer->image_id ) ? $old_answer->image_id : '';
21 $answer_view_format = ! empty( $old_answer->answer_view_format ) ? $old_answer->answer_view_format : 'text';
22 $answer_two_gap_match = ! empty( $old_answer->answer_two_gap_match ) ? stripslashes( $old_answer->answer_two_gap_match ) : '';
23 ?>
24
25 <div class="tutor-quiz-question-answers-form">
26 <input type="hidden" name="tutor_quiz_answer_id" value="<?php echo esc_attr( ! empty( $old_answer->answer_id ) ? $old_answer->answer_id : '' ); ?>" />
27
28 <?php
29 if ( 'true_false' === $question_type ) {
30 ?>
31 <div class="tutor-quiz-builder-group">
32 <!-- <h4><?php esc_html_e( 'Select the correct option', 'tutor' ); ?></h4> -->
33 <div class="tutor-quiz-builder-row">
34 <div class="tutor-quiz-builder-col auto-width">
35 <label>
36 <input type="radio" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][true_false]" value="true" checked="checked">
37 <?php esc_html_e( 'True', 'tutor' ); ?>
38 </label>
39 <label>
40 <input type="radio" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][true_false]" value="false">
41 <?php esc_html_e( 'False', 'tutor' ); ?>
42 </label>
43 </div>
44 </div>
45 </div>
46 <?php
47 } elseif ( 'multiple_choice' === $question_type || 'single_choice' === $question_type || 'ordering' === $question_type ) {
48 ?>
49
50 <div class="tutor-mb-32">
51 <label class="tutor-form-label">
52 <?php esc_html_e( 'Answer title', 'tutor' ); ?>
53 </label>
54 <div class="tutor-mb-16">
55 <input class="tutor-form-control" type="text" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_title]" value="<?php echo esc_attr( $answer_title ); ?>">
56 </div>
57 </div>
58
59 <div class="tutor-mb-32">
60 <label class="tutor-form-label">
61 <?php esc_html_e( 'Upload Image', 'tutor' ); ?>
62 </label>
63
64 <?php
65 // Load thumbnail segment.
66 tutor_load_template_from_custom_path(
67 tutor()->path . '/views/fragments/thumbnail-uploader.php',
68 array(
69 'media_id' => $image_id,
70 'input_name' => 'quiz_answer[' . $question_id . '][image_id]',
71 ),
72 false
73 );
74 ?>
75 </div>
76
77 <div class="tutor-row tutor-mb-32">
78 <div class="tutor-col-12">
79 <label class="tutor-form-label">
80 <?php esc_html_e( 'Display format for options', 'tutor' ); ?>
81 </label>
82 </div>
83 <div class="tutor-col-auto">
84 <div class="tutor-form-check tutor-mb-16">
85 <input type="radio" id="tutor_quiz_type_text" class="tutor-form-check-input" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_view_format]" value="text" <?php echo $answer_view_format ? checked( 'text', $answer_view_format ) : 'checked="checked"'; ?>/>
86 <label for="tutor_quiz_type_text"><?php esc_html_e( 'Only text', 'tutor' ); ?></label>
87 </div>
88 </div>
89 <div class="tutor-col-auto">
90 <div class="tutor-form-check tutor-mb-16">
91 <input type="radio" id="tutor_quiz_type_img" class="tutor-form-check-input" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_view_format]" value="image" <?php echo checked( 'image', $answer_view_format ); ?>/>
92 <label for="tutor_quiz_type_img"><?php esc_html_e( 'Only Image', 'tutor' ); ?></label>
93 </div>
94 </div>
95 <div class="tutor-col-auto">
96 <div class="tutor-form-check tutor-mb-16">
97 <input type="radio" id="tutor_quiz_type_img_text" class="tutor-form-check-input" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_view_format]" value="text_image" <?php echo checked( 'text_image', $answer_view_format ); ?>/>
98 <label for="tutor_quiz_type_img_text"><?php esc_html_e( 'Text &amp; Image both', 'tutor' ); ?></label>
99 </div>
100 </div>
101 </div>
102 <?php
103 } elseif ( 'fill_in_the_blank' === $question_type ) {
104 ?>
105
106 <div class="tutor-mb-32">
107 <label class="tutor-form-label">
108 <?php esc_html_e( 'Question Title', 'tutor' ); ?>
109 </label>
110 <div class="tutor-mb-16">
111 <input class="tutor-form-control" type="text" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_title]" value="<?php echo esc_attr( $answer_title ); ?>">
112 <div class="tutor-form-feedback">
113 <i class="tutor-icon-circle-info-o tutor-form-feedback-icon"></i>
114 <div><?php echo wp_kses( __( 'Please make sure to use the <strong>{dash}</strong> variable in your question title to show the blanks in your question. You can use multiple <strong>{dash}</strong> variables in one question.', 'tutor' ), array( 'strong' => true ) ); ?></div>
115 </div>
116 </div>
117 </div>
118
119 <div class="tutor-mb-32">
120 <label class="tutor-form-label">
121 <?php esc_html_e( 'Correct Answer(s)', 'tutor' ); ?>
122 </label>
123 <div class="tutor-mb-16">
124 <input class="tutor-form-control" type="text" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_two_gap_match]" value="<?php echo esc_attr( $answer_two_gap_match ); ?>"/>
125 <div class="tutor-form-feedback">
126 <i class="tutor-icon-circle-info-o tutor-form-feedback-icon"></i>
127 <div><?php echo wp_kses( __( 'Separate multiple answers by a vertical bar <strong>|</strong>. 1 answer per <strong>{dash}</strong> variable is defined in the question. Example: Apple | Banana | Orange', 'tutor' ), array( 'strong' => true ) ); ?></div>
128 </div>
129 </div>
130 </div>
131 <?php
132 } elseif ( 'answer_sorting' === $question_type ) {
133 ?>
134
135 <div class="tutor-quiz-builder-group">
136 <h4><?php esc_html_e( 'Answer title', 'tutor' ); ?></h4>
137 <div class="tutor-quiz-builder-row">
138 <div class="tutor-quiz-builder-col">
139 <input type="text" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_title]" value="">
140 </div>
141 </div>
142 </div> <!-- /.tutor-quiz-builder-group -->
143
144 <div class="tutor-quiz-builder-group">
145 <h4><?php esc_html_e( 'Matched Answer title', 'tutor' ); ?></h4>
146 <div class="tutor-quiz-builder-row">
147 <div class="tutor-quiz-builder-col">
148 <input type="text" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][matched_answer_title]" value="">
149 </div>
150 </div>
151 <p class="help"></p>
152 </div> <!-- /.tutor-quiz-builder-group -->
153
154 <?php
155 } elseif ( 'matching' === $question_type ) {
156 ?>
157 <div class="tutor-mb-32">
158 <label class="tutor-form-label">
159 <?php esc_html_e( 'Answer title', 'tutor' ); ?>
160 </label>
161 <div class="tutor-mb-16">
162 <input class="tutor-form-control" type="text" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_title]" value="<?php echo esc_attr( $answer_title ); ?>"/>
163 </div>
164 </div>
165
166 <div class="tutor-mb-32">
167 <label class="tutor-form-label">
168 <?php esc_html_e( 'Matched Answer title', 'tutor' ); ?>
169 </label>
170 <div class="tutor-mb-16">
171 <input class="tutor-form-control" type="text" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][matched_answer_title]" value="<?php echo esc_attr( $answer_two_gap_match ); ?>"/>
172 </div>
173 </div>
174
175 <div class="tutor-mb-32">
176 <label class="tutor-form-label">
177 <?php esc_html_e( 'Upload Image', 'tutor' ); ?>
178 </label>
179
180 <?php
181 // Load thumbnail segment.
182 tutor_load_template_from_custom_path(
183 tutor()->path . '/views/fragments/thumbnail-uploader.php',
184 array(
185 'media_id' => $image_id,
186 'input_name' => 'quiz_answer[' . $question_id . '][image_id]',
187 ),
188 false
189 );
190 ?>
191 </div>
192
193 <div class="tutor-row tutor-mb-32">
194 <div class="tutor-col-12">
195 <label class="tutor-form-label">
196 <?php esc_html_e( 'Display format for options', 'tutor' ); ?>
197 </label>
198 </div>
199 <div class="tutor-col-auto">
200 <div class="tutor-form-check tutor-mb-16">
201 <input type="radio" id="tutor_quiz_type_text" class="tutor-form-check-input" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_view_format]" value="text" <?php echo $answer_view_format ? checked( 'text', $answer_view_format ) : 'checked="checked"'; ?>/>
202 <label for="tutor_quiz_type_text"><?php esc_html_e( 'Only text', 'tutor' ); ?></label>
203 </div>
204 </div>
205 <div class="tutor-col-auto">
206 <div class="tutor-form-check tutor-mb-16">
207 <input type="radio" id="tutor_quiz_type_img" class="tutor-form-check-input" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_view_format]" value="image" <?php echo checked( 'image', $answer_view_format ); ?>/>
208 <label for="tutor_quiz_type_img"><?php esc_html_e( 'Only Image', 'tutor' ); ?></label>
209 </div>
210 </div>
211 <div class="tutor-col-auto">
212 <div class="tutor-form-check tutor-mb-16">
213 <input type="radio" id="tutor_quiz_type_img_text" class="tutor-form-check-input" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_view_format]" value="text_image" <?php echo checked( 'text_image', $answer_view_format ); ?>/>
214 <label for="tutor_quiz_type_img_text"><?php esc_html_e( 'Text &amp; Image both', 'tutor' ); ?></label>
215 </div>
216 </div>
217 </div>
218 <?php
219 } elseif ( 'image_matching' === $question_type ) {
220 ?>
221 <div class="tutor-mb-32">
222 <label class="tutor-form-label">
223 <?php esc_html_e( 'Upload Image', 'tutor' ); ?>
224 </label>
225
226 <?php
227 // Load thumbnail segment.
228 tutor_load_template_from_custom_path(
229 tutor()->path . '/views/fragments/thumbnail-uploader.php',
230 array(
231 'media_id' => $image_id,
232 'input_name' => 'quiz_answer[' . $question_id . '][image_id]',
233 ),
234 false
235 );
236 ?>
237 </div>
238 <div class="tutor-mb-32">
239 <label class="tutor-form-label">
240 <?php esc_html_e( 'Image matched text', 'tutor' ); ?>
241 </label>
242 <div class="tutor-mb-16">
243 <input class="tutor-form-control" type="text" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_title]" value="<?php echo esc_attr( $answer_title ); ?>"/>
244 </div>
245 </div>
246 <?php
247 } elseif ( 'image_answering' === $question_type ) {
248 ?>
249
250 <div class="tutor-mb-32">
251 <label class="tutor-form-label">
252 <?php esc_html_e( 'Upload Image', 'tutor' ); ?>
253 </label>
254
255 <?php
256 // Load thumbnail segment.
257 tutor_load_template_from_custom_path(
258 tutor()->path . '/views/fragments/thumbnail-uploader.php',
259 array(
260 'media_id' => $image_id,
261 'input_name' => 'quiz_answer[' . $question_id . '][image_id]',
262 ),
263 false
264 );
265 ?>
266 </div>
267
268 <div class="tutor-mb-32">
269 <label class="tutor-form-label">
270 <?php esc_html_e( 'Answer input value', 'tutor' ); ?>
271 </label>
272 <div class="tutor-mb-16">
273 <input class="tutor-form-control" type="text" name="quiz_answer[<?php echo esc_attr( $question_id ); ?>][answer_title]" value="<?php echo esc_attr( $answer_title ); ?>"/>
274 <div class="tutor-form-feedback">
275 <i class="tutor-icon-circle-info-o tutor-form-feedback-icon"></i>
276 <div><?php echo wp_kses( __( 'The answers that students enter should match with this text. Write in <strong>small caps</strong>', 'tutor' ), array( 'strong' => true ) ); ?></div>
277 </div>
278 </div>
279 </div>
280 <?php
281 }
282 ?>
283
284 <div class="tutor-quiz-answers-form-footer">
285 <button type="button" id="quiz-answer-save-btn" class="tutor-answer-save-btn tutor-btn tutor-btn-primary tutor-btn-sm">
286 <?php esc_html_e( 'Update Answer', 'tutor' ); ?>
287 </button>
288 </div>
289 </div>
290