tools
4 years ago
add_new_instructor.php
4 years ago
addons.php
4 years ago
announcements.php
4 years ago
answer.php
4 years ago
course-list.php
3 years ago
enable_disable_addons.php
4 years ago
get-pro.php
5 years ago
instructors.php
4 years ago
question_answer.php
4 years ago
quiz_attempts.php
4 years ago
students.php
4 years ago
tools.php
4 years ago
tutor-pro-addons.php
4 years ago
uninstall.php
4 years ago
view_attempt.php
4 years ago
welcome.php
4 years ago
withdraw_requests.php
3 years ago
answer.php
110 lines
| 1 | <?php |
| 2 | use TUTOR\Input; |
| 3 | |
| 4 | $question_id = Input::get( 'question_id', 0, Input::TYPE_INT ); |
| 5 | $question = tutor_utils()->get_qa_question( $question_id ); |
| 6 | ?> |
| 7 | |
| 8 | <div class="wrap"> |
| 9 | <h2><?php _e( 'Answer', 'tutor' ); ?></h2> |
| 10 | |
| 11 | <div class="tutor-qanda-wrap"> |
| 12 | <form action="<?php echo admin_url( 'admin-post.php' ); ?>" id="tutor_admin_answer_form" method="post"> |
| 13 | <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?> |
| 14 | <input type="hidden" value="tutor_place_answer" name="action"/> |
| 15 | <input type="hidden" value="<?php echo esc_attr( $question_id ); ?>" name="question_id"/> |
| 16 | |
| 17 | <div class="tutor-option-field-row"> |
| 18 | <div class="tutor-option-field"> |
| 19 | <?php |
| 20 | $settings = array( |
| 21 | 'teeny' => true, |
| 22 | 'media_buttons' => false, |
| 23 | 'quicktags' => false, |
| 24 | 'editor_height' => 200, |
| 25 | ); |
| 26 | wp_editor( null, 'answer', $settings ); |
| 27 | ?> |
| 28 | |
| 29 | <p class="desc"><?php _e( 'Write an answer here', 'tutor' ); ?></p> |
| 30 | </div> |
| 31 | |
| 32 | <div class="tutor-option-field"> |
| 33 | <button type="submit" name="tutor_answer_submit_btn" class="button button-primary"><?php _e( 'Place answer', 'tutor' ); ?></button> |
| 34 | </div> |
| 35 | </div> |
| 36 | </form> |
| 37 | </div> |
| 38 | |
| 39 | <div class="tutor-admin-individual-question"> |
| 40 | <div class="tutor_original_question tutor-bg-white "> |
| 41 | <div class="question-left"> |
| 42 | <?php |
| 43 | echo tutor_utils()->get_tutor_avatar( $question->user_id ); |
| 44 | ?> |
| 45 | </div> |
| 46 | |
| 47 | <div class="question-right"> |
| 48 | |
| 49 | <div class="question-top-meta"> |
| 50 | <p class="review-meta"> |
| 51 | <?php echo esc_attr( $question->display_name ); ?> - |
| 52 | <span class="tutor-color-muted"> |
| 53 | <?php echo wp_sprintf( __( '%s ago', 'tutor' ), human_time_diff( strtotime( $question->comment_date ) ) ); ?> |
| 54 | </span> |
| 55 | </p> |
| 56 | </div> |
| 57 | |
| 58 | <div class="tutor_question_area"> |
| 59 | <p> |
| 60 | <strong><?php echo stripslashes( esc_attr( $question->question_title ) ); ?> </strong> |
| 61 | |
| 62 | <span class="tutor-color-muted"> |
| 63 | <?php _e( 'on', 'tutor' ); ?> <?php echo esc_attr( $question->post_title ); ?> |
| 64 | </span> |
| 65 | </p> |
| 66 | <?php echo wp_kses_post( wpautop( stripslashes( $question->comment_content ) ) ); ?> |
| 67 | </div> |
| 68 | |
| 69 | </div> |
| 70 | </div> |
| 71 | |
| 72 | <?php |
| 73 | $answers = tutor_utils()->get_qa_answer_by_question( $question_id ); |
| 74 | ?> |
| 75 | |
| 76 | <div class="tutor_admin_answers_list_wrap"> |
| 77 | <?php |
| 78 | if ( is_array( $answers ) && count( $answers ) ) { |
| 79 | foreach ( $answers as $answer ) { |
| 80 | ?> |
| 81 | <div class="tutor_original_question <?php echo $question->user_id == $answer->user_id ? 'tutor-bg-white' : 'tutor-bg-light'; ?>"> |
| 82 | <div class="question-left"> |
| 83 | <?php |
| 84 | echo tutor_utils()->get_tutor_avatar( $answer->user_id ); |
| 85 | ?> |
| 86 | </div> |
| 87 | |
| 88 | <div class="question-right"> |
| 89 | <div class="question-top-meta"> |
| 90 | <p class="review-meta"> |
| 91 | <?php echo esc_attr( $answer->display_name ); ?> - |
| 92 | <span class="tutor-color-muted"> |
| 93 | <?php echo wp_sprintf( __( '%s ago', 'tutor' ), human_time_diff( strtotime( $answer->comment_date ) ) ); ?> |
| 94 | </span> |
| 95 | </p> |
| 96 | </div> |
| 97 | |
| 98 | <div class="tutor_question_area"> |
| 99 | <?php echo wp_kses_post( wpautop( stripslashes( $answer->comment_content ) ) ); ?> |
| 100 | </div> |
| 101 | </div> |
| 102 | </div> |
| 103 | <?php |
| 104 | } |
| 105 | } |
| 106 | ?> |
| 107 | </div> |
| 108 | </div> |
| 109 | </div> |
| 110 |