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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_form.php
tutor / views / modal Last commit date
add_quiz.php 7 years ago edit-lesson.php 7 years ago edit_quiz.php 7 years ago question_answer_edit_form.php 7 years ago question_answer_form.php 7 years ago question_form.php 7 years ago
question_form.php
234 lines
1 <?php
2 global $wpdb;
3 $settings = maybe_unserialize($question->question_settings);
4 ?>
5
6 <div class="quiz-questions-form">
7
8
9 <div class="question-form-header">
10 <a href="javascript:;" class="back-to-quiz-questions-btn open-tutor-quiz-modal" data-quiz-id="<?php echo $quiz_id; ?>"
11 data-back-to-tab="#quiz-builder-tab-questions"><i class="tutor-icon-next-2"></i> <?php _e('Back', 'tutor'); ?></a>
12 </div>
13
14
15 <div class="quiz-question-form-body">
16
17
18 <div class="quiz_question_form">
19
20 <div class="tutor-quiz-builder-group">
21 <h4><?php _e('Write your question here', 'tutor'); ?></h4>
22 <div class="tutor-quiz-builder-row">
23 <div class="tutor-quiz-builder-col">
24 <input type="text" name="tutor_quiz_question[<?php echo $question_id; ?>][question_title]" placeholder="<?php _e('Type your quiz title here', 'tutor'); ?>" value="<?php echo $question->question_title; ?>">
25 </div>
26 </div>
27 </div>
28
29 <div class="tutor-quiz-builder-group">
30 <h4><?php _e('Question Type', 'tutor'); ?></h4>
31 <div class="tutor-quiz-builder-row">
32 <div class="tutor-quiz-builder-col">
33 <div class="tutor-select">
34 <div class="select-header">
35 <span class="lead-option"> <i class="tutor-icon-yes-no"></i> True or False </span>
36 <span class="select-dropdown"><i class="tutor-icon-light-down"></i> </span>
37 <input type="hidden" class="tutor_select_value_holder" name="tutor_quiz_question[<?php echo $question_id; ?>][question_type]" value="" >
38 </div>
39
40 <?php $question_types = tutor_utils()->get_question_types();
41
42
43 ?>
44
45 <div class="tutor-select-options" style="display: none;">
46 <?php
47 $has_tutor_pro = tutor()->has_pro;
48
49 foreach ($question_types as $type => $question_type){
50 ?>
51 <p class="tutor-select-option" data-value="<?php echo $type; ?>" <?php echo $question->question_type===$type ? ' data-selected="selected"' : ''; ?> data-is-pro="<?php echo (! $has_tutor_pro && $question_type['is_pro']) ? 'true' : 'false' ?>" >
52 <?php echo $question_type['icon'].' '.$question_type['name']; ?>
53
54 <?php
55 if (! $has_tutor_pro && $question_type['is_pro']){
56 $svg_lock = '<svg width="12" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M11.667 6h-1V4.667A4.672 4.672 0 0 0 6 0a4.672 4.672 0 0 0-4.667 4.667V6h-1A.333.333 0 0 0 0 6.333v8.334C0 15.402.598 16 1.333 16h9.334c.735 0 1.333-.598 1.333-1.333V6.333A.333.333 0 0 0 11.667 6zm-4.669 6.963a.334.334 0 0 1-.331.37H5.333a.333.333 0 0 1-.331-.37l.21-1.89A1.319 1.319 0 0 1 4.667 10c0-.735.598-1.333 1.333-1.333S7.333 9.265 7.333 10c0 .431-.204.824-.545 1.072l.21 1.891zM8.667 6H3.333V4.667A2.67 2.67 0 0 1 6 2a2.67 2.67 0 0 1 2.667 2.667V6z" fill="#E2E2E2" fill-rule="nonzero"/></svg>';
57 printf("<span class='question-type-pro' title='%s'>%s</span>",__('Pro version required', 'tutor'), $svg_lock );
58 }
59 ?>
60 </p>
61 <?php
62 }
63 ?>
64
65 </div>
66 </div>
67 </div>
68 </div>
69 </div>
70
71 <div class="tutor-quiz-builder-group">
72 <div class="tutor-quiz-builder-row">
73 <div class="tutor-quiz-builder-col auto-width">
74 <label class="btn-switch">
75 <input type="checkbox" value="1" name="tutor_quiz_question[<?php echo $question_id; ?>][answer_required]" <?php checked('1', tutor_utils()->avalue_dot('answer_required', $settings)); ?> />
76 <div class="btn-slider btn-round"></div>
77 </label>
78 <span><?php _e('Answer Required', 'tutor'); ?></span>
79 </div>
80 <div class="tutor-quiz-builder-col auto-width">
81 <label class="btn-switch">
82 <input type="checkbox" value="1" name="tutor_quiz_question[<?php echo $question_id; ?>][randomize_question]" <?php checked('1', tutor_utils()->avalue_dot('randomize_question', $settings)); ?> />
83 <div class="btn-slider btn-round"></div>
84 </label>
85 <span><?php _e('Randomize', 'tutor'); ?></span>
86 </div>
87 </div>
88 </div>
89
90 <div class="tutor-quiz-builder-group">
91 <h4><?php _e('Mark for this question', 'tutor'); ?></h4>
92 <div class="tutor-quiz-builder-row">
93 <div class="tutor-quiz-builder-col">
94 <input type="text" name="tutor_quiz_question[<?php echo $question_id; ?>][question_mark]" placeholder="<?php _e('set the mark ex. 10', 'tutor'); ?>" value="<?php
95 echo $question->question_mark; ?>">
96 </div>
97 </div>
98 </div>
99
100 <div class="tutor-quiz-builder-group">
101 <div class="tutor-quiz-builder-row">
102 <div class="tutor-quiz-builder-col auto-width">
103 <label class="btn-switch">
104 <input type="checkbox" value="1" name="tutor_quiz_question[<?php echo $question_id; ?>][show_question_mark]" <?php checked('1', tutor_utils()->avalue_dot('show_question_mark', $settings)); ?> />
105 <div class="btn-slider btn-round"></div>
106 </label>
107 <span><?php _e('Show marks', 'tutor'); ?></span>
108 </div>
109 </div>
110 </div>
111
112 <div class="tutor-quiz-builder-group">
113 <h4><?php _e('Description', 'tutor'); ?> <span>(<?php _e('Optional', 'tutor'); ?>)</span></h4>
114 <div class="tutor-quiz-builder-row">
115 <div class="tutor-quiz-builder-col">
116 <textarea name="tutor_quiz_question[<?php echo $question_id; ?>][question_description]"><?php echo $question->question_description;?></textarea>
117 </div>
118 </div>
119 </div>
120
121 <div class="tutor-quiz-builder-group">
122 <h4>
123 <?php
124 switch ($question->question_type){
125 case 'true_false':
126 echo __('Answer options &amp; mark correct', 'tutor');
127 break;
128 case 'ordering':
129 echo __('Student should order below items exact this order, make sure your answer is in right order, you can re-order them', 'tutor');
130 break;
131 }
132 ?>
133 </h4>
134 <div class="tutor-quiz-builder-row">
135 <div class="tutor-quiz-builder-col">
136 <div id="tuotr_question_options_for_quiz" class="quiz-modal-field-wrap">
137 <div id="tutor_quiz_question_answers" data-question-id="<?php echo $question_id; ?>">
138 <?php
139
140 $answers = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}tutor_quiz_question_answers where belongs_question_id = {$question_id} AND belongs_question_type = '{$question->question_type}' order by answer_order asc ;");
141 if (is_array($answers) && count($answers)){
142 foreach ($answers as $answer){
143 ?>
144 <div class="tutor-quiz-answer-wrap" data-answer-id="<?php echo $answer->answer_id; ?>">
145 <div class="tutor-quiz-answer">
146 <span class="tutor-quiz-answer-title">
147 <?php
148 echo $answer->answer_title;
149 if ($answer->belongs_question_type === 'fill_in_the_blank'){
150 echo ' ('.__('Answer', 'tutor').' : ';
151 echo "<strong>{$answer->answer_two_gap_match} </strong>)";
152 }
153 if ($answer->belongs_question_type === 'matching'){
154 echo " - {$answer->answer_two_gap_match}";
155 }
156 ?>
157 </span>
158
159 <?php
160 if ($answer->image_id){
161 echo '<span class="tutor-question-answer-image"><img src="'.wp_get_attachment_image_url($answer->image_id).'" /> </span>';
162 }
163 if ($question->question_type === 'true_false' || $question->question_type === 'single_choice'){
164 ?>
165 <span class="tutor-quiz-answers-mark-correct-wrap">
166 <input type="radio" name="mark_as_correct[<?php echo $answer->belongs_question_id; ?>]"
167 value="<?php echo $answer->answer_id; ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" <?php checked(1, $answer->is_correct); ?> >
168 </span>
169 <?php
170 }elseif ($question->question_type === 'multiple_choice'){
171 ?>
172 <span class="tutor-quiz-answers-mark-correct-wrap">
173 <input type="checkbox" name="mark_as_correct[<?php echo $answer->belongs_question_id; ?>]"
174 value="<?php echo $answer->answer_id; ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" <?php checked(1, $answer->is_correct); ?> >
175 </span>
176 <?php
177 }
178 ?>
179 <span class="tutor-quiz-answer-edit">
180 <?php if ( $question->question_type !== 'true_false' ){ ?>
181 <a href="javascript:;"><i class="tutor-icon-pencil"></i> </a>
182 <?php } ?>
183 </span>
184 <span class="tutor-quiz-answer-sort-icon"><i class="tutor-icon-menu-2"></i> </span>
185 </div>
186
187 <div class="tutor-quiz-answer-trash-wrap">
188 <a href="javascript:;" class="answer-trash-btn" data-answer-id="<?php echo $answer->answer_id; ?>"><i class="tutor-icon-garbage"></i> </a>
189 </div>
190 </div>
191 <?php
192 }
193 }
194 ?>
195 </div>
196
197
198 <div id="tutor_quiz_question_answer_form"></div>
199
200
201 <a href="javascript:;" class="add_question_answers_option" data-question-id="<?php echo $question_id; ?>">
202 <i class="tutor-icon-block tutor-icon-plus"></i>
203 <?php _e('Add An Option', 'tutor'); ?>
204 </a>
205 </div>
206 </div>
207 </div>
208 </div>
209
210 </div>
211
212
213 </div>
214
215 </div>
216
217
218
219
220
221 <div class="tutor-quiz-builder-modal-control-btn-group question_form_inner">
222 <div class="quiz-builder-btn-group-left">
223 <a href="javascript:;" class="quiz-modal-tab-navigation-btn quiz-modal-question-save-btn"><?php _e('Save &amp; Continue', 'tutor');
224 ?></a>
225 </div>
226 <div class="quiz-builder-btn-group-right">
227 <a href="javascript:;" class="quiz-modal-tab-navigation-btn quiz-modal-btn-cancel"><?php _e('Cancel', 'tutor'); ?></a>
228 </div>
229 </div>
230
231
232
233
234 </div>