Albertxu

I want to save some tests (about one thousand tests totally) from a quiz website to a text file.

3 posts in this topic

I want to save some tests (about one thousand tests totally) from a quiz website to a text file. 

The test page is a simple one, it contains:
1) The questions; they are inside the <p class="qw">...</p>
2) 5 choices; they are radio buttons id ="a1", "b1" ...

When I click a radio for a choice, if correct, the background of it will turn green, if wrong, it will turn red, and the correct answer will turn green. What I need to get is the correct answer. 

So when I click an answer, no matter right or wrong, the test will automatically go to the next question in about 3 or 4 seconds (I don't know exactly how many seconds). 

So what I want to save is: 
Questions
choice 1;
choice 2;
choice 3;
choice 4;
choice 5;
correct answer
Then next question...

I have limited knowledge of AutoIt, I have check the IE UDFs, but I don't know where to start. Especially I don't know how to do since the test will to go next item automatically. 

Please give me some hints. Thank you very much.

Share this post


Link to post
Share on other sites



That's a quite complex task. It won't be easy with "limited knowledge of AutoIt".
What have you tried so far? At least you need to open the URL and retrieve a list of objects to investigate (paragraph, buttons ...).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Albertxu,

What kind of tests are these?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • SalamanderSoup
      By SalamanderSoup
      I've created a simple script that opens the Snipping Tool; Selects the "Full Screen Snip" option; then closes the program, prompting a save.  What I can't figure is how to name the file using the system date and time.
      Can anyone help?
      Run(@WindowsDir & '\system32\SnippingTool.exe') AutoItSetOption('MouseCoordMode', 0) Sleep(1) $hWnd= WinWait("Snipping Tool", "ToolBarWindow32", 1) WinActive($hWnd) MouseClick('primary', 84, 48, 1, 0) MouseClick('primary', 84, 140, 1, 0) WinClose("[Class:Microsoft-Windows-Tablet-SnipperEditor]") ControlClick("Snipping Tool", "", "Button1")  
       
       
       
    • Razraal
      By Razraal
      Hey there folks!
      Task:
      I have an array of DllStructs, created with the function DllStructCreate. Let's call the array $structs. This $structs contains important information for the program. I want to save my  $structs variable for future use in a file (i.e.: the user closes the program, opens it again and has the option to load a file). I want to load files which contain a $structs variable, and let the program work with this "loaded" variable. Questions:
      Since I have never done such a thing (saving/loading a file, possibly in a different format from txt or ini), I'd like to know:
      Is this possible? Is my only option to save my $structs in text format? That would require a function which receives a file and interprets the text it has, creating a new $structs with the info it's getting from the file. (I think this could lead to trouble) I'm worried about security. Since the program will be loading files, I don't want it to crash because the user decided to give it modified files. Is it possible to create a file that's readonly for the user? That would prevent some tampering with the file. From what I've been reading, I have several functions available for File management, namely FileOpen, FileRead and FileWrite. In a first glance, these appear to be the only functions I need. Do I need more?  
      Thank you for your time!
      Cheers!
    • madmega
      By madmega
      Hi, i have some sort of problem here, from a website i can download a xls file, it is 180kb, when i open it with excel and then save it (without changing anything), the file is 130kb.

      Is there a possibility to resave a xls file, without opening excel to do it ?
    • Rapidnxit
      By Rapidnxit
      Hi! I am using a simple function to put a watermark into another image. It works very well, but if then I try to delete the source image file (in the script below it is called $sFile) I have the error that the file is open in my process. Thanks in advance and sorry for my bad english.
      Func _Watermark($sFile2, $sFile, $sLogo) Local $hImage1, $hImage2, $hGraphic _GDIPlus_Startup () $hImage1 = _GDIPlus_ImageLoadFromFile ($sFile) ; image $X1 = _GDIPlus_ImageGetWidth ($hImage1) $Y1 = _GDIPlus_ImageGetHeight ($hImage1) $hImage2 = _GDIPlus_ImageLoadFromFile ($sLogo) ; logo $X2 = _GDIPlus_ImageGetWidth ($hImage2) $Y2 = _GDIPlus_ImageGetHeight ($hImage2) $hGraphic = _GDIPlus_ImageGetGraphicsContext ($hImage1) _GDIPlus_GraphicsDrawImage ($hGraphic, $hImage2, $X1-$X2-5, 5) _GDIPlus_ImageSaveToFile ($hImage1, $sFile2) ; image watermarked _GDIPlus_ImageDispose ($hImage1) _GDIPlus_ImageDispose ($hImage2) _GDIPlus_ShutDown () EndFunc ;==>_Watermark  
    • marcoauto
      By marcoauto
      Ciao
      I need to save a file with ISO 8859-1 encoding
      Now my script is:
      $contenuti_header = "Configuration file <> O:\test.txt <> Last update: 28/09/2015 09:46:36 ð ñ" $record_part1 = "ò1ò0ò1òLayer_01ïï1ï0ï0ï0ï0ï0ï0ïï0ï255ï0ï0ï0ï255ï255ï125ï0ï0ï3ï0ï0ï0ï0ï0ï0ï0ï0ï0ï3ï150ï5ï102ï82ï10ï4ï0ï0ïTahoma;16777215;22;1;ï0ï0ï0ïïïï0ï0ï33ï500ï200ï4ï1ï720ï10ï5ï100ï63ï300ï850ï16777215ï0ï0ï0ï0ï0ï0ï0ï0ï0ï0ï" $record_part2 ="ï0ïTahoma;16777215;22;1;ïïhh.nnïïï0ïï0ï0ï0ï4ï65793ï255ï0ï2ï0ï0ïï5ï5ï0ï0ï0ï0ï0ï100ï100ï0ï0ï8421504ï16777215ïïï0ï0ïïï0ï720ï576ï0ï0ï0ï0ï0ï0ï0ï0ï2ï0ï6ï0ï0ï1ï0ï1ï0ï0ïîò0ò0òòòòòòó" for $i = 1 to $num $contenuti_record = $record_part1 & "ò" & $num & $record_part2 Next $contenuti_end = "òòòòòòòòòòòòòó" $fileTemplate = FileOpen("O:\file.txt", 2) FileWrite($fileTemplate, $contenuti_header&$contenuti_record&$contenuti_end) FileClose($fileTemplate) Autoit writes the file with UTF-8 encoding but the programs that read that file can't read it correctly. If I open file.txt with SublimeText and save it with ISO 8859-1 encoding, the program works well
      Thanks
      Marco