The Answer System Automatically submits the answer and saves the question.

Source: Internet
Author: User

/// = Userscript = <br/> // @ name etju <br/> // @ namespace etju <br/> // @ include http://www.etju.com/netfiles3web/#/stuonlinehwt.aspx? * <Br/> // =/userscript = <br/> function myrefresh () <br/>{< br/> window. history. go (-1); <br/>}< br/> // alert (window. location); <br/> var mydivt.pdf = document. getelementbyid ('message'); <br/> var mytds = mydivt133. getelementsbytagname ('td '); <br/> var bsubmit = false; <br/> var selectedans = []; <br/> var fname = 'd: // jsj.txt '; <br/>{< br/> // alert (document. body. innerhtml); <br/> // alert (document. body. childn Odes [0]. innerhtml); <br/> If (document. Body. childnodes [0]. innerhtml! = Undefined) <br/>{< br/> bsubmit = true; <br/>}< br/> else <br/>{</P> <p> var ansstr = (document. body. childnodes [0]. nodevalue); <br/> var ans = ansstr. split (';'); <br/> for (VAR I = 0; I <ans. length-1; I ++) <br/>{< br/> var sel = ans [I]. split ('. ') [1]; <br/> selectedans [I] = sel; <br/>}</P> <p> // alert (selectedans [0] + selectedans [1] + selectedans [2] + selectedans [3] + selectedans [4] ); <br/>}< br/> VaR Subslen = 0; <br/>{< br/> var FSO = new activexobject ("scripting. fileSystemObject "); <br/> var subs = new array (); <br/> If (FSO. fileexists (fname) <br/>{< br/> var file = FSO. opentextfile (fname, 1); <br/> while (! File. atendofstream) <br/>{< br/> subs [subslen] = file. readline (); <br/> subslen = subslen + 1; <br/>}< br/> file. close (); <br/>}< br/> else <br/>{< br/> var file = FSO. createtextfile (fname); <br/> file. close (); <br/>}< br/> var FSO, F, S; <br/> FSO = new activexobject ("scripting. fileSystemObject "); <br/> F = FSO. opentextfile (fname, 8); <br/> var numofsub = 0; <br/> var allmatch = true; <br/> // alert (subsl En); <br/> for (var k = 0; k <mytds. length; k ++) <br/>{< br/> If (mytds [K]. haschildnodes () = true) <br/>{< br/> If (mytds [K]. getattribute ('height ')! = '63') <br/>{< br/> continue; <br/>}< br/> // alert (bsubmit ); <br/> var subject = mytds [K]. childnodes [0]. innerhtml; <br/> subject = subject. substring (2); <br/> // var sels = mytds [K]. childnodes [1]; <br/> var name = "radio" + (numofsub + 1 ). tostring (); <br/> var sels = document. getelementsbyname (name); <br/> If (bsubmit = true) <br/>{< br/> var bmatch = false; <br/> for (VAR I = 0; I <subslen; I ++) <br/> {<br/> If (Subs [I]. indexof (subject )! =-1) <br/>{< br/> // have a subject exist, read it's answer <br/> var sel = Subs [I]. charat (subs [I]. length-1); <br/> var selans = 0; <br/> // alert (subs [I]); <br/> If (SEL = 'A') <br/>{< br/> selans = 0; <br/>}< br/> else if (SEL = 'B') <br/>{< br/> selans = 1; <br/>}< br/> else if (SEL = 'C') <br/>{< br/> selans = 2; <br/>}< br/> else if (SEL = 'D') <br/>{< br/> selans = 3; <br/>}< br/> // sels. childnodes [2 + (Selans * 4)]. checked = true; <br/> sels [selans]. checked = true; <br/> bmatch = true; <br/> break; <br/>}</P> <p> If (bmatch! = True) <br/>{< br/> // select a as answer <br/> // alert (subject); <br/> // sels. childnodes [2]. checked = true; <br/> sels [0]. checked = true; <br/> allmatch = false; <br/>}< br/> else <br/> {<br/> // alert ('123 '); <br/> var bmatch = false; <br/> for (VAR I = 0; I <subslen; I ++) <br/>{< br/> If (subs [I]. indexof (subject )! =-1) <br/>{< br/> // have a subject exist, read it's answer and check <br/> bmatch = true; <br/> break; <br/>}</P> <p> If (bmatch! = True) <br/>{< br/> // write to file and save <br/> var line = subject + ''; <br/> var sel = selectedans [numofsub]; <br/> var selno = ['A', 'B', 'C', 'D']; <br/> var selans = 0; <br/> If (SEL = 'A') <br/> {<br/> selans = 0; <br/>}< br/> else if (SEL = 'B') <br/>{< br/> selans = 1; <br/>}< br/> else if (SEL = 'C') <br/>{< br/> selans = 2; <br/>}< br/> else if (SEL = 'D') <br/>{< br/> selans = 3; <br/>}</P> <p> L INE + = (selno [selans] + ':' + sels [selans]. nextsibling. nodevalue + ';'); <br/> // alert (selectedans [numofsub]); <br/> line + = (''+ selectedans [numofsub]); <br/> // alert (line); <br/> F. writeline (line); <br/> allmatch = false; <br/>}< br/> else <br/>{</P> <p >}< br/> numofsub ++; <br/>}< br/> F. close (); <br/> If (bsubmit = true) & (allmatch = true )) <br/>{< br/> // alert (all the subjects match! '); <Br/> var FSO, F, S; <br/> FSO = new activexobject ("scripting. fileSystemObject "); <br/> F = FSO. opentextfile ('d: // ref.txt ', 1); <br/> S = f. readall (); <br/> F. close (); <br/> var ref = Number (s); <br/> If (ref> = 9) <br/>{< br/> alert (all the subjects match! '); <Br/>}< br/> else <br/>{< br/> ref ++; <br/> F = FSO. opentextfile ('d: // ref.txt ', 2); <br/> F. write (ref. tostring (); <br/> F. close (); <br/>}< br/> else if (bsubmit = true) <br/>{< br/> var FSO, F, s; <br/> FSO = new activexobject ("scripting. fileSystemObject "); <br/> F = FSO. opentextfile ('d: // ref.txt ', 2); <br/> F. write ('0'); <br/> F. close (); <br/>}< br/> If (bsubmit = true) <br/>{< br/> document. form1.s Ubmit (); <br/>}< br/> else <br/>{< br/> var FSO, F, S; <br/> FSO = new activexobject ("scripting. fileSystemObject "); <br/> F = FSO. opentextfile ('d: // ref.txt ', 1); <br/> S = f. readall (); <br/> F. close (); <br/> var ref = Number (s); <br/> If (ref <3) <br/> setTimeout ('myrefresh ()', 2000); // refresh once per second <br/> else <br/> {<br/> F = FSO. opentextfile ('d: // ref.txt ', 2); <br/> F. write ('0'); <br/> F. close (); <br/> alert ('all t He subjects match! '); <Br/>}< br/>

1. Download Trixie;

2. Copy the script to the scripts directory;

3. Modify the security attributes of the browser, add www.etju.com to the trusted site, and change all the active-related options of the trusted site to execute;

4.ensure that there is an empty file ref.txt or the content is 0 under the D drive;

5.disconnect all Internet pages, re-open the website, and access the Answer System. The questions are stored in ddrive jsj.txt;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.