Index: trunk/extensions/Quiz/quiz.js |
— | — | @@ -78,22 +78,35 @@ |
79 | 79 | }; |
80 | 80 | } |
81 | 81 | // Displays the shuffle buttons. |
82 | | - else if(input[j].className == "scriptshow") { |
| 82 | + else if(input[j].className == "shuffle") { |
83 | 83 | input[j].style.display = "inline"; |
84 | | - input[j].onclick = function() { shuffle(this.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('div')[0]); }; |
85 | | - } |
86 | | - // Correct the bug of ie6 on textfields |
87 | | - else if((input[j].className == "numbers" || input[j].className == "words") |
88 | | - && typeof document.body.style.maxHeight == "undefined" ) { |
89 | | - input[j].parentNode.onclick = function() { |
90 | | - this.parentNode.firstChild.style.display = "inline"; |
91 | | - this.parentNode.firstChild.style.position = "absolute"; |
92 | | - this.parentNode.firstChild.style.marginTop = "1.7em"; |
| 84 | + input[j].onclick = function() { shuffle(this.form.getElementsByTagName('div')[0]); }; |
| 85 | + } |
| 86 | + // Display the reset button |
| 87 | + else if(input[j].className == "reset") { |
| 88 | + input[j].style.display = "inline"; |
| 89 | + input[j].onclick = function() { |
| 90 | + this.form.quizId.value = ""; |
| 91 | + this.form.submit(); |
93 | 92 | }; |
94 | | - input[j].parentNode.onmouseout = function() { |
95 | | - this.parentNode.firstChild.style.display = "none"; |
96 | | - }; |
97 | 93 | } |
| 94 | + // Correct the bug of ie6 on textfields |
| 95 | + else if(input[j].className == "numbers" || input[j].className == "words") { |
| 96 | + if(typeof document.body.style.maxHeight == "undefined" ) { |
| 97 | + input[j].parentNode.onclick = function() { |
| 98 | + this.parentNode.firstChild.style.display = "inline"; |
| 99 | + this.parentNode.firstChild.style.position = "absolute"; |
| 100 | + this.parentNode.firstChild.style.marginTop = "1.7em"; |
| 101 | + }; |
| 102 | + input[j].parentNode.onmouseout = function() { |
| 103 | + this.parentNode.firstChild.style.display = "none"; |
| 104 | + }; |
| 105 | + } |
| 106 | + input[j].onkeydown = function() { this.form.shuffleButton.disabled = true; }; |
| 107 | + } |
| 108 | + if(input[j].className == "check") { |
| 109 | + input[j].onclick = function() { this.form.shuffleButton.disabled = true; }; |
| 110 | + } |
98 | 111 | } |
99 | 112 | } |
100 | 113 | } |