function quiz_get_user_results in Quiz 5
Same name and namespace in other branches
- 8.4 quiz.pages.inc \quiz_get_user_results()
- 5.2 quiz.module \quiz_get_user_results()
- 6.6 quiz.pages.inc \quiz_get_user_results()
- 6.2 quiz.pages.inc \quiz_get_user_results()
- 6.3 quiz.pages.inc \quiz_get_user_results()
- 6.4 quiz.pages.inc \quiz_get_user_results()
- 6.5 quiz.pages.inc \quiz_get_user_results()
- 7 quiz.pages.inc \quiz_get_user_results()
- 7.4 quiz.pages.inc \quiz_get_user_results()
Displays all the quizs the user has taken part in
Return value
HTML output for page
1 string reference to 'quiz_get_user_results'
- quiz_menu in ./
quiz.module - Implementation of hook_menu().
File
- ./
quiz.module, line 575 - Quiz Module
Code
function quiz_get_user_results() {
global $user;
$results = array();
$dbresult = db_query("SELECT\n n.nid nid,\n n.title title,\n u.name name,\n qr.rid rid,\n qr.time_start,\n qr.time_end\n FROM {node} n, {quiz} q, {quiz_result} qr, {users} u\n WHERE\n n.type = 'quiz'\n AND\n n.nid = q.nid\n AND\n qr.quiz_nid = q.nid\n AND\n u.uid = qr.uid\n AND\n u.uid = " . $user->uid . "\n ORDER BY qr.rid ASC");
//Create results array
while ($line = db_fetch_array($dbresult)) {
$results[$line['rid']] = $line;
}
return theme('quiz_get_user_results', $results);
}