General developer forum

 
 
Picture of nikhil pednekar
course not completed
 

Does anyone knows what will be the exact query for showing list of

user who have not completed the course?

thanks,

Regards,

Nikhil Pednekar

 
Average of ratings: -
Picture of Jitendra Gaur
Re: course not completed
 

Hi Nikhil,

Use this query 

SELECT u.username, c.fullname
FROM {course_completions} cc
JOIN {course} c ON (c.id = cc.course)
JOIN {user} u ON (u.id = cc.userid)
WHERE cc.timecompleted IS NULL
ORDER BY cc.course ASC

Hope this is help you.

Thanks,

Jitendra Gaur

 
Average of ratings: -
Picture of nikhil pednekar
Re: course not completed
 

thanks jitendra,

i have one problem...my {course_completions} is empty...

as this query showing null values...

any solution?

thanks.

 
Average of ratings: -
Picture of Jitendra Gaur
Re: course not completed
 

Hi Nikhil,

From moodle 2.x version course_completions is nessesory  table to log the completed course by the student. so you need to first configure the course completion settings only after that you can get the course completion data.

Take a detail look at course completion of moodle doc - 

http://docs.moodle.org/dev/Course_completion

 
Average of ratings: -
Picture of nikhil pednekar
Re: course not completed
 

hi jitendra,

i tried almost all settings of course completion from completion doc. But still that table is empty.

Could you tell me what will be possible settings of course completion.

Thanks.

 
Average of ratings: -
Picture of Jitendra Gaur
Re: course not completed
 

Hi Nikhil, 

You can do following things - 

Add course_completion block on course page and when student login they can manually complete the course which you need to set in completion tracking setting under the course administration.

Its require to run admin/cron.php to execute the course_completion module.

 
Average of ratings: -