كيف أحدد كود
2 مشترك
منتدى الدعم و المساعدة لأحلى المنتديات :: منتدى الدعم والمساعدة :: دعم مشاكل التومبلايت و الأكواد :: أرشيف قسم "مشاكل التومبلايت و الأكواد"
صفحة 1 من اصل 1
كيف أحدد كود
السلام عليكم
أريد أنسخ كود من هذا الموقع
بس ما قدرت أحدده مع أنه في الخطوات ذكروا أن ذلك ممكن
هذا الموقع وهو لصناعة كود مسابقة
http://www.coe.uga.edu/~ichoi/edit4160/createquiz.html
أريد أنسخ كود من هذا الموقع
بس ما قدرت أحدده مع أنه في الخطوات ذكروا أن ذلك ممكن
هذا الموقع وهو لصناعة كود مسابقة
http://www.coe.uga.edu/~ichoi/edit4160/createquiz.html
رد: كيف أحدد كود
تفضل الكود الخاصة بهذا الموقع
http://www.coe.uga.edu/~ichoi/edit4160/createquiz.html
http://www.coe.uga.edu/~ichoi/edit4160/createquiz.html
- الكود:
<html>
<head>
<title>Create Quiz html file</title>
</head>
<script language ="JavaScript">
<!-- hide
/* This script is for Creating Quiz Html files for on the www
Created by Ikseon Choi, Since Nov.1997.
Quiz Making Tool V1.1 (Nov. 24,1997, test version)
Quiz Making Tool V1.2 (Oct. 24, 1998, test version) Instructional Systems, Penn State
*/
Quiz = new Array();
var i=0, j=0;
var final_script;
function Check_items()
{
c=0;
for (j=0;j<=6;j++)
if (document.forms[0].elements[j].value == "") c +=1;
if (c != 0) alert("Please enter missing data.")
}
function Creating_script()
{
Check_items();
for (j=0;j<=6;j++) Quiz[i*10+j]=document.forms[0].elements[j].value;
i++;
}
function Finishing_script()
{
document.forms[0].display.value =
"<html>"+"\n"+
"<head>"+"\n"+
"<title>Quiz html out-put</title>"+"\n"+
"<script language ='JavaScript'>"+"\n"+
"<!-- hide"+"\n"+
"var ans = new Array;"+"\n"+
"var done = new Array;"+"\n"+
"var score = 0;"+"\n"+
"var tot_ques=" + i + ";"+"\n";
tot_ques=i;
for (i=0;i<tot_ques;i++)
document.forms[0].display.value +="ans[" + (i+1) + "]=" + "'" + Quiz[i*10+6] + "'" + ";" +"\n";
document.forms[0].display.value +=
"function Engine(question, answer) {"+"\n"+
" if (answer != ans[question]) {"+"\n"+
" if (!done[question]) {"+"\n"+
" done[question] = -1;"+"\n"+
" alert('Wrong! The right answer is ' + ans[question]);"+"\n"+
" }"+"\n"+
" else {"+"\n"+
" alert('You have already answered that!');"+"\n"+
" }"+"\n"+
" }"+"\n"+
" else {"+"\n"+
" if (!done[question]) {"+"\n"+
" done[question] = -1;"+"\n"+
" score++;"+"\n"+
" alert('Correct! Great!');"+"\n"+
" }"+"\n"+
" else {"+"\n"+
" alert('You have already answered that!');"+"\n"+
" }"+"\n"+
" }"+"\n"+
"}"+"\n"+
"function Test_result() {"+"\n"+
" if (score == tot_ques) {"+"\n"+
" alert('Oh! You got full points!');"+"\n"+
" }"+"\n"+
" else {"+"\n"+
" alert('You got ' + score + ' point(s) out of ' + tot_ques + ' questions.')"+"\n"+
" }"+"\n"+
"}"+"\n"+
"//-->"+"\n"+
"</"+"script>" +"\n"+
"<BODY BGCOLOR='#FFFFFF'>"+"\n"+
"<hr>"+"\n"+
"<center><font size=6 face=Arial>Let's Play</font><br>"+"\n"+
"</" + "center><p>"+"\n"+
"<hr>"+"\n"+
"<form>"+"\n"
for (i=0;i<tot_ques;i++)
{
document.forms[0].display.value +=
"<b>" + (i+1) + "." + Quiz[i*10+1] + ". </b><p>"+"\n"+
"<input type=radio value='a' onClick='Engine(" + (i+1) + ", this.value)'>" + Quiz[i*10+2] + "<br>"+"\n"+
"<input type=radio value='b' onClick='Engine(" + (i+1) + ", this.value)'>" + Quiz[i*10+3] + "<br>"+"\n"+
"<input type=radio value='c' onClick='Engine(" + (i+1) + ", this.value)'>" + Quiz[i*10+4] + "<br>"+"\n"+
"<input type=radio value='d' onClick='Engine(" + (i+1) + ", this.value)'>" + Quiz[i*10+5] + "<br><br><br>"+"\n\n\n"
}
document.forms[0].display.value +=
"<center>"+"\n"+
"<input type=button onClick='Test_result()' value='Final Results'>"+"\n"+
"</center>"+"\n"+
"</form>"+"\n"+
"<hr>"+"\n"+
"</BODY>"+"\n"+
"</HTML>"+"\n"
final_script=document.forms[0].display.value;
}
function Opening_script() {
var myQuiz=window.open(" ", "myQuiz");
myQuiz.document.write(final_script);
}
//-->
</script>
<body>
<hr>
<h3><center> Quiz Making Tool V1.2 (Oct. 1998)</h3>
<h4> Created by <A HREF="[email=ichoi@coe.uga.edu]mailto:ichoi@coe.uga.edu[/email]">Ikseon Choi</A></h4>
(Ver. 1.1 Nov. 24,1997, Test version)</center>
<hr>
<h4><center>This page has been accessed
<IMG SRC="[url=http://help.ahlamontada.com/view-source:http://www.coe.uga.edu/cgi-bin/Count.cgi?dd=katt077&ft=6]/cgi-bin/Count.cgi?dd=katt077&ft=6[/url]">times since Feb. 25 1998.</center></h4>
<hr>
<h3> How to use this tool:</h3><br><h4>
1. Enter your question content according to the following format <br>
2. Click "Enter this data to script" button<br>
3. If you have additional questions, go to step 1<br>
4. If finished, Click "Creating JavaScript"<br>
4-1. You may have a quick view of your quiz page by clicking "See my Quiz Page"<br>
4-2. After confirming your page, you need to go back the original page by closing your quiz page<br>
4-3. You can save your file by following directions.
5. You can select all scripts by dragging mouse<br>
6. Move it to your editor by mouse<br>
7. Save it<br>
8. You can open it by your browser. Good Luck!<br>
</h4>
<hr>
<form>
Question No: <input type="text" name="no" size =3><br>
Question Content:<br> <textarea rows="5" cols=63 name="content" ></textarea><br>
Answer a: <input type="text" name="answerA" size = 60><br>
Answer b: <input type="text" name="answerB" size = 60><br>
Answer c: <input type="text" name="answerC" size = 60><br>
Answer d: <input type="text" name="answerD" size = 60><br>
Right Answer : <input type="text" name="right_answer" size=3><br><br>
<input type="reset" value ="Enter this data to script" onClick="Creating_script()">
<input type="button" value = "Creating JavaScript" onClick="Finishing_script()">
<input type="button" value = "See my Quiz Page" onClick="Opening_script()"><br><br><hr>
Javascript for the quiz:<br>
<textarea name="display" onFocus="blur()" rows=15 cols=63></textarea>
</form>
</body>
</html>
رد: كيف أحدد كود
تفضل
- الكود:
"<html>"+"\n"+
"<head>"+"\n"+
"<title>Quiz html out-put</title>"+"\n"+
"<script language ='JavaScript'>"+"\n"+
"<!-- hide"+"\n"+
"var ans = new Array;"+"\n"+
"var done = new Array;"+"\n"+
"var score = 0;"+"\n"+
"var tot_ques=" + i + ";"+"\n";
tot_ques=i;
for (i=0;i<tot_ques;i++)
document.forms[0].display.value +="ans[" + (i+1) + "]=" + "'" + Quiz[i*10+6] + "'" + ";" +"\n";
document.forms[0].display.value +=
"function Engine(question, answer) {"+"\n"+
" if (answer != ans[question]) {"+"\n"+
" if (!done[question]) {"+"\n"+
" done[question] = -1;"+"\n"+
" alert('Wrong! The right answer is ' + ans[question]);"+"\n"+
" }"+"\n"+
" else {"+"\n"+
" alert('You have already answered that!');"+"\n"+
" }"+"\n"+
" }"+"\n"+
" else {"+"\n"+
" if (!done[question]) {"+"\n"+
" done[question] = -1;"+"\n"+
" score++;"+"\n"+
" alert('Correct! Great!');"+"\n"+
" }"+"\n"+
" else {"+"\n"+
" alert('You have already answered that!');"+"\n"+
" }"+"\n"+
" }"+"\n"+
"}"+"\n"+
"function Test_result() {"+"\n"+
" if (score == tot_ques) {"+"\n"+
" alert('Oh! You got full points!');"+"\n"+
" }"+"\n"+
" else {"+"\n"+
" alert('You got ' + score + ' point(s) out of ' + tot_ques + ' questions.')"+"\n"+
" }"+"\n"+
"}"+"\n"+
"//-->"+"\n"+
"</"+"script>" +"\n"+
"<BODY BGCOLOR='#FFFFFF'>"+"\n"+
"<hr>"+"\n"+
"<center><font size=6 face=Arial>Let's Play</font><br>"+"\n"+
"</" + "center><p>"+"\n"+
"<hr>"+"\n"+
"<form>"+"\n"
for (i=0;i<tot_ques;i++)
{
document.forms[0].display.value +=
"<b>" + (i+1) + "." + Quiz[i*10+1] + ". </b><p>"+"\n"+
"<input type=radio value='a' onClick='Engine(" + (i+1) + ", this.value)'>" + Quiz[i*10+2] + "<br>"+"\n"+
"<input type=radio value='b' onClick='Engine(" + (i+1) + ", this.value)'>" + Quiz[i*10+3] + "<br>"+"\n"+
"<input type=radio value='c' onClick='Engine(" + (i+1) + ", this.value)'>" + Quiz[i*10+4] + "<br>"+"\n"+
"<input type=radio value='d' onClick='Engine(" + (i+1) + ", this.value)'>" + Quiz[i*10+5] + "<br><br><br>"+"\n\n\n"
}
document.forms[0].display.value +=
"<center>"+"\n"+
"<input type=button onClick='Test_result()' value='Final Results'>"+"\n"+
"</center>"+"\n"+
"</form>"+"\n"+
"<hr>"+"\n"+
"</BODY>"+"\n"+
"</HTML>"+"\n"
منتدى الدعم و المساعدة لأحلى المنتديات :: منتدى الدعم والمساعدة :: دعم مشاكل التومبلايت و الأكواد :: أرشيف قسم "مشاكل التومبلايت و الأكواد"
صفحة 1 من اصل 1
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى