function _quiz_get_quizzes in Quiz 6.5
Same name and namespace in other branches
- 8.6 quiz.module \_quiz_get_quizzes()
- 8.4 quiz.module \_quiz_get_quizzes()
- 8.5 quiz.module \_quiz_get_quizzes()
- 6.6 quiz.module \_quiz_get_quizzes()
- 6.3 quiz.module \_quiz_get_quizzes()
- 6.4 quiz.module \_quiz_get_quizzes()
- 7.6 quiz.module \_quiz_get_quizzes()
- 7 quiz.module \_quiz_get_quizzes()
- 7.4 quiz.module \_quiz_get_quizzes()
- 7.5 quiz.module \_quiz_get_quizzes()
- 6.x quiz.module \_quiz_get_quizzes()
Get a full list of the quizzes.
Parameters
$uid: An optional user ID. If supplied, only quizzes created by that user will be returned.
Return value
A list of all quizzes.
1 call to _quiz_get_quizzes()
- quiz_admin_quizzes in ./
quiz.admin.inc - Displays the quizzes by title with a link to the appropriate results for that specific quiz.
File
- ./
quiz.module, line 2542 - Quiz Module
Code
function _quiz_get_quizzes($uid = 0) {
$results = array();
$args = array();
/* Not sure what the first inner join is supposed to do here. But as a negative
* side effect, it returns duplicates of every quiz that has multiple vids.
$sql = "SELECT n.nid, n.title, u.name, n.created
FROM {node} n
INNER JOIN {quiz_node_properties} qnp
INNER JOIN {users} u
WHERE n.type = 'quiz'
AND n.nid = qnp.nid
AND u.uid = n.uid";
*/
$sql = "SELECT n.nid, n.title, u.name, n.created\n FROM {node} n\n INNER JOIN {users} u\n ON u.uid = n.uid\n WHERE n.type = 'quiz'";
if ($uid != 0) {
$sql .= " AND n.uid = %d";
$args[] = $uid;
}
$sql .= " ORDER BY n.nid DESC";
$dbresult = db_query($sql, $args);
while ($line = db_fetch_array($dbresult)) {
$results[$line['nid']] = $line;
}
return $results;
}