if (is_user_logged_in()) { ?> <li id="course-personal"><a href="<?php echo trailingslashit(bp_loggedin_user_domain() . bp_get_course_slug() . BP_COURSE_SLUG); ?> "><?php printf(__('My Courses <span>%s</span>', 'vibe'), bp_course_get_total_course_count_for_user(bp_loggedin_user_id())); ?> </a></li> <?php if (is_user_instructor()) { ?> <li id="course-instructor"><a href="<?php echo trailingslashit(bp_loggedin_user_domain() . bp_get_course_slug() . BP_COURSE_SLUG); ?> "><?php printf(__('Instructing Courses <span>%s</span>', 'vibe'), bp_course_get_instructor_course_count_for_user(bp_loggedin_user_id())); ?> </a></li> <?php } ?> <?php } ?> <?php do_action('bp_course_directory_filter'); ?>
/** * Echo the component's slug * * @package BuddyPress_Course_Component * @since 1.6 */ function bp_course_slug() { echo bp_get_course_slug(); }
<li class="selected" id="course-all"><a href="<?php echo trailingslashit(bp_get_root_domain() . '/' . bp_get_course_root_slug()); ?> "><?php printf(__('All Courses <span>%s</span>', 'vibe'), bp_course_get_total_course_count()); ?> </a></li> <?php if (is_user_logged_in()) { ?> <li id="my-course"><a href="<?php echo trailingslashit(bp_loggedin_user_domain() . bp_get_course_slug() . 'course'); ?> "><?php printf(__('My Courses <span>%s</span>', 'vibe'), bp_course_get_total_course_count_for_user(bp_loggedin_user_id())); ?> </a> </li> <?php } bp_get_options_nav(); ?> <?php do_action('bp_course_directory_filter'); ?>
?> <?php do_action('bp_before_activity_type_tab_course'); ?> <?php if (bp_is_active('course')) { ?> <?php if (bp_course_get_total_course_count_for_user(bp_loggedin_user_id())) { ?> <li id="activity-course"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_course_slug() . '/'; ?> " title="<?php _e('The activity of course I am a member of.', 'vibe'); ?> "><?php printf(__('My Courses <span>%s</span>', 'vibe'), bp_course_get_total_course_count_for_user(bp_loggedin_user_id())); ?> </a></li> <?php } ?> <?php }
function evaluate_quiz($quiz_id, $marks, $user_id, $max) { $activity_id = bp_course_record_activity(array('action' => __('Instructor evaluated Quiz for student ', 'vibe'), 'type' => 'quiz_evaluated', 'content' => sprintf(__('Student %s got %s out of %s in Quiz %s', 'vibe'), bp_core_get_userlink($user_id), $marks, $max, get_the_title($quiz_id)), 'primary_link' => trailingslashit(bp_core_get_user_domain($user_id) . bp_get_course_slug()) . 'course-results/?action=' . $quiz_id, 'item_id' => $quiz_id)); bp_course_record_activity_meta(array('id' => $activity_id, 'meta_key' => 'instructor', 'meta_value' => get_post_field('post_author', $quiz_id))); do_action('badgeos_wplms_evaluate_quiz', $quiz_id, $marks, $user_id); }