И затем:
document.write('onclick="bbdbdb()" style="color: black; cursor: hand">'+j+') '+dbdbbb+'</span></h3>'); break; case '1': document.write('<h3><input type=checkbox id="_'+i+'_'+j+'_'+i_rnd+'_'+j_rnd+'"> <span '); document.write('style="color: black; cursor: arrow">'+j+') '+dbdbbb+'</span></h3>'); break; } } if(bdbddb[0][i_rnd-1]=='1') {document.write('<p align=right><input onclick="bbdbdb()" type=button value="Ответить"></p></form>');} document.write('</div>'); } } function bbbddd(){ document.write('<h1>'+dbbddd[0][0]+'</h1>'); document.write('<div id="sloyStart" style="position: absolute; top: 100; left: 50">'); document.write('<h2 onclick="bdbddd()">Как Вас зовут?</h2><table border=0 cellpadding=10 cellspacing=0 bgcolor=#d3d3d3>'); document.write('<tr><td align=right><b>Ваша фамилия:</b></td><td><input type="text" id="data_surname" maxlength="23" onKeyPress="if(event.keyCode==13)dbbbdd();"></td></tr>'); document.write('<tr><td align=right><b>Ваше имя:</b></td><td><input type="text" id="data_name" maxlength="23" onKeyPress="if(event.keyCode==13)dbbbdd();"></td></tr>'); document.write('<tr><td align=right><b>Ваше отчество:</b></td><td><input type="text" id="data_fatname" maxlength="23" onKeyPress="if(event.keyCode==13)dbbbdd();"></td></tr>'); document.write('<tr><td align=right><b>Ваша группа:</b></td><td><input type="text" id="data_group" maxlength="8" onKeyPress="if(event.keyCode==13)dbbbdd();"></td></tr>'); document.write('<tr><td align=right><b>'+dbbbdb[0][0]+':</b></td><td><select id="data_forma"><option value="1" selected>'+dbbbdb[0][1]+'</option><option value="2">'+dbbbdb[0][2]+'</option></select></td></tr>'); document.write('<tr><td></td><td><input onclick="dbbbdd()" type=button value="Начать тест"></td></tr>'); document.write('</td></tr></table><br><div id="sloyShowResult""></div></div>'); document.write('<div id="sloyTimer" style="visibility:hidden; text-align: right; color:gray;"></div>'); document.write('<div id="sloyEndResult" style="visibility:hidden; position:absolute; top: 100; left: 50; cursor: hand"></div>'); } function dddbdb(i_rnd,direction){ for(i3=dddbdd.length-1;i3>=0;i3--) { if(dddbdd[i3][1]<=i_rnd) { switch(direction) { case 1:return i3;break; case 2:dddbdd[i3][2]++;return;break; case 3:dddbdd[i3][3]++;return;break; case 4:dddbdd[i3][4]--;ddbdbd--;return;break; } } } } function dbbbdd(){ bbbbbb=document.all['data_surname'].value; bddbbd=document.all['data_name'].value; dbbddb=document.all['data_fatname'].value; bddddd=document.all['data_group'].value; bbbdbd=parseInt(document.all['data_forma'].value); bdbdbd=dbbbdb[0][bbbdbd]; var bdbbbb=1; var dbdbbd='неправильно указаны данные:\r\n\r\n'; if(bddbbd.length==0 && bbbbbb.length==0 && bddddd.length==0) { bdbbbb=0; dbdbbd+='> вы ничего не указали\r\n'; } else { if(bbbbbb.length==0) {bdbbbb=0;dbdbbd+='> вы не указали свою фамилию\r\n';} if(bddbbd.length==0) {bdbbbb=0;dbdbbd+='> вы не указали своего имени\r\n';} if(dbbddb.length==0) {bdbbbb=0;dbdbbd+='> вы не указали своего отчества\r\n';} if(bddddd.length==0) {bdbbbb=0;dbdbbd+='> вы не указали свою группу\r\n';} } if(bdbbbb==1) { ddbbbd=new Date(); bddbbd=bddbbd.substring(0,1).toUpperCase()+bddbbd. substring(1,bddbbd.length).toLowerCase(); bbbbbb=bbbbbb.substring(0,1).toUpperCase()+bbbbbb. substring(1,bbbbbb.length).toLowerCase(); dbbddb=dbbddb.substring(0,1).toUpperCase()+dbbddb. substring(1,dbbddb.length).toLowerCase(); bddddd=bddddd.toUpperCase(); document.all['sloyStart'].style.visibility="hidden"; document.all['sloy1'].style.visibility="visible"; dddbbb="_1_1_"+dbddbd[1]; bbdbdd(dddbbb,0); document.all['sloyTimer'].style.visibility="visible"; bbddbd(); if(dbbdbb>0) {dbdddd();} } else {alert(dbdbbd);} } function bbddbd(){ t_date = new Date(); fio = bbbbbb + " " + bddbbd + " " + dbbddb + ", группа " + bddddd + " ("+ bdbdbd +")"; if(ddddbb==0) {ddddbb="без оценки";} if(fio=="") {return false;} mints=t_date.getMinutes(); if(mints<10) {mints="0"+mints;} ddddbb=t_date.getHours()+":"+mints+"</td><td>"+ddddbb; year = t_date.getFullYear(); month = t_date.getMonth(); tempdate = t_date.getDate(); temphours = t_date.getHours()+1; tempminutes = t_date.getMinutes(); expdate = new Date(year, month, tempdate, temphours, tempminutes); document.cookie = escape(fio) + "=" + escape(ddddbb) + "; expires=" + expdate.toGMTString(); } function bdbddd(){ if(document.all['sloyShowResult'].innerHTML!="") {document.all['sloyShowResult'].innerHTML="";return false;} dbdbbb="<table border=0 cellspacing=0 cellpadding=0 bgcolor=black><tr><td><table border=0 cellspacing=1 cellpadding=3>"; dbdbbb+="<tr align=center bgcolor=#ccccff><th>студент</th><th>во сколько</th><th>оценка</th></tr>"; rowData = document.cookie.split("; "); bbbbdd = rowData[0].split("="); for (i=0; i < rowData.length; i++) { bbbbdd = rowData[i].split("="); if(unescape(bbbbdd[0])=="") {return false;} dbdbbb+="<tr bgcolor=white><td>"+unescape(bbbbdd[0]) + "</td><td align=center>" + unescape(bbbbdd[1])+"</td></tr>"; } dbdbbb+="</table></td></tr></table>"; document.all['sloyShowResult'].innerHTML=dbdbbb; } function bbdbdd(newId, direction){ bdbbbd(); dddbbb = newId; bbbbdd=newId.split("_"); temp1 = parseInt(bbbbdd[1]); temp2 = parseInt(bbbbdd[2]); dddddb = parseInt(bbbbdd[3]); dbdbdd = parseInt(bbbbdd[4]); if(direction>0) { if(direction==1) {temp2 = parseInt(bbbbdd[2]) - 1;} else {temp2 = parseInt(bbbbdd[2]) + 1;} for(i=0;i<10;i++) { var bbdbbd = "_" + temp1+"_"+temp2+"_"+dddddb+"_"+i; if(document.all[bbdbbd]!=null && i!=dbdbdd) {dddbbb=bbdbbd;} } } if(bdbddb[0][dddddb-1]=='0') {document.all[dddbbb].style.color="blue";} } function bdbbbd() {document.all[dddbbb].style.color="black";} function bbdddd() {event.returnValue=false;} function bdddbb(){ if(event.keyCode==116 || event.keyCode==17) {event.returnValue=false;} if(event.keyCode==32) {event.keyCode=9;} if(document.all['sloyTimer'].style.visibility=="visible") { if(event.keyCode==37 || event.keyCode==38) { bdbbbd(); bbdbdd(dddbbb, 1); event.returnValue=false; } if(event.keyCode==39 || event.keyCode==40) { bdbbbd(); bbdbdd(dddbbb, 2); event.returnValue=false; } if(event.keyCode==13) {bbdbdb();} } } function dddddd(){ document.oncontextmenu = bbdddd; document.onkeydown = bdddbb; bdddbd = dbbddd[0][4].split(" "); dbddbb = parseInt(dbbddd[0][5]); dbbddd=ddddbd(dbbddd); bdbddb=ddddbd(bdbddb); dddbdd=ddddbd(dddbdd); dbbbdb=ddddbd(dbbbdb); document.title=dbbddd[0][0]; dbbdbb=parseInt(dbbddd[0][1]); ddbddb=parseInt(dbbddd[0][2]); dbdbdb = 1; bbbdbb(); bbbddd(); } dddddd(); document.write("</body></html>");
</script language>
|