I have course A and B, student must complete course A and get score more 60, then they can start coures B.How can I do that? thanks
SOLVED
function wplms_before_start_course_status(){
.......
if(is_numeric($precourse)){
$preid=bp_course_get_user_course_status($user_id,$precourse);
if(!empty($preid) && $preid > $pre_course_check_status){
// COURSE STATUSES : Since version 1.8.4
// 1 : START COURSE
// 2 : CONTINUE COURSE
// 3 : FINISH COURSE : COURSE UNDER EVALUATION
// 4 : COURSE EVALUATED
$pre_score = get_post_meta($precourse,$user_id,true);
if($pre_score >= 80){
$cflag=1;
}
}
}else if(is_array($precourse)){
foreach($precourse as $pc){
$preid=bp_course_get_user_course_status($user_id,$pc);
if(!empty($preid) && $preid > $pre_course_check_status){
$pre_score = get_post_meta($pc,$user_id,true);
if($pre_score >= 80){
$cflag=1;
}
}else{
//Break from loop
break;
}
}
}
.......
}
thanks for your solution.
it may help other users too.
closing this topic.