<?php get_header(); the_post(); ThemexLesson::refresh($post->ID, true); ThemexCourse::refresh(ThemexLesson::$data['course'], true); $layout = ThemexCore::getOption('lessons_layout', 'right'); if ($layout == 'left') { ?> <aside class="sidebar column fourcol"> <?php get_sidebar('lesson'); ?> </aside> <div class="column eightcol last"> <?php } else { ?> <div class="column eightcol lesson-content"> <?php } ?> <?php if (ThemexLesson::$data['prerequisite']['progress'] == 0 && ThemexLesson::$data['status'] != 'free' && ThemexCore::checkOption('lesson_hide') && !ThemexCourse::isAuthor()) { printf(__('Complete "%s" lesson before taking this lesson.', 'academy'), '<a href="' . get_permalink(ThemexLesson::$data['prerequisite']['ID']) . '">' . get_the_title(ThemexLesson::$data['prerequisite']['ID']) . '</a>'); } else { the_content(); comments_template('/questions.php'); } ?> </div>
<?php $questions = ThemexLesson::hasQuestions($post->ID); if ($questions || comments_open()) { ?> <div class="questions clearfix" id="comments"> <h1><?php _e('Questions', 'academy'); ?> </h1> <?php if ($questions) { ?> <div class="questions-listing toggles-wrap"> <ul> <?php wp_list_comments(array('per_page' => -1, 'avatar_size' => 75, 'type' => 'comment', 'callback' => array('ThemexLesson', 'renderQuestion'))); ?> </ul> </div> <?php } ?> <?php if (comments_open() && (ThemexCourse::isMember() || ThemexCourse::isAuthor())) { ?> <div class="question-form eightcol column last"> <?php comment_form(); ?> </div>
/** * Refreshes module data * * @access public * @return void */ public static function refresh($ID = 0, $extended = false) { if (!isset(self::$data['ID']) || $ID != self::$data['ID'] || $extended && !self::$data['extended']) { self::$data = self::getLesson($ID, $extended); } }
?> </h4> </div> <div class="widget-content"> <ul class="styled-list style-3"> <?php foreach (ThemexCourse::$data['lessons'] as $lesson) { ?> <li class="<?php if ($lesson->post_parent != 0) { ?> child<?php } ?> <?php if (ThemexLesson::getProgress($lesson->ID) == 100) { ?> completed<?php } ?> <?php if ($lesson->ID == ThemexLesson::$data['ID']) { ?> current<?php } ?> "> <a href="<?php echo get_permalink($lesson->ID); ?> "><?php
<div class="quiz-question <?php echo $question['type']; ?> "> <div class="question-title"> <div class="question-number"><?php echo $counter; ?> </div> <h4 class="nomargin"><?php echo do_shortcode(themex_stripslashes($question['title'])); ?> </h4> </div> <?php ThemexLesson::renderAnswers($key, $question); ?> </div> <?php } ?> <input type="hidden" name="course_action" value="complete_course" /> <input type="hidden" name="lesson_action" value="complete_quiz" /> <input type="hidden" name="course_id" value="<?php echo ThemexCourse::$data['ID']; ?> " /> <input type="hidden" name="lesson_id" value="<?php echo ThemexLesson::$data['ID']; ?> " />
<?php ThemexLesson::refresh($GLOBALS['lesson']->ID); ?> <div class="lesson-item <?php if ($GLOBALS['lesson']->post_parent != 0) { ?> toggle-<?php echo $GLOBALS['lesson']->post_parent; ?> lesson-child<?php } ?> <?php if (ThemexCourse::isMember() && ThemexLesson::$data['progress'] != 0) { ?> completed<?php } ?> "> <div class="lesson-title"> <?php if (ThemexCore::checkOption('lesson_collapse') && ($GLOBALS['lesson']->post_parent != 0 || isset(ThemexCourse::$data['lessons'][$GLOBALS['index'] + 1]) && ThemexCourse::$data['lessons'][$GLOBALS['index'] + 1]->post_parent !== 0)) { ?> <div class="lesson-toggle toggle-element" data-class="toggle-<?php echo $GLOBALS['lesson']->ID; ?> "></div> <?php } ?>