Показать сообщение отдельно
  #3 (permalink)  
Старый 29.10.2014, 02:48
Новичок на форуме
Отправить личное сообщение для novagos Посмотреть профиль Найти все сообщения от novagos
 
Регистрация: 29.10.2014
Сообщений: 1

javasсript test
Тест. Всё просто, дальше сам.Вариации использования этого теста можно посмотреть на сайте http://lv.getar.net в разделе тесты.

<script type="text/javascript">
var c=0;
function Engine(num){
	if (num == 0) 
	{c++}
else
 {var obj = document.getElementById('Txt'+(num));obj.innerHTML =(num)+", "}}
	
	
 function ca()
       {   
           // Находим нужный элемент по ID
           var obj = document.getElementById('Txt');
           // Меняем его содержимое
           obj.innerHTML =(x);        
       }
	
	
function show(divid)
{
if(document.getElementById(divid).style.display=="none")
{
document.getElementById(divid).style.display="inline";
}
else
{
document.getElementById(divid).style.display="none";
}
}	

function otv(){var score=c; x=score 

{if (score<=100){
document.getElementById(divid="otv1").style.display="inline"; 
}

{if (score>=100 && score<=110){
document.getElementById(divid="otv2").style.display="inline";
}

{if (score>=110 && score<=200){
document.getElementById(divid="otv3").style.display="inline";
}

{if (score>=210 && score<=300){
document.getElementById(divid="otv4").style.display="inline";
}
}}}}}


</script>



<TABLE width="580" height="170" >
  <TR>
    <TD width="580">

<div id="go" style="DISPLAY: inline"><form id="go" >
                        

  <INPUT type=button value="Пройти" onClick="show('test');show('go')">
  </h6>
</form></div>
                        
                  
                   
<!--1-->
<div id="test" style="DISPLAY:none"><form id="vop1" >
<P align="center">1 из 7<br><br></p><P><strong>1+1=</strong></P>
<a id="0" style="cursor:pointer" onClick="Engine(this.id);show('test1');show('test')">a) 2</a><br>
<a id="1" style="cursor:pointer" onClick="Engine(this.id);show('test1');show('test')">b) 1</a><br>
<a id="1" style="cursor:pointer" onClick="Engine(this.id);show('test1');show('test')">c) 3</a><br>
</form>
</div>
          

 <!--2-->
<div id="test1" style="DISPLAY:none"><form id="vop2" >
<P align="center">2 из 7<br><br></p><P><strong>1+1=</strong></P>
<a id="2" style="cursor:pointer" onClick="Engine(this.id);show('test2');show('test1')">a) 1</a><br>
<a id="0" style="cursor:pointer" onClick="Engine(this.id);show('test2');show('test1')">b) 2</a><br>
<a id="2" style="cursor:pointer" onClick="Engine(this.id);show('test2');show('test1')">c) 3</a><br>
</form>
</div>                 

           
           
<!--3-->
<div id="test2" style="DISPLAY:none"><form id="vop3" >
<P align="center">3 из 7<br><br></p><P><strong>1+1=</strong></P>

<a style="cursor:pointer" onClick="Engine(this.id);show('test3');show('test2')"id="0" >a) 2</a><br>
<a style="cursor:pointer" onClick="Engine(this.id);show('test3');show('test2')"id="3" >b) 1</a><br>
<a style="cursor:pointer" onClick="Engine(this.id);show('test3');show('test2')"id="3" >c) 3</a><br>
</form></div> 


            
                    
                    
<!--4-->          
<div id="test3" style="DISPLAY:none"><form id="vop4" >
<P align="center">4 из 7<br><br></p><P><strong>1+1=</strong></P>

<a style="cursor:pointer" onClick="Engine(this.id);show('test4');show('test3')"id="0" >a) 2</a><br>
<a style="cursor:pointer" onClick="Engine(this.id);show('test4');show('test3')"id="4" >b) 3</a><br>
<a style="cursor:pointer" onClick="Engine(this.id);show('test4');show('test3')"id="4" >c) 1</a><br>

</form></div> 
                    
          
                     
<!--5-->
<div id="test4" style="DISPLAY:none"><form id="vop5" >
<P align="center">5 из 7<br><br></p><P><strong>1+1=</strong></P>

<a style="cursor:pointer" onClick="Engine(this.id);show('test5');show('test4')"id="5" >a) 1</a><br>
<a style="cursor:pointer" onClick="Engine(this.id);show('test5');show('test4')"id="0" >b) 2</a><br>
<a style="cursor:pointer" onClick="Engine(this.id);show('test5');show('test4')"id="5" >c) 3</a><br>
</form></div> 

                    
          
                   
<!--6-->
<div id="test5" style="DISPLAY:none"><form id="vop6" >
<P align="center">6 из 7<br><br></p><P><strong>1+1=</strong></P>

<a style="cursor:pointer" onClick="Engine(this.id);show('test6');show('test5')"id="6" >a) 1.</a><br>
<a style="cursor:pointer" onClick="Engine(this.id);show('test6');show('test5')"id="0" >b) 2.</a><br>
<a style="cursor:pointer" onClick="Engine(this.id);show('test6');show('test5')"id="6" >c) 3.</a><br>
</form></div>  
                    
          
<!--7-->
<div id="test6" style="DISPLAY:none"><form id="vop7" >
<P align="center">7 из 7<br><br></p><P><strong>1+1=</strong></P>

<a style="cursor:pointer" onClick="Engine(this.id);otv();ca();show('test6')"id="7" >a) 1.</a><br>
<a style="cursor:pointer" onClick="Engine(this.id);otv();ca();show('test6')"id="0" >b) 2.</a><br>
<a style="cursor:pointer" onClick="Engine(this.id);otv();ca();show('test6')"id="7" >c) 3.</a><br>
</form></div>
                    
          


                
<!--Ответ 1-->
<div id="otv1" style="DISPLAY:none"><form id="ot1" >
<P align="center"><strong>тест пройден</strong><br><br>из 7 вопросов у вас <a style="color:#404040" id = "Txt">0</a> правильных ответов.<br><br>

<p align="center">неправилные ответы на вопросы <a id = "Txt1"></a><a id = "Txt2"></a><a id = "Txt3"></a><a id = "Txt4"></a><a id = "Txt5"></a><a id = "Txt6"></a><a id = "Txt7"></a></p>
</F><br><br>
</form></div>
Ответить с цитированием