home *** CD-ROM | disk | FTP | other *** search
- function saveFile(txt)
- {
- num = document.forms[0].lesson_num.value+'_'+document.forms[0].exam_num.value;
- window.status='╧εµαδ≤Θ±≥α, ∩εΣεµΣΦ≥σ. ┬√∩εδφ σ≥± ±ε⌡≡αφσφΦσ ≡στ≤δⁿ≥α≥εΓ ...';
- try {
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var fl = fso.CreateTextFile( "C:\\exam_"+num+".txt" , true);
- fl.WriteLine(txt);
- fl.Close(); delete fl; delete fso;
- } catch(e) {}
- window.status='';
- }
-
- function openFile()
- {
- num = document.forms[0].lesson_num.value+'_'+document.forms[0].exam_num.value;
- s = "";
- window.status='╧εµαδ≤Θ±≥α, ∩εΣεµΣΦ≥σ. ┬√∩εδφ σ≥± ε≥Ω≡√≥Φσ ⌠αΘδα ...';
- try {
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var fl = fso.OpenTextFile("C:\\exam_"+num+".txt");
- var s = fl.ReadAll();
- fl.Close(); delete fl; delete fso;
- } catch(e){}
- window.status='';
- return s;
- }
-
- function Qwest()
- {
- var ch = '';
- var the_form = document.forms[0];
- try
- {
- for(j=1; j<21; j++)
- {
- var the_item;
- eval("the_item=the_form.q" + j );
- k = the_item.length;
- if (k>0)
- {
- //ch += j+"-";
- for(i=0;i<k;i++)
- {
- if(the_item[i].checked)
- {
- ch += the_item[i].value;
- }
- }
- ch+=";";
- }
- }
- }catch(e){}
- return ch;
- }
-
- function checkQwest()
- {
- saveFile(Qwest());
- }
-
- function resultQwest()
- {
- document.forms.resform.result.value = Qwest()
- }
-
-
- function restoreQwest()
- {
- var the_form = document.forms[0];
- num = document.forms[0].lesson_num.value+'_'+document.forms[0].exam_num.value;
- var the_item;
- res = openFile();
- try{
-
- if (res != '')
- {
- qw = res.split(";")
- for(i=0;i<20;i++)
- {
- kk = i+1;
- st = qw[i];
- if(st !="")
- {
- eval("the_item=the_form.q" + kk);
- if(the_item[0].type == "checkbox")
- {
- ss = st.split("");
- for (ii = 0; ii < ss.length; ii++)
- {
- d = ss[ii];
- the_item[d].click();
- the_item[d].cheked = true;
- }
-
- }
- else
- {
- the_item[st].cheked = true;
- the_item[st].click();
- }
- }
- }
- }
- }catch(e){}
- }
-
-
-