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.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 / views / modal / question_form.php
tutor / views / modal Last commit date
add_quiz.php 5 years ago edit-lesson.php 5 years ago edit_quiz.php 5 years ago question_answer_edit_form.php 5 years ago question_answer_form.php 5 years ago question_form.php 5 years ago
question_form.php
224 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 question here', 'tutor'); ?>" value="<?php echo htmlspecialchars( stripslashes($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> <?php _e('True or False', 'tutor'); ?> </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 <div class="tutor-select-options" style="display: none;">
43 <?php
44 $has_tutor_pro = tutor()->has_pro;
45
46 foreach ($question_types as $type => $question_type){
47 ?>
48 <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' ?>" >
49 <?php echo $question_type['icon'].' '.$question_type['name']; ?>
50
51 <?php
52 if (! $has_tutor_pro && $question_type['is_pro']){
53 $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>';
54 printf("<span class='question-type-pro' title='%s'>%s</span>",__('Pro version required', 'tutor'), $svg_lock );
55 }
56 ?>
57 </p>
58 <?php
59 }
60 ?>
61
62 </div>
63 </div>
64 </div>
65 </div>
66 </div>
67
68 <div class="tutor-quiz-builder-group">
69 <div class="tutor-quiz-builder-row">
70 <div class="tutor-quiz-builder-col auto-width">
71 <label class="btn-switch">
72 <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)); ?> />
73 <div class="btn-slider btn-round"></div>
74 </label>
75 <span><?php _e('Answer Required', 'tutor'); ?></span>
76 </div>
77 <div class="tutor-quiz-builder-col auto-width">
78 <label class="btn-switch">
79 <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)); ?> />
80 <div class="btn-slider btn-round"></div>
81 </label>
82 <span><?php _e('Randomize', 'tutor'); ?></span>
83 </div>
84 </div>
85 </div>
86
87 <div class="tutor-quiz-builder-group">
88 <h4><?php _e('Point(s) for this answer', 'tutor'); ?></h4>
89 <div class="tutor-quiz-builder-row">
90 <div class="tutor-quiz-builder-col">
91 <input type="text" name="tutor_quiz_question[<?php echo $question_id; ?>][question_mark]" placeholder="<?php _e('set the mark ex. 10', 'tutor'); ?>" value="<?php
92 echo $question->question_mark; ?>">
93 </div>
94 </div>
95 </div>
96
97 <div class="tutor-quiz-builder-group">
98 <div class="tutor-quiz-builder-row">
99 <div class="tutor-quiz-builder-col auto-width">
100 <label class="btn-switch">
101 <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)); ?> />
102 <div class="btn-slider btn-round"></div>
103 </label>
104 <span><?php _e('Display Points', 'tutor'); ?></span>
105 </div>
106 </div>
107 </div>
108
109 <div class="tutor-quiz-builder-group">
110 <h4><?php _e('Description', 'tutor'); ?> <span>(<?php _e('Optional', 'tutor'); ?>)</span></h4>
111 <div class="tutor-quiz-builder-row">
112 <div class="tutor-quiz-builder-col">
113 <textarea name="tutor_quiz_question[<?php echo $question_id; ?>][question_description]"><?php echo stripslashes($question->question_description);?></textarea>
114 </div>
115 </div>
116 </div>
117
118 <div class="tutor-quiz-builder-group">
119 <h4>
120 <?php
121 switch ($question->question_type){
122 case 'true_false':
123 echo __('Input options for the question and select the correct answer.', 'tutor');
124 break;
125 case 'ordering':
126 echo __('Make sure you’re saving the answers in the right order. Students will have to match this order.', 'tutor');
127 break;
128 }
129 ?>
130 </h4>
131 <div class="tutor-quiz-builder-row">
132 <div class="tutor-quiz-builder-col">
133 <div id="tuotr_question_options_for_quiz" class="quiz-modal-field-wrap">
134 <div id="tutor_quiz_question_answers" data-question-id="<?php echo $question_id; ?>">
135 <?php
136
137 $answers = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}tutor_quiz_question_answers where belongs_question_id = %d AND belongs_question_type = %s order by answer_order asc ;", $question_id, $question->question_type));
138 if (is_array($answers) && count($answers)){
139 foreach ($answers as $answer){
140 ?>
141 <div class="tutor-quiz-answer-wrap" data-answer-id="<?php echo $answer->answer_id; ?>">
142 <div class="tutor-quiz-answer">
143 <span class="tutor-quiz-answer-title">
144 <?php
145 echo stripslashes($answer->answer_title);
146 if ($answer->belongs_question_type === 'fill_in_the_blank'){
147 echo ' ('.__('Answer', 'tutor').' : ';
148 echo '<strong>'.stripslashes($answer->answer_two_gap_match).'</strong>)';
149 }
150 if ($answer->belongs_question_type === 'matching'){
151 echo ' - '.stripslashes($answer->answer_two_gap_match);
152 }
153 ?>
154 </span>
155
156 <?php
157 if ($answer->image_id){
158 echo '<span class="tutor-question-answer-image"><img src="'.wp_get_attachment_image_url($answer->image_id).'" /> </span>';
159 }
160 if ($question->question_type === 'true_false' || $question->question_type === 'single_choice'){
161 ?>
162 <span class="tutor-quiz-answers-mark-correct-wrap">
163 <input type="radio" name="mark_as_correct[<?php echo $answer->belongs_question_id; ?>]"
164 value="<?php echo $answer->answer_id; ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" <?php checked(1, $answer->is_correct); ?> >
165 </span>
166 <?php
167 }elseif ($question->question_type === 'multiple_choice'){
168 ?>
169 <span class="tutor-quiz-answers-mark-correct-wrap">
170 <input type="checkbox" name="mark_as_correct[<?php echo $answer->belongs_question_id; ?>]"
171 value="<?php echo $answer->answer_id; ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" <?php checked(1, $answer->is_correct); ?> >
172 </span>
173 <?php
174 }
175 ?>
176 <span class="tutor-quiz-answer-edit">
177 <?php if ( $question->question_type !== 'true_false' ){ ?>
178 <a href="javascript:;"><i class="tutor-icon-pencil"></i> </a>
179 <?php } ?>
180 </span>
181 <span class="tutor-quiz-answer-sort-icon"><i class="tutor-icon-menu-2"></i> </span>
182 </div>
183
184 <div class="tutor-quiz-answer-trash-wrap">
185 <a href="javascript:;" class="answer-trash-btn" data-answer-id="<?php echo $answer->answer_id; ?>"><i class="tutor-icon-garbage"></i> </a>
186 </div>
187 </div>
188 <?php
189 }
190 }
191 ?>
192 </div>
193
194
195 <div id="tutor_quiz_question_answer_form"></div>
196
197
198 <a href="javascript:;" class="add_question_answers_option" data-question-id="<?php echo $question_id; ?>">
199 <i class="tutor-icon-block tutor-icon-plus"></i>
200 <?php _e('Add An Option', 'tutor'); ?>
201 </a>
202 </div>
203
204 <div id="quiz_validation_msg_wrap"></div>
205
206 </div>
207 </div>
208 </div>
209
210 </div>
211
212 </div>
213
214 </div>
215
216
217 <div class="tutor-quiz-builder-modal-control-btn-group question_form_inner">
218 <div class="quiz-builder-btn-group-left">
219 <a href="javascript:;" class="quiz-modal-tab-navigation-btn quiz-modal-question-save-btn"><?php _e('Save &amp; Continue', 'tutor'); ?></a>
220 </div>
221 <div class="quiz-builder-btn-group-right">
222 <a href="javascript:;" class="quiz-modal-tab-navigation-btn quiz-modal-btn-cancel"><?php _e('Cancel', 'tutor'); ?></a>
223 </div>
224 </div>