MDL-20929 fixed input validation
This commit is contained in:
@@ -443,6 +443,7 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
|
||||
echo '<form id="attemptsform" method="post" action="'.$FULLSCRIPT.'" onsubmit="var menu = document.getElementById(\'menuaction\'); return (menu.options[menu.selectedIndex].value == \'delete\' ? \''.addslashes_js(get_string('deleteattemptcheck','quiz')).'\' : true);">';
|
||||
echo '<div>';
|
||||
echo '<input type="hidden" name="id" value="'.$cm->id.'" />';
|
||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||
echo '<input type="hidden" name="mode" value="overview" />';
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
add_to_log($course->id, "choice", "report", "report.php?id=$cm->id", "$choice->id",$cm->id);
|
||||
|
||||
if ($action == 'delete' && has_capability('mod/choice:deleteresponses',$context)) {
|
||||
if (data_submitted() && $action == 'delete' && has_capability('mod/choice:deleteresponses',$context) && confirm_sesskey()) {
|
||||
choice_delete_responses($attemptids, $choice->id); //delete responses.
|
||||
redirect("report.php?id=$cm->id");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user