Communications Between Macromedia Flash 'Movies'* and Moodle.

Communications Between Macromedia Flash 'Movies'* and Moodle.

Jamie Pratt -
回帖数:43

Specification for a Communications Interface Between Macromedia Flash 'Movies'* and Moodle.

There has been a discussion here about the need for a means of communication between Flash and Moodle. I have taken Flash Moodle communication to mean allowing interfacing Flash movies with moodle so that it would be easy for a Flash programmer / designer with little knowledge of PHP and Moodle to amongst other things:

  • Be able to create an interface for a user or admin to create and configure an instance of their movie and store configuration data for that instance in the moodle database.
  • Be able to allow users or admins to have instances of the movie that have been created appear nearly anywhere in the Moodle site. Movies could be made to appear as part of an activity module, in an HTML resource, in a forum etc.
  • Be able to load data stored in the Moodle database into their movie. This would include data used to initialise the movie for example for a quizz activity this might be a list of questions, question types etc.
  • Be able to access data about whether the user is logged in and if so information about the user such as their name, and information about their previous attempts at activities which are contained in the Flash movie.
  • Be able to communicate with Moodle to tell Moodle about the user's activity within the Flash movie. This would include being able to grade the user for their activity in the Flash movie and have those grades appear in the moodle grade book and to be able to record user activity in the activity log.

Most of the functionality for doing this is already available in Moodle but it does require some understanding of the Moodle architecture, action script and php programming to be able to have your Flash movie communicate with Moodle. It would be helpful to have an extensible library of php and action script code / an actionscript 'component' that would take care of most of the mechanics of communication between Flash and Moodle.

*A Flash object is called a Flash movie do not confuse it with video that can be played back through Flash. A Flash movie can include video, audio, graphics and animation, interactive quizzes, learning objects and can contain code (actionscript) that will run uniformly across most browsers and much more.

回复Jamie Pratt

An Example

Jamie Pratt -

An Example of Flash Movies Talking to Moodle

I don't want to shut people out of this discussion by making it to difficult for none programmers to understand. I thought it might help to discuss a concrete example of a Flash movie talking to Moodle in order to ground the conversation a bit and move the conversation away from abstract concepts.

I have some Flash movies talking to Moodle on my site here :

http://hindiwallah.com/course/view.php?id=2

Access them as a guest or log in as tom, password tomtom To see the activities recording your interaction with them in real time. Make sure you have your sound on to hear the computer playing the sounds of devanagiri letters to you.

You can download the code for these movies to have a look at it here :

http://hindiwallah.com/letterquizzfiles/letter_without_source.zip

and

http://hindiwallah.com/letterquizzfiles/letter_with_source.zip : a 1 MB file including .fla and .as source files for compiling flash movies.

Just unzip the files in the root directory of your moodle installation to install the Find the letter quizz activities on your test system. Database tables will be automatically created when you go to the main admin page of your site. Then you can add these activities to your courses.

Let me tell you what I did to get them talking to Moodle.

  1. My movies take advantage of the existing very well concieved and easy to use framework for plugging your own activities into Moodle. An administrator when he creates an instance of my activity is presented with a form for configuring the instance of the movie. The form for my activity is not really very user friendly it asks the user to enter the name of the Flash movie to load and to enter the XML code needed to initialise the movie. This is only the first version of my activity. For my final version I want to have a more user friendly interface that generates the XML depending on the input of the user. An example of some XML used to configure my movie is shown at the end of this post. XML is not difficult to understand but it would be better to not have the admin have to deal with XML, we can generate the XML for them.
  2. Normally 'view.php' is the script that displays the html for a particular activity. Normally view.php would access the moodle database and pull out information about the configuration data for the activity instance and generate the HTML for the activity. In my activity it just outputs the html with my Flash movie embedded in it.
  3. When my movie has loaded it calls up a php script. This php script doesn't output html as normal but outputs xml. The xml is loaded into the Flash movie and this xml is interpreted by my Flash movie. The data that was passed in the XML is used to initialise the Flash movie. In the case of my movies this initialisation data is :
    • an array of names of letters to include in the quizz and an array of pointers to directories containing the mp3 sound files that the flash movie will load in to play the sounds of the letters as part of the quizz. This information is the configuration data for the instance of the movie which was stored in the database.
    • we check whether the user is logged in or not and pass a flag telling the movie if the user is logged in. We need this as if the user is a guest we won't send any information about his attempts at the quizz to Moodle to record.
    • if the user is logged in we pass information about previous correct and incorrect attempts at this quizz by this user which are pulled from the database.
  4. The user interacts with my Flash movie. He is played the sounds of devanagiri letters and presses the button which he thinks is the letter he heard played. When he presses a button which button he pressed and which button was plated are recorded in an xml object. This xml object can contain an array of such objects. Every 10 seconds or whenever the user pushes the 'update records' button this xml object is sent off to another php script and the information is interpretted by the php script and saved in the Moodle database.
  5. To integrate the activity into the recent activities block and user activity log pages of Moodle I have included some simple php scripts in lib.php in the activity directory. These scripts tell the recent activity and user activity log how to interpret the data that was stored in the Moodle database by the Flash movie. It would not be difficult to write a script to integrate my activity into the Moodle gradebook as simple to use hooks are also provided in the Moodle activity framework so that you only need to write a simple php script to tell the Moodle gradebook how to interpret data in the database to grade attempts at an activity. In my case this might just be writing code to query the database to count right and wrong answers and working out the grade from there.

Scripts that we write to output XML are very similar to scripts that generate HTML. We can use all the features we use in Moodle for generating HTML for generating XML. We can use the datalib.php functions to query the moodle database. Also we access to all the same session variables as if we were running a script to generate HTML. We can include the config.php script which gives us access to all the Moodle session variables in the same way we access them in the rest of Moodle. We can use moodle functions to authenticate the user to only allow them access to the XML script if they are logged in.

Changes that need to be made to core Moodle functions.

We need to change just a few things in the moodle core functions to use them when generating XML. Error handling in Moodle is often handled by generating a page of HTML to tell the user about the error. We need to be able to suppress this HTML if we are generating XML and instead generate a message which can be passed through XML. This would probably mean a very small change to the code for the core Moodle functions. Without this change if their is an error the script that should be generating XML code will spew out an html page describing any error which will just be ignored by the Flash movie and there would be no feedback about any errors occurring which would be OK if there are no problems with the script but would make debugging difficult and would mean that the malfunctioning script would just not work without any feedback to the user about it not working (so results would mysteriously not be recorded in the database or a movie would fail to load fully).

Jamie

---------------------------------------------------------------

<tabledata>
<voices>
<voice>
<desc>(Kalpana) Female Voice 1</desc>
<location>kalpana</location>
</voice>
<voice>
<desc>(krishna) Female Voice 2</desc>
<location>krishna</location>
</voice>
</voices>
<letters>
<l>ka</l><l>kha</l><l>ga</l><l>gha</l><l>ca</l><l>cha</l><l>ja</l><l>jha</l><l>ta_r</l><l>tha_r</l><l>da_r</l><l>dha_r</l><l>na_r</l><l>ta</l><l>tha</l><l>da</l><l>dha</l><l>na</l><l>pa</l><l>pha</l><l>ba</l><l>bha</l><l>ma</l><l>ya</l><l>ra</l><l>la</l><l>va</l><l>sha</l><l>sa_r</l><l>sa</l><l>ha</l>
</letters>
</tabledata>

回复Jamie Pratt

Re: An Example

Jamie Pratt -
I hope this is clear so far.

I will post about my plan for some opening up communication between Flash and Moodle using web services in a couple of hours after I have written it up.

Jamie
回复Jamie Pratt

Re: An Example

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Just checking: have you already looked at and rejected the SCORM standard for this?  If so, why?
回复Martin Dougiamas

SCORM compliance

Jamie Pratt -
Hi Martin,

I've not really looked into the scorm standard. At one point I looked for some good resources explaining the standard on the net but didn't find anything (I probably didn't look hard enough, any pointers anyone?). I did read something about making Flash movies SCORM compliant involves Flash talking to javascript and then presumably javascript sending data to a server. This put me off. It sounds complex and I think javascript might be best avoided because javascript code is often not cross browser compatible. Also I have the impression that SCORM is not a well implemented standard and that SCORM compliance won't guarantee compatibility with other LMSes.

I agree having learning objects built in Flash comply to the SCORM standard and making sure the Moodle SCORM activity module can handle them would possibly be a better way of having Moodle talk to the Flash activities. I'm not sure though if this communication would be flexible and compatible with other LMSes and how complex implementing it would be.

Has anyone had experience making learning object Flash movies SCORM compliant?

Jamie
回复Jamie Pratt

Re: SCORM compliance

Jamie Pratt -

I did a google search for information about SCORM and I found this Macromedia white paper on making Flash Learning Objects SCORM compliant. It sounds like a painful process. There is a free HTML template that allows SCORM calls directlly from Flash actionscript which takes care of having Flash communicate with the javascript SCORM api. I have known about this for a while but I'm not particularly enthusiastic about using it.

A major drawback of Flash - javascript - moodle is that we will lose cross browser compatibility on the way. Flash cannot communicate back and forth with javascript in the Opera browser or the Internet Explorer for Mac browsers and doesn't work properly in a number of other browser / OS combinations depending on the browser version. More info in the macromedia document mentioned above.

I think that probably direct Flash to PHP communication will be more reliable, more flexible, simpler to implement and use, and maybe faster. I'm sure there is space in the moodle world for both approaches though and would like to hear about people using the scorm standard to facilitate communication between Flash and Moodle.

回复Jamie Pratt

Re: SCORM compliance

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
I'm by no means an expert on SCORM, but it does seem that it's trying to achieve the same sort of goals as yours, so it's worth trying to work with it.  SCORM also has a lot of currency as a standard right now so there are extra benefits with aligning your work with it (such as cross-LMS, buzzword compliance, editing tools etc)

As I understand it there is no requirement in SCORM at all for Javascript, it's just the way most people choose to implement it.  It may very well be possible for the Flash script to communicate via PHP scripts in a way that is very very similar (if not the same) to the standard.   I could easily be wrong on this though.

P.S. I should point out just in case you missed it, that you can already pass parameters to a Flash file in Moodle if you add it as a "file" or "link" resource (see the Parameters section at the bottom of the form).  It's not the whole bidirectional story obviously, but it may be useful enough as a starting point for you.
回复Martin Dougiamas

Re: SCORM compliance

Jamie Pratt -
I am now the proud owener of a copy of "Sharable Content Object Reference Model (SCORM) Run-Time Environment (RTE) Version 1.3.1" the SCORM standard paper describing how a SCORM SCO (Shareable Content Object) interfaces with a SCORM compatible LMS.

This is downloadable from :

http://www.adlnet.org/index.cfm?fuseaction=DownFile&libid=648&bc=false

in case anyone else is interested.

The SCORM standard does say that the SCORM API a group of functions through which the SCO communicates with the LMS is in javascript. It is intended that the javascript provide an interface to the SCO on the client and then how the LMS implements the communication between the server and client is up to the LMS.

I'm interested in the idea of implementing the SCORM API and the SCORM data model or something like it in actionscript instead of javascript. Action script is almost identical to javascript. I'm looking at the SCORM document now to see how easy it will be to implement and work with such an API.

Jamie
回复Jamie Pratt

Re: SCORM compliance

Jamie Pratt -
I looked at the SCORM doc I mentioned in my previous post.

I don't see how trying to comply with the SCORM specification is going to benefit this project. Unless we have Flash talk to javascript which will not work on many browsers, Flash movies will not work with other LMSs. The SCORM API and data model would seem to just add a lot of complexity to implementation and use of an interface between moodle and flash. I want to keep the Moodle - Flash communication mechanism simple to use.

It would be possible to implement a SCORM-like API in actionscript on top of my Flash - Moodle web services communication system. The SCORM specification doesn't say how the client side should communicate with the server side. I want my web services frame work to be a flexible way of communicating all kinds of data between Flash and Moodle.
回复Jamie Pratt

Re: SCORM compliance

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
> I want my web services frame work to be a flexible way of communicating all kinds of data between Flash and Moodle.

OK, well, I'm interested - keep going!
回复Martin Dougiamas

Re: SCORM compliance

Josep M. Fontana -
Actually, when we all started discussing about the issue of Flash integration with Moodle I kept on thinking that the most difficult problem would be the interface (i.e. be able to build input forms that were flexible enough to accommodate all the different possibilities offered by Flash applets), but, OF COURSE, that would not be needed if Flash applets are integrated into Moodle via SCORM! This is a good idea. I think you are definitely on the right track. With the so-called Flash components that come in the MX version of Flash it is fairly easy for the average user to customize applets to meet his/her needs and recycle the same applet to build many different activities following the same basic pattern. So the need for the interface that I saw as the stumbling block for integration with Moodle totally disappears.

To tell you the truth, though, I've always been a bit scared of getting into SCORM . I've made an attempt to build a SCORM package (not with Flash applets, though) using Reload which has failed miserably. I'm totally sure it is my fault since I'm starting with this and I was totally unfamiliar with Reload. All I'm saying, though, is that unless it becomes a little easier to create SCORM packages this and many other possibilities will still be out of reach for the less daring. I guess it is just a matter of learning how to do it right, but I'm finding it a bit difficult myself.

Josep M.
回复Josep M. Fontana

Re: SCORM compliance

Josep M. Fontana -
It is not much consolation, but apparently I'm not the only one to be having problems with SCORM. See this thread (only 2 messages):

http://moodle.org/mod/forum/discuss.php?d=14838#70894

That is not to say in any way that the SCORM solution is not the best to attempt to integrate FLAH with Moodle. What I'm saying is that SCORM integration needs to be more fine tunned (unless, of course, all of these problems I'm referring to are not due to an inherent difficulty with creating SCORM packages that work properly).

Josep M.
回复Josep M. Fontana

Re: SCORM compliance

Jamie Pratt -
>Actually, when we all started discussing about the issue of Flash integration with Moodle I kept on thinking that the most difficult problem would be the interface (i.e. be able to build input forms that were flexible enough to accommodate all the different possibilities offered by Flash applets), but, OF COURSE, that would not be needed if Flash applets are integrated into Moodle via SCORM!

Can you explain more how you expect SCORM compliance would make a difference here?

Jamie
回复Jamie Pratt

Re: SCORM compliance

Martín Langhoff -
I've done a bit of background work on that front, originally aimed for a different LMS (BELTS).

If the user is using a modern browser, you can code the DOM object in Javascript, and have it broker the communication with the server using XML-RPC.

There are some JS libraries under BSD licenses that implement an XML-RPC client on the browser. And we have XML-RPC libraries that we can reuse at the server end, too.

That would make for a straightforward implementation.

Other than that, you can code the DOM object as a Java applet -- in fact, I believe there is a BSD-licensed Java applet somewhere in sourceforge.net that does the basic SCORM methods, but I don't think I want to deal with that code ;)
回复Martín Langhoff

Re: SCORM compliance

Jamie Pratt -
From the Macromedia site. Browsers that support JS to Flash communications :

Netscape Navigator 3.0 - 4.7x, and Netscape 6.2 or higher
(Windows 95/98/NT/2000/XP or MacOS; LiveConnect and Java-enabled)

Internet Explorer 3.0 and above
(Windows 95/98/NT/2000/XP only; ActiveX enabled)

Note: Internet Explorer on Macintosh and early versions of Netscape 6 do not support this method. See Additional Information at the bottom of this document for details.


Info about browsers that support Flash to JS communications can be found here :

http://www.macromedia.com/support/flash/ts/documents/browser_support_matrix.htm

For me one of the attractive features of Flash is that it works consistently across most browser platform. I'm not keen on making Flash talk to javascript for which support across browsers seems to be spotty. We can ignore some of the older browsers but apparently Opera and IE for the Mac and possibly others do not fully support Flash - JS bidirectional comms.

People who are interested in integrating Flash with Moodle in this way might look at the support built into Flash for talking to a SCORM API. There are HTML templates in Flash for publishing Flash movies so that you can call SCORM API functions from within actionscript. There are also components in Flash for making drag and drop and all kinds of quizzes that call the SCORM API functions. Would these work with the Moodle scorm activity module??

The built in Flash support for the SCORM standard I guess must suffer from the poor support for Flash - JS comms mentioned above.

Jamie
回复Jamie Pratt

Another example

Bernard Boucher -
Hi Jamie,
great work.

Here is another way to make Flash or Applets communicate with Moodle without accessing Moodle database directly. A modified flash movie from Flashkit to accept parameters :

flash1.png
You will find attached a zip file containing a text file permitting to import that type of questions in a quiz or in a lesson using the gift format. Try it if you want. If you edit the text file and change the numbers 34 and 56 then you will have 2 new similar questions and the curve will be adapted to these new values also. You can multiply the questions without modifying the flash movie.

The problem if we use your flash movie instead of the one included as example, is that the answers are choosed in the normal Moodle format instead of your beautiful one.

To completely fullfill your requirements a new question type should be created to accept parameters ( output,answers ) from your movie.

If so then applet and flash movies with be able to communicate bidirectionnaly with Moodle without having to bother with database access. Also all Moodle reporting and logging features will be available at the same time.
You will also have the choice to import yours questions in a lesson or in a quiz.
Also the export and backup feature will work.

That post explain a little bit the avantages of doing it that way.

Have a good test,

Bernard





回复Bernard Boucher

Re: Another example

Jamie Pratt -
Hi Bernard and Martin,

I am aware that it is possible to pass parameters to a Flash movie through the HTML used to embed it in a page. You can pass parameters in the url as Bernard has done or you can pass them in as a FLASHVARS paramater. Both methods are suitable for passing data to initialise the Flash movie. I don't think this method is as flexible as loading xml into the movie and parsing it though. It is most suitable for small ammounts of data and as Martin pointed out it is unidirectional as well as being a one time only transaction.

In my example movie I use Flashvars to point my movie to where it can find the php script it is to communicate with (look for the two FLASHVARS bits below) :

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="90%" height="90%" id="random_oo_6" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="<?php echo $letter->flashfilename ?>" />
<param name="loop" value="false" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="salign" value="lt" />
<param name="bgcolor" value="#ffff99" />
<param name="FLASHVARS" value="initxmlpath=xml.php&cm_id=<?php echo $cm->id ?>" />
<embed src="<?php echo $letter->flashfilename ?>" FLASHVARS="initxmlpath=xml.php&cm_id=<?php echo $cm->id ?>" loop="false" menu="false" quality="high" scale="noscale" salign="lt"  bgcolor="#ffff99" width="90%" height="90%" name="random_oo_6" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

回复Jamie Pratt

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Jamie Pratt -

Opening Up Communication between Moodle and Flash with Web Services.

Flash can handle several ways of communicating directly with php scripts on your server. The most primitive way of doing this involves 'url encoding' your data which is not really suitable I feel for complex data. Another method is by sending your data as XML objects to and from the server. This allows for describing more complex data and is a well accepted and well understood method of data interchange. The third method 'Flash Remoting' involves a proprietary format created by Macromedia to descibe data elements. This proprietary format is more compact and handles a lot of the mechanics of transferring data between your server side script and your Flash movie automatically. Flash Remoting is available for PHP. Flash Remoting in PHP is not supported by Macromedia though, someone reverse engineered the Flash remoting mechanism and built a php library to implement it. Unfortunately however Flash Remoting for PHP (see http://amfphp.org ) doesn't seem to be a very mature technology and still has some bugs.

My personal preference is to go with communication through XML. Since I read that moodle 2.0 will be entirely XML based using XSLT style sheets to convert this XML to XHTML then I guess the XML is a logical choice to use here as well. When moodle 2.0 comes along we can possibly use Flash movies that can load XML as an alternative to HTML.

How does XML based communication between a Flash Movie and PHP work?

Communication between the Flash movie and Moodle will take place after the movie has loaded into the users browser. The Flash movie can communicate once or many times to a php script through the internet. Communication will be two way the Flash movie would include an XML object passed to the PHP script at the URL through the POST method, in a similar way to an HTML form submitting data to a script. The data we send from the Flash movie to the PHP script would be a request to store data in the database or to send some particular data back to the Flash movie.The PHP script will send back to the Flash movie an XML object which is a response to the request to store data, a status message to tell the Flash Movie if the data was stored successfully. Or the data sent back would be the data from the data base or whatever that the Flash Movie requested.

The PHP scripts we create can be considered a kind of web service. We need to be careful about what is made available through our web service because there is no guarantee that only our Flash movies will use them. We can check where appropriate that the user is logged in by checking moodle session variable before sending or accepting data which will give us some protection. It will be difficult for the average user to spoof an XML request sent by the POST method to the server.

We can predefine a few 'web services' that the flash movies will be allowed to access. These web services might include :

  • loading config data for that instance of the movie.
  • data about the user and previous attempts at this quizz.
  • to send data to moodle about attempts at an activity to record the progress of the user.
  • for quizzes where cheating must at all costs be prevented we will want to send the answers of the user back to the server for checking rather than sending the answers to check on the client side.

We will allow access to the moodle database but only for certain purposes we cannot allow general access to the database from the Flash movie because this would be a security problem. We can make it relatively easy to define simple web services and provide examples of how to program these correctly. It might be necessary for a Flash movie developer to have to get his feet wet with a very little bit of php to define unusual web services.

The actual transmission, receiving, parsing and generating of the xml on the actionscript and php sides should be dealt with by moodle code so the activity developer just has to deal with the data after it has been received. XML will be the format we wrap our data in to send it across the net between the Flash movie and the php script but this will be parsed by moodle code on the php and action script sides and made available to the Flash developer as a nested array of data. To configure my example movie it is necessary to write XML to configure the movie but it would also be easy to have a normal web form to submit data to the moodle database and then to pull that data out of the database and have php convert it to xml before sending it to the flash movie.

回复Jamie Pratt

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Richard Treves -
Jamie,

This is really interesting to me, I pass text to flash movies that render them into quizzes but don't use it to talk back to moodle.  Thanks for discussing

Richard
回复Richard Treves

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Timothy Takemoto -
Dear Richard Treves,
What text do you pass to flash movies? Quizzes? Can you render normal mulitiple choice quizes using flash? I would really like that ability to decrease the chances of copying.
Tim
回复Timothy Takemoto

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Richard Treves -

 Tim,

See http://e-learning.geodata.soton.ac.uk/moodle/local/quiz/quiz.swf?dat_name=gah_5_4.txt

Text is a file marked with variables (though it could be XML just as easily). 

How is that more secure than a moodle quiz though?  I don't pass any results back to moodle, its formative only

Cheers

Richard

回复Richard Treves

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Timothy Takemoto -
Dear Richard,
Thanks for the link but sorry, i do not seem to see anything at the URL above, and even very little when I view source.

If you do nto pass any results back to moodle, how does the quiz work? When you say quiz, is it one of your own, or the moodle quiz module?
Tim
回复Timothy Takemoto

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Richard Treves -
Hmm, odd.  Working from here on dial up in firefox.  Do you have the latest flash plugin loaded?

The quiz is for self assessment only, I don't record results or grade it.

Richard
回复Richard Treves

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Timothy Takemoto -
Dear Richard Treves,

I think that I have the latest flash plugin. NO problem with flash elsewhere. I downloaded Firefox today (Can't see the benefits myself: Already have google toolbar which stops popups, and what is the advantage of tabs over multiple windows? But people are raving about it) and perhaps it wil work when I install it but here on my updated IE6, a blank page.

I understand now about self assessment flash. Good idea. Very moodle.

By the way, I am very impressed with Jamie's dedication. I hope life in India is suiting you well. I am still in Japan and am jealous.

Tim
回复Timothy Takemoto

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Jamie Pratt -
Hi Timothy,

>>By the way, I am very impressed with Jamie's dedication.

Thanks 微笑. I hope that what I'm writing is making some sense, it doesn't feel like it is. The ideas are in my head but they aren't coming out as clearly as I would like.

I'm soon going to be sending you, and the other donors who are interested in Flash a proposal, that you and the others interested in funding work on Flash - Moodle integration think about giving me some funds for work on this and an extension to the quizz module.

If not I'm happy just to contribute my ideas for what they are worth, I may well work on this as my contribution to the moodle project even if noeone is interested in funding my work.

Jamie
回复Jamie Pratt

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Jamie Pratt -

Further Details of My Proposal for a Web Services Interface to Moodle

We will have one central web service function "lib/webservice.php" that accepts an XML object. The XML object is a list of requests for web services along with data passed to the web service (like paramaters passed to a function). The web services will be similar to functions we can call from our Flash movie across the web to insert data into tables in the Moodle database or to request data from Moodle. The webservice script outputs an XML object which is a list of responses to the web service requests. For instance the response to a web service request to insert data into the database would be just a success or error message response. Response to a request for data would be an XML encoded list of records or data from the SESSION variables or whatever.

"lib/webservice.php" will be easily extensible. "lib/webservice.php" will look in a sub directory "lib/webservices/" for a script to include to process each web service request. "lib/webservice.php" will set up session variables and include database access functions. In the web services directory for a web service "blahblah" there should be a file that has the name "blahblah.php". "blahblah.php" will call appropriate Moodle functions to check that the user that is logged in or is an admin or teacher and output an error status message if the user is not allowed to access this web service. "blahblah.php" will call moodle functions to access the database or other data that is accessible from within a PHP script in moodle and put it in an array. The array will then be turned into XML by "lib/webservice.php". All the XML responses to the list of service requests will be sent back to the Flash Movie.

On the action script side, in our Flash movies, the XML requests for web services are all handled by a macromedia component. The flash developer just has to call methods on the component to ask for a web service and after asking for one or more services then he / she calls a method on the component to send off the requests for web services all together. When the response from Moodle to the web service requests has beeen returned then the component calls back a function the flash developer has defined. The responses to the web services will be available to the Flash developer as an array as the component will do all the processing of the XML. The component will pop up a little message box if communication with moodle times out and it may also be desirable to have the component handle other errors passed back from Moodle. There will be a debug mode where dialogue boxes are popped up showing all comms as they are sent to and received from moodle.

I will write next about how I imagine we could have a generic flash activity module to integrate a variety of configurable Flash movie activities into Moodle.

回复Jamie Pratt

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Dave Ray -

Jamie,
          Your energy here is exciting! I wish I had
formal programing skills to offer. As an electrical
contractor I know little web programming. What I want to do
with Flash is to :
------drag and drop electric jpg/png components
------associate these components with an installation process
------For example; assemble an electrical contactor
------outputs from this drag and drop would go to the database for results
         When I get paid from my last several jobs I will be
happy to contribute to a general or specific pool of funds!

Cheers--

回复Jamie Pratt

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Dave Ray -
回复Dave Ray

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
Offtopic wrt communications, but notice you can link to the file directly to have Moodle automatically embed the Flash here


回复Martin Dougiamas

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Dave Ray -
Sorry about offtopic, but thanks-possible solution!
回复Dave Ray

SCORM approach vs. Flash/Moodle interface approach

Josep M. Fontana -
I'm responding to Jamie's question about why I thought the SCORM solution suggested here might make it unnecessary for us to worry about creating an additional interface between Moodle and Flash.

I'm now feeling a little colder towards the SCORM approach due to the problems I'm experiencing when trying to put together SCORM packages that work within Moodle and to the issues Jamie mentions in his last posting concerning the use Flash makes of some non-mandatory parts of the SCORM data model not supported in Moodle. If these issues were solved, though, and building SCORM packages were made easier for the average user, this would be the ideal solution to integrate Flash with Moodle. I'm going to try to explain why I think so.

As I see it, the main challenges for integrating Flash with Moodle are the following:

1) Have Flash communicate with the Moodle data base (Jamie appears to have solved this problem)

2) Finding an easy way for the average user to incorporate a Flash applet as a Moodle activity.

Problem 2) in turn can be subdivided into two different problems:

a) The problem of inserting the Flash applet in one of the courses just as now we can insert a forum, a quiz, etc. without having to write any scripts or having to modify any pre-existing code by hand.

b) The problem of being able to reuse (wasn't the current buzzword 'repurpose'?) the same basic applet for different activities (i.e. same applet with different "contents").

Problem (b) needs a little explaining since it hasn't been specifically discussed before as far as I know. Let me give you an example to illustrate what I mean a bit more clearly. Say I create a Flash applet where the user sees a text
and s/he is asked to click on or mark in some way all the words related to emotions, or all the words that have to do with human behavior or all the words that have negative connotations and so on. As everybody that has worked with Flash knows, creating an applet is a very time consuming and painstaking process. So if I create an applet like the one I'm describing, I would want to do it in a way that allows me to reuse it to repeat the same basic type of activity in however many courses I need it.

If I do it this way, I will need to work very hard only when I design and implement the basic structure and objects that make up the applet. After the basic applet is created, though, 80% of the work is done: I will simply have to change the words from the texts and reassign the correct and incorrect answers every time I want to produce a new version of the activity. But, crucially, if I want to create new instances of the same basic type of activity, i.e. one that follows the same or a similar kind of pattern, I won't have to rebuilt the applet from scratch again.

Here's where the Flash 'components' I mentioned before come in to play and where the issue of SCORM vs. additional 'interface' becomes relevant. If we want to reuse or repurpose Flash applets within Moodle in the way I have described, one of the two following conditions would have to be met: either i) we can have an interface* between Moodle and the Flash applet that allows the course creator to easily change the contents of each specific type of applet and thus be able to add new instances of the same type of Flash-based activity to the courses or ii) we do not have any additional interface between Moodle and Flash but instead we have a more or less easy way to change the contents of the applets outside Moodle. That is, in order to create a new activity in Moodle based on a particular type of applet, we would simply have to manipulate the basic applet outside Moodle to change its contents and then insert the new instance of the applet into Moodle. As you might have guessed, a way to insert applets into Moodle without having to worry about writing or modifying code (problem 2.a) is doing it via SCORM.

* In order to avoid confusion, perhaps it would be useful here to be a bit more precise about what we mean by interface. When I talk about interface I mean some kind of input form that enables the creator of the activity to give 'content' to the Flash applet. Thus the interface for the quiz module would be the two input forms the quiz creator has to fill out in order to insert a quiz in a course: the one with fields like 'name', 'introduction', 'open quiz', 'close quiz' etc., and the one for each specific type of quiz with fields like (in the case of a 'multiple choice' type quiz): 'choice 1' : 'feedback', 'choice 2' : 'feedback' and so on.

Alternative ii), as I said, would be the one that can be implemented via SCORM and the one that would leverage the so-called Flash components (http://www.macromedia.com/devnet/mx/flash/articles/components.html). As I mentioned in my earlier post, with the new feature in the MX version of Macromedia Flash called 'components' it appears to be fairly easy for the average user to customize applets to meet his/her needs and recycle the same applet to create many different instances of the same basic type of activity. With components applets can be built using a modular architecture (each one of the 'objects' that makes up a particular applet can be a highly and easily customizable independent "movie clip") and thus working with a particular applet becomes a little bit like working with templates when creating web pages.

As I said, alternative ii) avoids the problem of having to create an additional interface between Flash and Moodle. This is more important than it appears at first sight because, if you think about it, the problem with the interface approach is that we need the interface to be flexible enough to keep pace with the enormous range of possibilities one has when building Flash applets. If we were to restrict ourselves to reproduce the typical quiz modalities (multiple choice, True/False and cloze) in Flash format, building an interface similar to the one we now have for quizzes would perhaps not be all that difficult and probably would be the way to go. But once we get to be more imaginative with Flash, being able to build an interface for each new type of applet could become a daunting task. If we can "feed the contents" to the applet outside Moodle and then integrate the applet simply by adding it as an activity (via SCORM or whatever other method) we solve parts a) and b) of problem (2) at the same time. People who build the Flash applets can even create Flash interfaces for data input in their own applets as you can see in: http://www.roothouse.com/Root

All this being said, though, I go back to the concerns I expressed at the beginning. From my own experience and from the discussions in the SCORM module forums, I have reached the conclusion that the integration of SCORM
into Moodle is still rather problematic. Building SCORM packages is not the most intuitive and easy task, either. So, what we gain on one side we lose on the other.

Josep M.

回复Josep M. Fontana

Re: SCORM approach vs. Flash/Moodle interface approach

Jamie Pratt -

Hi Josep,

Thanks for your post.

Josep talks about 'repurposing' movies. I've talked about configuring them. We're talking about doing the same thing ie. having one movie that can be reused with different content, different settings.

I think that configuring Flash Movies instances and having the configuration stored in the Moodle database is a better way to 'repurpose' Flash Movies. As I have said in previous posts we could have the Flash developer define an interface to configure the Flash movie through an HTML form or through a Flash movie which calls a web service. I don't think that that need be a lot more complex than having the Flash movie developer make his movie accept configuration data from the Flash component configuration interface in the Flash authoring environment.

Having the Flash movie configured in Moodle and having the configuration data stored in the Moodle database has a couple of advantages.

  1. A moodle course creator will not need access to the Flash authoring environment to configure a movie instance. All configuration could be done within Moodle.
  2. Each instance of the movie would use the same .swf file but then call up configuration data from the database. This means that once a user has tried one instance of an activity based on a particular Flash movie the movie is then in his cache. Then only the new configuration data will have to be loaded for another activity which uses the same .swf file.

Having said this there is no reason why a movie shouldn't be configured using the component configuration interface in the Flash authoring environment and then could talk to either a SCORM interface with Moodle or a web services interface. The difference with the web services interface is that we would have the option of storing configuration data in the Moodle database, something we can't do if we want to be SCORM compliant I think (because a SCORM learning object must be totally defined by the files in the learning object package).

I think the principle advantage of using SCORM would be being able (possibly) to reuse learning objects based on a Flash movie with another LMS. I don't expect it would be that difficult to extend the SCORM activity functionality so that it works with the learning interactions included in Flash. Possibly Moodle would already work with custom built Flash movies that do not use the non mandatory parts of the data model. I think it would be nice if we had the option of interfacing Flash movies to Moodle in either way.

About the limitations of configuring Flash movies within Moodle. It is not difficult to define a custom html form for configuring a movie, this would have similar flexibility to working with the component configuration interface in the Flash authoring environment. Martin has found a very nice way of doing this were the activity developer just designs a form with fields for the different variables. I suggest that for configuring Flash movies we also allow the Flash developer to design a Flash movie that will communicate with a web service to save configuration data.

Jamie

回复Jamie Pratt

generic Flash activity module

Jamie Pratt -

We can make a new generic Flash activity module that will support integration of Flash movies into the grade book and activity logs. This will be an activity module that fits in the excellent moodle activity module framework.

Stored in the Database :

prefix_flash_config : stores configuration data for a particular instance of an activity. Config data will include the maximum grade for the activity and the scale if any used the activity name. Also their will be an XML field for storing configuration data unique for this type of movie.

prefix_flash_activity : stores details of user activity with the flash movie activities. Web services will be available to Flash movies where users are logged in to write string data into this table a flag in the table will indicate what to include in 'outline' and 'full' activity log views.

prefix_flash_grades : Web services from the Flash movie will pass a grade from the Flash movie and be recorded in this table. This is not completely secure and in situations were high grades will be very valuable to the user should not be relied on. In most situations though it will be difficult for the average user to insert false grades.

prefix_flash_storage : This table may be used by the Flash movie to store and recall XML data between a user's attempts at an instance of the activity. Data will be for use internally in the Flash movie.

Web Services available to the Flash movie :

flash_setconfig : used to store configuration information for the movie this might be used by 'yourmovie_config.swf' (see Configuring A Flash Movie Activity below)

flash_getconfig : will fetch configuration data for a movie from prefix_flash_config table.

flash_getstorage : will fetch any data stored the last time this instance of a flash movie was run from prefix_flash_storage table.

flash_recactivity : will store string notices about the users activity in an instance of the activity.

flash_setgrade : will record grades for the activity.

flash_setstorage : will store any data which will be needed next time this instance of the Flash movie is run.

flash_isuser : will return a 1 if this is a real user or a 0 if they are a guest. Data needed so that we can tell the user nothing is being recorded.

Integration into Moodle :

We can implement the functions in the lib.php that moodle calls to get grade info, recent activity info etc by pulling data out of the database.

Configuring A Flash Movie Activity :

There is exisiting functionality in moodle to configure an activity. The configuration form for an activity is common to every instance. We will use this form to configure how to embed the flash file in the html page and we will present a pull down list of the installed flash .swf files so that the admin can pick the movie activity they want to use.

The Flash movie activity configuration settings which may be different for every movie are then set on another page. Normally the Moodle activity framework sends the admin to the page in the course where they can view the instance of the acitivity they have just created after filling one page of configuration settings. But we need to further configure the activity, we want to have a configuration page unique to each movie. So, view.php which would normally just display the html page for an instance of an activity will not display the activity until it is fully initialised. Instead view.php will :

  • search for a .swf movie file called yourmovie_config.swf which will contain a movie that will collect configuration data for the main activity movie
  • or if there is no such file it will look for yourmovie_config.html which will be an html form for collecting configuration info for the movie.
  • after the activity has been fully configured view.php will show the activity. If before the activity has been fully configured a normal user visits the activity a message will be displayed saying the activity needs to be configured by an admin.
回复Jamie Pratt

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Jamie Pratt -
I posted the following to flashcoders@chattyfig.figleaf.com a popular email list for Flash action script programmers.

Display all headersDate: Fri, 12 Nov 2004 15:43:04 +0530
From: "Jamie P"
To: "flashcoders.chattyfig.figleaf.com"
Subject: Moodle open source Learner Management System and Flash

Hi all,

I thought some of you might be interested in the discussion over at Moodle.org about how to get Flash and Moodle talking to each other. See here :

http://moodle.org/mod/forum/discuss.php?d=14822

Moodle is an open source Learner Managment System. There is interest from a number of people about how to have Flash Movie "Learning Objects" such as quizzes
etc. record grades and user activity in the Moodle database to be available in the Moodle gradebook and other parts of Moodle and allow configuration data such
as questions loaded into Flash movie instances from the Moodle database.

There are two possible ways that we could do this.

We could go with using the SCORM standard for communications between Moodle and Flash movies. We would use the SCORM template included in the Flash authoring
system for publishing Flash movies which would allow us to use fscommand to call functions in the SCORM API. This would involve Flash communicating with
Javascript (the SCORM standard specifies a javascript API). I have read that communication between Flash and Javascript is not supported in many browsers.
According to the Macromedia technical notes I read OPERA, IE for the Mac and some versions of Netscape do not support this. The adavantage of doing things this
way though would be that we would be using a popular standard and thus (in theory) learning objects created to work in Moodle would also work with other LMSs
and vice-versa.

There is already a SCORM activity type in Moodle that allows a course creator to upload SCORM learning objects and have those SCORM learning objects communicate
with Moodle. It seems though that Flash uses some non-mandatory parts of the SCORM data model which are not supported in Moodle.

Or we could have Flash Movies communicate with Moodle through web services exposed by Moodle to load in configuration data and communicate with Moodle about
student activity in a module. This way of having Flash talk to Moodle I feel would have the advantage of working across all modern browsers and also use of such
web services would probably be a lot simpler for the developer than using the SCORM API.

I think there is probably room for both systems of communicating Moodle - Flash. But I'm wondering whether I want to get involved in extending the SCORM
compliant interface or creating a new web services interface.

I wonder how easy it is to use the Flash SCORM template to build custom learning object Flash Movies. As I have said I have read Flash - Javascript
communication doesn't work properly on OPERA, IE for the Mac and some versions of Netscape and possibly in other browsers - any experience anyone?

I would be interested in peoples experience and opinions in this area. Discuss it here and I'll try and summarise what is said and post it to the forums over at
moodle.org or you can head on over to http://moodle.org/mod/forum/discuss.php?d=14822 to contribute your two bits to this discussion.

Jamie
--
--------------------------------------------------
James Pratt, Mussoorie, India
Phone no (mobile) : +91(0)135 3214895
Home Page : http://e-gakusei.org/
回复Jamie Pratt

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Jamie Pratt -
There was an interesting post on the quizz forum.

Flash and Moodle - use SCORM
by Eamon O Doherty - Monday, 15 November 2004, 09:30 PM

We at Ossidian.com have been developing Flash content and tests for several years. We ported them to the SCORM 1.2 standard and they work very well within the SCORM module of Moodle - tracking progress etc. Flash MX has all the tools to create the SCORM LMS calls - all you need is a SCORM 1.2 Javascript wrapper. Try adlnet.org for appropriate documentation and downloads.

I would seriously recommend against going a proprietary route to making Flash talk to Moodle tables. The world of elearning is very standards-directed and, although SCORM is not perfect, surely does not need yet another set of protocols ?


I wanted to respond to this here to keep this discussion in one place.

I would say we should have two ways of integrating Flash content into Moodle.

It is my understanding that Flash has no way to communicate with the SCORM javascript API in certain browsers. I tested the 'Flash SCORM demonstrator' from ADLnet (downloadable here) which I was able to upload and use as a Moodle SCORM activity. I found it did not work with my OPERA browser, it did work with Netscape 7.1 and IE 6.0 on Windows. But I guess it wouldn't work on IE on the Mac and Netscape 6.0 - 6.2.

I didn't like the experience of using the 'SCORM demonstrator'. The SCORM learning object gave me arcane error messages when communications failed. Also I don't like frames or pop up windows, these are things which are frowned on by web developers for various reasons, I think it would be nicer if we could embed our activities directly in our pages which is certainly possible if we have our Flash movies talking to web services.

As I've said I think by directly communicating with Moodle rather than through SCORM we can implement a communications system that is simpler to use and more reliable - which will work across browsers.

Also communication via the SCORM API would just be for activities. If a Flash movie can talk to the moodle database etc. then we can have Flash movies that implement Menu tree blocks, or other non activity related content. We can detect if the user has the Flash player or not and if they do then give them a Flash menu instead of an html one for instance.

I have talked a lot about web services and communication interfaces in my posts to this forum and may have given the impression that I was going to do something very complex. In fact I'm just using the most common sense way of directly connecting Flash to Moodle.

Jamie
回复Jamie Pratt

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Chardelle Busch -
Core developers的头像

Jamie,

I may be getting off topic again here, but have you taken a look at Petr's Book module?  It's a great way to integrate flash movies into Moodle, and he is making some changes to it for the next version.  I was just thinking that since the flash files can be embedded into html, which is then "embedded" into a book page, this might be helpful.

And as for SCORM, I too have had difficulty with frames not showing up, and I have yet to try a packager where the tracking works in Moodle (and I don't find the interface all that appealing either).  The latest one I tried was a packager I got from Macromedia Exchange created by DigitalThink for Dreamweaver MX 2004.  Better than Reload, but still no tracking and no table of contents frame.

回复Jamie Pratt

Re: Communications Between Macromedia Flash 'Movies'* and Moodle.

Jamie Pratt -
I was interested to read the ADLnet the makers of SCORM are looking into maybe using web services as another communication mechanism ( I read this in the SCORM
RTE document).

"There are ongoing research and development efforts investigating alternative methods
(e.g., as a Web Service) for LMS vendors to provide SCOs access to the API Instance.
However, SCORM only supports the method described above, the DOM and
ECMAScript are reliable technologies that have been around for some time and are
simple to use. Future versions of SCORM may introduce other communication protocols
that support the fundamental requirements defined by the IEEE standard.
3.2.1.1"
RTE-3-28 SCORM ® Run-Time Environment (RTE) Version 1.3.1


Unfortunately I haven't been able to find any more info about ADLnet progress with research on web services or alternative communication methods.
回复Jamie Pratt

Jamie Pratt is a Moodle+Flash Expert - Highly Recommended

Timothy Takemoto -

I would not be posting this if I were not extremely impressed.

After the temporary hiatus on the flash+moodle donor's forum, I decided to employ Jamie Pratt to make a module to create a psychology test module using flash.

Despite the fact that my budget was very limited (I don't think I should say how much, it was that limited) Jamie has produced a module that greatly exceeded my expectations. Not only does the Flash part of the module work perfectly, but the module integrates seemlessly with Moodle allowing me to use it without changing the database (it installs automatically), backup the new module with its results, access and change it as --and only as-- an adminstrator, and download the results as an excel or csv file.

I have not looked at the code and I would not know how to judge what I would be looking at even if I did, but judging by the performance of the module that Jamie created, I can but very strongly recommend Jamie as a fast, proficient, cost effective, polite, and above all *performing* (it works!) flash+moodle module developer.

I hope, by this recommendation that I do not annoy all those module developers that are contributing here, many for free. I know that there are many developers that deserve great praise. I only mean to express my gratitude, and how impressed I am, with Jamie's work publicly. 

(Even if that means cutting my own throat, because Jamie deserves to be very busy, so busy that he should not be able to fit in any work my meagre budget can commision in future.)

The module in question will be released GNU soon.

Jamie...Thank you very, very much.

Tim
tkmt

回复Timothy Takemoto

Re: Jamie Pratt is a Moodle+Flash Expert - Highly Recommended

Jamie Pratt -
Thanks a lot Tim.

The Test of Unconscious Preference as this Module is tentatively called will be made available for all soon.

I'll soon be working on generic code for Flash activities with a Flash component to handle talking to Moodle.

Josep has been kind enough to provide some funds for this work. If any more donors wish to donate money towards developement of this Moodle feature then get in touch. Every 500 dollars will buy an extra weeks work on documentation, extra features or Flash modules. I'm just trying to cover my basic living expenses while I explore Moodle - Flash possibilities.

My email is jamie at e-gakusei.org

Jamie
回复Jamie Pratt

Re: Jamie Pratt is a Moodle+Flash Expert - Highly Recommended

Richard Treves -

 Hi Both,

Like Chardelle I am eagerly waiting to see this, sounds like something really useful. 

Much as I'd like to only use Moodle I'm stuck with having to think of other VLEs as well so I was wondering if the flash quiz you will produce will stand on its own as well as integrating with Moodle?  Articulate have just released something:

http://www.articulateglobal.com/quizmaker.html

That I was thinking of buying. Its SCORM, QTI compliant and also has the capacity to sit anywhere on the web and send emails with results to a database somewhere.

Will your development fulfill these areas too?  Maybe able to contribute something if so.

Cheers

Richard

回复Richard Treves

Re: Jamie Pratt is a Moodle+Flash Expert - Highly Recommended

Jamie Pratt -

I might be interested in integrating activities into other LMSs. Flash movies I have developed talk to Moodle using XML sent through HTTP. Nothing like what you talk about is on my drawing board right now though.

回复Jamie Pratt

Re: Jamie Pratt is a Moodle+Flash Expert - Highly Recommended

Jamie Pratt -

Release of our psychological test Flash module has been delayed slightly as we are deciding on a name for it and Timothy Takemoto is working on some example tests. It will hopefully be released under GPL sometime in the next week or so.

Here's what I'm working on as a start for Moodle Flash integration for anyone interested. This will be finished and released under a GPL license late in January. Much of the functionality I discuss below is already implemented in the psychological test activity and I'm now just working on generalising the code to create a framework for integrating all kinds of Flash movies into Moodle as activities.

Thanks to Josep and Tim for providing me some funds to support myself while I work on this!

Flash Movie Activity Module

I'm working on a generic Flash movie activity module. This activity module will fit into the Moodle activity module framework so that activities based on repurposable or non repurposable Flash movies can be created and configured in courses just as any other activity can and they can 'talk' to Moodle.

What the Activity Creator will see.

Integration will include :

logging of user actions. gradebook integration. Allow flash movies to send grades to the server. automatic detection of flash movies installed in a sub directory. First step of config will be to allow an activity creator to choose among movies installed, choose a name for the activity, set the maximum grade. Second step will be movie specific. Movies will be configured in one of three ways : If available use a movie specific Flash movie which will generate XML to save which will be sent to the Flash activity movie. Or use a movie specific HTML form designed by the movie designer data from which will be converted to XML and sent to the movie. Or use a default HTML form in which the activity creator can enter XML directly which will be passed to the movie. back up features so all user data, grades and configuration data for a movie can be backed up and restored as part of the Moodle course back up and restore.

What the Flash Movie Designer Will See.

The Flash movie desginer will make use of some simple methods on an actionscript class to save and fetch data to the Moodle database.

Functions will be able to send the following commands to Moodle :

Fetch init data. Fetch and save persistent data. Save a grade.

The Movie designer will not deal with XML directly, this will be done for him / her by the class. They will pass objects of data to the class methods.

Commands to be sent to the server will be cached until a go() method is invoked, thus several commands can be sent at once. When the data has been fetched callback functions will be called passing a data object received to the function.

Debugging mode will be supported to pop up a window everytime XML is sent or received showing the XML sent and received.

In the case of a communications error the prebuilt class will deal with the error by popping up a dialogue box with an error message.

Security.

The Flash activity Movie is passed a unique unpredictable key generated by PHP through the FLASHVARS parameter in the HTML that embeds the acitivity in a page. This valid key is stored on the server side along with information about what course and what instance of the activity the user is accessing. We always use this session information or information from the Moodle session variable we can rely on on the server side when we need to know who the user is, what activity this is.

The Web Services opened up must however be treated as a public interface which may be accessed by something other than our Flash Movies, we will be sure that a user can only modify their own data or may only alter movies' init data if they are teachers.

Database Usage.

We will use three main database table to store info for all kind of different movies :

mdl_flash_init
mdl_flash_persist
mdl_flash_grade

They will all have one 'TEXT' column in which we store XML as well as timemodified, userid, flashid columns and others. This will allow us to have great flexibility in what we store in the database and meet the storage needs of many different Flash Movies.

More ...

This is just a start. I hope I will have time to add some more features to the activity module in the next month or later. Also I intend to make it easy for an activity designer to add functionality on the server side to extend this module.