Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 9:52 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Need help using cmi.suspend_data
PostPosted: January 3rd, 2012, 9:33 pm 
Offline

Joined: October 31st, 2011, 3:21 pm
Posts: 28
Opus: Pro 9.6
OS: Windows 7 Professional 64 bit
System: Intel i7-2600k, 16 GB RAM, Nvidia Quadro 4000
Hello all,

I'm trying to save and retrieve my variables from the LMS by using the "cmi.suspend_data" run-time environment data model.

So far it works using one variable, but when I try adding another variable, the first variable will override the second one every time.

The variables I want to save are "test" and "test1". Thanks for the help. Cheers

Code:
function PublicationStart()
{
    // run LMS initialisation functions - see Private SCORM Functions
   LMSInit();

    // add below any actions required by the publication when the LMS starts
   
     // example - get Learner Name, ID and Lesson Location from SCORM v1.2 LMS
     GetLMSValue("cmi.core.student_id","LMS_LEARNER_ID");
     GetLMSValue("cmi.core.student_name","LMS_LEARNER_NAME");
     GetLMSValue("cmi.core.lesson_location","LMS_LESSON_LOCATION");
     GetLMSValue("cmi.suspend_data","test1");
     GetLMSValue("cmi.suspend_data","test")

     

     // example - get Learner Name from SCORM 2004 LMS
//     GetLMSValue("cmi.learner_id","LMS_LEARNER_ID");
//     GetLMSValue("cmi.learner_name","LMS_LEARNER_NAME");
//     GetLMSValue("cmi.location","LMS_LESSON_LOCATION");

}

GetPublication().PublicationStart = PublicationStart;


function PublicationEnd()
{
   // Send information back to the LMS.
   // Add your own SetValue commands for information you want saved
   // SCORM 1.2
   SetLMSValue("cmi.core.session_time",PublicationTime());
   SetLMSValue("cmi.core.lesson_status",LMS_LESSON_STATUS);
   SetLMSValue("cmi.core.score.raw",LMS_SCORE_RAW);
   SetLMSValue("cmi.suspend_data",test1);
    SetLMSValue("cmi.suspend_data",test)

   
   // SCORM 2004
//   SetLMSValue("cmi.session_time",PublicationTime2004());
//   SetLMSValue("cmi.completion_status",LMS_LESSON_STATUS);
//   SetLMSValue("cmi.score.raw",LMS_SCORE_RAW)

   LMSEnd();
}
GetPublication().PublicationEnd = PublicationEnd;


For this message zmayor has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Need help using cmi.suspend_data
PostPosted: January 4th, 2012, 11:15 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Z,

I am not official support, but only another Opus user. And I know very little on SCORM currently, but wanted to learn some so I did some searching/researching. You can also carry that further too for yourself.
So, some observations... that may or may-not help.

- From what I have been able to find and read, cmi.suspend_data is only "...a single place to store information". Apparently it is not utility or a command to address multiple variables. (Repeat disclaimer: I am no SCORM expert. Maybe you have some better reference sheet or better experience/guidance here.)

- I read somewhere that SCORM API only exercises the LMSGetValue when a lesson or unit is first accessed. I cannot be sure that is the case when using Opus, so only mention it in passing.

- I would suggest when you are testing and troubleshooting these kinds of systems and solutions, that you make frequent changes to the variables you are testing. For example, if you want to store or read the variable test1, use Opus to increment it with a counter or append it with a date and time-stamp. That way if your SCORM code keeps returning the same data over a 20-minute period, you might suspect that something's broke... data is not getting updated to the LMS, etc.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Need help using cmi.suspend_data
PostPosted: January 4th, 2012, 3:04 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
You're using it wrong. The RTE contains all the 'variables' based on OOP.

Therefore cmi is the OBJECT and suspend_data is the PROPERTY or variable that will contain the value. You cannot add properties to the CMI data model as it's a standardised specification.

To achieve your aim, you'd need to create a string that demarcates your variable name and variable value and store this in the suspend_data property.

IE myVarA=fish:myVarB=cat:myVarC=horse

Every time you end your SCORM session you'd have to write / rewrite the entire string and when you read the string back in, you'd need to use some Opus Script to break the string back into distinct units for each Opus variable.

It's not SCORM specific, but here's my posting on using OOP with Opus:

http://www.live.interaktiv.co.uk/index. ... Itemid=166

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : CJMAC, zmayor


Top
 Profile Visit website  
 
 Post subject: Re: Need help using cmi.suspend_data
PostPosted: January 4th, 2012, 6:12 pm 
Offline

Joined: October 31st, 2011, 10:29 pm
Posts: 4
Opus: Pro 7
OS: WIN 7
Hello all,

I have been following right along with zmayor (my coworker), we are both relatively new at Opus and also SCORM.

When reading over your reply we were at a little disconnected when trying to understand how to create a string and then break the string back into distinct units for each variable.

Once we began creating a string as you have it in your example we got syntax errors that caused concern. Also, when trying to launch the course through our LMS (Scorm Cloud) for testing, the publication failed to launch.

We are currently testing this on a small publication with three variables to try and achieve a progress tracking capability, if you will.

Thank you for the link to your site with tutorials on OOP. Very helpful!

Good day.

CJMAC


For this message CJMAC has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Need help using cmi.suspend_data
PostPosted: January 5th, 2012, 10:12 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
suspend_data is of type CMIstring4096 which should mean that it can be any ASCII characters up to 4096 in length if you have a valid string:

Code:
myString = "myVarA=fish:myVarB=cat:myVarC=horse"
SetLMSValue("cmi.suspend_data",myString)


As for breaking up the string, use the javascript function split:

Code:
myArray = myString.split(":")


Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : CJMAC, zmayor


Top
 Profile Visit website  
 
 Post subject: Re: Need help using cmi.suspend_data
PostPosted: January 5th, 2012, 11:57 pm 
Offline

Joined: October 31st, 2011, 3:21 pm
Posts: 28
Opus: Pro 9.6
OS: Windows 7 Professional 64 bit
System: Intel i7-2600k, 16 GB RAM, Nvidia Quadro 4000
Thanks Mack for the help! We're learning a lot from this post.

As you can see, my co-worker, CJMAC, and I are new to Opus Scripts. We have been testing with the codes you gave us, but have not been able to make it work. We are unsure where to place the scripts.

If you could help point us in the right direction, yet again, that would be great!

Thanks!

Here is what we have
Code:
function PublicationStart()
{
    // run LMS initialisation functions - see Private SCORM Functions
   LMSInit();

    // add below any actions required by the publication when the LMS starts
     myString = "myVarA=fish:myVarB=cat:myVarC=horse";
     myArray = myString.split(":")


     // example - get Learner Name, ID and Lesson Location from SCORM v1.2 LMS
     GetLMSValue("cmi.core.student_id","LMS_LEARNER_ID");
     GetLMSValue("cmi.core.student_name","LMS_LEARNER_NAME");
     GetLMSValue("cmi.core.lesson_location","LMS_LESSON_LOCATION");
     GetLMSValue("cmi.suspend_data","myArray")
     
     

     // example - get Learner Name from SCORM 2004 LMS
//     GetLMSValue("cmi.learner_id","LMS_LEARNER_ID");
//     GetLMSValue("cmi.learner_name","LMS_LEARNER_NAME");
//     GetLMSValue("cmi.location","LMS_LESSON_LOCATION");

}

GetPublication().PublicationStart = PublicationStart;


function PublicationEnd()
{
   // Send information back to the LMS.
   // Add your own SetValue commands for information you want saved
   // SCORM 1.2
   SetLMSValue("cmi.core.session_time",PublicationTime());
   SetLMSValue("cmi.core.lesson_status",LMS_LESSON_STATUS);
   SetLMSValue("cmi.core.score.raw",LMS_SCORE_RAW);
   SetLMSValue("cmi.suspend_data",myString)   

   
   // SCORM 2004
//   SetLMSValue("cmi.session_time",PublicationTime2004());
//   SetLMSValue("cmi.completion_status",LMS_LESSON_STATUS);
//   SetLMSValue("cmi.score.raw",LMS_SCORE_RAW)

   LMSEnd();
}
GetPublication().PublicationEnd = PublicationEnd;


For this message zmayor has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Need help using cmi.suspend_data
PostPosted: January 8th, 2012, 9:35 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
At start, get the data from suspend_data into myString and then split into myArray.

Code:
GetLMSValue("cmi.suspend_data","myString")
myArray = myString.split(":")



At end, create myString and then save this into suspend_data.

Code:
myString = "myVarA=fish:myVarB=cat:myVarC=horse";
SetLMSValue("cmi.suspend_data",myString)


Note: myArray = myString.split(":")

The myArray will have multiple cells that can be accessed using:

myArray[x]

where x is a zero based index value.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Need help using cmi.suspend_data
PostPosted: January 9th, 2012, 6:32 pm 
Offline

Joined: October 31st, 2011, 3:21 pm
Posts: 28
Opus: Pro 9.6
OS: Windows 7 Professional 64 bit
System: Intel i7-2600k, 16 GB RAM, Nvidia Quadro 4000
Hey Mack,

I went ahead and made the correct changes, but something is still preventing it from working. I uploaded the test file we've been working on in Opus and we've been uploading this publication to http://www.cloud.scorm.com to test it out. If you could look it over real quick and tell us what we're doing wrong, again, we would greatly appreciate it!

Thanks for all the good work!


You do not have the required permissions to view the files attached to this post.


For this message zmayor has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Need help using cmi.suspend_data
PostPosted: January 10th, 2012, 11:45 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Dropped it into my moodle server and it worked fine. It wrote and retrieved the suspend_data string and other cmi values correctly.

Have you got a content package working correctly with the SCORM Cloud before?

Mack


You do not have the required permissions to view the files attached to this post.

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : zmayor


Top
 Profile Visit website  
 
 Post subject: Re: Need help using cmi.suspend_data
PostPosted: January 10th, 2012, 9:07 pm 
Offline

Joined: October 31st, 2011, 3:21 pm
Posts: 28
Opus: Pro 9.6
OS: Windows 7 Professional 64 bit
System: Intel i7-2600k, 16 GB RAM, Nvidia Quadro 4000
Thanks Mack!

We figured it out. We appreciate the help!


For this message zmayor has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 38 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group