Home › Forums › Legacy Support › Support queries › Setup issues › how to include a user email ID row while downloading stats under a course
- This topic has 10 replies, 4 voices, and was last updated 4 years, 2 months ago by Diana.
Viewing 11 posts - 1 through 11 (of 11 total)
-
AuthorPosts
-
September 3, 2020 at 8:28 am #300390KARVYFINTECHParticipantWhen we want download the starts there are check boxes for Date (Joining), Date (Finish), ID, Student Name, Units Status, Quiz scores, Badge, Certificate, Certificate Code, Course Progress, Course Marks, Assignment scores We want to add user email id also as row, so that we can easily filter a user with email id. (as user email is unique for every user)September 4, 2020 at 12:40 pm #300811JacksonBlockedHello, But there is no need for user email, id also would be unique when you download a csv file , Thanks,September 8, 2020 at 4:15 am #301549KARVYFINTECHParticipantThis reply has been marked as private.September 9, 2020 at 10:10 am #301989JacksonBlockedHello, yes, You can replace id, First download csv file and you can edit same csv after insert your own id , You can import the csv file, Thanks,September 11, 2020 at 10:19 am #305052KARVYFINTECHParticipantThis reply has been marked as private.September 12, 2020 at 12:38 pm #309907Anshuman SahuKeymasterplease try adding this given code in your wplms-customizer.php file in wplms customizer plugin :
add_filter('wplms_course_stats_list','add_custom_course_stat'); add_action('wplms_course_stats_process','process_custom_course_stat',10,6); function add_custom_course_stat($list){ $list['user_email']= 'Email'; return $list; } function process_custom_course_stat(&$csv_title, &$csv,&$i,&$course_id,&$user_id,&$field){ if($field != 'user_email') // Ensures the field was checked. return; $title=__('Email','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = 'Email'; $user = get_user_by('id',$user_id); $field_val=$user->user_email; if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; }
September 15, 2020 at 10:15 am #310964KARVYFINTECHParticipantThis reply has been marked as private.September 16, 2020 at 8:21 am #311282KARVYFINTECHParticipantThis reply has been marked as private.September 17, 2020 at 3:04 pm #311777Anshuman SahuKeymasterWell in course the total marks always be 100 and marks will be actually the percentage out of 100 . remove above code and add this code to have email at first place:add_filter('wplms_course_stats_list','add_custom_course_stat'); add_action('wplms_course_stats_process','process_custom_course_stat',10,6); function add_custom_course_stat($list){ array_splice($list, 0,0,array('email'=>'Email')); return $list; } function process_custom_course_stat(&$csv_title, &$csv,&$i,&$course_id,&$user_id,&$field){ if($field != 'user_email') // Ensures the field was checked. return; $title=__('Email','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = 'Email'; $user = get_user_by('id',$user_id); $field_val=$user->user_email; if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; }
September 18, 2020 at 11:44 am #311998KARVYFINTECHParticipantThis reply has been marked as private.September 19, 2020 at 12:59 pm #312342DianaParticipantNo sir, then the query will be so long -
AuthorPosts
Viewing 11 posts - 1 through 11 (of 11 total)
- The topic ‘how to include a user email ID row while downloading stats under a course’ is closed to new replies.