mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-28728 SCORM - only show delete button if data exists for this user in this scorm
This commit is contained in:
parent
d32e353e35
commit
a12b1d751d
@ -1110,7 +1110,9 @@ function scorm_get_attempt_status($user, $scorm, $cm='') {
|
||||
}
|
||||
if (!empty($cm)) {
|
||||
$context = context_module::instance($cm->id);
|
||||
if (has_capability('mod/scorm:deleteownresponses', $context)) {
|
||||
if (has_capability('mod/scorm:deleteownresponses', $context) &&
|
||||
$DB->record_exists('scorm_scoes_track', array('userid' => $user->id, 'scormid' => $scorm->id))) {
|
||||
//check to see if any data is stored for this user:
|
||||
$deleteurl = new moodle_url($PAGE->url, array('action'=>'delete', 'sesskey' => sesskey()));
|
||||
$result .= $OUTPUT->single_button($deleteurl, get_string('deleteallattempts', 'scorm'));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user