Permalink
Browse files

MDL-27314 quiz responses report: delete confirmation did not cancel.

  • Loading branch information...
1 parent 96cd18c commit cbda44bca4f45836fd5997585012d1c338a8fe9d @timhunt timhunt committed with stronk7 Dec 9, 2011
Showing with 7 additions and 8 deletions.
  1. +2 −2 mod/quiz/report/overview/overview_table.php
  2. +5 −6 mod/quiz/report/responses/responses_table.php
View
4 mod/quiz/report/overview/overview_table.php
@@ -77,8 +77,8 @@ function wrap_html_start(){
if ($this->candelete) {
// Start form
$url = new moodle_url($this->reporturl, $this->displayoptions);
- echo '<div id="tablecontainer" class="overview-tablecontainer">';
- echo '<form id="attemptsform" method="post" action="' . $this->reporturl->out_omit_querystring() .'">';
+ echo '<div id="tablecontainer">';
+ echo '<form id="attemptsform" method="post" action="' . $url->out_omit_querystring() .'">';
echo '<div style="display: none;">';
echo html_writer::input_hidden_params($url);
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())) . "\n";
View
11 mod/quiz/report/responses/responses_table.php
@@ -32,13 +32,11 @@ function wrap_html_start(){
if (!$this->is_downloading()) {
if ($this->candelete) {
// Start form
- $displayurl = new moodle_url($this->reporturl, $this->displayoptions);
- $strreallydel = addslashes_js(get_string('deleteattemptcheck','quiz'));
+ $url = new moodle_url($this->reporturl, $this->displayoptions);
echo '<div id="tablecontainer">';
- echo '<form id="attemptsform" method="post" action="' . $displayurl->out_omit_querystring() .
- '" onsubmit="confirm(\''.$strreallydel.'\');">';
+ echo '<form id="attemptsform" method="post" action="' . $url->out_omit_querystring() .'">';
echo '<div style="display: none;">';
- echo html_writer::input_hidden_params($displayurl);
+ echo html_writer::input_hidden_params($url);
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())) . "\n";
echo '</div>';
echo '<div>';
@@ -49,13 +47,14 @@ function wrap_html_finish(){
if (!$this->is_downloading()) {
// Print "Select all" etc.
if ($this->candelete) {
+ $strreallydel = addslashes_js(get_string('deleteattemptcheck','quiz'));
echo '<div id="commands">';
echo '<a href="javascript:select_all_in(\'DIV\',null,\'tablecontainer\');">'.
get_string('selectall', 'quiz').'</a> / ';
echo '<a href="javascript:deselect_all_in(\'DIV\',null,\'tablecontainer\');">'.
get_string('selectnone', 'quiz').'</a> ';
echo '&nbsp;&nbsp;';
- echo '<input type="submit" value="'.get_string('deleteselected', 'quiz_overview').'"/>';
+ echo '<input type="submit" onclick="return confirm(\''.$strreallydel.'\');" name="delete" value="'.get_string('deleteselected', 'quiz_overview').'"/>';
echo '</div>';
// Close form
echo '</div>';

0 comments on commit cbda44b

Please sign in to comment.