Quiz freezing (seemingly randomly)

Topics related to using ToolBook for building web apps.

Quiz freezing (seemingly randomly)

Postby Robert Stevenson » Fri Jun 17, 2016 4:28 pm

One of these mastery module things where students must get 20 questions correct in a row or be set back to starting over. Works great for mastery learning but sucks every time the student gets down to 1 from the starting point of 20 and then has the page freeze not allowing them to go to the next question. I have copied a typical page script from it. Does anything pop out to you that might be causing this behavior?

--------------------------------------------------------------------------------
Actions for Definable Multiple Choice Question "Definable Multiple Choice" of Page "crayfish"
--------------------------------------------------------------------------------

-- On question answered... -----------------------------------------------------
If score = "correct"
Set visible of Web Graphic "correct" of This Background to true
Set currentmastery to currentmastery + 1
Set needing to mastery - currentmastery
Set text of Field "need" of This Background to needing
If currentmastery >= mastery
Go to page "certificate"
End if
Else
Set visible of Web Graphic "incorrect" of This Background to true
Set currentmastery to 0
Set text of Field "need" of This Background to mastery
End if
Set enabled of Navigation Button "next" of This Background to true
Set enabled of Navigation Button "previous" of This Background to true



--------------------------------------------------------------------------------
Actions for Button "Exit" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On click... -----------------------------------------------------------------
Exit (LMS: Student cannot resume) (LMS: no automatic navigation)


--------------------------------------------------------------------------------
Actions for Navigation Button "next" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On load page... -------------------------------------------------------------
Set enabled of Self to false


--------------------------------------------------------------------------------
Actions for Web Graphic "incorrect" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On click... -----------------------------------------------------------------
Set visible of Self to false


-- On unload page... -----------------------------------------------------------
Set visible of Self to false


--------------------------------------------------------------------------------
Actions for Web Graphic "correct" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On click... -----------------------------------------------------------------
Set visible of Self to false


-- On unload page... -----------------------------------------------------------
Set visible of Self to false


--------------------------------------------------------------------------------
Actions for Navigation Button "previous" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On load page... -------------------------------------------------------------
Set enabled of Self to false
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: Quiz freezing (seemingly randomly)

Postby Clifton » Fri Jun 17, 2016 5:34 pm

Is it possible that your quiz "freezes" because there are no more quiz pages to serve. In theory, a student could keep getting thrown back until the quiz runs out of pages. Not sure of your logic for this. If your quiz is randomized, this could present other issues when it comes to serving pages.

Note: the PowerPac has its own quiz randomizer which can be reset and started over at any time. See gotoRandomPage() in the PowerPac library of functions. You may or may not find it useful to rectify your navigation logic.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Quiz freezing (seemingly randomly)

Postby Robert Stevenson » Sat Jun 18, 2016 5:01 pm

Curious if you think having a timer on each page might be causing this?
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: Quiz freezing (seemingly randomly)

Postby Clifton » Sat Jun 18, 2016 5:08 pm

What does the time do?
Does it fire other actions?
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Quiz freezing (seemingly randomly)

Postby Robert Stevenson » Sat Jun 18, 2016 5:24 pm

Clifton wrote:Is it possible that your quiz "freezes" because there are no more quiz pages to serve. In theory, a student could keep getting thrown back until the quiz runs out of pages. Not sure of your logic for this. If your quiz is randomized, this could present other issues when it comes to serving pages.

Note: the PowerPac has its own quiz randomizer which can be reset and started over at any time. See gotoRandomPage() in the PowerPac library of functions. You may or may not find it useful to rectify your navigation logic.




It is randomized (in the old-fashioned way) but it draws from over 150 questions so I'm thinking that shouldn't be a problem. Its only the score that re-sets at 20 and then they once again need to get it down to 0 by getting 20 consecutively correct.
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: Quiz freezing (seemingly randomly)

Postby Clifton » Sat Jun 18, 2016 5:30 pm

You may have 150 questions, but how many does the quiz randomizer pick to serve. That would be your limitation. If the randomizer picks all 150, well that is fine, but if it picks only 20, then at some point the student will run out of questions.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Quiz freezing (seemingly randomly)

Postby Robert Stevenson » Sat Jun 18, 2016 6:28 pm

It is picking the whole thing (which turns out to be 177 questions)
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: Quiz freezing (seemingly randomly)

Postby Robert Stevenson » Mon Jun 20, 2016 7:30 pm

Okay ... I have been playing with this for far too long. I now get it to freeze only under the exact circumstances of when the student actually gets 20 correct responses in a row (and should be taken to the certificate page where the scoring widget writes the 100% into the Moodle gradebook). Problem is the book doesn't seem to know what to do when it gets to that "mastery" position. I have included my updated action script and would love someone to take a cursory look at it and see if anything jumps of the screen as being the source of the problem.

--------------------------------------------------------------------------------
Actions for Page "first"
--------------------------------------------------------------------------------

-- On load page... -------------------------------------------------------------
If currentmastery >= mastery
Go to page "certificate"
End if


--------------------------------------------------------------------------------
Actions for Definable Multiple Choice Question "Definable Multiple Choice" of Page "first"
--------------------------------------------------------------------------------

-- On question answered... -----------------------------------------------------
If score = "correct"
Set visible of Web Graphic "correct" of This Background to true
Set currentmastery to currentmastery + 1
Set needing to mastery - currentmastery
Set text of Field "need" of This Background to needing
Go to the next page
Else
Set visible of Web Graphic "incorrect" of This Background to true
Set currentmastery to 0
Set text of Field "need" of This Background to mastery
End if
Set enabled of Navigation Button "next" of This Background to true
Set enabled of Navigation Button "previous" of This Background to true



--------------------------------------------------------------------------------
Actions for Button "Exit" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On click... -----------------------------------------------------------------
Exit (LMS: Student cannot resume) (LMS: no automatic navigation)


--------------------------------------------------------------------------------
Actions for Navigation Button "next" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On load page... -------------------------------------------------------------
Set enabled of Self to false


--------------------------------------------------------------------------------
Actions for Field "need" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On load page... -------------------------------------------------------------
Set text of Self to needing


--------------------------------------------------------------------------------
Actions for Web Graphic "incorrect" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On click... -----------------------------------------------------------------
Set visible of Self to false


-- On unload page... -----------------------------------------------------------
Set visible of Self to false


--------------------------------------------------------------------------------
Actions for Web Graphic "correct" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On click... -----------------------------------------------------------------
Set visible of Self to false


-- On unload page... -----------------------------------------------------------
Set visible of Self to false


--------------------------------------------------------------------------------
Actions for Navigation Button "previous" of Background "wormdiagram"
--------------------------------------------------------------------------------

-- On load page... -------------------------------------------------------------
Set enabled of Self to false
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Re: Quiz freezing (seemingly randomly)

Postby Clifton » Mon Jun 20, 2016 8:56 pm

Robert Stevenson wrote:
I now get it to freeze only under the exact circumstances of when the 
student actually gets 20 correct responses in a row (and should be taken to the certificate
page where the scoring widget writes the 100% into the Moodle gradebook).
Problem is the book doesn't seem to know what to do when it gets to that "mastery" position.

--------------------------------------------------------------------------------
Actions for Definable Multiple Choice Question "Definable Multiple Choice" of Page "first"
--------------------------------------------------------------------------------

-- On question answered... -----------------------------------------------------
If score = "correct"
Set visible of Web Graphic "correct" of This Background to true
Set currentmastery to currentmastery + 1
Set needing to mastery - currentmastery
Set text of Field "need" of This Background to needing
Go to the next page
Else
Set visible of Web Graphic "incorrect" of This Background to true
Set currentmastery to 0
Set text of Field "need" of This Background to mastery
End if
Set enabled of Navigation Button "next" of This Background to true
Set enabled of Navigation Button "previous" of This Background to true


TRY THIS:
If score = "correct"
Set visible of Web Graphic "correct" of This Background to true
Set currentmastery to currentmastery + 1
Set needing to mastery - currentmastery
Set text of Field "need" of This Background to needing
Else
Set visible of Web Graphic "incorrect" of This Background to true
Set currentmastery to 0
Set text of Field "need" of This Background to mastery
End if
Set enabled of Navigation Button "next" of This Background to true
Set enabled of Navigation Button "previous" of This Background to true
Delay 300 ms
If currentmastery >= mastery
Go to page "certificate"
Break out of action sequence
end if


LOGIC:
The idea is to let the on question answered event fully finish BEFORE allowing page navigation. The delay action should allow for this and you should be able to reduce the delay to 100ms or less. I've seen issues with automatic navigation inside a question event and it doesn't always play well with sudden page navigation because various tasks are being performed each time a question is answered. As soon as you navigate to another page, the object on which the event depend are destroyed and the application may/could freeze.

    There are more flexible (and possibly reliable) ways to do this using PowerPac functions . . . notably pgTBObjSet() and gotoPage(), but I think the above should work (though not tested). Just don't move the delay inside the if/then statement as nested delays are NOT supported.
NOTE:
In addition, you should not use actions like this outside of a sharedAction routine otherwise every time you have to modify the logic you will have to change it on 150+ pages!! A sharedAction can be called as many times as you need it but it resides in just one place when it has to be edited. Plus sharedActions are portable and can be imported into other courses.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Quiz freezing (seemingly randomly)

Postby Robert Stevenson » Tue Jun 21, 2016 9:28 am

Now that I have 170+ questions I'm thinking I am stuck with editing every question object. Need to find a good resource to learn the shared action stuff.
I notice you have cut the going to next page automatically out when the question is correct. Curious as to why?
Robert Stevenson
 
Posts: 138
Joined: Wed May 14, 2014 11:46 am

Next

Return to Web (DHTML) Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron