Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 978
  • Last Modified:

fscommand

I am using fscommand in the actionscript to send info to a LMS.

For example, commands like:

fscommand ("LMSSetValue","cmi.core.lesson_status,completed");
fscommand ("LMSSetValue","cmi.core.lesson_status,passed");
fscommand ("LMSSetValue","cmi.core.lesson_status,failed");

I am trying to send a grade to the LMS using cmi.core.score.raw.

fscommand ("LMSSetValue","cmi.core.score.raw,integervaluehere");

Integervaluehere is the score.  This does not generate an error, but also does not change the score on the LMS.  Does the fscommand look correct?  Do I need another step to set initialize integervaluehere (which should already have a value)?  Could someone give an example?  The program works fine, except for this one problem.

This is for Flash MX version 5.

Thanks in advance,

Mark
0
flashinglemur
Asked:
flashinglemur
  • 7
  • 4
  • 3
1 Solution
 
muso120999Commented:
I guess there should be default values set, but setting the score requires a scale (ie. min to max) so it might be worth trying:
fscommand ("LMSSetValue","cmi.core.score.min,0");
fscommand ("LMSSetValue","cmi.core.score.max,100");
fscommand ("LMSSetValue","cmi.core.score.raw,integervaluehere");

Also make a call to LMSCommit, to make sure that the data is purged occasionally.

And be aware that there can be a slight delay between sending the data to the LMS, and it actually receiving it.
0
 
flashinglemurAuthor Commented:
Muso,

I thought that was going to be it.  I set the min and max value, but the score is still 0% (which I think is the LMS default).  The course is marked as completed (if it's a passing grade), but 0% is the grade.

Do I need to say int(integervaluehere");

I'm already doing calculations with integervaluehere (to determine is the score is passing or not), so it's a number and not alpha.

Mark

0
 
muso120999Commented:
>> Do I need to say int(integervaluehere");

No, because that parameter is being sent as part of a string.  Have you tried using a string constant, like:
fscommand ("LMSSetValue","cmi.core.score.raw,12");

just to rule out the current value (or type) of your variable?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
muso120999Commented:
I had assumed this, but you are literally using something like this:
score=12;
fscommand ("LMSSetValue","cmi.core.score.raw,"+score);

rather than:
fscommand ("LMSSetValue","cmi.core.score.raw,integervaluehere");

as without concatenating the value it isn't going to evaluate until it reaches the LMS, and that then will interpret it probably as a zero.
0
 
flashinglemurAuthor Commented:
No, I was literally using:

fscommand("LMSSetValue","cmi.core.score.raw,total");

if I tried:

fscommand ("LMSSetValue","cmi.core.score.raw,"+score);

I think it would balk b/c you can only have one or two parameters for fscommand.

Is this not correct?
0
 
flashinglemurAuthor Commented:
Muso,

Just in case I tested it as:

fscommand ("LMSSetValue","cmi.core.score.raw,"+score);

and upon publishing received the following error message...

"wrong number of parameters.  fscommand requires between 1 and 2."

Mark
0
 
muso120999Commented:
I'm afraid I don't understand why you get that last error message - I've tried it myself with no error (only two parameters are actually being used)

Anyway, did you know there is also this method of setting the score:
fscommand ("CMISetScore",integervaluehere);



When I am testing these things I sometimes also add a trace, like an alert pop-up into the HTML page that is published, like:

function flashName_DoFSCommand(command, args){
    Alert("Cmd: \r" + command +"\r\rParams: \r" + args);

... insert the Alert line, after the DoFSCommand function.  This allows you to tell exactly what is being sent to the LMS, and whether it is what you expect it to be at this stage.
0
 
blue-genieCommented:
just out of curiousity - why are you using FScommand rather than javascript?
0
 
muso120999Commented:
FSCommand in this case is making calls to JavaScript routines, that are developed by Macromedia as part of the AICC/SCORM wrapper.  My last example included some JavaScript to test the output
0
 
blue-genieCommented:
we simply use a getURL to call the scorm api commands, bypassing Macromedia's idea of it.

0
 
muso120999Commented:
I agree that Macromedia's FSCommand is a clumsy implementation when compared to direct getURL... do you have a suggestion then?
0
 
flashinglemurAuthor Commented:
OK, this is a strange situation.  Using debugging, they've determined that the LMS initializes and finishes as soon as the page loads.  Therefore I was hosed from the beginning (read that: out of my control).  I have to wait for this to be fixed, but I'm sending the points to Muso for his input.  Thanks!
0
 
muso120999Commented:
I know how much of a pain this stuff is at times; I have had to work around a not-quite-compliant LMS before, and that's a far from ideal situation.

Glad you've figured out the cause at least, and thanks for the points.

Incidentally, I checked the HTML code generated by MX2004 last night, and min and max are actually set default values (0 and 100).
0
 
blue-genieCommented:
i never use the flash scorm stuff - now i know why :-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now