function quiz_access_to_score in Quiz 7
Same name and namespace in other branches
- 8.4 quiz.module \quiz_access_to_score()
- 6.4 quiz.module \quiz_access_to_score()
- 7.6 quiz.module \quiz_access_to_score()
- 7.4 quiz.module \quiz_access_to_score()
- 7.5 quiz.module \quiz_access_to_score()
Helper function to determine if a user has access to score a quiz.
Parameters
$quiz_creator: uid of the quiz creator.
4 calls to quiz_access_to_score()
- LongAnswerResponse::getReportFormScore in question_types/
long_answer/ long_answer.classes.inc - Implementation of getReportFormScore
- ShortAnswerResponse::getReportFormScore in question_types/
short_answer/ short_answer.classes.inc - Implementation of getReportFormScore
- ShortAnswerResponse::getReportFormSubmit in question_types/
short_answer/ short_answer.classes.inc - Implementation of getReportFormSubmit
- ShortAnswerResponse::getReportFormValidate in question_types/
short_answer/ short_answer.classes.inc - Implementation of getReportFormValidate
File
- ./
quiz.module, line 230 - Quiz Module
Code
function quiz_access_to_score($quiz_creator = NULL) {
global $user;
if ($quiz_creator == NULL) {
$quiz = quiz_get_quiz_from_menu();
$quiz_creator = $quiz->uid;
}
if (user_access('score any quiz')) {
return TRUE;
}
if (user_access('score own quiz') && $user->uid == $quiz_creator) {
return TRUE;
}
}