autocomplete = "off" to a form but will that work and where would I add the tag?
Thanks for the help Tim!!
file mod/quiz/attempt.php
lines 471-472
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";
Joseph
Joseph gave the right answer. (Just remember that the Moodle forums adds an X in front of 'onclick'.)
You may wonder why we add this attribute using JavaScript. That is because autocomplete= is not valid HTML, but it is OK in JavaScript.
Thanks again for your help!
Some people do use Moodle messaging to send passwords. It is about as secure as email, assuming you trust Martin D, Jordan, and the other HQ folks who have access to the DB.
Jim,
autocomplete is a (generally useful) feature of modern browsers. I think it is every user's responsibility to turn that feature ON or OFF at will.
I'm not sure but I think that, in an institution such as a school, university, etc. where a number of different users (students etc.) may use the same physical machine, autocomplete does not work across different users' sessions. It is only if one user comes back to the same machine and identify themselves that they will find the autocomplete feature in their own session.
But I may be wrong.
Joseph
Tim,
autocomplete="off" may not be valid HTML, but it does work.
echo '<form autocomplete="off" id="responseform" method="post" action="', $quiz->thispageurl . '" enctype="multipart/form-data"' .' onkeypress="return check_enter(event);" accept-charset="utf-8">', "\n";
on the other hand, using JavaScript (as per Moodle 1.9) does not work.
echo '<form id="responseform" method="post" action="', $quiz->thispageurl . '" enctype="multipart/form-data"' .' onclick="autocomplete=\'off\'" onkeypress="return check_enter(event);" accept-charset="utf-8">', "\n";
Just tested in moodle 1.9.9 and FireFox.
Joseph
Why we don't just do
<form id="responseform" ... >
<script type="text/javascript">
document.getElementById('responseform').autocomplete = 'off';
</script>
Actually, we do pretty much that in Moodle 2.0.
1.- How I test:
Go to quiz, answer question once, then move away. Come back to same question, click inside input box, type "c", "cat" autocomplete appears. See attached screenshot.
2.- Adding the little script after line 412 does the trick, Tim. Maybe should be added to Moodle 1.9 as a fix?
Joseph
I am giving a moodle quiz to my high school physics class, and I'm finding that there is still a problem with autocomplete. One question is "What do you call the force exerted by a rope?" The answer is "tension." The problem is that if two students take the quiz on the same computer, the 2nd person taking the quiz will see "tension" as soon as he types "t". I have tried using the "some java security in a pop-up window" option and the problem persists. It even persists if I tell Firefox to clean recent history.
This is crazy... The students can see the answers of the previous students. How can I stop it? The computers I have in the classroom are running firefox on Ubuntu 8, but the students will take the quiz at home, and in the library, where there is a variety of computers.
Thanks,
Peter Halverson