function _quiz_remove_unscored_message in Quiz 8.5
Same name and namespace in other branches
- 8.6 quiz.pages.inc \_quiz_remove_unscored_message()
- 8.4 quiz.pages.inc \_quiz_remove_unscored_message()
- 6.4 quiz.pages.inc \_quiz_remove_unscored_message()
- 7.6 quiz.pages.inc \_quiz_remove_unscored_message()
- 7 quiz.pages.inc \_quiz_remove_unscored_message()
- 7.4 quiz.pages.inc \_quiz_remove_unscored_message()
- 7.5 quiz.pages.inc \_quiz_remove_unscored_message()
Helper function to remove the message saying the quiz haven't been scored.
File
- ./
quiz.pages.inc, line 26 - User pages.
Code
function _quiz_remove_unscored_message() {
if (!empty($_SESSION['messages']['warning'])) {
// Search for the message, and remove it if we find it.
foreach ($_SESSION['messages']['warning'] as $key => $val) {
if ($val == t('This @quiz has not been scored yet.', array(
'@quiz' => _quiz_get_quiz_name(),
))) {
unset($_SESSION['messages']['warning'][$key]);
}
}
// Clean up if the message array was left empty.
if (empty($_SESSION['messages']['warning'])) {
unset($_SESSION['messages']['warning']);
if (empty($_SESSION['messages'])) {
unset($_SESSION['messages']);
}
}
}
}