SCORM doesn't work on moodle 1.9.9+

SCORM doesn't work on moodle 1.9.9+

by mohd kasni -
Number of replies: 6
I developed my courseware using captivate 4 but got problem with SCORM tracking when uploaded to moodle 1.9.9+(i used the moodle windows installer). My courseware pass the test suite 127 and 2004 but no tracking in moodle. so i decided to use flash external interface to call a function when my captivate slide reach end of slide, the funtion then call a function inside flash and assign a value to button exit to complete the scorm. when i run it on self test the function work. but on moodle when the slide call a function, nothing happened. please help me.

one layer and one frame only!
#########as3 flash code#########
import flash.external.ExternalInterface;
ExternalInterface.addCallback("unloadMe",unloadSWF);

import pipwerks.SCORM;
myLoader.source=('121.swf');
var lessonStatus:String;
var lmsConnected:Boolean;
var success:Boolean;
var scorm:SCORM = new SCORM();
var siap:String='p';
function unloadSWF() {
siap='y';
ape.text=siap;
}
ape.text=siap;
lmsConnected=scorm.connect();

if (lmsConnected) {

lessonStatus=scorm.get("cmi.core.lesson_status");

if (lessonStatus=="completed"||lessonStatus=="passed") {

//Course has already been completed.
scorm.disconnect();

} else {

//Must tell LMS course has not been completed yet.
success=scorm.set("cmi.core.lesson_status","incomplete");

if (success) {
success=scorm.set("cmi.core.score.min","0");
}
//console("scorm.set('cmi.core.score.min', '0'): "+success);

if (success) {
success=scorm.set("cmi.core.score.max","100");
}
//console("scorm.set('cmi.core.score.max', '100'): "+success);

if (success) {
scorm.save();
} else {
//serverUnresponsive();
}

}

} else {

trace("Could not connect to LMS.");

}

exit_but1.buttonMode=true;
lo_but1.buttonMode=true;
help_but1.buttonMode=true;



exit_but1.addEventListener(MouseEvent.MOUSE_OVER, naviOver);
exit_but1.addEventListener(MouseEvent.MOUSE_OUT, naviOut);
exit_but1.addEventListener(MouseEvent.CLICK, naviDown);
help_but1.addEventListener(MouseEvent.MOUSE_OVER, naviOver1);
help_but1.addEventListener(MouseEvent.MOUSE_OUT, naviOut1);
help_but1.addEventListener(MouseEvent.CLICK, naviDown1);
lo_but1.addEventListener(MouseEvent.MOUSE_OVER, naviOver3);
lo_but1.addEventListener(MouseEvent.MOUSE_OUT, naviOut3);
lo_but1.addEventListener(MouseEvent.CLICK, naviDown3);


var help:URLRequest=new URLRequest('javascript:window.open("demo.html","Help","height=700,width=700");void(0)');
var exit:URLRequest=new URLRequest('javascript:window.open("exit.html")');
var lo:URLRequest=new URLRequest('javascript:window.open("exit.html");void(0)');

function naviOver3(event:MouseEvent):void {
lo_but1.gotoAndStop(2);
}
function naviOut3(event:MouseEvent):void {
lo_but1.gotoAndStop(1);
}
function naviDown3(event:MouseEvent):void {
lo_but1.gotoAndStop(3);
navigateToURL(lo, "_self");
}


function naviOver(event:MouseEvent):void {
exit_but1.gotoAndStop(2);
}
function naviOut(event:MouseEvent):void {
exit_but1.gotoAndStop(1);
}
function naviDown(event:MouseEvent):void {
exit_but1.gotoAndStop(3);

if (siap=='y') {
success=scorm.set("cmi.core.lesson_status","completed");
scorm.disconnect();
lmsConnected=false;
navigateToURL(exit, "_self");
} else {
navigateToURL(exit, "_self");

}
}

function naviOver1(event:MouseEvent):void {
help_but1.gotoAndStop(2);
}
function naviOut1(event:MouseEvent):void {
help_but1.gotoAndStop(1);
}
function naviDown1(event:MouseEvent):void {
help_but1.gotoAndStop(3);
navigateToURL(help, "_self");
}


*note - ape.text is a dynamic text to show siap value when unloadMe function called.on moodle the 'p' string doesn't change to 'y' when unloadMe() called. but on self test 127 it works!


file to upload in moodle and self test 127 - https://acrobat.com/#d=djnPehqLs0hRrujijfpUjA

.fla file - https://acrobat.com/#d=bqkgF2TNnm5nbYDGOySD4g

Average of ratings: -
In reply to mohd kasni

Re: SCORM doesn't work on moodle 1.9.9+

by Wade Gemmell -
Hi Mohd,

There could be a variety of things wrong but lets tackle the most obvious culprits first.

1. Your AS3.0 Script can run correctly (and thus your software work) but not implement SCORM correctly and you would not receive any errors. I suspect this is why your self test runs but it appears to "break" when you load it in Moodle. You should probably load to a designated test server that specializes in SCORM (such as Rustici) and will provide you with debugging logs that are SCORM based (Flash Debugger for AS3.0 will not generate these kind of logs)

2. I notice you are using the Pipweks package, you need to make changes in the manifest and html files for it to work, have you done this ?

Start with these two areas and if you could include a copy of the debugging log I can give you some more specific feed back.

FYI, Captivate 4 does an excellent job of producing Flash based content for Moodle. To make it work correctly by default you MUST generate your content in AS2 format with all of your resource files externalized. This could be why you have problem with SCORM tracking but it is a far easier way to generate content that hand coding in Flash CS4.

Hope that helps.

Cheers,

Wade

In reply to Wade Gemmell

Re: SCORM doesn't work on moodle 1.9.9+

by mohd kasni -
Thanks for your explanation, but sorry to tell my client only run Moodle as they want it to be run localhost all the time.It is true Captivate 4 is ok when I upload it to a real moodle server.But it break when on local host(i did add trusted location for my moodle installation directory as required by the self test coz ExternalInterface class were used). Why is it captivate call the unloadMe function work on ADL self test and not in moodle? Is it something wrong with the moodle for windows suite?

2.I need to use pipweks as he show a good tutorial on as3 coz my project contain away3d which is in as3. I did change the manifest file and html, if not, how can i past the self test right? as i did said, all my scorm calling work on ADL self test 127, when i click the exit button, the blue and green text shows successfully. Have you try running my zip file on 127 self test? i did include the zip and .fla files. please help me.... smile
In reply to mohd kasni

Re: SCORM doesn't work on moodle 1.9.9+

by John deGrazia -

Hey!

Change your server to BD (BlueDomino). They have an automatic install program for moodle and many other PHP programs.

under Home, under scripting and addons, under installcentral, under more, there you will find moodle.

You get one MySQL database free.

BD is cheap.  I want you to be successful, not hung up on a message board to nowhere. I can't understand a tenth of what these guys are saying.

Alex

In reply to John deGrazia

Re: SCORM doesn't work on moodle 1.9.9+

by mohd kasni -
Thanks for your reply Alex, my client ONLY use moodle. They want to distribute it at school, so moodle should always run in localhost and ONLY want to use MOODLE. My content doesn't have problem when uploaded to a REAL server(like BlueDomino, my own server and even my client server). They used moodle with XAMPP packages downloaded from moodle website. With this package installed, it start making this kind of bug like no "green tick" when completed etc. So i tried to install XAMPP manually and extract moodle files(this method works ok on windows). So that's why i did ask, is it because of the XAMMP package moodle break my content?
In reply to Wade Gemmell

Re: SCORM doesn't work on moodle 1.9.9+

by John deGrazia -

Hi,

You're problem might be solved by what I have written below; I also had trouble getting everything straight, but what appears below seems to have done the trick.

How to upload or install Scorm objects (or zips, projects, whatever you want to call them).

The scorm repository is full of good scorm zips. These contain all the files and directories needed to run the scorm, as well as a "front page" (front page for the computer, that is) called the imsmanifest.xml.

Now, to install a scorm project, simply go to the scorm option on the drop-down menu called activities. You must be on the course front page, have administrative priviledges for the installation and have editing turned on to do so. Make a course called learning moodle, if you don't want to juggle what you're doing elsewhere.

The page that comes up calls for an upload: After creating a folder with the name of the project that you want to use, upload the entire zip file of the scorm directory that you chose from the scorm repository pages. If you see anything except a small folder icon entitled "parent directory," you are uploading to the wrong place. You'll get the picture if you toggle back and forth between that and the other "database" folders a few times, and explore your database backup directories and folder trees.

Now, when you have finished uploading and unzipping your scorm zip, go back to the same page, the installation page that appeared when you clicked on the scorm option under activities, and using the same window, the one labelled "package file," and which gives you a "choose or upload folder window/option," go back to the folder you just uploaded with a click of the choose file button, and select the file entitled "imsmanifest.xml."

That is the same name that is used in every folder (the different folder names are what enable the computer to differentiate between the various imsmanifest.xml files). Now, if you have entered a complete sentence in the summary and a title of a word or more, when you go down the page and click on save and display there should appear on your screen the hyperlinked title of your scorm project. Voila, that's it! You will find the scorm project listed on your course page, as well.

Thank you, Moodle community! Alexsmile

In reply to John deGrazia

Re: SCORM doesn't work on moodle 1.9.9+

by mohd kasni -
Thanks for your reply. I tried your instruction to unzip 1st and choose manifest.xml files but still got the same problem( https://acrobat.com/#d=d*9GhRoaDpuRrdXmzDMxaQ ). The weird thing is that this only happened in moodle package for mac, in moodle package for windows it works!

Here is the debug mode code generated by moodle

Sat, 14 Aug 2010 13:00:27 GMT: Moodle SCORM 1.3 API Loaded, Activity: a, SCO: SCORM2004_QUIZ2
Sat, 14 Aug 2010 13:00:28 GMT: Initialize("", "") => 0
Sat, 14 Aug 2010 13:00:28 GMT: GetValue("cmi.completion_status") - completed => 0
Sat, 14 Aug 2010 13:00:28 GMT: GetValue("cmi.completion_status") - completed => 0
Sat, 14 Aug 2010 13:00:28 GMT: SetValue("cmi.completion_status", "incomplete") => 0
Sat, 14 Aug 2010 13:00:38 GMT: SetValue("cmi.score.raw", "25") => 0 //1st attempt
Sat, 14 Aug 2010 13:00:41 GMT: SetValue("cmi.completion_status", "completed") => 0
Sat, 14 Aug 2010 13:00:41 GMT: Commit("", "") => 0
Sat, 14 Aug 2010 13:00:41 GMT: SetValue("cmi.exit", "normal") => 0
Sat, 14 Aug 2010 13:00:41 GMT: Terminate("", "") => 0
Sat, 14 Aug 2010 13:00:43 GMT: Moodle SCORM 1.3 API Loaded, Activity: a, SCO: SCORM2004_QUIZ2
Sat, 14 Aug 2010 13:00:43 GMT: Initialize("", "") => 0
Sat, 14 Aug 2010 13:00:43 GMT: GetValue("cmi.completion_status") - completed => 0
Sat, 14 Aug 2010 13:00:44 GMT: GetValue("cmi.completion_status") - completed => 0
Sat, 14 Aug 2010 13:00:44 GMT: SetValue("cmi.completion_status", "incomplete") => 0//need to set to incomplete to overwrite current score
Sat, 14 Aug 2010 13:00:54 GMT: SetValue("cmi.score.raw", "0") => 0
Sat, 14 Aug 2010 13:00:59 GMT: SetValue("cmi.completion_status", "completed") => 0
Sat, 14 Aug 2010 13:00:59 GMT: Commit("", "") => 0
Sat, 14 Aug 2010 13:00:59 GMT: SetValue("cmi.exit", "normal") => 0
Sat, 14 Aug 2010 13:00:59 GMT: Terminate("", "") => 0

Refreshing page will make Score to vanish!(only in mac)

As you can see if the user retake the quiz, it should overwrite the new marks to 0, but no Score were showed after the word "QUIZ".(it should be QUIZ(Score:0).

Here is the quiz files that works on moodle windows but not in moodle mac.
scorm 127 - https://acrobat.com/#d=nWx2xpPMDbkajsBDsE0lNg
scorm 2004 - https://acrobat.com/#d=ySHTapTUFjQRwOixVvGPjw


I hope someone could test it on moodle for windows and mac.