Skip to content

Commit

Permalink
quiz NOBUG Turn off autocomplete on the quiz form in a way that actua…
Browse files Browse the repository at this point in the history
…lly works.

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

0 comments on commit d256e1c

Please sign in to comment.