More information: info@elisabeth-carrio.com

Login

Start course

Course manager -> Take this course page
/*
/*=================================================*/
// COURSE STATUS :
// 0 : NOT STARTED
// 1: STARTED
// 2 : SUBMITTED
// > 2 : EVALUATED

// VERSION 1.8.4 NEW COURSE STATUSES
// 1 : START COURSE
// 2 : CONTINUE COURSE
// 3 : FINISH COURSE : COURSE UNDER EVALUATION
// 4 : COURSE EVALUATED

do_action(‘wplms_before_start_course’);

get_header(‘buddypress’);

do_action(‘wplms_start_course’);

$user_id = get_current_user_id();

if(isset($_POST[‘course_id’])){
$course_id=$_POST[‘course_id’];
$coursetaken=get_user_meta($user_id,$course_id,true);
}else if(isset($_COOKIE[‘course’])){
$course_id=$_COOKIE[‘course’];
$coursetaken=1;
}

if(!isset($course_id) || !is_numeric($course_id))
wp_die(__(‘INCORRECT COURSE VALUE. CONTACT ADMIN’,’vibe’));

$course_curriculum=vibe_sanitize(get_post_meta($course_id,’vibe_course_curriculum’,false));
$unit_id = wplms_get_course_unfinished_unit($course_id);

$unit_comments = vibe_get_option(‘unit_comments’);
$class=  »;
if(isset($unit_comments) && is_numeric($unit_comments)){
$class .= ‘enable_comments’;
}

$class= apply_filters(‘wplms_unit_wrap’,$class,$unit_id,$user_id);

if ( have_posts() ) : while ( have_posts() ) : the_post();

?>

jQuery(document).ready(function($){ $(‘.unit_content’).trigger(‘load_comments’); });« ;
}
}else{
echo ‘

‘;
_e(‘Course Curriculum Not Set.’,’vibe’);
echo ‘

‘;
}
}else{
the_content();
if(isset($course_id) && is_numeric($course_id)){
$course_instructions = get_post_meta($course_id,’vibe_course_instructions’,true);
echo apply_filters(‘the_content’,$course_instructions);
}
}

endwhile;
endif;
?>
$curriculum){
if(is_numeric($curriculum)){
$units[]=$curriculum;
}
}
}else{
echo ‘

‘.__(‘Course Curriculum Not Set’,’vibe’).’

‘;
}

if($unit_id == »){
echo ‘

‘.((isset($done_flag) && $done_flag)? »: ‘‘.__(‘Start Course’,’vibe’).’‘).

‘;
}else{

$k = array_search($unit_id,$units);

if(empty($k)) $k = 0;

$next=$k+1;
$prev=$k-1;
$max=count($units)-1;

$done_flag=get_user_meta($user_id,$unit_id,true);

echo ‘

‘;
if($prev >=0){
if(get_post_type($units[$prev]) == ‘quiz’){
$quiz_status = get_user_meta($user_id,$units[$prev],true);
if(!empty($quiz_status))
echo ‘‘.__(‘Previous Quiz’,’vibe’).’‘;
else
echo ‘‘.__(‘Previous Quiz’,’vibe’).’‘;
}else
echo ‘‘.__(‘Previous Unit’,’vibe’).’‘;
}
echo ‘

‘;

echo ‘

‘;
if(!isset($done_flag) || !$done_flag){
if(get_post_type($units[($k)]) == ‘quiz’){

$quiz_status = get_user_meta($user_id,$units[($k)],true);
$quiz_class = apply_filters(‘wplms_in_course_quiz’, »);
if(is_numeric($quiz_status)){
if($quiz_status < time()){ echo '‘.__(‘Check Results’,’vibe’).’‘;
}else{
echo ‘‘.__(‘Continue Quiz’,’vibe’).’‘;
}
}else{
echo ‘‘.__(‘Start Quiz’,’vibe’).’‘;
}
}else{
echo apply_filters(‘wplms_unit_mark_complete’,’‘.__(‘Mark this Unit Complete’,’vibe’).’‘,$unit_id,$course_id);
}
}else{
if(get_post_type($units[($k)]) == ‘quiz’){
$quiz_status = get_user_meta($user_id,$units[($k)],true);
$quiz_class = apply_filters(‘wplms_in_course_quiz’, »);
if(is_numeric($quiz_status)){
if($quiz_status < time()){ echo '‘.__(‘Check Results’,’vibe’).’‘;
}else{
echo ‘‘.__(‘Continue Quiz’,’vibe’).’‘;
}
}else{
echo ‘‘.__(‘Check Results’,’vibe’).’‘;
}
}
// If unit does not show anything
}
echo ‘

‘;

echo ‘

‘;

$nextflag=1;
if($next <= $max){ $nextunit_access = vibe_get_option('nextunit_access'); if(isset($nextunit_access) && $nextunit_access){ for($i=0;$i<$next;$i++){ $status = get_post_meta($units[$i],$user_id,true); if(!empty($status)){ $nextflag=0; break; } } } if($nextflag){ if(get_post_type($units[$next]) == 'quiz'){ $quiz_status = get_user_meta($user_id,$units[$next],true); if(!empty($quiz_status)) echo '‘.__(‘Next Quiz’,’vibe’).’‘;
else
echo ‘‘.__(‘Next Quiz’,’vibe’).’‘;
}else{
if(get_post_type($units[$next]) == ‘unit’){ //Display Next unit link because current unit is a quiz on Page reload
echo ‘‘.__(‘Next Unit’,’vibe’).’‘;
}else{
echo ‘‘.__(‘Next Unit’,’vibe’).’‘;
}
}
}else{
echo ‘‘.__(‘Next Unit’,’vibe’).’‘;
}
}
echo ‘

‘;

} // End the Bug fix on course begining
?>

‘;
?>

  • ‘.bp_core_get_user_displayname( $author_id) .’‘;

    $link = vibe_get_option(‘unit_comments’);
    if(isset($link) && is_numeric($link))
    $link = get_permalink($link);
    else
    $link = ‘#’;
    ?>

  • ‘.__(‘YOU’,’vibe’).’‘;
    ?>

    X
    %d blogueurs aiment cette page :