Front end option – No scoring

Home Forums Legacy Support Support queries Update Issues Front end option – No scoring

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #319453
    ART-Providers
    Participant
    I 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 this
    #319771
    Anshuman Sahu
    Keymaster
    ok 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>';
        }
    });
    #319887
    ART-Providers
    Participant
    Hi 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.
    #320528
    ART-Providers
    Participant
    I 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); } });
    #320876
    Anshuman Sahu
    Keymaster
    there 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>';
        }
    });
    
    
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Front end option – No scoring’ is closed to new replies.