Flash module add-on: Moodle amfPHP

Flash module add-on: Moodle amfPHP

by Marcus Potter -
Number of replies: 63

I’m new to Moodle and sadly dyslexic, so please don’t take any offence if someone is already 10 steps ahead of me on this subject or cant understand a word I am writing! :P

Please note this is labelled "Moodle amfPHP" with a simple goal of trying to consolidate movements in one area on amf Moodle using AS3 & amfphp.

What is AMF (non technical overview)
amfPHP (put simply) is probably the most efficient way in bridging data from Moodle (example) with a client side (eg swf file). Its not about "Flash media server" or multiplayer environments. Its best to think of it as a piece of string which would enable any Moodle module to communicate with front end SWFs (once a amf library is in place)
For Official amfPHP overview (click here)
Moodle and AM

Why Moodle amfPHP
Moodle is built in PHP, AMF is more efficient than for example using XML or Json. (Anyone not convinced see james wards comparisons for speed tests of data types such as: XML, Json, AMF).

The journey to writing this post started by googling for Moodle amf to find the "Moodle amf library". After looking through a gazillion different forum posts which each whisper towards "wouldn’t amf be ideal for Moodle" etc etc I never found it!
(I would love to be wrong on this comment but it doesn’t appear to exist yet!! other than Jamie P's first steps forward)

Jamies Moodle AMF Tutorial
http://docs.moodle.org/en/Development:AMFPHP

Hopefully this topic wont get bogged down with "why use flash player 9 questions" or "why AS3" and simply move to getting the right people together who wouldn’t dream of not taking advantages in binary communication, the advantages in using the latest flash player, OOP style mythologies and bridging Moodle via amf php for Flex or Flash. In conclusion Moodle is a truly great LMS, LCMS.... In my opinion Flex is key to turning Moodle into a true Rich Internet Application (google RIA)

***********************************************************************

The main purpose of this post is to find and work with like minded people (Moodle/Non Moodle) who are pro "amfPHP/Moodle"
Myself and some other colleagues have been working for nearly 2 years on EFL learning systems using a mixture of amfphp,flex2-3,as3, FMS3/Red5 and AIR (but not YET using Moodle) hence I have been digging around Moodle forums to see who else is seeing the "light" on this path in the Moodle world.

To date I have only been able to find (from memory)

  • Moodle API plans for version 2.0, the obvious goal being to have standard defined API in Moodle) DF webservices something seem to be doing allot of work from memory.

  • AmfPHP User authentication (Jamie P)

  • Looking over Mats new AS3 “flash Module” xml bridges to Moodle (forums/Matts wiki tutorials)

  • Lots of outdated (dead threads) of people who are wanting this also (but the threads dry up), knowledge is not shared or people offering to help on this area, but progress doesn’t seem obvious? (to me as a new moodle user)

Possible first steps??
1. Build up and on from Jamie’s AMF “Membership authentication” (amfphp)
2. Quickly discuss and obtain an understanding of status regarding “API progress” for Moodle (eg keeping in line with core API/services for future Moodle versions would limit future changes to the libraries AMF functions for future versions)
3. Selection of a Moodle test project, if agreed (eg amf conversation of an assessment module)
4. Build up further amfphp Libraries of core Moodle modules.

What we have

Solid experience of Multiuser applications and EFL learning applications & games. We have some assessment components (eg picture match, gap fill and so on) built in Flex/AS3 which utilise amfphp, (at the moment they use are own flex learning content authoring systems - hence now writing this to hopefully build upon a Moodle base )

I am happy to open up the flex/flash modules so we can get traction on this project. Otherwise we are a very small team who love making cool leaning applications and have combination of the following skill sets.
1. Flex 3, AS3
2. FMS3/Red5
3. Papervision, Away 3d
4. EFL Teaching Qualifications/Experience
5. Good level of knowledge of LAMP environments
6. A number of "amfPHP" projects under our belts
7. Linux Solaris teams (SAMP)
8. Modest LAMP Servers in UK, US, China & Sun (SAMP) server in Singapore
9. Solid design & UX (user experience/Usability skills sets)
10. 2 years of pure sweat in making (2way) rich learning applications and social networks

What we don’t have
1. Any deep knowledge of Moodle or TRUE understanding of what is going on in this area (other than trying to read content which is in the various Moodle website)
2. A Big team of people committed to making Moodle amf happen.
3. Ok side issue (but Knowledge of SCROM we looked at and found it was so bloated) right or wrong we shyed away from it in favour of propriety systems cut down systems using amfPHP (there’s no reason we cant get the best of all worlds) - but dont know enough about this area (TBH)


Can people let me know if they are available to assist in helping build up a "open" amf library for Moodle Please specify skill sets or specific knowledge.

Lets make this happen once and for all
You are welcome to email me personally at marcusjpotter(at)google(dot)com

Average of ratings: Useful (1)
In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
Hi Marcus,

Thanks for your post. Great to hear you are interested in Flash, amfphp and Moodle and in helping work towards getting some more support for developers wanting to use amfPHP with Flash.

The good news is that their is an API that can be used with amfphp. Practically the whole Moodle api can be used on the php side. The only issue is when sometimes error messages are output by the Moodle API to html. But that can be worked around. Here is documentation on some of the Moodle API. But the best documentation is the code itself, find a piece of code that does what you want to do or something similar and understand it and copy and/or hack it, everything is open and there for you to play with.

I expect that what you may be looking for as an 'API' is a collection of more higher level such as functions to create courses or add users that Moodle sometimes lacks. Many of these functions are there but you need to dig around in Moodle to find them. More code should probably be encapsulated in higher level functions and / or object orientated code. This is slowly happening in Moodle.

Jamie
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Hey Jamie (all)

Great!, Thanks for the prompt response. Pleased you also see it as important and share the goal and benefit of link amf with "Moodle" core functions (API focussed).

Again I hope we can get a few people to support this movement and build upon lots of people contributions and understandings to date. As I mention I am new to moodle, so i am not promising miracles straight away! (Jamie - or ANYONE! please send any suggestions for parties to contact if they are interested in similar objectives)

I will start to delve into the API docs later this week, In conclusion my goal is not about trying to reinvent the moodle authoring system. The back end administration does what it needs to do (for stage 1)

The core goal (in my opinion) is to allow authors of content to use moodle (as they normally would) and not have to touch (eg technical knowledge) to administer/Publish and not touch flash/xml files or other (related "bits of understanding") to complete slick "interactive" lesson modules. In summary stage 1 to me means:

1. Building up AMF library for core "Course/Grading" functions (excuse my non moodle terms)
2. Building up some "interactive and slick" Flash/Flex templates for standard quiz/Course modules.
3. Storing user data back in core LMS systems.
(I Appreciate what you mention about error handling codes)

On completion of the above and no doubt a "gazillion" uknown areas. We can then start to get more creative and look deeper across the board.

Again I would really appreciate the support from moodle members who have gone through the pain in understanding the learning moodles systems/APIs/php side. I will also set up a MoodleAMF site-wiki, as others seem to be doing in various areas. (of course it will be all open source! :P )

Don’t be shy, lets get this done together!!
Look forward to hearing from each of you!

Cheers
Marcus Potter

PS: Long term - I would also love to work with some people who passionate about creating EFL content, English level Diagnostics, assessment testing (eg Ielts, OCR or alike). We have some pretty neat ideas to really change the "norm" eg) dull interactions or testing testing testing to develop new ways of 2way/multiplayer learning/Async mythologies, again get in touch if you fancy playing with some experimental teaching/learning methods.
In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Marcus,

Great to hear from you. I think your enthusiasm for projects to bring Moodle and Flash together more coherently and effectively will prove to be infectious!

A little re-cap about myself:
I too have a background in TEFL. I been TEFLing for eight years and have had stints as senior teacher, DoS and on freelance contracts to create paper-based EFL/ESL learning materials. I started using computer-based EFL/ESL materials with my students from the start, mostly Tell Me More (Auralog) and Eurotalk Languages (I'd love to work with Rosetta Stone materials but the opportunity hasn't yet arisen), plus a few others that aren't really worth mentioning here.

I'm also an AS 2.0 and AS 3.0 developer (Actually, I'll only work with AS 2.0 now if you put a gun to my head!) and I'm working on what I hope will be some neat and very useful new ideas for EFL/ESL students. If you haven't already seen the prototypes, they're on my Moodle site: http://matbury.com/moodle/

My thoughts on SCORM:
I agree that SCORM is 'bloated' and I also think it offers a narrow way of working with learning on-line. Pedagogically speaking, I think it pushes learning resources developers towards the dreaded 'dump and pump' AKA 'savings and loans' model of learning. I'm basically saying, the easiest stuff to do with SCORM is to either create verification tests (i.e. Has the student understood the presentation?) or progress tests (i.e. Has the student retained what was in the presentations?). These two options are a necessary part of most learning/training programmes, but they do little to address how the students actually learn. In other words, we're saying to the students, "Learn this because we'll be testing you on it later."

However, I think SCORM is a very attractive format to providers of education/training and Moodle should continue to support it for the sake of its own survival. I think the fact is, that education/training providers have SCORM as a necessary check box somewhere near the top of their list. It is also supported by a large number of very competitive educational resource tool developers who make it simple and easy for course designers to author multiple choice, cloze, open cloze, drag and drop, and multiple matching tests.

So what do I think we should do with Flash and Moodle?
From my point of view, I think it makes a lot of sense to create a simple but powerful and flexible wrapper that makes it as easy as possible for Flash developers to create learning interactions to deploy in Moodle. That's my game plan and that's what I'm trying to achieve with the FlashMod project. I think there are a lot of very good Flash developers who know very little about Moodle and would be put off from developing Flash learning interactions for Moodle because of the apparent lack of support for deploying Flash learning interactions and recording user data from them. So to summarise, I'd like to see:
Easy, standardised deployment of any 3rd party e-learning SWF in Moodle.
Easy, standardised interface(s) for e-learning SWFs to report user interaction data to Moodle.
An extended SWF gradebook which is flexible enough to allow SWFs to report back the widest variety of user interaction data possible.

I believe that if we bring down this first hurdle effectively and make Moodle accessible to Flash developers, we'd see a rapid growth of some really great Flash based e-learning projects. I also think that this would make Moodle a more competitive choice for education providers who are shopping for an LMS/LCMS. I think there are a lot of Flash developers and people in education/training who enjoy thinking 'outside the box' and have some great ideas. I'd like to make working with Moodle easier for them (and me!).

About amfPHP:
I must confess, I don't know a great deal about amfPHP. I've read up on AMF and it looks like an exciting format that opens up a multitude of possibilities and some very rich Internet applications. So, in my opinion, anything that helps integrate AMF with Moodle would be a step in the right direction.

And finally:
Now you've read my thoughts on Moodle, I'm keen to get involved with your project and help where I can.

I look forward to hearing from you soon.

All the best,

Matt smile
In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
Hey Marcus,

I will also set up a MoodleAMF site-wiki

I would suggest that we should work on docs.moodle.org so that there is no need to maintain another wiki and so that the documentation we work on is of the most benefit to as many people as possible. I would expect that documentation on the Moodle wiki will be read by more people.

Jamie
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Hey Jamie (All)

Agreed core documentation should be on moodle smile I'm in full support of this hence pushing the moodle amf forward once and for all, through this thread!

(support also noted from Matt Bury and more recently "markhorsell") thanks guys! (others dont be shy in sending me a message!)

*****************************

We are in the midst of setting up dedicated a site to "moodle amf", with complimentry source files (We have put a good year++ into "learning systems" which use amfPHP/as3/Flash & Flex- As other areas unfold to conclusion I will include include all required items a complete example of working system being discussed here (I for one am confused with all the variations!) but learning slowly!

I'm pretty much devoting full time to moodle amfphp cause at the moment, I have had to take a step back to move forward!!, so I'm also busy at the moment getting together releasable assets (amfphp/AS3) which have been produced already (ok all be it non moodle, at the moment :P).

I'm confident these assets will still help fast track a number of SOME of areas for moodle amf, Again I'm just making these friendly in opening up some core examples, via a website which my team and myself are working on, as I write this.

We will also have a moodle system set up with a 'dev" AMF library so we can start to draw upon a core requirements list for moodle services (see Jamies starting post)

My focus will be co-ordinating the colliding of specific "services" contained in a AMF library so anyone could use or learn from (again in conjunction/support of the planned moodle docs), by the time we collide together, we can finally get around to starting to building specific amf services!!

(Jamie) Q:
Which version of moodle do you recomend for this purposes



New Questions (jamies moodle revamp)
"new Quiz reports for Moodle 2.0, some bug fixing for the Question Creation module" (jamies post)

Again this will be key to continue on from, once you settle down on new structures, we can progress the revamp and subsiquently move forward with associated amfPHP.

Probably another stupid question, Let me know approx timescales on first releases.

thanks all
Marcus
In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
Hi Marcus,

Moodle 2.0 is scheduled to be out in early 2009. There will be a lot of changes in 2.0. The release has tended to be later than projected in the past.

My quiz report stuff is mostly done and is available from cvs, most of the changes will be in 2.0, some of them got into 1.9. The question creation module is available from the Moodle CVS contrib area.

I think I will be free to work on a new Flash thingy (activity or resource or something) in the next few months.

Jamie
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Excellent - sounds good! yeh "flash thingy" (smile)

Demo Trails (moodle AMF)
So we will proceed with version 1.9 (x?) moodle with amf 1.9
haha amfPHP to go to 2.0 (from memory) soon also (first finishing touches apparently from recent readings)

I guess you are in UK timezone at moment?
Marcus
In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Tom Cox -
I just wish that every "stable" Moodle from this point on was SCORM compliant. I also seek a better way to give people a learnin', but I fear another "Flash" module would soon get left behind with every new core(gradebook,certificates) Moodle rev.. Unfortunately, but most importantly, clients want standards, and focus on a standard creates a better product. Please, come over to The Dark Side and make Moodle recognized for it's ability to play nice with SCORM.
I also wish that the providers of rapid prototyping LMS SCORM module package generators would ensure that they are SCORM compliant, as they make really cool tools, when they work. Are you listening UghdoeB. Anyway.
In reply to Tom Cox

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Tom,

I understand the need for standards and I also understand that a lot of education/training providers want to buy ready-made courses "off the shelf" that they can deploy in any LMS which is what SCORM's biggest selling point is. I'm not suggesting that we try to replace SCORM. I think there will always be a place in e-learning for it or something very much like it.

However, as I said before, I think SCORM pushes learning content creators towards a narrow set of learning objectives and a reliance on SCORM would over emphasise verification and assessment testing and not address effective learning enough.

I think there is not only room for more than just SCORM, I believe that having alternatives and a variety a approaches to learning and different formats is very necessary. Flash is much, much more than a presentation tool. We're only just beginning to get to grips with what we can achieve with it in e-learning. The future of Flash in education looks really exciting to me and the possibilities are unpredictable and probably endless. In my opinion, SCORM limits those possibilities to an unacceptable degree.

Just my two cents.

smile
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -

Hey All

Nice to see some comments starting to develop here

Matt
Great to see you on this thread - Will hook up with you shortly. Would like to chat to you about a few things from your project and your great work to date! (ecstatic to see you offering your support) you may wish you never said that LOL :P its 3;57am in the morning, And I have just finished a long haul flight, so let me come back to you when I am more coherent! there’s a number of interesting points you reference (in particular testing testing testing) what about ways to help me learn! (stage 1 of this amf Moodle project) will be to simply utilize tests admittedly (as a test project)! its what we do with that afterwards where it becomes more fun! :P

Matt - Tom (SCORM)
Let me see what I can add here.. Perhaps my lack of understanding here (SCORM/Moodle) is oversimplifying areas or perhaps I am being too much of an optimistic/simpleton/newbie to this area (SCORM/Moodle). But my 2 cents worth is:

  • SCORM - Is a must - (and one reason I am here at Moodle)
  • If there are existing Moodle supported tools for assisting in content generation of SCORM compliant assets into Moodle, Then this is the creation goal and SCORM (or others eg AICC) and Moodle hinges its success on its Interoperability, Put simply its the only way to go
  • Tools (eg such as EXE) is most probably one of many tools enhancing Moodles authoring capabilities, creating a SCORM package and letting Moodle do the rest (once the package is imported) again, My hope is to only build on these tools
  • Admittedly I don’t understand what part SCORM may HAVE to play in the communication of (example) grades back to any given LMS - but on the basis of my limited understanding that either this is not the case or not the issue in hand (meaning we can again let scorm do what it does or needs to do!) - lets assume for the (next part of this example post) that SCORM is used to create a glorified manifesto to manage (learning assets) across any VLE/LMS/LCMS.

In Terms of AMF/SCORM/Moodle

  • amfPHP (for Moodle) would not be about, allowing content creators to (compliant) course/content/media into Moodle.
  • amfPHP (for Moodle) would be about how we can (example) extract the content creators "compliant" course/content/media from Moodle and output on the fly using binary technologies (amfphp) to communicate to the SWF(s) outputs

Loosely putting in non technical terms (amfPHP) would become more of an efficient web service to assist with the core of Moodle and simply open a library for developers to interact with Moodle in a efficient/standard way and build upon future cores of the underlying PHP used in Moodle.

Again as I say, I perhaps shouldn't have attempted the above post in present (jetlagged state of mind), But one hopes for example, I could use Moodle, Exe, anything to create content. The purpose of this thread devoted to amfMoodle, is about tackling Moodle to have a "Core" solid AMF librabry to communicate (theoretically) with any function that Moodle does or attempts to do in the future.

*********************************

Again - Matt I will love to speak to you about your flash mod project, You are addressing a series of key areas of 2way communication needed in my understanding (eg communicating test/activity results) I have briefly read through your wiki, knowing that it is done in AS3 is likeable to say the least! :P, so this can be used to learn from and settle my curiosity for what SCROM does or doesn’t do in the part of the process.

I have sent a few messages to some people who had played with amf (Moodle focused) in the past, I hope to here back from these people in due course. They will of course be encouraged to share code or incites into this or a more devoted amfMoodle website.

Finally!
The next real stage is to follow on from Jamies pointers and start getting familiar with the Moodle API (and start to understand related Moodle "core" functions) eg) quiz module, ask lots of stupid questions and define a functional list/Spec of all required items for stage 1 AMF librabries for an AMF Moodle quiz! Woowhoo finally - the meat of the bone or this post in one paragraph!!


I would love to be reading countless suggestions on this subject in my email inbox :P

As always, These posts are intended for correction, by people in the "know" I write such posts to speed up learning curves on assumptions, so I look forward to learning needed corrections on any assumptions made!

Cheers
Marcus

PS: yes I have used word for this post (my english needs about 20 corrections and re-reads/writes before I can get it out!), and yes I have commited the sin of not copying via notepad, to save my brain cells remembering where I emphasised key words! :P

In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Tom Cox -

Hi Matt, I dig that we need to teach in many a new way, but at the end of the day you need results, or if you don't need results, than communication with Moodle is not an issue. SCORM tracks results like: who, what, when, how long, correct1, correct2, pass/fail, score, etc. The module proposed on your site follows the same kinda stuff:

mdl_flashmod_interactions

This table is a record of students' interactions with FlashMod presentations. In other words, their scores and activities. It records the following parameters:

Field
Type
Collation
Attributes
Null
Default
Extra
Action
id int(11)

No
auto_increment PRIMARY KEY
userid int(11)

No


groupid int(11)

Yes Null

courseid int(11)

No


presentationname varchar(255) utf8_general_ci
No


timemodified int(11)

No


timeelapsed int(11)

Yes Null

grade int(4)

Yes Null

scoreone int(11)

Yes Null

scoretwo int(11)

Yes Null

answer text utf8_general_ci
Yes Null


I'm not getting what the "tool" has to do with it. At the end of the day, it's really about the communication between this thing(SCORM/Flash based SCORM/FlashMoodleAPI), the data(who, what, when, how long, correct1, correct2, pass/fail, score, etc), and Moodle. To me, what happens in the presentationAnimationVideoWebcastGameHotDogEatingContestSeminarSlideshow has little to do with the tool used. I just want it to report to gradebook.

I don't see any limitation to SCORM, only the current tools used to develop it.

Flash has a SCORM export feature. You can go wild with all the power of Flash, but it still reports the things that need to be measured.

I loved Jamie Pratt's Flash Mod and got much use from it. It reported things like who, what, when, how long, correct, pass/fail, score, etc. It became too buggy after Moodle 1.7. and may have lost support. I later was saved by SCORM when I republished all my flash quizzes in SCORM 1.2 for Moodle 1.8/9. Same results in gradebook, same cool flash based, video rich, heavily interactive course.

What if the main Moodle/FlashAPI module developer gets hit by a bus? Many a SCORM guy could get hit by a bus and few tears would fall(YukYuk), and it would still report to gradebook.

Tom
In reply to Tom Cox

Re: Flash module add-on: Moodle amfPHP

by Tom Cox -

Forgot to mention, granted, SCORM communication is one way (right?, kinda, not sure), but couldn't one break SCORM law and use existing methods(flash to DB) to pull data from moodle, if even needed? Is it needed?

I can see a situation where you may want to give Jimmy the "Special Test" next time if he gets <33% on the "Normal Test", but is this a burning issue? Flash could see Jimmy's situation and retest, without ever looking at any moodle tables.  

In reply to Tom Cox

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Tom,

Whatever your objections might be to not using SCORM, the simple evidence is apparent that there are a number of Flash developers who'd like to work with Moodle but who can't get SCORM to do what they want.

Macromedia ceased developing Flash for SCORM with Flash MX 2004 and put their efforts with regards to integrating SCORM with Flash into Robodemo, now known as Adobe Captivate. I think Captivate is a much better choice for authoring SCORM compliant learning materials.

As for your criticism of the example DB table you copied from my wiki; the table is presented as a starting point and I'm inviting other people involved in e-learning to contribute ideas and make suggestions about what data would be good to include in it. It is by no means definitive.

The gist of your argument seems to be, "Why create a new way for Flash to interact with Moodle? Why not stay with what we've got?" My retort would have to be, "Because with another way for Flash to interact with Moodle could, and most probably will, open up a whole new world of possibilities for e-learning content creators." I'd prefer to see e-learning move forward, not stay where it is, and I'm excited about the prospect of integrating amfPHP with Moodle and seeing some really cool e-learning emerge.

Matt.
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Tom Cox -
I'm not really for or against any method, I'm just still not clear what the advantages of a new mod are.

Flash CS3 still allows export as "Flash with SCORM 1.2 tracking". Tracking of the things that need to be measured. What one does with the content is up to them and Flash.

I'm not criticizing your DB. It's a nice DB.

I'm not arguing that we should "stay with what we got". I'm suggesting we focus on something that works, consistently, for more than a rev. or two.

I don't think I could ever max out the capabilities of Flash with SCORM tracking.

Am I missing something? What new frontiers in E-learning is this module going open up? Anyway.
In reply to Tom Cox

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Tom,

Regarding this comment:

Flash CS3 still allows export as "Flash with SCORM 1.2 tracking". Tracking of the things that need to be measured. What one does with the content is up to them and Flash.

Adobe have included backward compatibility with both their Flash Player and IDE so that developers can continue to work with projects older versions of Actionscript. Just to clarify, there are two types of Actionscript currently in general use - AS 2.0 and AS 3.0. They have to be regarded as different languages as they are not compatible. Likewise Flash Player 9 contains two virtual processors AVM1, for AS 2.0 and AVM2 for AS 3.0. So although a developer might use Flash CS3 IDE to author applications, he/she has the option to work in versions 6, 7, 8 or 9. The SCORM templates that you mention were bundled with Flash MX 2004 (Flash 6) and have had no subsequent development in later versions of the Flash IDE. They are essentially Flash Player 6 applications.

Why is this important?
Since AS 2.0 and AS 3.0 are incompatible (although they can communicate with each other), it would be very difficult to author SCORM compliant applications in AS 3.0. It would require the developer to be both a Flash developer and a SCORM expert to write the necessary functions in AS 3.0 to communicate with the SCORM Javascript API.

Am I missing something? What new frontiers in E-learning is this module going open up? Anyway.

For a start, it'd be very nice to get away from using SCORM's Javascript API and talk directly to Moodle through amfPHP, which is much faster and lighter than XML, JSON, AJAX, etc. Universities would be able to significantly reduce their bandwidth usage. I think that would be very attractive to something like the UK's Open University or the growing number of large academic organisations that are adopting Moodle as their LMS.

Another thing is AS 3.0. It's a very powerful client-side language which is capable of much more than simple multiple choice, open cloze, drag 'n' drop, play a video type activities. With AS 3.0, it's relatively easy to analyse audio waveforms (i.e. speech recognition), do VoIP and video, and have extremely intricate and fast user interface interaction (Actionscript is many times faster than Javascript because it's pre-compiled, and AS 3.0 is up to ten times faster than AS 2.0).

Also with AS 3.0 and Papervision, real-time interactive 3D applications become much easier to write which I believe design, architecture, the sciences and engineering could all benefit from enormously, and with fast, lightweight, real-time peer to peer interaction across the Internet, collaborative activities... well, do I need to go on?

Do I sound like a bit of an evangelist? Anyway, I hope you can be convinced that amfPHP would be of great benefit to Moodle and e-learning in general. The more I find out about it, the more excited I get about the possibilities that lie ahead.

All the best,

Matt
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Tom Cox -
Cool dude. Could you give me a scenario where SCORM's com is not enough? I dig the 3D as well, but WTF it has to do with Moodle, I don't know. MM Director has supported 3D for many a year, and publishes 3D as "shockwave", but do you need a new way to communicate with Moodle to take advantage of it? What would one say about a 3D course, renderTime, ShaderLookedCool, FPS=superfast?

Again, what makes this mods com. better than SCORM's com.? Again, what is this new mod going to do, specifically, beyond what SCORM already(sometimes) does?

I'd love to get on board, but I still have yet to see what the advantages would be. Word, Tom
In reply to Tom Cox

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Tom,

The best thing I can suggest is to get the info straight from the horses mouth:

http://www.amfphp.org/

Flash, Flex and AIR, communicate through the NetConnection class:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetConnection.html

Most Flash developers are used to using NetConnections for streaming video, but it can do much much more than that. You basically get true, two way communication and even better, you can preserve datatypes meaning you can send and receive data objects of any class native to AS 3.0 and even custom AS 3.0 classes too. This is the exciting part.

Please note: Although it's also possible with AS 2.0, I think Object Oriented Programming is pretty difficult to do in AS 2.0 and I don't want make any unreasonable claims!

The main thing, as far as Moodle is concerned though, is how easy it would be for Flash developers, with little or no knowledge of Moodle's code base or API to write applications which integrate with Moodle. I think that this is a major barrier for Flash developers who want to work with Moodle.
In reply to Tom Cox

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Hey Tom

mdl_flashmod_interactions

Thanks the outline of students' interactions for FlashMod presentations scores and activities. Im Still finding my way around all the different areas.

*******************************************************
Quote from tom
"but couldn't one break SCORM law and use existing methods(flash to DB) to pull data from moodle, if even needed? Is it needed?"

Yes that is correct - perhaps my long winded words didn't hit the right point. We shouldnt need to worry about SCORM or its tools (which correct - they have nothing to do with it, the topic here is in integrating with moodles PHP to deliver an amf gateway) What we require is calling a method of a service class using amfPHP, and then writing data back.

Creators wont need to worry about the code, NetConnection or the gateway or Responder, onResult arguments. They will simply install the assets on their server and publish their created content!.

For AS3 Evangilists
This will then open core functions of moodle to AS developers to get more experimental with moodle system and a bread of new RIA moodle systems.

I have just had a good long chat with Matt on skype and shown an example of pure AS3 with amfphp. Between work already done by my internal dev team, Matt, Jamie and others, I hope we can make make sure this module is well positioned to future alignment with the moodle core and bridging on work done to date, and avoid the "hit by bus scenario" also :P

I will provide some amf example of AS3 "question activity" types to Matt shortly, so he can start playing around also. Within a short while we can start posting online as completed moodle examples. I will also start to open up a demo moodle amf gateway so people can start playing around.

In addition, The SWF/Fla or Flex components can then be proivided to parties so they can customise their own styling (eg skins) - they should need to touch anything else.

Final Installation
The only issue for final execution (done by server admins) would be in installing amfPHP gateway within their moodle environment, (to provide straight out of the box solutions)

Future note worthy
Also with Flex 4 (Gumbo) this will make it even easier due to its
clean separation of visuals and logic (eg like css is used)

Also with flash player10 (astro) will help bring new options from the new text features available in this player version, text elements like <div>, <p>, <span> and <a> are represented as ActionScript objects which developers can query and modify.

Anyway thats not the issue in hand now!

Thanks again Tom for outlining "flashmod interactions"
Marcus
In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
Hey Marcus, Matt and all,

Great that there is resurgence of interest in making it easier for Flash developers to develop interactive learning activities and having them able to communicate with Moodle!\

I'm busy working on the new Quiz reports for Moodle 2.0, some bug fixing for the Question Creation module and some work custom applications with other clients.

Am definitely meaning to work on some kind of way to easily to include a Flash resource in a course. I'm thinking a resource type might be appropriate.

I plan to keep this project very simple this time. My aim will be to make something easy to maintain. I was a bit disappointed that there was very little help offered by others to help maintain the Flash module.

Jamie





In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
I would suggest we work up a list of things we would like to be able to do from Flash, possibly prioritize them and we could work on some documentation where it doesn't exist / possibly add some functions to the Moodle API to cover some commonly required functions.

Let me start with some obvious ones :

  • get the user name, make sure the user is logged in - already demonstrated in my amfphp example.
  • store a grade in the grade book.
  • add an item to the Moodle log
  • Get general data from the Moodle database.

In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Hey Jamie

Agreed, This is the place to start (eg core functions). I had tried to push the same direction in an earlier post.

Im BUSY :P setting up a series of systems at the moment (see other post in this thread)

So If "moodle" knoweledagble people can help to add in on this list referenced by Jamie (will be really appreciated)

Cheers
Marcus
In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
I think there are essentially only two significant problem to work on.

Include Flash Resource in the Course


Is to have a way to include a Flash movie as an activity in a course. This might not be as a full activity plug in but as a resource type.

I have already shown how the Moodle session can be accessed from http requests such as those used by amfphp or other http requests sent from Flash. The info in the Moodle session should be used to tell Moodle who the user is.

Then we need a way of having Moodle know what course module this is. I would suggest we have some kind of resource that passes a randomly generated key to the Flash resource. And on the Moodle side this key that expires after a period of time is associated with a user and course module id. A record would be created in a table recording these keys and the associated data.

I think this needs to be done as the only other way of communicating this data is to pass it as parameters to that Flash movie - either as GET params to the movie or using the Flash Params tag and then we would pass the same data back to Moodle. This is open to being hacked by students. Your students can fool the Flash movie to think it is another course module and then the Flash movie would tell Moodle to store grades for another activity, the
service (amfphp, REST, xml whatever) that is called by Flash would be able to be accessed directly by a malicious user and they would be able to store grades in the grade book for any course module. The possibilities are even worse of course if you are passing user ids back and forth.

Using HTML forms to be able to customise Flash movies

It would be good to have a way to be able to easily set up a form to collect input from teachers to be used to customise a Flash interaction.

I'm wondering if it would be good to have some new code to be able to leverage the formslib code and make it possible to have teachers be able to use a web interface to design forms. This code could be used across Moodle.

Maybe better keep it simple and have the movie designer use php and build their forms with php using the formslib library. Fairly complex forms can be build by simply copying and pasting code.

In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Jamie,

Great to hear from you and I'm glad you're still enthusiastic about making using Flash in Moodle more accessible.

Re: Include Flash Resource in the Course

I think that's a great idea. The FlashMod code basically grabs user and course details from the "Link to a file or website" form. I think this works well for people who are already familiar with Moodle and could be adapted for much easier, simpler use from a UI point of view. Obviously, as you've said, we'd need to adopt a more secure way of doing this.

Re: Using HTML forms to be able to customise Flash movies

There are quite a few threads on these forums from people who want to know how to modify Jeroen Widjering's FLV Player (passing FlashVars into to it). I think having something like the SWFObject 2.0 HTML form, which I've attached just in case you haven't seen it, but adapted specifically for use with Moodle would be a good direction to head in. Jeroen Widjering also has a pretty handy HTML form for generating the correct FlashVars to pass into it: http://www.jeroenwijering.com/?page=wizard
I think having ready-made forms and back-end code to handle deploying popular Flash apps would be fantastic. And your idea of being able to create new custom forms would be even better.

I look forward to getting stuck into this project, and yes, a Wiki on Moodle docs is probably the best way to go. We may even get more contributors that way.

All the best,

Matt
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
I was thinking more of collecting data to use in the movies - data that would be passed into the movie to customize the learning interaction itself eg. words, links to files, etc.

But also the Flash resource would be able to fulfill the more general need for a way to include a swf in a course with the swf being displayed at the right size etc.
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
"I was thinking more of collecting data to use in the movies - data that would be passed into the movie to customize the learning interaction itself eg. words, links to files, etc."

Ah,so I'm not quite sure what you mean when you say customise. The SWFObject and FLV Player wizards make it very easy to pass parameters and FlashVars into a SWF with the embed code.

Do you mean to pass lesson data in through a NetConnection? i.e. lists of vocabulary, questions and answers, URLs to media files, etc.
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
"Do you mean to pass lesson data in through a NetConnection? i.e. lists of vocabulary, questions and answers, URLs to media files, etc."

Yes, sorry if I was unclear.
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Ok, no worries.

Just one UI consideration I've been pondering over...

I've been using the Moodle Quiz module for a while and I've found that using the UI forms to create even short activities can take quite a long time on-line. I think if anyone wanted to create entire courses through this kind of UI, they'd soon get very impatient with it.

I think we'd need to find a better UI for this kind of thing and/or think about other ways of authoring Flash lesson data.

Ideally, any developers/designers creating generic custom learning interactions should also create authoring tools to go with them to make authoring faster, easier and more accurate. Do you think this is a realistic point of view?
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
"create authoring tools to go with them"

What kind of thing tools where you thinking of? Flash movies?

I think you have a point, probably most serious quiz users for instance hand write quiz import files. But is there also a place for the html form??
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
"But is there also a place for the html form??"

Yes, I agree. They're a handy way for Moodle/e-learning beginners to get started with entering lesson data. I'd also say that they're not the most efficient way to do it and I think better alternatives would make content authors' lives a lot more productive and fulfilling.

"What kind of thing tools where you thinking of? Flash movies?"

Yes, Flash movies are one option but Windows prevents them from running from the desktop by default. Users would have to change that setting and could only do so if they have admin permissions.

Another option would be Adobe AIR, but again the user would have to have admin permissions install it.

Flash .exe files could be worth considering but a lot of email clients and firewalls automatically filter them out. That would present a problem for distributing them.

I quite like the idea of users editing simple XML lesson data templates. Users would have the starting XML format with examples and they could just copy and paste nodes and edit the content with a text editor. I've created quite a few XML driven Flash apps and websites and clients with very little or no experience of that sort of thing picked it up very quickly.

I think there are a number of possible solutions with advantages and drawbacks. I think we need some advice from non-developer Moodle users to find the best solution for this issue.
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Hi Matt/Jamie
As a non moodle user, Not sure how much I can help here.

XML Files
I agree Matt, Editing an "pre given" xml file is a very quick way of authoring, and is very readable by all types of users EG) with reference to "speed of authoring" it is an ideal format to allow people to edit.

The only issues are users miss a ">" and wonder why it becomes invalid? and become reliant on more technical counterpart to problem solve/fix.

Automation
In an ideal world, Users would install moodle and start authoring SWF content (from within moodle) and should never need to think or understand what or how the pre made swfs course assests work or understand how to populate them or push/pull content from them. The ideal solution would perhaps allow moodle to have a core package to include required SWF assets in the moodle install.

The only technical requirement should be if a moodle owner wishes to change skins, fine, you will need a person with design/flash experience to modify and upload/replace/add new, or extend pre-given functionality.

I cant help with the debating of methods to date to include SWF files which enable "flash based" courses to communicate with moodle core, but the main problems appear to be solved to "get the task accomplished". I guess a standardized "streamlined" way forward is the core topic here.

Since we are talking about the evolution of moodle, Should we fix on the goal of (THIS PROJECT) is all "Authoring" within moodle (which obviously allows users to work online, and not have to install or learn any 3rd party authoring tools) Once "one moodle" method is finalized, it can be adapted to (or by) other tools which could do the same (eg desktop, 3rd party)

Matts point
I agree these methods are best for beginners but can be very time consuming when authoring (lots of content or even a full lesson)
  • Local authoring is obviously best for speed (which syncs online automatically)
  • AIR would be good for this (given a few issues mentioned and sync issues and two people editing same content - without using expensive enterprise "LiveCycle Data Services" solutions)
Again stage 1 should focus on getting a chosen methodology fixed, we can then refine as separate projects to speed up (eg offline). Although, you are completely correct with the points mentioned!

(matt?Jamie) I will send you access to our flex based (amfPHP) authoring system, it may help you see a slicker, quicker way of authoring)

Aside from authoring methods
In an ideal world (From a users perspective), Moodle core should simply allow them to choose publishing "type for a course output" (and not effect authoring) EG...
  • Flash course
  • HTML course
When the course is published its simply extracts the required course data on the fly (amf format) into the pre included templates (on their server), in the same way HTML moodle (html/css) works and subsequently communicates student back to the LMS (via jamies extension?)

I'm strongly guessing there are a number of methods of interacting with swf functions, hence this multitude of potential solutions/confusions/ongoing debates! (not meant negatively this is how evolution happens and gets refined)

In My opinion the ULTIMATE goal(and my thinking) of such a system would be to appeal to the hundreds of thousands existing "moodle admins" with their "existing courses" which would allow them to publish as an alternative (if desired) a one click option to output as a SWF based course, to be more interactive and user friendly?

Again perhaps I am over simplifying and not solving the problems in building upon many methods to date (which I don't understand).

As for myself, I am now becoming a "moodle admin" user trying to output flash based courses, (I am) unsure which method to use (in moodle). Let alone begin to look through the countless moodle suggestions talking about 3rd party tools for this purpose.

Moodle Flash Options
What are the most common/effective methods used to create flash based courses?
A) Using moodle
B) Using opensource tools (to publish to moodle)

Once I can understand the strong contenders, I will start to use them to complete a flash based course, I can then record my actions and steps taken to get to the end goal (whilst assessing the learning curves as a new user)

Cheers
Marcus

In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Marcus,

Good points well made. I think it's also worth bearing in mind that what we're proposing is not just another activity module, like the quiz module, but something more akin to a revolution in developing course materials in Moodle.

As you've already witnessed on Moodle forums, a popular response to the question, "How can we deploy generic 3rd party Flash content in Moodle?" is, "Use SCORM". So I think the popular perception of what we want to create is an alternative to SCORM. As far as I know, Moodle doesn't have tools for authoring SCORM learning content, only for deploying learning packages and recording the output from them. I don't see any reason why we should have to supply content authoring wizards for anything other than the specific Flash learning interactions that we provide as a 'getting started kit' with the amfPHP module. I think 3rd party developers can find very good solutions to content authoring issues and I think it's a good idea to leave that up to them.

I think that if we create...

# The means to deploy generic 3rd party Flash learning interactions,
# Have genuine, fast, efficient 2 way communication between Flash and Moodle,
# An Actionscript - Moodle API that Flash developers can quickly and easily understand and use,
# Really straightforward, well written documentation.

...we will already have some major advantages over SCORM.

What do you think?

In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Alex Britez -
hi all,
My name is Alex, and it seems like i got here just in time to join the flash party. I am a Flex/Flash developer and am looking to give SCORM capabilities to one of the applications that i am working on. Speaking to what "my" intentions are in using Moodle and other LMS packages, I would like to grab assements created within the Moodle environment, and display them for users in a Flash environment. I did a bit of work like this using Docent many years ago, and at the time I was basically sending a recieving javascript calls to and from the LMS. My concern with what i have read is that if Moodle goes with a webservice route, although it is cleaner and nicer it won't be as portable thoughout multiple LMSs. Without a standard like SCORM that would prove to be very difficult. Personally, I would be fine comunicating through ExternalInterface calls from JavaScript and Flex. Once I have access to the data I could always do what i need to it on my end. Sorry if i am way off, just skimmed a bunch of the threads. Either way, this is definitly something i am interested in, so count me in if you need any help with Flash/Flex.
In reply to Alex Britez

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Alex and welcome to the party! smile

Regarding your comments:

"Speaking to what "my" intentions are in using Moodle and other LMS packages, I would like to grab assements created within the Moodle environment, and display them for users in a Flash environment."

If I understand this correctly, you'd like to retrieve data from the Moodle SCORM database tables, do some sorting/analysis and present the results (graphically?) within a Flash application. Is that correct?

"My concern with what i have read is that if Moodle goes with a webservice route, although it is cleaner and nicer it won't be as portable thoughout multiple LMSs."

I'm quite sure what you mean by this. Could you please explain what you mean by "portable thoughout multiple LMSs"? Do you mean LMS's other than Moodle or several Moodle installations linked together?

Flash and Flex communicate with amfPHP through the NetConnection and Responder classes and it facilitates direct calls from Actionscript to PHP functions as if they were native Actionscript. So it would be pretty easy to create libraries of Moodle functions for Flash/Flex to call and have fast, lightweight, two-way communication. Cool huh?

I understand it works with:

"Flash and Flex with Remoting
JavaScript and Ajax with JSON
XML clients with XML-RPC" (http://www.amfphp.org/docs/)

I look forward to reading your reply.

All the best,

Matt
In reply to Alex Britez

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
"I would like to grab assements created within the Moodle environment, and display them for users in a Flash environment"

If I understand what you want to do correctly I don't think SCORM would allow you to do that, would it?? One advantage of using amfphp and server side scripts is that we send messages to the server to tell it to do whatever we like - fetch whatever data we allow it too, send emails, store data, anything a server can do we can allow our Flash scripts to send messages to tell it to do. It is the ultimate in flexibility. We will work out a set of server side functions for common use but the developer can come up with so much more to meet there needs with some php / Moodle knowledge.

It is interesting that when we talk of Flash so many people start talking about SCORM. Noeone talks about SCORM when people talk about putting some dynamic html functionality in a page. Why don't people suggest that the dynamic html functionality should use the SCORM API too. smile
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
For me this project is about using amfphp to access the Moodle API. Much more powerful than the SCORM API.

I suppose we could think along the lines of making the library of common functions we make available to Flash movies which we call through amfphp (not JS) resemble the functionality of the SCORM API, if we think the advantages of doing this :

  • familiarity for some Flash developers??
  • easy to port learning interactions over.
Outweigh the disadvantages :
  • lack of flexibility
  • may not cover all the functionality we want
  • lack of security. SCORM requires you to load the answers to questions into your page and then grade the questions on the client side and send the grade back to the LMS. I feel this is inherently insecure - the answer is available on the client side and someone clever could fake a grade being sent back from SCORM to the server side.

To my mind the SCORM API is not worth duplicating.


In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
"To my mind the SCORM API is not worth duplicating."

Ooops. I think it is great that Moodle supports the SCORM API and it really is wonderful that Catalyst and others are working on improving that support but to make the amfphp set of common functions a SCORM like interface is not such a good idea after we have already broken with the SCORM api by not making the api a JS api but communicating directly from Flash to the server.

Probably noeone else was thinking along these lines anyway mixed. Haha.
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Alex Britez -
I'm going to need to really sink my head in this a bit more to see what it is exactly that i am looking for.

Basically what I would like to is allow for some sort of assessment creation for a flex based presentation software i am working on. (www.empressr.com)

Let me know if i am totally off, since i just started doing research in this subject, but I could either.

Build the assessments within my application and create a zip of files along with a manifest docs to load into an LMS where then transmit calls which allow the Flash doc to directly hook into the LMS internally.

Use a amfPHP in conjunction with the LMS API (Moodle API) to call services from within the LMS, and be able to do the assessment creation from within the Moodle environment, and communicate back and forth. This is more of an external solution where the data is created by the LMS and my app would only act as the visual layer.

Am I on the right track here. I think both have their pro's and con's, just a matter of if we want to take the presentation out of "the cloud" where then we would need to conform to individual services much like we do for photos (Flickr, Photobucket,...) or do a standardized solution which would work with any LMS which follow SCORM guidelines, however limiting some of the functionality and as i mentioned before taking the viewer out of "the cloud"

Let me know if i am somewhat on track, or if there are other alternatives. Both are great, just ends up being more of a business decision in the end.
In reply to Alex Britez

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
You might think about encapsulating the code for communicating with the LMS in a function or class with the aim of being easily able to re purpose your presentation / assessments for different platforms eg. SCORM and / or other LMSs APIs.
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hey Jamie,

Much better put than I did. smile

I think a major problem with this project is that the majority of Moodlers don't know what it is. I wonder how many people reading this thread have ever heard of amfPHP before, let alone know what it does.

How are we doing with the amfPHP - Moodle wiki? It'd be nice to be able to point interested parties to a concise summary of what our project it about, what it does, what it doesn't do and why it's such a great idea to use with Moodle. It could save us a lot of time answering posts that are off-topic.

If you could set it up and put a link from this thread, I'd be happy to contribute what I can to it.

Just a thought smile

Matt
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
I personally feel we would be better off sticking with the Moodle docs wiki for the reasons I outlined in the post above.

Feel free to add to http://docs.moodle.org/en/Development:AMFPHP. We could probably take down that credits notice now and possibly add a section with a list of credits. As the documentation expands we can add a menu template to pages as you see on some other pages so that there is a menu of related pages in the upper left of the page. We could also add a category to docs for Flash stuff.
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Jamie,

Yeah, that's what I meant: http://docs.moodle.org/en/Development:AMFPHP

The trouble with this is, it's in AS 2.0. Even the alternative version that it links to for Flash CS3 is in AS 2.0!

I'll see if I can dig some stuff out in AS 3.0. It'd really be handy and more convenient in the long run to get this stuff going in AS 3.0 just because it's so much faster and is a full-blown OOP language. Plus it's got those handy native datatypes like XML and RegExp, and uses E4X and AMF3... etc.

I understand, though, that most people will be used to older versions of amfPHP and using Flash 8 / AS 2.0. Is it possible to make it work with both? I've just installed amfPHP 1.9.beta. Works like a charm so far! smile
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -

Jamie/Matt/Alex (& others)

Rushing at inetrnet cafe (between meetings but...)
Having briefly skimmed over recent posts, Will try and summarise brief post:

1. Moodle AMF/AS Code

  • We SHOULD use 1.9 (test on beta 2.0)
  • All AS code SHOUL be in AS3

2. Moodle Core AMF
I have been addressing a stage 1 plan (for core services) My initial focus will be on amfphp/AS3 examples for  

  • Account:
    UA/PW/ *Security Question/*Answer (or lost password options availble
  • Personal Details:
    Description, Sex, Country/city, Email, (role type), Last system access*
  • Moodle Logs:
    Required information for storing in moodle logs* (not assessed)
  • Additions
    (user course list, Enrolment)

This is the logical first step in my opinion (moodle basics). Again I will produce full spec this week.

The above would be made public for

  • Online AMF lib
  • php files (for amfphp lib folder)
  • AS3 files/template FLA(s) (possible Flex Project)

Once the above files (no Im not suggesting it) users could even start to build Moodle Flex based applications in a variety of ways. Silly Example:  cross hybrid AIR apps (using Flex/Webkit engine for html/with heavy CSS & JS Changes to moodle css :P)

Stage 2 (my core goal Questions/Courses)

  • Multiple choice Question (sample)
  • Recording Student grades (amf main focus/Alternatives can be trailed pending SCORM outcomes
  • Extensions of the above (All Question types, Course authoring)

Again I will be releasing an AS3/AMF/Flash: Flex project which will help fast track the above.

SCORM/AUTHORING ISSUES
SCORM: Not my area!!! BUT...

  • Moodle/SCORM (Pacakages)
    These appear to be imported into SCORM not created in SCORM (correct??????)
  • 3rd party tools create SCORM pacakages
    eg EXE or other packages?
  • SCRMM LMS Communication
    Again not sure how data is sent back other than JS(vars), Client side, com back to LMS? - will read in detail posts supplied/Additional SCORM details )
  • SCORM - Should be adhered to where possible (given headaches/in-effeciencies it MAY present)

Moodle authoring
From initial evaluation of authoring in moodle (last 24 hours) the process was beyond time consuming and slightly unpleasent in the presentation (usability/speed) a RIA "new authoring environment tools" would be welcomed! (but not considering now)

SCORM creation
EXE appeared (from briefly viewing) good with ref to speed/authoring logic). I am a firm believer in the advantages of using Flex/amf bridged via/from existing admin systems (extracting pre written function of systems). The exploration of EXE (Python/pyAMF) is not something I can look into at this stage.

If moodle DOESNT create SCORM compliant packages, I would personally favour

  • EXE authoring
  • Create "SCORM pacakages" (import into moodle)
  • (1) Communication of results via amf to moodle system
  • (2) Exploration for SCORM communication JS/Clientside/Submit (again unknown/Not preffered but maybe essential)

Anyway (main concentration) core moodle AMF services 9will let other with actual knowledge plan SCORM posible additions.

Cheers
Marcus

In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Getting started with amfphp
Lee Brimelow has some great AMFphp/AS3 source files & training Videos to get you started with AMFphp...

If you want to know answers to:
  • What is amf php?
  • Why (James Ward Podcast AMF slight java & blaze ds focus)
  • How to create a simple service?
  • How do I work with AS3 and AMFphp?
  • Fetching records/Retuning objects from a database

Introduction to AMFPHP 1

Learn how to install AMFPHP and create a simple service that sends email
View

Introduction to AMFPHP 2
In this tutorial you will learn how to directly return database records to Flash using AMFPHP.
View

Marcus
In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Nice one Marcus,

New Documentation in Developer Wiki:
I've also added a little bit of an AS 3.0 code example to use with the existing UserName.php service on the Moodle Developer wiki here: http://docs.moodle.org/en/Development:AMFPHP

It's just a little intro to demonstrate to people familiar with Flash, just how easy it would be to integrate Flash apps. with Moodle. It demonstrates a couple of services that hook into Moodle's API, namely getting your own logged in user data and status. If I knew Moodle's API better (or at all!) I could do a lot more with it.

SCORM and security issues:
As far as the SCORM thing goes, there are already plenty of third party software products that take the agony out of composing SCORM compliant packages. I do think, however, making replacement AS 3.0 apps. (in Flash/Flex) and relevant services to provide secure (i.e. unhackable) tests for learners that report to the SCORM-Moodle API (i.e. bypass the Javascript bit and hook into the SCORM DB directly) would be desireable for many folk who'd like to be able to give tests and exams on-line that could reliably count towards learners' grades (continuous assessment?).

Help Needed:
I think the next step is if anyone here knows the Moodle API, they can help us with putting together some basic Moodle services for AMFPHP, especially for retrieving user data, loggin status, gradebook, courses, etc. to facilitate creating some really nice Flash/Flex apps. to demonstrate some of the capabilities - I'd just love the people here who are used to XML see just how fast and light AMF3 is!

Pass Any Data Directly, Any Type:
I'm new to AMF but as far as I know, AMF supports all native datatypes to Flash; numbers, strings, objects (libraries!), bitmaps, etc. The data is actually returned from AMFPHP to Flash/Flex as an object.

Easy to Use:
Anyone used to using video with Actionscript 3.0 will be familiar with the NetConnection class and calling PHP methods from ActionScript is actually easier than writing video apps.! You can also build debugging into your apps. and tell the user and/or the Moodle DB when something goes wrong. Fewer blank screen woes. smile

ActionScript 2.0 Friendly:
Also, as far as I know, although it's more difficult to use AMF with ActionScript 2.0, it's not impossible although you'd be limited to AMF0. It's a bit slower but still faster than XML.

It's Getting Better All The Time:
The AMFPHP project is currently in 1.9.beta and there's talk (and some previews) of an iminent release of AMFPHP 2.0. They've already included a MethodTable class in 1.9.beta but it's still a bit buggy. I can't wait for the release of 2.0! smile

And Finally, I'll Say It Again:
I really hope that someone with the know-how can help with building a library of Moodle services for AMFPHP. Moodle's already a great LMS. This could easily make Moodle the number one!

Cheers! smile

P.S. I've attached a copy of the Flash source files for the tutorial on: http://docs.moodle.org/en/Development:AMFPHP - I couldn't upload them there!
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
Glad to hear you have become interested in amf Matt!

I think it would be helpful to get together a list of services that will be needed - a list of things we want to be able to tell the server to do. I started one here. Please add your ideas.

I'm assuming that we are all thinking about a services api for an activity to appear in a Moodle course. Let's stick to that for now. We can create lists of functions needed for other parts of Moodle in parrallel or at another time but I think for now we should concentrate on an activity module api.
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Jamie!

Yeah, once I took a look at it and ran through a few tutorials and checked out what it's capable of, I became a convert. It takes me a while to get round to checking things out in between meeting deadlines for projects and teaching work!

Yes, I agree about getting an activity module going being the first step. I think there are quite a few people waiting with 'baited breath' for a new Flash Activity Module to be available.

Regarding your list of services:
  • get the user name, make sure the user is logged in - already demonstrated in my amfphp example.
  • store a grade in the grade book.
  • add an item to the Moodle log
  • Get general data from the Moodle database.
I'm not sure if the following would be good DB practice. The idea is to provide extensibility to the Moodle DB so that if a learning interaction requires specialised fields for recording specific user data, the module can handle that. ActionScript developers would be able to create 'installation SFWs' to go with a learning interaction package:
  • Create a new specialised Moodle DB table for a specific learning interaction
  • Add a new column to an existing Moodle DB table for specific learning interaction
Right now, I can't think of anything to add. Any ideas anyone?

Another point, I think, is to have an overview of what we want to achieve from the point of view of learners, course content authors and Flash/Flex developers:


AMF Moodle project overview:


A round trip from the student's point of view:

1. Student clicks on link on course page
2. Flash learning interaction appears
3. Student completes learning interaction
4. Student is shown end of interaction feedback (i.e. grade, score, confirmation, response, etc.)
- Possibly a view of gradebook or student's records?
5. Student returns to course page


A round trip from a course content author's point of view:

1. Author enters edit mode
2. Author selects "Add Flash learning interaction..." from drop-down list on course page
3. Author selects/uploads Flash presentation SWF file
4. Author enters learning interaction data in a GUI/ uploads learning interaction data/ selects learning interaction data
5. Author confirms data and is shown the new learning interaction
6. Author tests learning interaction
7. Author returns to course page


Requirements from a Flash developer's point of view:

1. A tutorial of how install the necessary AS 2.0 packages to enable Flash remoting for Flash 6,7 and 8
2. A list of services with a concise summary for each one (i.e. what it's for and what it does)
3. A list of methods, parameters and returned object data for each service
4. Example AS 2.0 and AS 3.0 code for each service wherever appropriate

Please feel free, anyone, to add to, change or criticise these ideas. I'd really like this module to be good for everyone!

Matt smile
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Ah, one more thing...

I still haven't been able to satisfactorily resolve the issue with Flash being able to access files in the moodle_data directory. I haven't been able to get the file.php proxy script in Moodle's root directory to work.

Would it be possible to have a service in lib/amfphp/services/ that would handle files in moodle_data and reliably pass them on to Flash Player without any cross-domain security issues arising?

All the best,

Matt

BTW, Flash Player now also supports MP4, M4A, MOV, MP4V, 3GP and 3G2 video formats. smile
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
"Would it be possible to have a service in lib/amfphp/services/ that would handle files in moodle_data and reliably pass them on to Flash Player without any cross-domain security issues arising?"

Hmm. I don't think that is a good idea really. Direct http access is the best way to access files probably.

Why are you having cross domain security issues?? Make sure that you are loading the swf and file from the same domain. A common mistake is to load one using the www. prefix and one without.
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Jamie,

Sorry, I just had another good look at trying to get Flash to load files from moodle_data via file.php. It doesn't seem to be a cross-domain issue at all. It seems to be to do with the way file.php redirects the URL path to the moodle_data subdirectories and the user permissions that it allows.

e.g. If a student is enrolled on course number 99 and a SWF in that course tries to access media files in moodle_data/98, it doesn't work.

Is there any way round this? Is it possible to define a common media library for all courses in moodle_data? I just think it would be more efficient to have one core set of media files that could be accessed by all courses.

This probably isn't a question for this thread! mixed I'll re-post this in the general developer forum.

In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Andrew Hu -
Hi Matt and Jamie, really appreciate all the work in amf3/remoting, I also believe it to be a very good development solution especially for data intense situations.

I would suggest you just don't worry about SCORM. SCORM is a standard designed for interoperability and specifies that Javascript you want to bypass - it just isn't scorm without it. It is often a feature you must incorporate to get into corporate LMS systems but like the bulk of moodle content (Moodle Quiz etc) you just don't need to use it.

Why not just develop the gradebook moodle api (gradelib.php) to amfphp services?

Also check out WebOrb (www.themidnightcoders.com) it seems a little more stable than amfphp and the console code generator is rather cool.
In reply to Andrew Hu

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Hi Andrew

"I would suggest you just don't worry about SCORM. SCORM is a standard designed for interoperability and specifies that Javascript you want to bypass - it just isn't scorm without it. It is often a feature you must incorporate to get into corporate LMS systems"

Thanks..

"Why not just develop the gradebook moodle api (gradelib.php) to amfphp services?"

Will look at (gradelib.php) file

Thanks
<M>
In reply to Andrew Hu

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Andrew,

Thanks for the heads-up! That's really helpful and yeah, I think we're pretty much focussed on creating a module that makes it as easy as possible to deploy Flash/Flex learning interactions and record results from them.

I think we're pretty much set on using AMFPHP which is about to go into version 2.0. and yeah, version 1.9.beta's pretty buggy - I've found a few typo errors in the code just by putting it into Eclipse. I'll certainly check out WebOrb though.

If you haven't noticed, I've got a bit of a 'bee in my bonnet' about SCORM. Usuualy, when I ask questions or write posts about deploying Flash in Moodle, I get responses to the tune of, "Don't bother, just use SCORM instead." I find it quite annoying.angry But that's just me! smile

BTW - http://amfphp.org/ seems to be down. I think I remember reading an article with something about them project losing the domain name. You can still find the code at SourceForge: http://sourceforge.net/projects/amfphp/
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi all!

I've just started an AMF Moodle page in the Moodle wiki. It's only a start and it may not all be correct. Please feel free to edit anything you like to make it more correct, more complete and more concise.

http://docs.moodle.org/en/AMF_Moodle#Sir_Lee_Brimelow.27s_video_tutorials


Happy coding!

P.S. How are the services coming along?
In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by David McClelland -
Thanks for getting this kicked off - I am one of those who have been in the wings for a while.

I put some edits on the WIKI per your invitation.

I am getting AMFPHP 1.9 up and running on my test server and will try Moodle very soon.

A use-case that I haven't seen described anywhere but I hear often where SCORM is used: Can we keep the course structured as individual SCO's but present the course menu from within the course? My usual answer is "No, SCORM assumes the LMS is going to do that bit."

This may be a way to modify the answer to "No, unless you use our special Moodle LMS"

My approach will be to use Moodle/AMFPHP to extend capabilities while preserving a SCORM downgrade capability or my commercial clients.

Dave
In reply to David McClelland

Re: Flash module add-on: Moodle amfPHP

by David McClelland -
I am interested in extending Flash/Moodle capabilities and took a deep dive last night getting to "Hello World".

A few things I learned along the way:

Not sure PHP5 is required to use AMFPHP1.9 - at least, I used <5 syntax successfully.

Not sure why installation of AMFPHP in the Moodle Root Lib directory is required - I was successful with it in default root location without modifying gateway at all.

Example Script (use your own db, usr, pwd):

<?php
class moodleScrape
{

function scrape()
{
// Connecting, selecting database
$link = mysql_connect('db', 'usr', 'pwd')
or die('Could not connect: ' . mysql_error());
//echo 'Connected successfully';
mysql_select_db('moodle') or die('Could not select database');

$qResult = mysql_query ("SELECT * FROM mdl_course_categories ORDER BY id DESC");

return $qResult;
}
}
?>

There is no mention of phpmyadmin in the wiki - this is how I find what I want to query from Moodle
--
http://davidjmcclelland.com
In reply to David McClelland

Re: Flash module add-on: Moodle amfPHP

by Matt Bury -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi David and welcome!

Thanks for your input in the wiki. It's most appreciated.

Not sure PHP5 is required to use AMFPHP1.9 - at least, I used <5 syntax successfully.

I think, but I'm not sure (not being a PHP developer), that AMFPHP will run on <5 servers, but it detects faults caused by incompatibility and runs alternative scripts. Can anyone verify that?

Service library scripts can be written for PHP version 4 or 5 as far as I know without any problems. I converted the scripts I posted to PHP 5 so they will only run on version 5 or higher.

AMFPHP is being developed towards PHP 5 (object oriented) and they're looking ahead to incorporate PHP 6. and AMFPHP 2.0.beta is packaged for download and testing now. I think PHP 5 will become more and more of a requirement as the project progresses.

Not sure why installation of AMFPHP in the Moodle Root Lib directory is required - I was successful with it in default root location without modifying gateway at all.

It isn't required but it follows Moodle convention. The moodle/lib/ directory is for ajax, json, soap, etc. and AMFPHP fits rather neatly into that category so it seems like the logical place to put it.

In the wiki, "Find $gateway->setClassPath($servicesPath); and change it to: $gateway->setClassPath($CFG->dirroot."/lib/amfphp/services/");" just gets the paths from Moodle instead of hard coding them into all of your service scripts.

There is no mention of phpmyadmin in the wiki - this is how I find what I want to query from Moodle

There's no doubt that this is an easy way to get raw SQL queries for DBs. However, the idea of AMF Moodle is to hook into Moodle's API and use that to perform functions in Moodle. I don't see any reason not to use Moodle's API - you don't have to write much custom code, all you have to do is call Moodle functions. smile

All the best,

Matt
In reply to David McClelland

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
David & all

Good to see you here, thanks for your email and your offer to contribute to the amf moodle project.

"course structured as individual SCO's but present the course menu from within the course" & "use Moodle/AMFPHP to extend capabilities while preserving a SCORM downgrade capability"

Is this your intension? I had hope to use the this type of arrnagment, so i can link back (through amf) to a deeper mix of moodles core systems/modules... There are a couple of great modules written in the moodle/google summer camp projects which i have my eye on!


AMF Moodle core pLAN
AMONGST LOVING GETTING MY HEAD AROUND MOODLE (slowly!, very slowly) I have been playing with this as silly example IN flex framework which will BE EXTENDED TO use amf moodle core for everything from blogs, to quizes, from courses to messages, or from navigation structures to assignments (to scratch the surface!!)

Silly example of mixed context view of moodle using amf flex

I plan to release this soon as a os framework extension modules system smile with amf libs and end client flex applications, I will open source this mixed flash/as3/flex/Air project shortly. (AIR*webkit html extension - stage 1 mocks)

If anyone wants access to a protected area send me email: marcus (at)gmail (dot)com

Lack of use-case and collated project flows
Agreed... I have been giving an overall system plan a great deal of thought. I aim to provide some 'uml style' amf core modules plan soon, as a suggested draft for discussion or complete rewrite!.

update to all

I have been very busy organizing project systems for amf moodle (to aid "organized" communication and and repositories of amf service calls which also track both discussion and development areas in a system for techies and teachers to mix together. This will link in with Moodle wikis and documentation for the moodle amf project.

The goal for "amf moodle" complete most key aspects of amf lib extensions to moodle.
I have run a similar project for the os social network "boonex" and have amf libs which can be shown to anyone, if it helps people follow through from php to flex (or flash also).

I have been looking at Moodle with SVN GIT (*community extensions available for os projects) and google have completed some work to integrate back in with google code.

Amf Moodle project is on!
I have started to round up various moodle coders (thanks all), and there are around 10 people now!) with great skills in flex, as3, php, SCORM, who are interested in helping contribute to this project smile (david , again thanks for dropping by will come back with my contributions on finer points of discussion)

Any more please speak up :P

More soon
Marcus

thanks for the contributions david! smile

In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Andrew Hu -
Wow Marcus! I had thought you were attempting to make a module for creating content but this seems to be a rebuild of the moodle presentation layer. - Bloody big job! As moodle moves to version 2 and AJAX integration for the presentation layer (could the AJAX implementation be used as the template for the amfphp/flex?) did you intend to follow this path or branch away?
In reply to Andrew Hu

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Firstly of all - I wish I could write concise english... sadly not...

"I had thought you were attempting to make a module for creating content but this seems to be a rebuild of the moodle presentation layer
"
In my opionion the goals will be to extend moodle via amf directly to a series of Flex components utilsied from overall presentation layer.

"As moodle moves to version 2 and AJAX integration for the presentation layer (could the AJAX implementation be used as the template for the amfphp/flex?) did you intend to follow this path or branch away? "
I had only known that moodle was completing a core API for version 2 (appose to exposing AJAX functionality)

You can include "html" options via AIR with flex - which takes advantage of web kit engine and allows full screen input (disabled for security reasons "online"). There are also methods for utilising ajax with flex - in previous a like projects we have always favored Flex/as3/amf.



conclusion
I do want to build amf services from the core of moodle to utilize flex/as3/amf, I would like to align work (where possible) from moodles API efforts we certainly don't want to create a complete fork from the moodle project, more to the point I want to extend from the core php code and evolve amf services inline with future releases, meaning the AMF services should integrate with version 1.9 and be adapted as required for future versions (2.0 and above)

The main goal from my perspective is take on a modular approach to building AMF services, which integrate with flex components.

Based on my limited understanding of moodle, My intended proof of concept will hinge around student presentation layer to utilize amf services based on.
  • Authentication
  • Moodle Logs
  • Personal Details (including edit details, blogs & messages)
  • Quiz module & Grades
Leading to
  • Courses (stage2) - View, enroll, completion/logs.

Experience moodle users may be able to add onto this or make other valid points. It would be very helpful if moodle (php) specialists could list the core API services/php files which would assist with creation of the core php services.

Again Jamies point should be noted: above is a long term goal and as jamie correctly states
"I'm assuming that we are all thinking about a services api for an activity to appear in a Moodle course. Let's stick to that for now. We can create lists of functions needed for other parts of Moodle in parrallel or at another time but I think for now we should concentrate on an activity module api"



In reply to Marcus Potter

Re: Flash module add-on: Moodle amfPHP

by Jamie Pratt -
I think alternative interfaces to Moodle are a great idea. Probably it is good to be able to fall back to html for people/devices which do not have Flash.

There IS interest amongst core developers in Flash. See here Martin Dougiamas's addition to the brainstorm wiki page on plans for Moodle 3.0 http://docs.moodle.org/en/index.php?title=Development:Moodle_3.0&diff=next&oldid=37880
In reply to Jamie Pratt

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Agreed, fall back will be essential (especially as flex will need flash 9 player)

Hmm looks interested Moodle 3.0 brain storm (thanks for posting)

In reply to Matt Bury

Re: Flash module add-on: Moodle amfPHP

by Marcus Potter -
Hey Matt

Awesome work on the moodle amf wiki - thanks a bunch - i have some useful stuff to add in there...