Now retrieving only needed fields!
This commit is contained in:
@@ -368,13 +368,13 @@ function assignment_get_participants($assignmentid) {
|
||||
global $CFG;
|
||||
|
||||
//Get students
|
||||
$students = get_records_sql("SELECT DISTINCT u.*
|
||||
$students = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}assignment_submissions a
|
||||
WHERE a.assignment = '$assignmentid' and
|
||||
u.id = a.userid");
|
||||
//Get teachers
|
||||
$teachers = get_records_sql("SELECT DISTINCT u.*
|
||||
$teachers = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}assignment_submissions a
|
||||
WHERE a.assignment = '$assignmentid' and
|
||||
|
||||
@@ -354,7 +354,7 @@ function attendance_get_participants($attendanceid) {
|
||||
global $CFG;
|
||||
|
||||
//Get students
|
||||
$students = get_records_sql("SELECT DISTINCT u.*
|
||||
$students = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}attendance_roll a
|
||||
WHERE a.dayid = '$attendanceid' and
|
||||
|
||||
+1
-1
@@ -236,7 +236,7 @@ function chat_get_participants($chatid, $groupid=0) {
|
||||
}
|
||||
|
||||
//Get students
|
||||
$students = get_records_sql("SELECT DISTINCT u.*
|
||||
$students = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}chat_messages c
|
||||
WHERE c.chatid = '$chatid' $groupselect
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ function choice_get_participants($choiceid) {
|
||||
global $CFG;
|
||||
|
||||
//Get students
|
||||
$students = get_records_sql("SELECT DISTINCT u.*
|
||||
$students = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}choice_answers c
|
||||
WHERE c.choice = '$choiceid' and
|
||||
|
||||
@@ -61,14 +61,14 @@ function dialogue_get_participants($dialogueid) {
|
||||
global $CFG;
|
||||
|
||||
//Get conversation's creators
|
||||
$creators = get_records_sql("SELECT DISTINCT u.*
|
||||
$creators = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}dialogue_conversations c
|
||||
WHERE c.dialogueid = '$dialogueid' and
|
||||
u.id = c.userid");
|
||||
|
||||
//Get conversation's receivers
|
||||
$receivers = get_records_sql("SELECT DISTINCT u.*
|
||||
$receivers = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}dialogue_conversations c
|
||||
WHERE c.dialogueid = '$dialogueid' and
|
||||
|
||||
@@ -582,13 +582,13 @@ function exercise_get_participants($exerciseid) {
|
||||
global $CFG;
|
||||
|
||||
//Get students from exercise_submissions
|
||||
$st_submissions = get_records_sql("SELECT DISTINCT u.*
|
||||
$st_submissions = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}exercise_submissions s
|
||||
WHERE s.exerciseid = '$exerciseid' and
|
||||
u.id = s.userid");
|
||||
//Get students from exercise_assessments
|
||||
$st_assessments = get_records_sql("SELECT DISTINCT u.*
|
||||
$st_assessments = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}exercise_assessments a
|
||||
WHERE a.exerciseid = '$exerciseid' and
|
||||
|
||||
+3
-3
@@ -883,13 +883,13 @@ function forum_get_participants($forumid) {
|
||||
global $CFG;
|
||||
|
||||
//Get students from forum_subscriptions
|
||||
$st_subscriptions = get_records_sql("SELECT DISTINCT u.*
|
||||
$st_subscriptions = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}forum_subscriptions s
|
||||
WHERE s.forum = '$forumid' and
|
||||
u.id = s.userid");
|
||||
//Get students from forum_posts
|
||||
$st_posts = get_records_sql("SELECT DISTINCT u.*
|
||||
$st_posts = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}forum_discussions d,
|
||||
{$CFG->prefix}forum_posts p
|
||||
@@ -898,7 +898,7 @@ function forum_get_participants($forumid) {
|
||||
u.id = p.userid");
|
||||
|
||||
//Get students from forum_ratings
|
||||
$st_ratings = get_records_sql("SELECT DISTINCT u.*
|
||||
$st_ratings = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}forum_discussions d,
|
||||
{$CFG->prefix}forum_posts p,
|
||||
|
||||
@@ -382,7 +382,7 @@ function glossary_get_participants($glossaryid) {
|
||||
global $CFG;
|
||||
|
||||
//Get students
|
||||
$students = get_records_sql("SELECT DISTINCT u.*
|
||||
$students = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}glossary_entries g
|
||||
WHERE g.glossaryid = '$glossaryid' and
|
||||
|
||||
+2
-2
@@ -273,13 +273,13 @@ function journal_get_participants($journalid) {
|
||||
global $CFG;
|
||||
|
||||
//Get students
|
||||
$students = get_records_sql("SELECT DISTINCT u.*
|
||||
$students = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}journal_entries j
|
||||
WHERE j.journal = '$journalid' and
|
||||
u.id = j.userid");
|
||||
//Get teachers
|
||||
$teachers = get_records_sql("SELECT DISTINCT u.*
|
||||
$teachers = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}journal_entries j
|
||||
WHERE j.journal = '$journalid' and
|
||||
|
||||
+2
-2
@@ -308,7 +308,7 @@ function lesson_get_participants($lessonid) {
|
||||
global $CFG;
|
||||
|
||||
//Get students
|
||||
$students = get_records_sql("SELECT DISTINCT u.*
|
||||
$students = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}lesson_attempts a
|
||||
WHERE a.lessonid = '$lessonid' and
|
||||
@@ -317,4 +317,4 @@ function lesson_get_participants($lessonid) {
|
||||
//Return students array (it contains an array of unique users)
|
||||
return ($students);
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
+1
-1
@@ -266,7 +266,7 @@ function quiz_get_participants($quizid) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
return get_records_sql("SELECT DISTINCT u.*
|
||||
return get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}quiz_attempts a
|
||||
WHERE a.quiz = '$quizid' and
|
||||
|
||||
+2
-2
@@ -183,13 +183,13 @@ function survey_get_participants($surveyid) {
|
||||
global $CFG;
|
||||
|
||||
//Get students from survey_analysis
|
||||
$st_analysis = get_records_sql("SELECT DISTINCT u.*
|
||||
$st_analysis = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}survey_analysis a
|
||||
WHERE a.survey = '$surveyid' and
|
||||
u.id = a.userid");
|
||||
//Get students from survey_answers
|
||||
$st_answers = get_records_sql("SELECT DISTINCT u.*
|
||||
$st_answers = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}survey_answers a
|
||||
WHERE a.survey = '$surveyid' and
|
||||
|
||||
@@ -1032,20 +1032,20 @@ function workshop_get_participants($workshopid) {
|
||||
global $CFG;
|
||||
|
||||
//Get students from workshop_submissions
|
||||
$st_submissions = get_records_sql("SELECT DISTINCT u.*
|
||||
$st_submissions = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}workshop_submissions s
|
||||
WHERE s.workshopid = '$workshopid' and
|
||||
u.id = s.userid");
|
||||
//Get students from workshop_assessments
|
||||
$st_assessments = get_records_sql("SELECT DISTINCT u.*
|
||||
$st_assessments = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}workshop_assessments a
|
||||
WHERE a.workshopid = '$workshopid' and
|
||||
u.id = a.userid");
|
||||
|
||||
//Get students from workshop_comments
|
||||
$st_comments = get_records_sql("SELECT DISTINCT u.*
|
||||
$st_comments = get_records_sql("SELECT DISTINCT u.id, u.id
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}workshop_comments c
|
||||
WHERE c.workshopid = '$workshopid' and
|
||||
|
||||
Reference in New Issue
Block a user