PDA

View Full Version : Phân tích giúp về code tạo trắc nghiệm



vietnamnetvn
10-01-2009, 15:45
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>

ngoc_viet08
11-01-2009, 01:04
code dài quá nên lười xem quá bạn ơi . chỉ nên post thử 1 đoạn ngắn thôi
mới xem qua . hình như nó chỉ là code để dựng lên mấy cái chọn cho câu hỏi thôi . mà thường hàm kiểm tra câu hỏi có thể đặt trong tag head nên bạn copy sẽ thiếu .
đồng thời nếu câu trả lời nằm trong csdl ở server thì chắc chắn bạn chẳng làm gì được rồi vì còn 1 mớ code php ko gửi cho bạn mà chi gửi kết quả html.
theo mình thì bạn nên tìm hiểu kĩ về html và 1 số js cơ bản thì cũng làm nó dễ thôi .
chủ yếu là tạo mấy cái form với js kiểm tra form rồi tính toán kết quả và show ra thôi...

vietnamnetvn
11-01-2009, 11:10
khong phai nhu the Ban a, Banj thu view source cua site kia xem, mINH NGHI la chi can thieu 1 doan script nua thi phai

herofit
11-01-2009, 11:34
khong phai nhu the Ban a, Banj thu view source cua site kia xem, mINH NGHI la chi can thieu 1 doan script nua thi phai

lười chắc chắn bạn thiếu đoạn code check rùi

ngoc_viet08
11-01-2009, 15:08
</script>
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js"
type="text/javascript">
</script>
<br/>


<script language="javascript">
function download_tailieu(linkfile)
{
linkdown="http://download.luyenthianhvan.org/";
document.location.href=linkdown+linkfile;
}

function download_tailieu1(linkfile)
{
linkdown="http://tailieuduhoc.org/images/stories/Download/TOEFL/";
document.location.href=linkdown+linkfile;
}

</script>


<script language="javascript" src="http://datablue.luyenthianhvan.org/luyenthianhvan/vitec/text1.js"></script>
<!--
<script language="javascript" src="http://datablue.luyenthianhvan.org/luyenthianhvan/vitec/text1.php?getvitec=2"></script>
<script language="javascript" src="http://datablue.luyenthianhvan.org/luyenthianhvan/vitec/text.php"></script>
-->

<script type="text/javascript">
<!--
data_ltav_key = "SJwidsidbTiwwbckauiqwfgbUAA@6299";
data_ltav="http://datablue.luyenthianhvan.org/luyenthianhvan/";
vitec_ci=data_ltav + "vitec_ci.js";
vitec_mc=data_ltav + "vitec_mc.js";
vitec_ed=data_ltav + "vitec_ed.js";
vitec_fb=data_ltav + "vitec_fb.js";
vitec_wo=data_ltav + "vitec_wo.js";
vitec_fbwc=data_ltav + "vitec_fbwc.js";
vitec_fb2=data_ltav + "vitec_fb2.js";
vitec_ma=data_ltav + "vitec_ma.js";
vitec_gm="http://datablue.luyenthianhvan.org/luyenthianhvan/vitec/vitec_gm.js";
//-->
</script>
<div name="div_ltav"></div>
bạn copy từ đoạn mô , nhìn khó quá . chả biết đoạn mô mà phân tích.
trong site này có mấy đoạn js down về nữa chứ đâu phải chắc trên site ko đâu .
nếu câu hỏi chỉ dùng js thì người ta có thể view soure để biết kết quả ( nếu biết sơ về html , js)
còn tạo mấy câu trắc nghiệm rồi trả lời = html + js thì ko khó lắm đâu . đừng phân tích cái này , anh em nào rảnh làm cái demo 2-3 câu là hiểu à . ai giúp bạn ấy với .

start008
01-04-2009, 16:27
sao may u không lên trực tiếp trang đó mà phân tích. cứ đồi post lai hoài