continue course button incorrect

Home Forums Legacy Support Support queries Other issues continue course button incorrect

Viewing 15 posts - 1 through 15 (of 43 total)
  • Author
    Posts
  • #245765
    MeesterGijs
    Spectator
    Hello, This one is not so hard to explain but hard to show you. For a couple of times now I've had this issue: I've finished some course at meestergijs.nl/cursusaanbod. I want to finish another one, so I pick a course that says: "continue course" (vervolg cursus) instead of start. I'm then brought to the specific course page where the course button says continue course again. But then when I click that green button and actually continue course it shows me that I've actually already done all elements and finished the complete course. I'm then able to click the yellow "see your final score" (naar eindscore) button and I get my certificate. In short: the course button tells me I've started a course but in fact I've already finished it and I should see the final score. Like here. Last time I had this issue was when I finished the courses on one device (desktop) and went back to courses page on another device (iPad). Is it cookies related? Familair issue? Gijs
    #245859
    Veronica
    Moderator
    maybe! try to complete the entire course with the evaluation. after evaluation check, if it's completed or not!  
    #247694
    MeesterGijs
    Spectator
    It is. But when I log in on another device and go to that same course it says: continue course. When it should show the final score. Look at this video. The button says start, not continue. But when I 'start' the course it shows that I've already done a couple of elements. Or could it be because I deleted my membership and then added one again? Also related to these buttons. I just switched users and when I clicked the course button of a course (What Which for example) on the courses page (meestergijs.nl/aanmelden) it didn't send me to the course page (meestergijs.nl/item/what-which), but immediately put me inside the course. I have never seen that! How come? Is that a setting in every course? What did I do? Then when I tried that as an administrator, it didn't work anymore. One minute later, same course..
    #247728
    Anshuman Sahu
    Keymaster
    please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :       add_filter('bp_course_single_item_view','custom_bp_course_single_item_view',999999); function custom_bp_course_single_item_view($x){   global $post;   $course_post_id = $post->ID;   $course_author= $post->post_author;   $course_classes = apply_filters('bp_course_single_item','course_single_item course_id_'.$post->ID.' course_status_'.$post->post_status.' course_author_'.$post->post_author,get_the_ID());   ?>     <li class="<?php echo $course_classes; ?>">     <div class="row">       <div class="col-md-4 col-sm-4">       <div class="item-avatar" data-id="<?php echo get_the_ID(); ?>">         <?php bp_course_avatar(); ?>       </div>     </div>     <div class="col-md-8 col-sm-8">       <div class="item">         <div class="item-title"><?php bp_course_title(); if(get_post_status() != 'publish'){echo '<i> ( '.get_post_status().' ) </i>';} ?></div>         <div class="item-meta"><?php bp_course_meta(); ?></div>         <div class="item-desc"><?php bp_course_desc(); ?></div>         <div class="item-credits">           <?php            if(function_exists('bp_course_is_member') && function_exists('the_course_button') && is_user_logged_in() && bp_course_is_member(get_the_ID(),get_current_user_id())){             the_course_button(get_the_ID());           }else{             bp_course_credits();            }                        ?>         </div>             <?php             $enable_instructor = apply_filters('wplms_display_instructor',true,$post->ID);                       if($enable_instructor){             ?>             <div class="item-instructor">               <?php bp_course_instructor(array('instructor_id'=> $course_author)); ?>             </div>             <?php } ?>             <div class="item-action"><?php bp_course_action() ?></div>             <?php do_action( 'bp_directory_course_item' ); ?>           </div>         </div>       </div>     </li>      <?php     return 1 ; }
    #247773
    MeesterGijs
    Spectator
    Few questions, though. How come I have that issue I've described? And was this code specifically written for me? And also. I've been told numerous that I use too much code. And now I get all of this code. Does this code effect anything else at my website?
    #247986
    Veronica
    Moderator
    hi, this code is checking the status of the course and on the basis of course status it's showing the button there. may be if you implemented some code by which your's this default functionality was not working but when you added this code this will work it's not going to make any impact on other functionalities of the site.
    #249062
    MeesterGijs
    Spectator
    Perfect! And doesn't mind if you're logging in on a different device than the device that you last used to work on a course?
    #249355
    Anshuman Sahu
    Keymaster
    nope it wont.
    #249436
    MeesterGijs
    Spectator
    Doesn't work, I think. I've added the code, resaved permalinks, deleted cache. But when Click the first grammar course, which says START. The course is already completed.. Weird What am I missing?
    #249437
    MeesterGijs
    Spectator
    This reply has been marked as private.
    #249443
    MeesterGijs
    Spectator
    This reply has been marked as private.
    #249654
    Anshuman Sahu
    Keymaster
    Well yes the above provided code will overwrite this code to show the enc score. Please remove the previosuly given code and try this one :   add_filter('bp_course_single_item_view','custom_bp_course_single_item_view',999999);   function custom_bp_course_single_item_view($x){     global $post;     $course_post_id = $post->ID;     $course_author= $post->post_author;     $course_classes = apply_filters('bp_course_single_item','course_single_item course_id_'.$post->ID.' course_status_'.$post->post_status.' course_author_'.$post->post_author,get_the_ID());     ?>       <li class="<?php echo $course_classes; ?>">       <div class="row">         <div class="col-md-4 col-sm-4">         <div class="item-avatar" data-id="<?php echo get_the_ID(); ?>">           <?php bp_course_avatar(); ?>         </div>       </div>       <div class="col-md-8 col-sm-8">         <div class="item">           <div class="item-title"><?php bp_course_title(); if(get_post_status() != 'publish'){echo '<i> ( '.get_post_status().' ) </i>';} ?></div>           <div class="item-meta"><?php bp_course_meta(); ?></div>           <div class="item-desc"><?php bp_course_desc(); ?></div>           <div class="item-credits">             <?php              if(function_exists('bp_course_is_member') && function_exists('the_course_button') && is_user_logged_in() && bp_course_is_member(get_the_ID(),get_current_user_id())){             $check_course= bp_course_get_user_course_status($user_id,$post->ID);             if(!empty($check_course) && $check_course > 3){             $marks = get_post_meta($post->ID,$user_id,true);             if(isset($marks)){             $marks = $marks;             }             echo '<style>             .course_id_'.$post->ID.' .item-credits form:first-child{display:none;}             </style>EINDSCORE : '.$marks.'';             }else{               the_course_button(get_the_ID());             }                          }else{               bp_course_credits();              }                              ?>           </div>               <?php               $enable_instructor = apply_filters('wplms_display_instructor',true,$post->ID);                         if($enable_instructor){               ?>               <div class="item-instructor">                 <?php bp_course_instructor(array('instructor_id'=> $course_author)); ?>               </div>               <?php } ?>               <div class="item-action"><?php bp_course_action() ?></div>               <?php do_action( 'bp_directory_course_item' ); ?>             </div>           </div>         </div>       </li>        <?php       return 1 ;   }  
    #249688
    MeesterGijs
    Spectator
    This new code shows me this: https://imgur.com/a/zPcGNvL. Sorry Any idea what code I should use?
    #249841
    Anshuman Sahu
    Keymaster
    yes you are right this is the correct and tested code :         add_filter('bp_course_single_item_view','custom_bp_course_single_item_view',999999);       function custom_bp_course_single_item_view($x){   global $post;   $course_post_id = $post->ID;   $course_author= $post->post_author;   $course_classes = apply_filters('bp_course_single_item','course_single_item course_id_'.$post->ID.' course_status_'.$post->post_status.' course_author_'.$post->post_author,get_the_ID());   ?>     <li class="<?php echo $course_classes; ?>">                 ">                   </div>                   ( '.get_post_status().' ) ';} ?>                                             if(function_exists('bp_course_is_member') && function_exists('the_course_button') && is_user_logged_in() && bp_course_is_member(get_the_ID(),get_current_user_id())){             $user_id = get_current_user_id();             $check_course= bp_course_get_user_course_status($user_id,$post->ID);             if(!empty($check_course) && $check_course > 3){             $marks = get_post_meta($course_post_id,$user_id,true);             if(isset($marks)){             $marks = $marks;             }             echo '             .course_id_'.$post->ID.' .item-credits form:first-child{display:none;}             EINDSCORE : '.$marks.'';             }else{               the_course_button(get_the_ID());             }           }else{             bp_course_credits();            }           ?>                     <?php             $enable_instructor = apply_filters('wplms_display_instructor',true,$post->ID);                       if($enable_instructor){             ?>                           $course_author)); ?>                         <?php } ?>                         <?php do_action( 'bp_directory_course_item' ); ?>           </div>         </div>       </div>    
  •       <?php     return 1 ;   }
#249983
MeesterGijs
Spectator
This is what I get when I add your latest code: https://imgur.com/a/T0gLuVn Also, when I delete your code again, I get this. It tells that I can start course, but it shows 83% done. But also this, where it tells you to continue, but I haven't started yet... I resaved permalinks, all plugins are up to date. Could it be a third party plugin? Or something else? And... I still have the code that shows this. Should I delete that code for your code? THis is that code:   add_filter('wplms_course_credits','wplms_show_new_course_student_status',9999,2); function wplms_show_new_course_student_status($credits,$course_id){ if(is_user_logged_in() && !is_singular('course')){ $user_id=get_current_user_id(); $check=get_user_meta($user_id,$course_id,true); if(isset($check) && $check){ if($check < time()){ return ''.sprintf(__('EXPIRED %s COURSE','vibe'),'<span class="subs">').'</span>'; }
 $check_course= bp_course_get_user_course_status($user_id,$course_id);
$new_check_course = get_user_meta($user_id,'course_status'.$course_id,true);
if(isset($new_check_course) && is_numeric($new_check_course) && $new_check_course){
switch($check_course){
case 1:
$credits ='<a href="'.get_permalink($course_id).'"><strong>'.sprintf(__('START %s COURSE','vibe'),'<span class="subs">').'</span></strong></a>';
break;
case 2:
$credits ='<a href="'.get_permalink($course_id).'"><strong>'.sprintf(__('CONTINUE %s COURSE','vibe'),'<span class="subs">').'</span></strong></a>';
break;
case 3:
$credits ='<a href="'.get_permalink($course_id).'"><strong>'.sprintf(__('UNDER %s EVALUATION','vibe'),'<span class="subs">').'</span></strong></a>';
break;
case 4:
$marks = get_post_meta($course_id,$user_id,true);
if(isset($marks)){
$marks = $marks;
}

$credits ='<a href="'.get_permalink($course_id).'"><strong>'.sprintf(__('FINISHED %s COURSE','vibe'),'<span class="subs"></span>').$marks.'</strong></a>';
break;
default:

$credits =apply_filters('wplms_course_status_display','<a href="'.get_permalink($course_id).'"><strong>'.sprintf(__('COURSE %s ENABLED','vibe'),'<span class="subs">').'</span></strong></a>',$course_id);
break;
}
}else{
switch($check_course){
case 0:
$credits ='<a href="'.get_permalink($course_id).'"><strong>'.__('START','vibe').'<span class="subs">'.__('COURSE','vibe').'</span></strong></a>';
break;
case 1:
$credits ='<a href="'.get_permalink($course_id).'"><strong>'.__('CONTINUE','vibe').'<span class="subs">'.__('COURSE','vibe').'</span></strong></a>';
break;
case 2:
$credits ='<a href="'.get_permalink($course_id).'"><strong>'.__('UNDER','vibe').'<span class="subs">'.__('EVALUATION','vibe').'</span></strong></a>';
break;
default:
$marks = get_post_meta($course_id,$user_id,true);
if(isset($marks)){
$marks = $marks;
}
$credits ='<a href="'.get_permalink($course_id).'"><strong>'.__('FINISHED','vibe').'<span class="subs">'.__('COURSE','vibe').'</span></strong></a>'.$marks;
break;
}
}
}
} return $credits; }
Viewing 15 posts - 1 through 15 (of 43 total)
  • The topic ‘continue course button incorrect’ is closed to new replies.