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