Home › Forums › Legacy Support › Support queries › Update Issues › Front end option – No scoring
- This topic has 4 replies, 2 voices, and was last updated 4 years ago by Anshuman Sahu.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
October 19, 2020 at 10:23 pm #319453ART-ProvidersParticipantI want an option 'No scoring' for courses when creating them. If this option is turned on, No score should be set only course will be complete or incomplete. If No scoring is off then it will score and stay as normal. How can this be achieved. Is this possible from backend course creation? Why does all courses have to have course marks which is then forced to be 100 for completion I do not understand thisOctober 21, 2020 at 6:38 am #319771Anshuman SahuKeymasterok this code will add a setting and will hide the score message on finish course please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :
add_filter('wplms_course_metabox','custom_fileds'); function custom_fileds($field1){ $prefix = 'vibe_'; $field1[]=array( // Text Input 'label' => __('Hide scoring','wplms-front-end'), // <label> 'desc'=>__('hide Scoring','wplms-front-end' ),// description 'id' => 'hide_scoring', // field id and name 'type' => 'switch' ,// type of field, 'options' => array( array('value' => 'H', 'label' =>__('Hide','vibe-customtypes')), array('value' => 'S', 'label' =>__('Show','vibe-customtypes')), ), 'std' => 'H' ); return $field1; } add_filter('wplms_course_creation_tabs','add_in_front_end'); function add_in_front_end($settings){ $fields = $settings['course_settings']['fields']; $arr=array(array( 'label' => __('Hide scoring','wplms-front-end'), // <label> 'text'=>__('hide Scoring','wplms-front-end' ),// description 'id' => 'hide_scoring', // field id and name 'type' => 'switch', // type of field 'options' => array( array('value' => 'H', 'label' =>__('Hide','vibe-customtypes')), array('value' => 'S', 'label' =>__('Show','vibe-customtypes')), ), 'std' => 'H' )); array_splice($fields, (count($fields)-1), 0,$arr ); $settings['course_settings']['fields'] = $fields; return $settings; } add_action('bp_get_course_check_course_complete',function($id){ $meta = get_post_meta($id,'hide_scoring',true); if(!empty($meta) && vibe_validate($meta)){ echo '<style>.congrats_message{display:none;}</style>'; } });
October 21, 2020 at 1:15 pm #319887ART-ProvidersParticipantHi Alex Thanks a lot for this. This hides the immediate display once you complete the course. However, the system is still setting marks in activity table as 0 for Scorm course and 100 for normal course. On Dashboard: Articulate course never gets 100% progress because score is always 0 Normal course gets 100% progress because score is 100 Both are set for automatic evaluation. https://snipboard.io/h1Qudv.jpg How can we not set any score at all but complete course progress.October 24, 2020 at 11:21 am #320528ART-ProvidersParticipantI have managed to nest the two codes you have provided so far to create a workaround. For Scorm Courses with Hide, I am setting score to 1 so it can be completed. Just one problem The Switch labels are not showing as display 'Array'https://snipboard.io/Xyx52S.jpg
Edited code: add_action('bp_get_course_check_course_complete',function($id){ $meta = get_post_meta($id,'hide_scoring',true); if(!empty($meta) && vibe_validate($meta)){ echo '<style>.congrats_message{display:none;}</style>'; //adding this to force complete progress by marking score 1 add_filter('wplms_course_student_marks',function($u_marks,$id,$user_id){ $upload_course = get_post_meta($id,'vibe_course_package',true); if(!empty($upload_course )){ if(function_exists('bp_course_update_user_progress')){ bp_course_update_user_progress($user_id,$id,100); } return 1; } return $u_marks; },10,3); } });October 26, 2020 at 3:16 pm #320876Anshuman SahuKeymasterthere is a mistake in above code in adding the settings : here is the updated code :add_filter('wplms_course_metabox','custom_fileds'); function custom_fileds($field1){ $prefix = 'vibe_'; $field1[]=array( // Text Input 'label' => __('Hide scoring','wplms-front-end'), // <label> 'desc'=>__('hide Scoring','wplms-front-end' ),// description 'id' => 'hide_scoring', // field id and name 'type' => 'switch' ,// type of field, 'options' => array('H'=>__('NO','wplms-front-end' ),'S'=>__('YES','wplms-front-end' )), 'std' => 'H' ); return $field1; } add_filter('wplms_course_creation_tabs','add_in_front_end'); function add_in_front_end($settings){ $fields = $settings['course_settings']['fields']; $arr=array(array( 'label' => __('Hide scoring','wplms-front-end'), // <label> 'text'=>__('hide Scoring','wplms-front-end' ),// description 'id' => 'hide_scoring', // field id and name 'type' => 'switch', // type of field 'options' => array('H'=>__('NO','wplms-front-end' ),'S'=>__('YES','wplms-front-end' )), 'std' => 'H' )); array_splice($fields, (count($fields)-1), 0,$arr ); $settings['course_settings']['fields'] = $fields; return $settings; } add_action('bp_get_course_check_course_complete',function($id){ $meta = get_post_meta($id,'hide_scoring',true); if(!empty($meta) && vibe_validate($meta)){ echo '<style>.congrats_message{display:none;}</style>'; } });
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
- The topic ‘Front end option – No scoring’ is closed to new replies.