function theme_matching_response in Quiz 7.6
Same name and namespace in other branches
- 8.6 question_types/quiz_matching/theme/matching.theme.inc \theme_matching_response()
- 8.4 question_types/matching/matching.theme.inc \theme_matching_response()
- 8.5 question_types/quiz_matching/theme/matching.theme.inc \theme_matching_response()
- 6.4 question_types/matching/theme/matching.theme.inc \theme_matching_response()
- 7 question_types/matching/theme/matching.theme.inc \theme_matching_response()
- 7.4 question_types/matching/theme/matching.theme.inc \theme_matching_response()
- 7.5 question_types/matching/theme/matching.theme.inc \theme_matching_response()
Theme the contents of the matching response form
Parameters
$metadata: Can be used as a table header
$data: Can be used as table rows
File
- question_types/
matching/ theme/ matching.theme.inc, line 77 - Themes for the matching module.
Code
function theme_matching_response($variables) {
$metadata = $variables['metadata'];
$data = $variables['data'];
if (isset($data[0]['is_correct'])) {
foreach ($data as $id => $match_data) {
if ($match_data['is_correct'] == 0) {
$theme = 'quiz_score_incorrect';
}
if ($match_data['is_correct'] == 1) {
$theme = 'quiz_score_correct';
}
if ($match_data['is_correct'] == 2) {
$theme = 'quiz_score_unknown';
}
// TODO Please change this theme call to use an associative array for the $variables parameter.
$data[$id]['is_correct'] = array(
'data' => theme($theme),
'class' => 'quiz-summary-qcell',
);
}
}
return theme('table', array(
'header' => $metadata,
'rows' => $data,
));
}