function theme_quiz_get_user_results in Quiz 5.2
Same name and namespace in other branches
- 8.4 quiz.pages.inc \theme_quiz_get_user_results()
- 5 quiz.module \theme_quiz_get_user_results()
- 6.6 quiz.pages.inc \theme_quiz_get_user_results()
- 6.2 quiz.pages.inc \theme_quiz_get_user_results()
- 6.3 quiz.pages.inc \theme_quiz_get_user_results()
- 6.4 quiz.pages.inc \theme_quiz_get_user_results()
- 6.5 quiz.pages.inc \theme_quiz_get_user_results()
- 7 quiz.pages.inc \theme_quiz_get_user_results()
- 7.4 quiz.pages.inc \theme_quiz_get_user_results()
Theme the user results page.
Parameters
$results: An array of quiz information.
Return value
Themed html.
1 theme call to theme_quiz_get_user_results()
- quiz_get_user_results in ./
quiz.module - Displays all the quizzes the user has taken part in.
File
- ./
quiz.module, line 2155
Code
function theme_quiz_get_user_results($results) {
$output = '';
$rows = array();
while (list($key, $result) = each($results)) {
$rows[] = array(
l('view', 'user/quiz/' . $result['result_id'] . '/userresults'),
check_plain($result['title']),
check_plain($result['name']),
$result['result_id'],
format_date($result['time_start'], 'small'),
$result['time_end'] > 0 ? format_date($result['time_end'], 'small') : t('In Progress'),
);
}
$header = array(
t('Action'),
t('@quiz Title', array(
'@quiz' => QUIZ_NAME,
)),
t('Username'),
t('Result<br />ID'),
t('Time Started'),
t('Finished?'),
);
if (!empty($rows)) {
$output .= theme('table', $header, $rows);
}
else {
$output .= t('No @quiz results found.', array(
'@quiz' => QUIZ_NAME,
));
}
return $output;
}