Solved

fscommand

Posted on 2004-08-23
14
930 Views
Last Modified: 2008-03-17
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
Comment
Question by:flashinglemur
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 3
14 Comments
 
LVL 10

Accepted Solution

by:
muso120999 earned 500 total points
ID: 11874390
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
 
LVL 1

Author Comment

by:flashinglemur
ID: 11874629
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
 
LVL 10

Expert Comment

by:muso120999
ID: 11874836
>> 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:muso120999
ID: 11875155
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
 
LVL 1

Author Comment

by:flashinglemur
ID: 11876785
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
 
LVL 1

Author Comment

by:flashinglemur
ID: 11876856
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
 
LVL 10

Expert Comment

by:muso120999
ID: 11878820
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 11879916
just out of curiousity - why are you using FScommand rather than javascript?
0
 
LVL 10

Expert Comment

by:muso120999
ID: 11880075
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 11882333
we simply use a getURL to call the scorm api commands, bypassing Macromedia's idea of it.

0
 
LVL 10

Expert Comment

by:muso120999
ID: 11882611
I agree that Macromedia's FSCommand is a clumsy implementation when compared to direct getURL... do you have a suggestion then?
0
 
LVL 1

Author Comment

by:flashinglemur
ID: 11895759
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
 
LVL 10

Expert Comment

by:muso120999
ID: 11895845
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 11900110
i never use the flash scorm stuff - now i know why :-)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question