Permalink
Browse files

quiz NOBUG Turn off autocomplete on the quiz form in a way that actua…

…lly works.

See http://moodle.org/mod/forum/discuss.php?d=153419 for dicussion.
  • Loading branch information...
1 parent 94c1fe8 commit d256e1c021e092de4cfd9248d481edf2d032ca51 @timhunt timhunt committed Jul 5, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 mod/quiz/attempt.php
@@ -469,8 +469,11 @@
$quiz->thispageurl = $CFG->wwwroot . '/mod/quiz/attempt.php?q=' . s($quiz->id) . '&page=' . s($page);
$quiz->cmid = $cm->id;
echo '<form id="responseform" method="post" action="', $quiz->thispageurl . '" enctype="multipart/form-data"' .
- ' onclick="this.autocomplete=\'off\'" onkeypress="return check_enter(event);" accept-charset="utf-8">', "\n";
- if($quiz->timelimit > 0) {
+ ' onkeypress="return check_enter(event);" accept-charset="utf-8">', "\n";
+ echo '<script type="text/javascript">', "\n",
+ 'document.getElementById("responseform").setAttribute("autocomplete", "off")', "\n",
+ "</script>\n";
+ if ($quiz->timelimit > 0) {
// Make sure javascript is enabled for time limited quizzes
?>
<script type="text/javascript">

0 comments on commit d256e1c

Please sign in to comment.