Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

fscommand

Posted on 2004-08-23
14
Medium Priority
?
955 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 2000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

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.

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

722 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