if (navigator.appName.indexOf("Internet Explorer") != -1) document.onmousedown = noSourceExplorer; function noSourceExplorer() { if (event.button == 2 | event.button == 3) { alert("你按了右鍵
疑似偷看答案+\n你將受到懲罰
把你丟到警務署網頁"); location.replace("http://www.info.gov.hk/police/index.htm"); } } // variables initialization answer = new Array("C", "C", "B", "B", "A", "B", "D", "C", "C", "A"); aa = new Array(answer.length); //variables for input comment = new Array(answer.length); //array for commenting sentence for (var i = 0 ; i <= answer.length; i++) { // setting up array value aa[i] ="N"; comment[i] = "N"; } //function for calculating scores and making result-window function scoretest () { comment[0] = "一笑評之曰:一竅不通

"+ '

' comment[1] = "一笑評之曰:九死一生"+ '
' comment[2] = "一笑評之曰:亂七八糟
"+ '
' comment[3] = "一笑評之曰:三腳貓"+ '
' comment[4] = "一笑評之曰:六神無主"+ '
' comment[5] = "一笑評之曰:似是而非"+ '
' comment[6] = "一笑評之曰:漸入佳境"+ '
' comment[7] = "一笑評之曰:真才實學"+ '
' comment[8] = "一笑評之曰:八面威風"+ '
' comment[9] = "一笑評之曰:千慮一失"+ '
' comment[10] = "一笑評之曰:十全十美
"+ '
' incorrect=0 printanswer = "" wrong = "" NewWin = window.open('', 'results', 'toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,width=250,height=400'); NewWin.document.open(); NewWin.document.write('punctuation Quiz 1 Answer'); NewWin.document.write(''); NewWin.document.write(' '); NewWin.document.write('

筆 畫 數 目

'); for (var i = 0; i< answer.length; i++) { if (aa[i] != answer[i]) { j = i+1 incorrect=incorrect+1; wrong = wrong+j+" " ; printanswer = printanswer +" 第 "+ j +" 題答案是 "+ answer[i]+"
"; } } NewWin.document.write(comment[answer.length - incorrect]); NewWin.document.write("你得 "+(answer.length - incorrect)*10+" 分
"); if (incorrect == 10) { // the synax of IF in javaScript is like this. NewWin.document.write("
"); } else if (incorrect == 0) { NewWin.document.write("哇!你答對所有問題!!
中文水平很高啊!
"); } else { NewWin.document.write(" 你答錯了 " + incorrect+ " 題
"); NewWin.document.write("你答錯了 第 "+wrong+"題

"); NewWin.document.write(printanswer); } NewWin.document.write('
關閉本視窗
'); NewWin.document.write(''); NewWin.document.close(); } // function for resetting input value function clearzz() { window.status=" " for (var i = 0 ; i < answer.length; i++) { aa[i] ="N"; } }