⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test3.htm

📁 javascript各种效果的实例及源代码
💻 HTM
字号:
<html>
<head>
<title>在线考试脚本(三)</title>
<style type="text/css">
<!--
body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }
 A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#fef4d9">
<br>
<br>
<center><font color=red face="隶书" size=6>在线考试脚本(三)</font></center>
<br>
<br><center>
<table border=5 bordercolor=blue borderlight=green>
<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面为效果显示区!</strong></font></td></tr><tr><td align=left>
<script>
 <!-- hide
 var ans = new Array;
 var done = new Array;
 var score = 0;
 // LOSER!  Don't read the answers!
 ans[1] = "c";
 ans[2] = "a";
 ans[3] = "b";
 ans[4] = "b";
 ans[5] = "d";
 ans[6] = "c";
 ans[7] = "c";
 ans[8] = "c";
 ans[9] = "d";
 ans[10] = "a";
 function Engine(question, answer) {
         if (answer != ans[question]) {
                 if (!done[question]) {
                         done[question] = -1;
                         alert("你选错了,你答对了" + score + "个");

                         }

                 else {

                         alert("你已经选过这个了!");

                         }

                 }

         else {

                 if (!done[question]) {

                         done[question] = -1;

                         score++;

                         alert("恭喜你,你答对了" + score + "个");

                         }

                 else {          

                         alert("你已经回答过这个了!");

                         }

                 }

 }

                 

 function NextLevel () {

         if (score > 10) {

                 alert("你作弊了吧!");

                 }

         if (score >= 7 && score <= 9) {

                 alert("你答的不错!!!")

                 //self.location="GameQuiz2.htm"

                 }

         else {

                 alert("你还要继续努力!!!")

                 }

 }

 

 //-->

 </script>

  <form>

 <b>1. WARM-UP: Who created the famous <i>WarCraft 2</i>?</b><p>

 <input type=radio value="a" onClick="Engine(1, this.value)">Sierra On-Line<br>

 <input type=radio value="b" onClick="Engine(1, this.value)">BlueByte<br>

 <input type=radio value="c" onClick="Engine(1, this.value)">Blizzard Entertainment<br>

 <input type=radio value="d" onClick="Engine(1, this.value)">Microsoft<p>

 

 <b>2. This famous 3D shooter claimed <i>PC Gamer's</i> Game of 1994 Award.</b><p>

 <input type=radio value="a" onClick="Engine(2, this.value)">Doom<br>

 <input type=radio value="b" onClick="Engine(2, this.value)">Hexen<br>

 <input type=radio value="c" onClick="Engine(2, this.value)">Descent<br>

 <input type=radio value="d" onClick="Engine(2, this.value)">Wolfenstein 3D<p>

 

 <b>3. The first intergalatic combat game.  Name it.</b><p>

 <input type=radio value="a" onClick="Engine(3, this.value)">Master of Orion<br>

 <input type=radio value="b" onClick="Engine(3, this.value)">Star Control<br>

 <input type=radio value="c" onClick="Engine(3, this.value)">StarCraft<br>

 <input type=radio value="d" onClick="Engine(3, this.value)">Star Trek<p>

 

 <b>4. The game ever to contain graphics was<br> this classic by Roberta Williams.</b><p>

 <input type=radio value="a" onClick="Engine(4, this.value)">King's Quest<br>

 <input type=radio value="b" onClick="Engine(4, this.value)">Mystery House<br>

 <input type=radio value="c" onClick="Engine(4, this.value)">Time Zone<br>

 <input type=radio value="d" onClick="Engine(4, this.value)">Mission: Asteriod<p>

 

 <b>5. The first real-time strategy game was: </b><p>

 <input type=radio value="a" onClick="Engine(5, this.value)">WarCraft: Orcs & Humans<br>

 <input type=radio value="b" onClick="Engine(5, this.value)">Command & Conquer<br>

 <input type=radio value="c" onClick="Engine(5, this.value)">Dune<br>

 <input type=radio value="d" onClick="Engine(5, this.value)">Dune 2<p>

 

 <b>6. In PC Gamer, Quake won these 'of-the-year' awards (1996): </b><p>

 <input type=radio value="a" onClick="Engine(6, this.value)">Best Game, Best Action Game<br>

 <input type=radio value="b" onClick="Engine(6, this.value)">Best Action Game, Best Multiplayer<br>

 <input type=radio value="c" onClick="Engine(6, this.value)">Best Sound Effects, Best Multiplayer<br>

 <input type=radio value="d" onClick="Engine(6, this.value)">All of the above<p>

 

 <b>7. The best selling game of all time is: </b><p>

 <input type=radio value="a" onClick="Engine(7, this.value)">WarCraft 2<br>

 <input type=radio value="b" onClick="Engine(7, this.value)">C&C: Red Alert<br>

 <input type=radio value="c" onClick="Engine(7, this.value)">Sim City<br>

 <input type=radio value="d" onClick="Engine(7, this.value)">King's Quest 5<p>

 

 <b>8. This is a turn-based strategy game: </b><p>

 <input type=radio value="a" onClick="Engine(8, this.value)">C&C: Red Alert<br>

 <input type=radio value="b" onClick="Engine(8, this.value)">Might and Magic 3<br>

 <input type=radio value="c" onClick="Engine(8, this.value)">Heroes of Might and Magic<br>

 <input type=radio value="d" onClick="Engine(8, this.value)">Daggerfall: The Elder Scrolls<p>

 

 <b>9. PC Gamer's <i>Best Game of the 1996</i> went to: </b><p>

 <input type=radio value="a" onClick="Engine(9, this.value)">C&C: Red Alert<br>

 <input type=radio value="b" onClick="Engine(9, this.value)">Tomb Raider<br>

 <input type=radio value="c" onClick="Engine(9, this.value)">Quake<br>

 <input type=radio value="d" onClick="Engine(9, this.value)">Civilization 2<p>

 

 <b>10. Blizzard's new release, <i>Diablo</i> is a: </b><p>

 <input type=radio value="a" onClick="Engine(10, this.value)">Role Playing Game<br>

 <input type=radio value="b" onClick="Engine(10, this.value)">2D Action Game<br>

 <input type=radio value="c" onClick="Engine(10, this.value)">3D Action Game<br>

 <input type=radio value="d" onClick="Engine(10, this.value)">Simulation<p>

 

 <center>

 <input type=button onClick="NextLevel()" value="Advance to next level">

 </center>

 </form>
               </td></tr>
</table></center>
<br>
<br>
<center>
<textarea name=source rows=12 cols=45 class=yk9>
脚本说明:
把如下代码加入<body>区域中
<script>
 <!-- hide
 var ans = new Array;
 var done = new Array;
 var score = 0;
 // LOSER!  Don't read the answers!
 ans[1] = "c";
 ans[2] = "a";
 ans[3] = "b";
 ans[4] = "b";
 ans[5] = "d";
 ans[6] = "c";
 ans[7] = "c";
 ans[8] = "c";
 ans[9] = "d";
 ans[10] = "a";
 function Engine(question, answer) {
         if (answer != ans[question]) {
                 if (!done[question]) {
                         done[question] = -1;
                         alert("你选错了,你答对了" + score + "个");

                         }

                 else {

                         alert("你已经选过这个了!");

                         }

                 }

         else {

                 if (!done[question]) {

                         done[question] = -1;

                         score++;

                         alert("恭喜你,你答对了" + score + "个");

                         }

                 else {          

                         alert("你已经回答过这个了!");

                         }

                 }

 }

                 

 function NextLevel () {

         if (score > 10) {

                 alert("你作弊了吧!");

                 }

         if (score >= 7 && score <= 9) {

                 alert("你答的不错!!!")

                 //self.location="GameQuiz2.htm"

                 }

         else {

                 alert("你还要继续努力!!!")

                 }

 }

 

 //-->

 </script>

  <form>

 <b>1. WARM-UP: Who created the famous <i>WarCraft 2</i>?</b><p>

 <input type=radio value="a" onClick="Engine(1, this.value)">Sierra On-Line<br>

 <input type=radio value="b" onClick="Engine(1, this.value)">BlueByte<br>

 <input type=radio value="c" onClick="Engine(1, this.value)">Blizzard Entertainment<br>

 <input type=radio value="d" onClick="Engine(1, this.value)">Microsoft<p>

 

 <b>2. This famous 3D shooter claimed <i>PC Gamer's</i> Game of 1994 Award.</b><p>

 <input type=radio value="a" onClick="Engine(2, this.value)">Doom<br>

 <input type=radio value="b" onClick="Engine(2, this.value)">Hexen<br>

 <input type=radio value="c" onClick="Engine(2, this.value)">Descent<br>

 <input type=radio value="d" onClick="Engine(2, this.value)">Wolfenstein 3D<p>

 

 <b>3. The first intergalatic combat game.  Name it.</b><p>

 <input type=radio value="a" onClick="Engine(3, this.value)">Master of Orion<br>

 <input type=radio value="b" onClick="Engine(3, this.value)">Star Control<br>

 <input type=radio value="c" onClick="Engine(3, this.value)">StarCraft<br>

 <input type=radio value="d" onClick="Engine(3, this.value)">Star Trek<p>

 

 <b>4. The game ever to contain graphics was this classic by Roberta Williams.</b><p>

 <input type=radio value="a" onClick="Engine(4, this.value)">King's Quest<br>

 <input type=radio value="b" onClick="Engine(4, this.value)">Mystery House<br>

 <input type=radio value="c" onClick="Engine(4, this.value)">Time Zone<br>

 <input type=radio value="d" onClick="Engine(4, this.value)">Mission: Asteriod<p>

 

 <b>5. The first real-time strategy game was: </b><p>

 <input type=radio value="a" onClick="Engine(5, this.value)">WarCraft: Orcs & Humans<br>

 <input type=radio value="b" onClick="Engine(5, this.value)">Command & Conquer<br>

 <input type=radio value="c" onClick="Engine(5, this.value)">Dune<br>

 <input type=radio value="d" onClick="Engine(5, this.value)">Dune 2<p>

 

 <b>6. In PC Gamer, Quake won these 'of-the-year' awards (1996): </b><p>

 <input type=radio value="a" onClick="Engine(6, this.value)">Best Game, Best Action Game<br>

 <input type=radio value="b" onClick="Engine(6, this.value)">Best Action Game, Best Multiplayer<br>

 <input type=radio value="c" onClick="Engine(6, this.value)">Best Sound Effects, Best Multiplayer<br>

 <input type=radio value="d" onClick="Engine(6, this.value)">All of the above<p>

 

 <b>7. The best selling game of all time is: </b><p>

 <input type=radio value="a" onClick="Engine(7, this.value)">WarCraft 2<br>

 <input type=radio value="b" onClick="Engine(7, this.value)">C&C: Red Alert<br>

 <input type=radio value="c" onClick="Engine(7, this.value)">Sim City<br>

 <input type=radio value="d" onClick="Engine(7, this.value)">King's Quest 5<p>

 

 <b>8. This is a turn-based strategy game: </b><p>

 <input type=radio value="a" onClick="Engine(8, this.value)">C&C: Red Alert<br>

 <input type=radio value="b" onClick="Engine(8, this.value)">Might and Magic 3<br>

 <input type=radio value="c" onClick="Engine(8, this.value)">Heroes of Might and Magic<br>

 <input type=radio value="d" onClick="Engine(8, this.value)">Daggerfall: The Elder Scrolls<p>

 

 <b>9. PC Gamer's <i>Best Game of the 1996</i> went to: </b><p>

 <input type=radio value="a" onClick="Engine(9, this.value)">C&C: Red Alert<br>

 <input type=radio value="b" onClick="Engine(9, this.value)">Tomb Raider<br>

 <input type=radio value="c" onClick="Engine(9, this.value)">Quake<br>

 <input type=radio value="d" onClick="Engine(9, this.value)">Civilization 2<p>

 

 <b>10. Blizzard's new release, <i>Diablo</i> is a: </b><p>

 <input type=radio value="a" onClick="Engine(10, this.value)">Role Playing Game<br>

 <input type=radio value="b" onClick="Engine(10, this.value)">2D Action Game<br>

 <input type=radio value="c" onClick="Engine(10, this.value)">3D Action Game<br>

 <input type=radio value="d" onClick="Engine(10, this.value)">Simulation<p>

 

 <center>

 <input type=button onClick="NextLevel()" value="Advance to next level">

 </center>

 </form>
</textarea>
<SCRIPT LANGUAGE="JavaScript">

<!-- hide

function goHist(a) 

{

   history.go(a);

}

//-->

</script>

<FORM METHOD="post">
<INPUT TYPE="button" VALUE="返回" onClick="goHist(-1)" style="background-color: #8000FF; color: rgb(255,255,255)">
</form>
</center>
<br>
<br>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -