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_list.php
94 lines
| 1 | <?php |
| 2 | |
| 3 | use TUTOR\Question_Answers_List; |
| 4 | |
| 5 | if ($question_type === 'open_ended' || $question_type === 'short_answer'){ |
| 6 | echo '<p class="tutor-px-32 tutor-py-16">'. |
| 7 | __('No option is necessary for this answer type', 'tutor'). |
| 8 | '</p>'; |
| 9 | return ''; |
| 10 | } |
| 11 | ?> |
| 12 | |
| 13 | <div id="tutor_quiz_question_answers" data-question-id="<?php echo $question_id; ?>"><?php |
| 14 | $answers = Question_Answers_List::answer_list_by_question( $question_id, $question_type ); |
| 15 | |
| 16 | if (is_array($answers) && count($answers)){ |
| 17 | foreach ($answers as $answer){ |
| 18 | ?> |
| 19 | <div class="tutor-quiz-answer-wrap" data-answer-id="<?php echo $answer->answer_id; ?>"> |
| 20 | <div class="tutor-quiz-answer"> |
| 21 | <span class="tutor-quiz-answer-title"> |
| 22 | <?php |
| 23 | echo stripslashes($answer->answer_title); |
| 24 | |
| 25 | if ($answer->belongs_question_type === 'fill_in_the_blank'){ |
| 26 | echo ' ('.__('Answer', 'tutor').' : '; |
| 27 | echo '<strong>'.stripslashes($answer->answer_two_gap_match).'</strong>)'; |
| 28 | } |
| 29 | |
| 30 | if ($answer->belongs_question_type === 'matching'){ |
| 31 | echo ' - '.stripslashes($answer->answer_two_gap_match); |
| 32 | } |
| 33 | ?> |
| 34 | </span> |
| 35 | |
| 36 | <?php |
| 37 | // Show image for the single answer |
| 38 | if ($answer->image_id){ |
| 39 | echo '<span class="tutor-question-answer-image"> |
| 40 | <img src="'.wp_get_attachment_image_url($answer->image_id).'" /> |
| 41 | </span>'; |
| 42 | } |
| 43 | |
| 44 | if ($question_type === 'true_false' || $question_type === 'single_choice') |
| 45 | { |
| 46 | ?> |
| 47 | <span class="tutor-quiz-answers-mark-correct-wrap tutor-mr-4"> |
| 48 | <input type="radio" name="mark_as_correct[<?php echo $answer->belongs_question_id; ?>]" value="<?php echo $answer->answer_id; ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" <?php checked(1, $answer->is_correct); ?> > |
| 49 | </span> |
| 50 | <?php |
| 51 | } elseif ($question_type === 'multiple_choice'){ |
| 52 | ?> |
| 53 | <span class="tutor-quiz-answers-mark-correct-wrap tutor-mr-4"> |
| 54 | <input type="checkbox" name="mark_as_correct[<?php echo $answer->belongs_question_id; ?>]" value="<?php echo $answer->answer_id; ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" <?php checked(1, $answer->is_correct); ?> > |
| 55 | </span> |
| 56 | <?php |
| 57 | } |
| 58 | ?> |
| 59 | |
| 60 | <?php if ( $question_type !== 'true_false' ): ?> |
| 61 | <span class="tutor-quiz-answer-edit tutor-mr-4"> |
| 62 | <a class="tutor-iconic-btn" href="javascript:;"> |
| 63 | <i class="tutor-icon-pencil" area-hidden="true"></i> |
| 64 | </a> |
| 65 | </span> |
| 66 | <?php endif; ?> |
| 67 | |
| 68 | <?php if($question_type !== 'fill_in_the_blank'): ?> |
| 69 | <span class="tutor-quiz-answer-sort-icon"> |
| 70 | <i class="tutor-d-flex tutor-icon-hamburger-o"></i> |
| 71 | </span> |
| 72 | <?php endif; ?> |
| 73 | </div> |
| 74 | |
| 75 | <?php if ( $question_type !== 'true_false' && $question_type !== 'fill_in_the_blank' ): ?> |
| 76 | <div class="tutor-quiz-answer-trash-wrap tutor-d-flex"> |
| 77 | <a href="javascript:;" class="answer-trash-btn answer-trash-btn tutor-d-flex tutor-align-center" data-answer-id="<?php echo $answer->answer_id; ?>"> |
| 78 | <i class="tutor-icon-trash-can"></i> |
| 79 | </a> |
| 80 | </div> |
| 81 | <?php endif; ?> |
| 82 | </div> |
| 83 | <?php |
| 84 | } |
| 85 | } |
| 86 | ?> |
| 87 | </div> |
| 88 | |
| 89 | <?php if($question_type!='true_false' && ($question_type!='fill_in_the_blank' || empty($answers))): ?> |
| 90 | <a href="javascript:;" class="add_question_answers_option tutor-d-flex tutor-align-center" data-question-id="<?php echo $question_id; ?>"> |
| 91 | <i class="tutor-icon-plus-o "></i> |
| 92 | <?php _e('Add An Option', 'tutor'); ?> |
| 93 | </a> |
| 94 | <?php endif; ?> |