Clearing out suspend data

monicae
monicae Community Member Posts: 10
Hi all,



Does anyone know how to clear a variable out of suspend data once a learner has set it once before?



I find that if set the variable to an empty string (Varmyvariablename.set("")), it is still recorded in the suspend data as %7E%7E%7Enull%7E%7E%7E - rather than just being null as it is before the learners first enter any text. I wonder if anyone knew of any way to clear this out completely?



Any suggestions would be welcome.



Context is that I have a course with a lot of learner reflection using input boxes.



Lectora does have the convenient option of keeping variables between sessions, but there is a risk of exceeding the suspend data limits with the amount of text involved - even with increased limits we have been able to set on our LMS.



I find learners do prefer working in the elearning package rather than a separate document and do want the elearning system to save their answers for them, rather than just to have the option to print their answers - a number have lost their answers when the network has crashed or they have closed the course in error.



So I want to keep the data, but give users the option to clear out their answers for each module when they have finished with them.



Obviously a better solution would be some other form of permanent storage for the data outside the suspend data, but I haven't yet been able to make this work!



Monica

Comments

  • ssneg
    ssneg Community Member Posts: 1,456 ♪ Opening Act ♪
    rather than just being null as it is before the learners first enter any text.


    In fact, it's never null. The "%7E%7E%7Enull%7E%7E%7E" is the safe representation of "~~~nulll~~~" string, which for some reason Lectora chose to represent an empty string. A variable in Lectora is never null or "", it is either "~~~nulll~~~" or something entered by the student. Of course, you can use JS to set it to null or empty string but I'm afraid that might cause issues (because why would Lectora not do that in the first place?).



    If I remember correctly, when in SCORM environment, Lectora uses cmi.suspend_data to store the variables. Therefore it is up to your LMS to clear it (usually by initiating a new SCORM attempt).



    Or I guess it would be easier to just set all variables to a space (" ") from within Lectora.
  • monicae
    monicae Community Member Posts: 10
    Thanks for taking the time to reply.



    Setting them just to a space rather than an empty string sounds like a simple workaround, assuming there are fewer bits in a space than ~~~null~~~, though it will still leave the names of all the variables sat in memory in the suspend data.



    What I was hoping for was to be able to clear out these variables (student answers needed only for as long as they are of interest to the student) without initiating a whole new SCORM attempt -it's a long multiscorm package that will probably take learners some time to complete overall ).



    In practice, nothing is transferred from the Lectora SCORM package to our LMS for any field before the student has used it and set it to some value, even if they have been into the course and used other fields. It is this that led me to believe at this stage the variables were null. (So for example I get "cmi.suspend_data => VarQ2=answer%20two;VarQ1=answer%20one;" and nothing more for the other questions in my package when I just answer those two questions.) What I'd like to be able to do is to get back to this point.



    I did try to set variable=null directly, but that seemed to crash the SCORM package - presumably I'd need to work harder to try to understand how Lectora handles the variables, but not sure I'm up to it.



    I guess in the longer term, LMSes will make more space available for suspend data, or provide other mechanisms for storing these longer answers from within SCORM, as it does seem to be needed for blended or even more reflected guided learning.



    Thanks again for your help.





    @ssneg 63691 wrote:
    In fact, it's never null. The "%7E%7E%7Enull%7E%7E%7E" is the safe representation of "~~~nulll~~~" string, which for some reason Lectora chose to represent an empty string. A variable in Lectora is never null or "", it is either "~~~nulll~~~" or something entered by the student. Of course, you can use JS to set it to null or empty string but I'm afraid that might cause issues (because why would Lectora not do that in the first place?).



    If I remember correctly, when in SCORM environment, Lectora uses cmi.suspend_data to store the variables. Therefore it is up to your LMS to clear it (usually by initiating a new SCORM attempt).



    Or I guess it would be easier to just set all variables to a space (" ") from within Lectora.
  • ssneg
    ssneg Community Member Posts: 1,456 ♪ Opening Act ♪
    Couple of ideas.



    1. What if you uncheck "Retain answers between sessions" in the Test Behavior tab? Will Lectora still store VarQ1..etc in cmi.suspend_data?



    2. It could be possible to use Lectora's LMSGetValue('cmi.suspend_data') and LMSSetValue('cmi.suspend_data', some_data) to manipulate the suspend data in case you run beyond the 4Kb limit in SCORM 1.2.
  • monicae
    monicae Community Member Posts: 10
    1. If you unclick "retain answers", then the answers are not stored in suspend data. This was my initial approach - learners have the data just for the session, warn them they lose them at the end of the day, but give them the option to print first. But it is too easy to come out of the session accidentally; and computers (and WYSE devices) do crash. The result is frustration. Giving them the option of a workbook to use in parallel didn't prove popular.



    2. Will look further at the LMSSetValue function etc. Thanks for the pointer. Our LMS does give us the option to up the 4Kb limit, so I have quite a lot more headroom to play with, but it all feels a bit vulnerable...

    Monica



    @ssneg 63764 wrote:
    Couple of ideas.



    1. What if you uncheck "Retain answers between sessions" in the Test Behavior tab? Will Lectora still store VarQ1..etc in cmi.suspend_data?



    2. It could be possible to use Lectora's LMSGetValue('cmi.suspend_data') and LMSSetValue('cmi.suspend_data', some_data) to manipulate the suspend data in case you run beyond the 4Kb limit in SCORM 1.2.
  • towers9815
    towers9815 Community Member Posts: 71 ☆ Roadie ☆
    I too having this issue with my course. Sadly it is a rather line 200 page course ( I know I know don't tell me pass it on to the SME and ID).

    Its only hitting during the assessment which contains 60! Questions.

    Now when I view the tracking data I can see the question response text from questions in other parts of the course?!

    I don't need Lectora to retain all of this ! What can I do ?
  • monicae
    monicae Community Member Posts: 10
    Hi Trav,

    Sorry - haven't logged into the forums for ages.  Must be way to late for you but in case anyone else is having the same issue in future, this was the simple script I used in the end to enable my learners to delete their answers.

    In my case it was sufficient to give learners the option to tidy up, so for them to launch the script off a "delete may answers" button with a run javascript action.

    <script type="text/javascript">

    function clearACAnswers() {

    VarAC1.set(" ");
    VarAC2.set(" ");
    VarAC3.set(" ");
    VarAC4.set(" ");
    VarAC5.set(" ");
    VarAC6.set(" ");
    VarAC7.set(" ");
    VarAC8.set(" ");
    VarAC9.set(" ");
    VarAC10.set(" ");

    }

    </script>

    Obviously AC1 etc were the names I gave the variables associated with the answers I had in mind - you would need to adapt for your own course.

    We also found that it was possible on our Moodle LMS to increase the suspend data limit - there may be a similar option on your LMS.

    I guess it would be possible to build in some error handling that checks when collected answers blow the suspend data limit and alert learners at that p0int, but I just relied on instructions to use the "delete" buttons regularly and  guidance about how to react to the rather ghastly error messages our LMS throws up if you do go over the limit.

    Monica