Home › Forums › Legacy Support › Support queries › Setup issues › Download Stats in Instructing Courses
Tagged: Download Stats
- This topic has 1 reply, 2 voices, and was last updated 8 years, 10 months ago by Anshuman Sahu.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
January 27, 2016 at 5:30 pm #21816infoutilSpectatorCongrats for the excellent job you'r doing with this LMS. It's wonderful using it and managing it as well. I have some extra-needs that would need review. I am managing this LMS for multiple users and I have to be able to offer periodic stats. My stats have to be compliant with my users necessities. So, beside the elements that the platform already offers I need to implement some extra user profile fields. I already used recommendations from the knowledge section and managed to insert a single user profile field. I still need more options. This is what I used:
<?php if(!class_exists('WPLMS_Customizer_Plugin_Class')) { class WPLMS_Customizer_Plugin_Class // We'll use this just to avoid function name conflicts { public function __construct(){ remove_filter('check_comment_flood', 'check_comment_flood_db'); add_filter('comment_flood_filter', '__return_false'); add_filter('wplms_course_stats_list',array($this,'add_custom_course_stat')); add_action('wplms_course_stats_process',array($this,'process_custom_course_stat'),10,6); } // END public function __construct public function activate(){ // ADD Custom Code which you want to run when the plugin is activated } public function deactivate(){ // ADD Custom Code which you want to run when the plugin is de-activated //Arata Numele Complet } function add_custom_course_stat($list){ $list['user_field']= 'Numele Complet'; return $list; } function process_custom_course_stat(&$csv_title, &$csv,&$i,&$course_id,&$user_id,&$field){ if($field != 'user_field') // Ensures the field was checked. return; $title=__('Numele Complet','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = 'Numele Complet'; if(bp_is_active('xprofile')) $field_val= bp_get_profile_field_data( 'field='.$ifield.'&user_id=' .$user_id ); if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; } // ADD custom Code in clas } // END class WPLMS_Customizer_Class } // END if(!class_exists('WPLMS_Customizer_Class')) ?>
Beside the fields named "Numele Complet" the fields that I have to insert are: "Cod Numeric Personal", "Serie Certificat Membru" and "Tel. Mobil". Thank You for your supportFebruary 2, 2016 at 1:47 pm #24446Anshuman SahuKeymasterI have updated the tiip for the course stats please refer it again : https://wplms.io/support/knowledge-base/add-custom-user-field-in-download-course-stats/ -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- The topic ‘Download Stats in Instructing Courses’ is closed to new replies.