PDA

View Full Version : Code trắc nghiệm



vietnamnetvn
10-01-2009, 16:23
Mình muốn tạo đề trắc nghiệm tương tự như http://luyenthianhvan.org/2008/10/lesson-409-toeic-test-vocabulary.html, xem source thì đoạn mã này là để tạo dữ liệu text và đề,Mình thử đưa đoạn mã này vào 1 file .htm và test ở local thì vẫn show ra các câu hỏi tuy nhiên khi nhấn vào Show answers thì Nó không có tác dụng gì cả, Với đoạn mã như trên thì thiếu cái script nào nữa các Bạn nhỉ?
Rất mong chỉ giáo!




<p><script type="text/javascript">var dapan_array=new Array("C","D","C","A","C","B","D","D","D","C");</script>1) ___ that as both birds and mammals become larger, their metabolic rates er unit of tissue decrease, and they generally live longer.<br /><br /><input id="choice1A" value="A" name="choice1" type="radio"><label id="C1A">a) The truth</label><br /><input id="choice1B" value="B" name="choice1" type="radio"><label id="C1B">b) If true</label><br /><input id="choice1C" value="C" name="choice1" type="radio"><label id="C1C">c) It is true</label><br /><input id="choice1D" value="D" name="choice1" type="radio"><label id="C1D">d) To be true</label><br /><br />2) Asteroids are small and therefore very difficult to identify, even when ___ to Earth<br /><br /><input id="choice2A" value="A" name="choice2" type="radio"><label id="C2A">a) quite closely</label><br /><input id="choice2B" value="B" name="choice2" type="radio"><label id="C2B">b) are being quite close</label><br /><input id="choice2C" value="C" name="choice2" type="radio"><label id="C2C">c) are they quite closely</label><br /><input id="choice2D" value="D" name="choice2" type="radio"><label id="C2D">d) they are quite close</label><br /><br />3) A number of modern sculptors have rejected ___ of minimal and environmental art and developed a style of extreme realism.<br /><br /><input id="choice3A" value="A" name="choice3" type="radio"><label id="C3A">a) which abstract qualities</label><br /><input id="choice3B" value="B" name="choice3" type="radio"><label id="C3B">b) there are abstract qualities</label><br /><input id="choice3C" value="C" name="choice3" type="radio"><label id="C3C">c) the abstract qualities</label><br /><input id="choice3D" value="D" name="choice3" type="radio"><label id="C3D">d) the qualities are abstract</label><br /><br />4) ___ tributaries of the Mississippi River system were navigated by steamboats during the period before the outbreak of the Civil War<br /><br /><input id="choice4A" value="A" name="choice4" type="radio"><label id="C4A">a) More than forty</label><br /><input id="choice4B" value="B" name="choice4" type="radio"><label id="C4B">b) More than forty were</label><br /><input id="choice4C" value="C" name="choice4" type="radio"><label id="C4C">c) Forty more than</label><br /><input id="choice4D" value="D" name="choice4" type="radio"><label id="C4D">d) There were more than forty</label><br /><br />5) Mary Eliza McDowell’s introduction to social service came ___, when she assisted victims of the great Chicago Fire of 1871<br /><br /><input id="choice5A" value="A" name="choice5" type="radio"><label id="C5A">a) was sixteen years old</label><br /><input id="choice5B" value="B" name="choice5" type="radio"><label id="C5B">b) had sixteen years</label><br /><input id="choice5C" value="C" name="choice5" type="radio"><label id="C5C">c) at age sixteen</label><br /><input id="choice5D" value="D" name="choice5" type="radio"><label id="C5D">d) sixteen</label><br /><br />6) Young herons are helpless for a few weeks ___ they learn to fly.<br /><br /><input id="choice6A" value="A" name="choice6" type="radio"><label id="C6A">a) how</label><br /><input id="choice6B" value="B" name="choice6" type="radio"><label id="C6B">b) before</label><br /><input id="choice6C" value="C" name="choice6" type="radio"><label id="C6C">c) despite</label><br /><input id="choice6D" value="D" name="choice6" type="radio"><label id="C6D">d) since</label><br /><br />7) The history of painting is a fascinating chain of events that probably began with ___<br /><br /><input id="choice7A" value="A" name="choice7" type="radio"><label id="C7A">a) ever made the very first pictures</label><br /><input id="choice7B" value="B" name="choice7" type="radio"><label id="C7B">b) the ever made very first pictures</label><br /><input id="choice7C" value="C" name="choice7" type="radio"><label id="C7C">c) the very first ever made pictures</label><br /><input id="choice7D" value="D" name="choice7" type="radio"><label id="C7D">d) the very first pictures ever made</label><br /><br />8) The center of gravity of the human body ___ behind the hip joint.<br /><br /><input id="choice8A" value="A" name="choice8" type="radio"><label id="C8A">a) locates</label><br /><input id="choice8B" value="B" name="choice8" type="radio"><label id="C8B">b) locating</label><br /><input id="choice8C" value="C" name="choice8" type="radio"><label id="C8C">c) to locate</label><br /><input id="choice8D" value="D" name="choice8" type="radio"><label id="C8D">d) is located</label><br /><br />9) The leaves and stems of the alfalfa plant are the only parts of the plant ___.<br /><br /><input id="choice9A" value="A" name="choice9" type="radio"><label id="C9A">a) the uses for livestock fees</label><br /><input id="choice9B" value="B" name="choice9" type="radio"><label id="C9B">b) for using livestock feed</label><br /><input id="choice9C" value="C" name="choice9" type="radio"><label id="C9C">c) used for livestock feed</label><br /><input id="choice9D" value="D" name="choice9" type="radio"><label id="C9D">d) they are used for livestock feed</label><br /><br />10) ___ choose to live in or near metropolitan areas simply because they like the rapid pace of city life.<br /><br /><input id="choice10A" value="A" name="choice10" type="radio"><label id="C10A">a) So large numbers of people to</label><br /><input id="choice10B" value="B" name="choice10" type="radio"><label id="C10B">b) There are large numbers of people</label><br /><input id="choice10C" value="C" name="choice10" type="radio"><label id="C10C">c) Large numbers of people</label><br /><input id="choice10D" value="D" name="choice10" type="radio"><label id="C10D">d) Large numbers of people who</label><br /><br /><div align="center"><input language="javascript" id="button1" onclick="dapan_onclick();" value="Show answers" name="button1" type="button"></div></p>

rain1007ht
17-01-2009, 20:11
onclick="dapan_onclick();"
Thiếu Javascript bạn ạ, nút "show answer" họi hàm dapan_onclick() nhưng code của bạn chưa có hàm này. Theo tớ đoán thì hàm này lấy giá trị (value) của các radio khi thí sinh chọn, sau đó lưu vào 1 mảng, so sánh với mảng "dapan_array" được khai báo trong đoạn code trên để tính điểm :D

tran_tuan82
18-01-2009, 08:24
onclick="dapan_onclick();" trong đoạn code đã post kia có rồi thì phải, nhưng không tìm được file java trong source của link http://luyenthianhvan.org/2008/10/lesson-409-toeic-test-vocabulary.html











<p><script type="text/javascript">var dapan_array=new Array("C","D","C","A","C","B","D","D","D","C");</script>1) ___ that as both birds and mammals become larger, their metabolic rates er unit of tissue decrease, and they generally live longer.<br /><br /><input id="choice1A" value="A" name="choice1" type="radio"><label id="C1A">a) The truth</label><br /><input id="choice1B" value="B" name="choice1" type="radio"><label id="C1B">b) If true</label><br /><input id="choice1C" value="C" name="choice1" type="radio"><label id="C1C">c) It is true</label><br /><input id="choice1D" value="D" name="choice1" type="radio"><label id="C1D">d) To be true</label><br /><br />2) Asteroids are small and therefore very difficult to identify, even when ___ to Earth<br /><br /><input id="choice2A" value="A" name="choice2" type="radio"><label id="C2A">a) quite closely</label><br /><input id="choice2B" value="B" name="choice2" type="radio"><label id="C2B">b) are being quite close</label><br /><input id="choice2C" value="C" name="choice2" type="radio"><label id="C2C">c) are they quite closely</label><br /><input id="choice2D" value="D" name="choice2" type="radio"><label id="C2D">d) they are quite close</label><br /><br />3) A number of modern sculptors have rejected ___ of minimal and environmental art and developed a style of extreme realism.<br /><br /><input id="choice3A" value="A" name="choice3" type="radio"><label id="C3A">a) which abstract qualities</label><br /><input id="choice3B" value="B" name="choice3" type="radio"><label id="C3B">b) there are abstract qualities</label><br /><input id="choice3C" value="C" name="choice3" type="radio"><label id="C3C">c) the abstract qualities</label><br /><input id="choice3D" value="D" name="choice3" type="radio"><label id="C3D">d) the qualities are abstract</label><br /><br />4) ___ tributaries of the Mississippi River system were navigated by steamboats during the period before the outbreak of the Civil War<br /><br /><input id="choice4A" value="A" name="choice4" type="radio"><label id="C4A">a) More than forty</label><br /><input id="choice4B" value="B" name="choice4" type="radio"><label id="C4B">b) More than forty were</label><br /><input id="choice4C" value="C" name="choice4" type="radio"><label id="C4C">c) Forty more than</label><br /><input id="choice4D" value="D" name="choice4" type="radio"><label id="C4D">d) There were more than forty</label><br /><br />5) Mary Eliza McDowell’s introduction to social service came ___, when she assisted victims of the great Chicago Fire of 1871<br /><br /><input id="choice5A" value="A" name="choice5" type="radio"><label id="C5A">a) was sixteen years old</label><br /><input id="choice5B" value="B" name="choice5" type="radio"><label id="C5B">b) had sixteen years</label><br /><input id="choice5C" value="C" name="choice5" type="radio"><label id="C5C">c) at age sixteen</label><br /><input id="choice5D" value="D" name="choice5" type="radio"><label id="C5D">d) sixteen</label><br /><br />6) Young herons are helpless for a few weeks ___ they learn to fly.<br /><br /><input id="choice6A" value="A" name="choice6" type="radio"><label id="C6A">a) how</label><br /><input id="choice6B" value="B" name="choice6" type="radio"><label id="C6B">b) before</label><br /><input id="choice6C" value="C" name="choice6" type="radio"><label id="C6C">c) despite</label><br /><input id="choice6D" value="D" name="choice6" type="radio"><label id="C6D">d) since</label><br /><br />7) The history of painting is a fascinating chain of events that probably began with ___<br /><br /><input id="choice7A" value="A" name="choice7" type="radio"><label id="C7A">a) ever made the very first pictures</label><br /><input id="choice7B" value="B" name="choice7" type="radio"><label id="C7B">b) the ever made very first pictures</label><br /><input id="choice7C" value="C" name="choice7" type="radio"><label id="C7C">c) the very first ever made pictures</label><br /><input id="choice7D" value="D" name="choice7" type="radio"><label id="C7D">d) the very first pictures ever made</label><br /><br />8) The center of gravity of the human body ___ behind the hip joint.<br /><br /><input id="choice8A" value="A" name="choice8" type="radio"><label id="C8A">a) locates</label><br /><input id="choice8B" value="B" name="choice8" type="radio"><label id="C8B">b) locating</label><br /><input id="choice8C" value="C" name="choice8" type="radio"><label id="C8C">c) to locate</label><br /><input id="choice8D" value="D" name="choice8" type="radio"><label id="C8D">d) is located</label><br /><br />9) The leaves and stems of the alfalfa plant are the only parts of the plant ___.<br /><br /><input id="choice9A" value="A" name="choice9" type="radio"><label id="C9A">a) the uses for livestock fees</label><br /><input id="choice9B" value="B" name="choice9" type="radio"><label id="C9B">b) for using livestock feed</label><br /><input id="choice9C" value="C" name="choice9" type="radio"><label id="C9C">c) used for livestock feed</label><br /><input id="choice9D" value="D" name="choice9" type="radio"><label id="C9D">d) they are used for livestock feed</label><br /><br />10) ___ choose to live in or near metropolitan areas simply because they like the rapid pace of city life.<br /><br /><input id="choice10A" value="A" name="choice10" type="radio"><label id="C10A">a) So large numbers of people to</label><br /><input id="choice10B" value="B" name="choice10" type="radio"><label id="C10B">b) There are large numbers of people</label><br /><input id="choice10C" value="C" name="choice10" type="radio"><label id="C10C">c) Large numbers of people</label><br /><input id="choice10D" value="D" name="choice10" type="radio"><label id="C10D">d) Large numbers of people who</label><br /><br /><div align="center"><input language="javascript" id="button1" onclick="dapan_onclick();" value="Show answers" name="button1" type="button"></div></p>