Expected behavior when user logs out without exiting activity?

Expected behavior when user logs out without exiting activity?

by Veronika Smith -
Number of replies: 3

When a user logs out instead of clicking "Exit Activity" on a SCORM activity, the user gets an error. Traced in the SCORM API debugging log it looks like this:

Thu, 29 Sep 2011 19:13:25 UTC: Commit("", "") => 0
Thu, 29 Sep 2011 19:13:25 UTC: LMSCommit("AJAXResult", "") => 0
Thu, 29 Sep 2011 19:13:25 UTC: LMSCommit("result", "false") => 0
Thu, 29 Sep 2011 19:13:25 UTC: LMSCommit("errorCode", "101") => 0
Thu, 29 Sep 2011 19:13:25 UTC: LMSGetErrorString("101", "General exception") => 0
Thu, 29 Sep 2011 19:15:08 UTC: LMSFinish("AJAXResult", "") => 0
Thu, 29 Sep 2011 19:15:08 UTC: LMSFinish("result", "false") => 0
Thu, 29 Sep 2011 19:15:08 UTC: LMSFinish("", "") => 0
Thu, 29 Sep 2011 19:15:08 UTC: LMSGetErrorString("101", "General exception") => 0
 
The user gets an error:
"Unable to save your state to LMS Error 101 : General exception"
 
Is this the expected behavior? Does the user have to click "Exit Activity" before "Logout" in order to avoid this error?
 
The activity completion records ok for me, but the course completion (which is only based on completing that single SCORM activity) is not marked complete.
Average of ratings: -
In reply to Veronika Smith

Re: Expected behavior when user logs out without exiting activity?

by Stefan Meise -

Hi,

we observe the same issue with several packages, including the demos from the ADL website. Looks like there's no mechanism to signal the RT that the user is logging off. Hence the JS runs on and fails lacking a session. Moodle 2.2.2 btw.

Am I missing anything or is this really normal behaviour?

Best

Stefan

In reply to Stefan Meise

Re: Expected behavior when user logs out without exiting activity?

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
that could probably be classed as a bug.

you can probably help to prevent the users from doing it by using the setting to open the SCORM in a new window - it's possibly more likely the users will close the window which should trigger LMSFinish() as expected.

feel free to create a new bug in the tracker for it although unless it gets a large number of votes or someone funds my time to fix it I'm likely to spend time on other tasks first and this will probably sit for a while.
In reply to Dan Marsden

Re: Expected behavior when user logs out without exiting activity?

by Mike Guelfi -

Sorry for the necro post, but this is the google result for the problem and I've found a solution that works for us.

In the theme's config.php file, adjust the incourse array from:

    'incourse' => array(
        'file' => 'general.php',
        'regions' => array('side-pre', 'side-post'),
        'defaultregion' => 'side-pre',
    ),

to

    'incourse' => array(
        'file' => 'general.php',
        'options' => array('nologinlinks'=>true),
        'regions' => array('side-pre', 'side-post'),
        'defaultregion' => 'side-pre',
     ),

i.e. add the options array (or add nologinlinks to the existing array if you have one)

This will remove the "(Log out)" link in the header and footer of the page while in a course, so the student can't log out without exiting the activity and hence don't generate the error where the javascript is attempting to write to a closed connection.