]> git.mjollnir.org Git - moodle.git/commitdiff
MOved quiz_get_participants from the bottom to the standard functions area
authormoodler <moodler>
Sun, 28 Sep 2003 14:57:16 +0000 (14:57 +0000)
committermoodler <moodler>
Sun, 28 Sep 2003 14:57:16 +0000 (14:57 +0000)
mod/quiz/lib.php

index c6dc4a4cd46bf24f78e46eb8d5172a4be58dfed3..d4765f0413f77f955c40bccfc9095d36f2d6a6c7 100644 (file)
@@ -220,6 +220,18 @@ function quiz_grades($quizid) {
     return $return;
 }
 
+function quiz_get_participants($quizid) {
+/// Returns an array of users who have data in a given quiz
+/// (users with records in quiz_attempts, students)
+
+    global $CFG;
+
+    return get_records_sql("SELECT DISTINCT u.*
+                            FROM {$CFG->prefix}user u,
+                                 {$CFG->prefix}quiz_attempts a
+                            WHERE a.quiz = '$quizid' and  
+                                  u.id = a.userid");
+}
 
 /// SQL FUNCTIONS ////////////////////////////////////////////////////////////////////
 
@@ -2406,21 +2418,5 @@ $oldalternativeids);
     return $answers;       
 }
 
-function quiz_get_participants($quizid) {
-//Returns the users with data in one quiz
-//(users with records in quiz_attempts, students)
-
-    global $CFG;
-
-    //Get students
-    $students = get_records_sql("SELECT DISTINCT u.*
-                                 FROM {$CFG->prefix}user u,
-                                      {$CFG->prefix}quiz_attempts a
-                                 WHERE a.quiz = '$quizid' and  
-                                       u.id = a.userid");
-
-    //Return students array (it contains an array of unique users)
-    return ($students);
-}
 
 ?>