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_answer_edit_form.php
224 lines
| 1 | <?php |
| 2 | if ($question_type === 'open_ended'){ |
| 3 | echo '<p style="color: #ff0000;">No option is necessary for this answer type</p>'; |
| 4 | return ''; |
| 5 | } |
| 6 | |
| 7 | $answer_title = ! empty($old_answer->answer_title) ? $old_answer->answer_title : ''; |
| 8 | $image_id = ! empty($old_answer->image_id) ? $old_answer->image_id : ''; |
| 9 | $answer_view_format = ! empty($old_answer->answer_view_format) ? $old_answer->answer_view_format : ''; |
| 10 | $answer_two_gap_match = ! empty($old_answer->answer_two_gap_match) ? $old_answer->answer_two_gap_match : ''; |
| 11 | ?> |
| 12 | |
| 13 | <div class="tutor-quiz-question-answers-form"> |
| 14 | |
| 15 | <input type="hidden" name="tutor_quiz_answer_id" value="<?php echo $old_answer->answer_id; ?>" /> |
| 16 | |
| 17 | <?php |
| 18 | if ($question_type === 'true_false'){ |
| 19 | //No Need |
| 20 | }elseif($question_type === 'multiple_choice' || $question_type === 'single_choice' || $question_type === 'ordering' ){ |
| 21 | |
| 22 | if ($question_type === 'ordering'){ |
| 23 | echo '<p class="quiz-modal-form-help">Make sure you are saving answer in right sorting in answers lists, student should ordering should match with this answer order.</p>'; |
| 24 | echo '<p class="quiz-modal-form-help">You can re-order it from above answer list.</p>'; |
| 25 | } |
| 26 | ?> |
| 27 | |
| 28 | <div class="tutor-quiz-builder-form-row"> |
| 29 | <label><?php _e('Answer title', 'tutor'); ?></label> |
| 30 | <div class="quiz-modal-field-wrap"> |
| 31 | <input type="text" name="quiz_answer[<?php echo $question_id; ?>][answer_title]" value="<?php echo $answer_title; ?>"> |
| 32 | </div> |
| 33 | </div> |
| 34 | |
| 35 | <div class="tutor-quiz-builder-form-cols-row"> |
| 36 | <div class="quiz-form-field-col"> |
| 37 | <label><?php _e('Upload Image', 'tutor'); ?></label> |
| 38 | <div class="tutor-media-upload-wrap"> |
| 39 | <input type="hidden" name="quiz_answer[<?php echo $question_id; ?>][image_id]" value="<?php echo $image_id; ?>"> |
| 40 | <div class="tutor-media-preview"> |
| 41 | <a href="javascript:;" class="tutor-media-upload-btn"> |
| 42 | <?php |
| 43 | if ($image_id){ |
| 44 | echo '<img src="'.wp_get_attachment_image_url($image_id).'" />'; |
| 45 | }else{ |
| 46 | echo '<i class="tutor-icon-image1"></i>'; |
| 47 | } |
| 48 | ?> |
| 49 | </a> |
| 50 | </div> |
| 51 | <div class="tutor-media-upload-trash-wrap"> |
| 52 | <a href="javascript:;" class="tutor-media-upload-trash">×</a> |
| 53 | </div> |
| 54 | </div> |
| 55 | </div> |
| 56 | |
| 57 | <div class="quiz-form-field-col"> |
| 58 | <label><?php _e('Answer option view format', 'tutor'); ?></label> |
| 59 | <div class="quiz-modal-field-wrap label-inline"> |
| 60 | <label> <input type="radio" name="quiz_answer[<?php echo $question_id; ?>][answer_view_format]" value="text" <?php |
| 61 | echo $answer_view_format ? checked('text', $answer_view_format) : 'checked="checked"' ?>> <?php _e('Only text', 'tutor'); ?> </label> |
| 62 | <label> <input type="radio" name="quiz_answer[<?php echo $question_id; ?>][answer_view_format]" value="image" <?php echo |
| 63 | checked('image', $answer_view_format) ?> > <?php _e('Only Image', 'tutor'); ?> </label> |
| 64 | <label> <input type="radio" name="quiz_answer[<?php echo $question_id; ?>][answer_view_format]" value="text_image" <?php echo checked('text_image', $answer_view_format) ?> > <?php _e('Text & Image both', 'tutor'); ?> </label> |
| 65 | </div> |
| 66 | </div> |
| 67 | </div> |
| 68 | |
| 69 | <?php |
| 70 | }elseif($question_type === 'fill_in_the_blank'){ |
| 71 | ?> |
| 72 | <div class="tutor-quiz-builder-form-cols-row"> |
| 73 | <div class="quiz-form-field-col full-width"> |
| 74 | <label><?php _e('Question Title', 'tutor'); ?></label> |
| 75 | <div class="quiz-modal-field-wrap"> |
| 76 | <input type="text" name="quiz_answer[<?php echo $question_id; ?>][answer_title]" value="<?php echo $answer_title; ?>"> |
| 77 | <p class="quiz-modal-form-help"><?php _e( 'Please make sure that <b>{dash}</b> variable contains in your question title to show dash, You can use multiple variable', 'tutor' ); ?></p> |
| 78 | </div> |
| 79 | </div> |
| 80 | |
| 81 | <div class="quiz-form-field-col full-width"> |
| 82 | <label><?php _e('Gap Answer', 'tutor'); ?></label> |
| 83 | <div class="quiz-modal-field-wrap"> |
| 84 | <input type="text" name="quiz_answer[<?php echo $question_id; ?>][answer_two_gap_match]" value="<?php echo $answer_two_gap_match; ?>"> |
| 85 | <p class="quiz-modal-form-help"><?php _e( 'Separate multiple answer by pipe <b>( | )</b> , 1 answer per variable assigned in question', 'tutor' ); ?></p> |
| 86 | </div> |
| 87 | </div> |
| 88 | </div> |
| 89 | |
| 90 | <?php |
| 91 | }elseif($question_type === 'matching'){ |
| 92 | ?> |
| 93 | |
| 94 | <div class="tutor-quiz-builder-form-cols-row"> |
| 95 | <div class="quiz-form-field-col full-width"> |
| 96 | <label><?php _e('Answer title', 'tutor'); ?></label> |
| 97 | <div class="quiz-modal-field-wrap"> |
| 98 | <input type="text" name="quiz_answer[<?php echo $question_id; ?>][answer_title]" value="<?php echo $answer_title; ?>"> |
| 99 | </div> |
| 100 | </div> |
| 101 | |
| 102 | <div class="quiz-form-field-col full-width"> |
| 103 | <label><?php _e('Matched Answer title', 'tutor'); ?></label> |
| 104 | <div class="quiz-modal-field-wrap"> |
| 105 | <input type="text" name="quiz_answer[<?php echo $question_id; ?>][matched_answer_title]" value="<?php echo $answer_two_gap_match; ?>"> |
| 106 | </div> |
| 107 | </div> |
| 108 | </div> |
| 109 | |
| 110 | <div class="tutor-quiz-builder-form-cols-row"> |
| 111 | <div class="quiz-form-field-col"> |
| 112 | <label><?php _e('Upload Image', 'tutor'); ?></label> |
| 113 | <div class="tutor-media-upload-wrap"> |
| 114 | <input type="hidden" name="quiz_answer[<?php echo $question_id; ?>][image_id]" value="<?php echo $image_id; ?>"> |
| 115 | <div class="tutor-media-preview"> |
| 116 | <a href="javascript:;" class="tutor-media-upload-btn"> |
| 117 | <?php |
| 118 | if ($image_id){ |
| 119 | echo '<img src="'.wp_get_attachment_image_url($image_id).'" />'; |
| 120 | }else{ |
| 121 | echo '<i class="tutor-icon-image1"></i>'; |
| 122 | } |
| 123 | ?> |
| 124 | </a> |
| 125 | </div> |
| 126 | <div class="tutor-media-upload-trash-wrap"> |
| 127 | <a href="javascript:;" class="tutor-media-upload-trash">×</a> |
| 128 | </div> |
| 129 | </div> |
| 130 | </div> |
| 131 | |
| 132 | <div class="quiz-form-field-col"> |
| 133 | <label><?php _e('Answer option view format', 'tutor'); ?></label> |
| 134 | <div class="quiz-modal-field-wrap label-inline"> |
| 135 | <label> <input type="radio" name="quiz_answer[<?php echo $question_id; ?>][answer_view_format]" value="text" <?php |
| 136 | echo $answer_view_format ? checked('text', $answer_view_format) : 'checked="checked"' ?>> <?php _e('Only text', 'tutor'); ?> </label> |
| 137 | <label> <input type="radio" name="quiz_answer[<?php echo $question_id; ?>][answer_view_format]" value="image" <?php echo |
| 138 | checked('image', $answer_view_format) ?> > <?php _e('Only Image', 'tutor'); ?> </label> |
| 139 | <label> <input type="radio" name="quiz_answer[<?php echo $question_id; ?>][answer_view_format]" value="text_image" <?php echo checked('text_image', $answer_view_format) ?> > <?php _e('Text & Image both', 'tutor'); ?> </label> |
| 140 | </div> |
| 141 | </div> |
| 142 | </div> |
| 143 | |
| 144 | <?php |
| 145 | }elseif ($question_type === 'image_matching'){ |
| 146 | ?> |
| 147 | <div class="tutor-quiz-builder-form-cols-row"> |
| 148 | <div class="quiz-form-field-col full-width"> |
| 149 | <div class="quiz-form-field-col"> |
| 150 | <label><?php _e('Upload Image', 'tutor'); ?></label> |
| 151 | <div class="tutor-media-upload-wrap"> |
| 152 | <input type="hidden" name="quiz_answer[<?php echo $question_id; ?>][image_id]" value="<?php echo $image_id; ?>"> |
| 153 | <div class="tutor-media-preview"> |
| 154 | <a href="javascript:;" class="tutor-media-upload-btn"> |
| 155 | <?php |
| 156 | if ($image_id){ |
| 157 | echo '<img src="'.wp_get_attachment_image_url($image_id).'" />'; |
| 158 | }else{ |
| 159 | echo '<i class="tutor-icon-image1"></i>'; |
| 160 | } |
| 161 | ?> |
| 162 | </a> |
| 163 | </div> |
| 164 | <div class="tutor-media-upload-trash-wrap"> |
| 165 | <a href="javascript:;" class="tutor-media-upload-trash">×</a> |
| 166 | </div> |
| 167 | </div> |
| 168 | </div> |
| 169 | </div> |
| 170 | |
| 171 | <div class="quiz-form-field-col full-width"> |
| 172 | <label><?php _e('Image matched text', 'tutor'); ?></label> |
| 173 | <div class="quiz-modal-field-wrap"> |
| 174 | <input type="text" name="quiz_answer[<?php echo $question_id; ?>][answer_title]" value="<?php echo $answer_title; ?>"> |
| 175 | </div> |
| 176 | </div> |
| 177 | |
| 178 | </div> |
| 179 | |
| 180 | <?php |
| 181 | }elseif($question_type === 'image_answering'){ |
| 182 | ?> |
| 183 | <div class="tutor-quiz-builder-form-cols-row"> |
| 184 | <div class="quiz-form-field-col full-width"> |
| 185 | <div class="quiz-form-field-col"> |
| 186 | <label><?php _e('Upload Image', 'tutor'); ?></label> |
| 187 | <div class="tutor-media-upload-wrap"> |
| 188 | <input type="hidden" name="quiz_answer[<?php echo $question_id; ?>][image_id]" value="<?php echo $image_id; ?>"> |
| 189 | <div class="tutor-media-preview"> |
| 190 | <a href="javascript:;" class="tutor-media-upload-btn"> |
| 191 | <?php |
| 192 | if ($image_id){ |
| 193 | echo '<img src="'.wp_get_attachment_image_url($image_id).'" />'; |
| 194 | }else{ |
| 195 | echo '<i class="tutor-icon-image1"></i>'; |
| 196 | } |
| 197 | ?> |
| 198 | </a> |
| 199 | </div> |
| 200 | <div class="tutor-media-upload-trash-wrap"> |
| 201 | <a href="javascript:;" class="tutor-media-upload-trash">×</a> |
| 202 | </div> |
| 203 | </div> |
| 204 | </div> |
| 205 | </div> |
| 206 | |
| 207 | <div class="quiz-form-field-col full-width"> |
| 208 | <label><?php _e('Answer input value', 'tutor'); ?></label> |
| 209 | <div class="quiz-modal-field-wrap"> |
| 210 | <input type="text" name="quiz_answer[<?php echo $question_id; ?>][answer_title]" value="<?php echo $answer_title; ?>"> |
| 211 | <p class="quiz-modal-form-help"><?php _e('Student input text should be matched with this answer, write in <b>Small Caps</b>','tutor'); ?></p> |
| 212 | </div> |
| 213 | </div> |
| 214 | |
| 215 | </div> |
| 216 | <?php |
| 217 | } |
| 218 | ?> |
| 219 | |
| 220 | <div class="tutor-quiz-answers-form-footer tutor-quiz-builder-form-row"> |
| 221 | <button type="button" id="quiz-answer-edit-btn" class="tutor-answer-edit-btn"><i class="tutor-icon-pencil"></i> <?php _e('Update Answer', 'tutor'); ?></button> |
| 222 | </div> |
| 223 | |
| 224 | </div> |