Included choice_get_participants() function.

This commit is contained in:
stronk7 2003-09-04 22:18:14 +00:00
parent c8c9cb7bb7
commit 8033a70237

View File

@ -119,4 +119,21 @@ function choice_get_choice($choiceid) {
}
}
function choice_get_participants($choiceid) {
//Returns the users with data in one choice
//(users with records in choice_answers, students)
global $CFG;
//Get students
$students = get_records_sql("SELECT DISTINCT u.*
FROM {$CFG->prefix}user u,
{$CFG->prefix}choice_answers c
WHERE c.choice = '$choiceid' and
u.id = c.userid");
//Return students array (it contains an array of unique users)
return ($students);
}
?>