mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
quiz: MDL-14926 New capability mod/quiz:reviewmyattempts, separate from mod/quiz:attempt. Merged from MOODLE_19_STABLE.
This commit is contained in:
parent
894687e8a3
commit
96c7d771df
14 changed files with 64 additions and 34 deletions
|
@ -1186,7 +1186,7 @@ function quiz_print_overview($courses, &$htmlarray) {
|
|||
// The $quiz objects returned by get_all_instances_in_course have the necessary $cm
|
||||
// fields set to make the following call work.
|
||||
$str .= '<div class="info">' . quiz_num_attempt_summary($quiz, $quiz, true) . '</div>';
|
||||
} else if (has_capability('mod/quiz:attempt', $context)){ // Student
|
||||
} else if (has_any_capability(array('mod/quiz:reviewmyattempts', 'mod/quiz:attempt'), $context)) { // Student
|
||||
/// For student-like people, tell them how many attempts they have made.
|
||||
if (isset($USER->id) && ($attempts = quiz_get_user_attempts($quiz->id, $USER->id))) {
|
||||
$numattempts = count($attempts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue