function theme_quiz_get_user_results in Quiz 6.3
Same name and namespace in other branches
- 8.4 quiz.pages.inc \theme_quiz_get_user_results()
- 5.2 quiz.module \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.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.pages.inc - Displays all the quizzes the user has taken part in.
File
- ./
quiz.pages.inc, line 221 - User pages.
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;
}