// | lesson_grades
// | (UL, pk->id,fk->lessonid)
// lesson_pages
- // (pk->id,fk->lessonid)
+ // (CL,pk->id,fk->lessonid)
// |
// |
// |
// lesson_answers
- // (pk->id,fk->pageid)
+ // (CL,pk->id,fk->pageid)
// |
// |
// |
//Must return an array of user records (all data) who are participants
//for a given instance of lesson. Must include every user involved
//in the instance, independient of his role (student, teacher, admin...)
-//See other modules as example.
- return false;
+ global $CFG;
+
+ //Get students
+ $students = get_records_sql("SELECT DISTINCT u.*
+ FROM {$CFG->prefix}user u,
+ {$CFG->prefix}lesson_attempts a
+ WHERE a.lessonid = '$lessonid' and
+ u.id = a.userid");
+
+ //Return students array (it contains an array of unique users)
+ return ($students);
}
//////////////////////////////////////////////////////////////////////////////////////
// | lesson_grades
// | (UL, pk->id,fk->lessonid)
// lesson_pages
- // (pk->id,fk->lessonid)
+ // (CL,pk->id,fk->lessonid)
// |
// |
// |
// lesson_answers
- // (pk->id,fk->pageid)
+ // (CL,pk->id,fk->pageid)
// |
// |
// |