quiz
7 years ago
announcements-metabox.php
7 years ago
course-add-product-metabox.php
7 years ago
course-additional-data.php
7 years ago
course-attachments-metabox.php
7 years ago
course-contents.php
7 years ago
course-topics.php
7 years ago
instructors-metabox.php
7 years ago
lesson-attachments-metabox.php
7 years ago
lesson-metabox.php
7 years ago
quiz_questions.php
7 years ago
quizzes.php
7 years ago
user-profile-fields.php
7 years ago
video-metabox.php
7 years ago
course-contents.php
227 lines
| 1 | <div class="course-contents"> |
| 2 | <?php |
| 3 | if (empty($current_topic_id)){ |
| 4 | $current_topic_id = (int) tutor_utils()->avalue_dot('current_topic_id', $_POST); |
| 5 | } |
| 6 | |
| 7 | $query_lesson = tutor_utils()->get_lesson($course_id, -1); |
| 8 | $query_topics = tutor_utils()->get_topics($course_id); |
| 9 | $attached_lesson_ids = array(); |
| 10 | |
| 11 | if ( ! count($query_topics->posts)){ |
| 12 | echo '<p class="course-empty-content">'.__('Add a topics to build this course', 'tutor').'</p>'; |
| 13 | } |
| 14 | |
| 15 | foreach ($query_topics->posts as $topic){ |
| 16 | ?> |
| 17 | <div id="tutor-topics-<?php echo $topic->ID; ?>" class="tutor-topics-wrap"> |
| 18 | |
| 19 | <div class="tutor-topics-top"> |
| 20 | <h4 class="tutor-topic-title"> |
| 21 | <i class="tutor-icon-move course-move-handle"></i> |
| 22 | <span class="topic-inner-title"><?php echo $topic->post_title; ?></span> |
| 23 | |
| 24 | <span class="tutor-topic-inline-edit-btn"> |
| 25 | <i class="tutor-icon-pencil topic-edit-icon"></i> |
| 26 | </span> |
| 27 | <span class="topic-delete-btn"> |
| 28 | <a href="<?php echo wp_nonce_url(admin_url('admin.php?action=tutor_delete_topic&topic_id='.$topic->ID), tutor()->nonce_action, tutor()->nonce); ?>" title="<?php _e('Delete Topic', 'tutor'); ?>" data-topic-id="<?php echo $topic->ID; ?>"> |
| 29 | <i class="tutor-icon-garbage"></i> |
| 30 | </a> |
| 31 | </span> |
| 32 | |
| 33 | <span class="expand-collapse-wrap"> |
| 34 | <a href="javascript:;"><i class="tutor-icon-light-down"></i> </a> |
| 35 | </span> |
| 36 | </h4> |
| 37 | |
| 38 | <div class="tutor-topics-edit-form" style="display: none;"> |
| 39 | <div class="tutor-option-field-row"> |
| 40 | <div class="tutor-option-field-label"> |
| 41 | <label for=""><?php _e('Topic Name', 'tutor'); ?></label> |
| 42 | </div> |
| 43 | <div class="tutor-option-field"> |
| 44 | <input type="text" name="topic_title" class="course-edit-topic-title-input" value="<?php echo $topic->post_title; ?>"> |
| 45 | |
| 46 | <p class="desc"> |
| 47 | <?php _e('Topic title will be publicly show where required, you can call it as a section also in course', 'tutor'); ?> |
| 48 | </p> |
| 49 | </div> |
| 50 | </div> |
| 51 | |
| 52 | <div class="tutor-option-field-row"> |
| 53 | <div class="tutor-option-field-label"> |
| 54 | <label for=""><?php _e('Topic Summery', 'tutor'); ?></label> |
| 55 | </div> |
| 56 | <div class="tutor-option-field"> |
| 57 | <textarea name="topic_summery"><?php echo $topic->post_content; ?></textarea> |
| 58 | <p class="desc"> |
| 59 | <?php _e('The idea of a summary is a short text to prepare students for the activities within the topic or week. The text is shown on the course page under the topic name.', 'tutor'); ?> |
| 60 | </p> |
| 61 | |
| 62 | <button type="button" class="button button-primary tutor-topics-edit-button"><i class="tutor-icon-pencil"></i> <?php _e('Edit Topic', 'tutor'); ?></button> |
| 63 | </div> |
| 64 | </div> |
| 65 | </div> |
| 66 | </div> |
| 67 | |
| 68 | <div class="tutor-topics-body" style="display: <?php echo $current_topic_id == $topic->ID ? 'block' : 'none'; ?>;"> |
| 69 | |
| 70 | <div class="tutor-lessons"> |
| 71 | <?php |
| 72 | $lessons = tutor_utils()->get_course_contents_by_topic($topic->ID, -1); |
| 73 | foreach ($lessons->posts as $lesson){ |
| 74 | $attached_lesson_ids[] = $lesson->ID; |
| 75 | |
| 76 | if ($lesson->post_type === 'tutor_quiz'){ |
| 77 | $quiz = $lesson; |
| 78 | ?> |
| 79 | <div id="tutor-quiz-<?php echo $quiz->ID; ?>" class="course-content-item tutor-quiz tutor-quiz-<?php echo $topic->ID; ?>"> |
| 80 | <div class="tutor-lesson-top"> |
| 81 | <i class="tutor-icon-move"></i> |
| 82 | <a href="javascript:;" class="open-tutor-quiz-modal" data-quiz-id="<?php echo $quiz->ID; ?>" data-topic-id="<?php echo $topic->ID; ?>"> |
| 83 | <i class=" tutor-icon-doubt"></i>[QUIZ] <?php echo $quiz->post_title; ?> |
| 84 | </a> |
| 85 | <a href="javascript:;" class="tutor-delete-quiz-btn" data-quiz-id="<?php echo $quiz->ID; ?>"><i class="tutor-icon-garbage"></i></a> |
| 86 | </div> |
| 87 | </div> |
| 88 | |
| 89 | <?php |
| 90 | }else { |
| 91 | ?> |
| 92 | <div id="tutor-lesson-<?php echo $lesson->ID; ?>" class="course-content-item tutor-lesson tutor-lesson-<?php echo |
| 93 | $lesson->ID; ?>"> |
| 94 | <div class="tutor-lesson-top"> |
| 95 | <i class="tutor-icon-move"></i> |
| 96 | <a href="javascript:;" class="open-tutor-lesson-modal" data-lesson-id="<?php echo $lesson->ID; ?>" data-topic-id="<?php echo $topic->ID; ?>"><?php echo $lesson->post_title; ?> </a> |
| 97 | <!-- |
| 98 | <a href="<?php /*echo admin_url( "post.php?post={$lesson->ID}&action=edit" ); */?>"><i class="tutor-icon-pencil"></i> |
| 99 | </a>--> |
| 100 | |
| 101 | <a href="javascript:;" class="tutor-delete-lesson-btn" data-lesson-id="<?php echo $lesson->ID; ?>"><i class="tutor-icon-garbage"></i></a> |
| 102 | </div> |
| 103 | </div> |
| 104 | <?php |
| 105 | } |
| 106 | } |
| 107 | ?> |
| 108 | |
| 109 | |
| 110 | <?php |
| 111 | /* |
| 112 | if (count($query_lesson->posts) > count($attached_lesson_ids)){ |
| 113 | |
| 114 | |
| 115 | ?> |
| 116 | <div class="drop-lessons"> |
| 117 | <p> |
| 118 | <i class="dashicons dashicons-upload"></i> |
| 119 | <?php echo __('Drop lesson here or', 'tutor'); ?> |
| 120 | |
| 121 | <a href="javascript:;" class="create-lesson-in-topic-btn open-tutor-lesson-modal" data-topic-id="<?php echo $topic->ID; ?>" data-lesson-id="0" ><?php _e('Create one'); ?></a> |
| 122 | </p> |
| 123 | </div> |
| 124 | <?php }else{ |
| 125 | ?> |
| 126 | <div class="create-new-lesson-wrap"> |
| 127 | <a href="javascript:;" class="create-lesson-in-topic-btn open-tutor-lesson-modal" data-topic-id="<?php echo $topic->ID; ?>" data-lesson-id="0" ><?php _e('Create new lesson', 'tutor'); ?></a> |
| 128 | </div> |
| 129 | <?php |
| 130 | } |
| 131 | */ ?> |
| 132 | |
| 133 | <!-- |
| 134 | <div class="tutor-create-new-lesson-form" style="display: none;" data-topic-id="<?php /*echo $topic->ID; */?>"> |
| 135 | <div class="tutor-option-field-row"> |
| 136 | <div class="tutor-option-field"> |
| 137 | <input type="text" name="lesson_title" value="" placeholder="<?php /*_e('Lesson title', 'tutor'); */?>"> |
| 138 | |
| 139 | <button type="button" class="button button-primary tutor-create-lesson-btn"> <?php /*_e('Create Lesson', 'tutor'); */?></button> |
| 140 | </div> |
| 141 | </div> |
| 142 | </div> |
| 143 | --> |
| 144 | |
| 145 | </div> |
| 146 | |
| 147 | <div class="tutor_add_quiz_wrap" data-add-quiz-under="<?php echo $topic->ID; ?>"> |
| 148 | |
| 149 | <!-- |
| 150 | <div class="tutor-available-quizzes"> |
| 151 | <?php |
| 152 | /* $attached_quizzes = tutor_utils()->get_attached_quiz($topic->ID); |
| 153 | if ($attached_quizzes){ |
| 154 | foreach ($attached_quizzes as $attached_quiz){ |
| 155 | */?> |
| 156 | <div id="added-quiz-id-<?php /*echo $attached_quiz->ID; */?>" class="added-quiz-item added-quiz-item-<?php /*echo $attached_quiz->ID; */?>" data-quiz-id="<?php /*echo $attached_quiz->ID; */?>"> |
| 157 | <span class="quiz-icon"><i class="dashicons dashicons-clock"></i></span> |
| 158 | <span class="quiz-name"> |
| 159 | <?php /*edit_post_link( $attached_quiz->post_title, null, null, $attached_quiz->ID ); */?> |
| 160 | </span> |
| 161 | <span class="quiz-control"> |
| 162 | <a href="javascript:;" class="tutor-quiz-delete-btn"><i class="tutor-icon-garbage"></i></a> |
| 163 | </span> |
| 164 | </div> |
| 165 | <?php |
| 166 | /* } |
| 167 | } |
| 168 | */?> |
| 169 | </div> |
| 170 | --> |
| 171 | |
| 172 | <div class="tutor-add-quiz-button-wrap"> |
| 173 | <a href="javascript:;" class="create-lesson-in-topic-btn open-tutor-lesson-modal" data-topic-id="<?php echo $topic->ID; ?>" data-lesson-id="0" ><?php _e('Add new lesson', 'tutor'); ?></a> |
| 174 | |
| 175 | <button type="button" class="tutor-add-quiz-btn"> <?php _e('Add Topic Quiz', 'tutor'); ?> </button> |
| 176 | </div> |
| 177 | |
| 178 | </div> |
| 179 | |
| 180 | </div> |
| 181 | |
| 182 | |
| 183 | </div> |
| 184 | <?php |
| 185 | } |
| 186 | ?> |
| 187 | <input type="hidden" id="tutor_topics_lessons_sorting" name="tutor_topics_lessons_sorting" value="" /> |
| 188 | </div> |
| 189 | |
| 190 | |
| 191 | <?php if (count($query_lesson->posts)) { |
| 192 | if ( count( $query_lesson->posts ) > count( $attached_lesson_ids ) ) { |
| 193 | ?> |
| 194 | <div class="tutor-untopics-lessons"> |
| 195 | <h3><?php _e( 'Un-assigned lessons' ); ?></h3> |
| 196 | |
| 197 | <div class="tutor-lessons"> |
| 198 | <!--<div class="drop-lessons" > |
| 199 | <p><i class="dashicons dashicons-upload"></i> <?php /*_e('Drop any unassigned lesson here', 'tutor'); */ |
| 200 | ?></p> |
| 201 | </div>--> |
| 202 | <?php |
| 203 | foreach ( $query_lesson->posts as $lesson ) { |
| 204 | if ( ! in_array( $lesson->ID, $attached_lesson_ids ) ) { |
| 205 | ?> |
| 206 | <div id="tutor-lesson-<?php echo $lesson->ID; ?>" class="tutor-lesson tutor-lesson-<?php echo $lesson->ID; ?>"> |
| 207 | |
| 208 | <div class="tutor-lesson-top"> |
| 209 | <i class="tutor-icon-move"></i> |
| 210 | <a href="javascript:;" class="open-tutor-lesson-modal" data-lesson-id="<?php echo $lesson->ID; ?>"><?php echo $lesson->post_title; ?> </a> |
| 211 | |
| 212 | <a href="<?php echo admin_url("post.php?post={$lesson->ID}&action=edit"); ?>"><i class="tutor-icon-pencil"></i> </a> |
| 213 | |
| 214 | <a href="javascript:;" class="tutor-delete-lesson-btn" data-lesson-id="<?php echo $lesson->ID; ?>"><i class="tutor-icon-garbage"></i></a> |
| 215 | </div> |
| 216 | |
| 217 | </div> |
| 218 | <?php |
| 219 | } |
| 220 | } |
| 221 | ?> |
| 222 | </div> |
| 223 | </div> |
| 224 | <?php } |
| 225 | } |
| 226 | ?> |
| 227 |