mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
Added proper page comments and inform user when attempts have been deleted
This commit is contained in:
parent
d2d7f39064
commit
8d1b4ee7b5
1 changed files with 42 additions and 36 deletions
|
@ -1,8 +1,11 @@
|
||||||
<?PHP
|
<?php // $Id$
|
||||||
|
/**
|
||||||
/**************************************************************************
|
* Displays the lesson statistics.
|
||||||
this file displays the lesson statistics.
|
*
|
||||||
**************************************************************************/
|
* @version $Id$
|
||||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||||
|
* @package lesson
|
||||||
|
**/
|
||||||
|
|
||||||
require_once('../../config.php');
|
require_once('../../config.php');
|
||||||
require_once('locallib.php');
|
require_once('locallib.php');
|
||||||
|
@ -29,10 +32,11 @@
|
||||||
require_capability('mod/lesson:manage', $context);
|
require_capability('mod/lesson:manage', $context);
|
||||||
|
|
||||||
/// Process any form data before fetching attempts, grades and times
|
/// Process any form data before fetching attempts, grades and times
|
||||||
if (has_capability('mod/lesson:edit', $context) and $form = data_submitted()) {
|
if (confirm_sesskey() and
|
||||||
confirm_sesskey();
|
has_capability('mod/lesson:edit', $context) and
|
||||||
|
$form = data_submitted($CFG->wwwroot.'/mod/lesson/report.php')) {
|
||||||
/// Cycle through array of userids with nested arrays of tries
|
/// Cycle through array of userids with nested arrays of tries
|
||||||
|
if (!empty($form->attempts)) {
|
||||||
foreach ($form->attempts as $userid => $tries) {
|
foreach ($form->attempts as $userid => $tries) {
|
||||||
// Modifier IS VERY IMPORTANT! What does it do?
|
// Modifier IS VERY IMPORTANT! What does it do?
|
||||||
// Well, it is for when you delete multiple attempts for the same user.
|
// Well, it is for when you delete multiple attempts for the same user.
|
||||||
|
@ -71,6 +75,8 @@
|
||||||
$modifier++;
|
$modifier++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lesson_set_message(get_string('attemptsdeleted', 'lesson'), 'notifysuccess');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $attempts = get_records('lesson_attempts', 'lessonid', $lesson->id, 'timeseen')) {
|
if (! $attempts = get_records('lesson_attempts', 'lessonid', $lesson->id, 'timeseen')) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue