We've developed a Moodle => QTI 2.0 export, which is almost complete (just the numerical questions still need to be implemented). The export even handles cloze type questions.
This follows the standard question-category export formula of Moodle. I submitted bug 1987 to the bug tracker to indicate our plans some time ago.
But now, I'm wondering - is this going to be useful for anyone? Or is all the current software only using QTI 1.2?
If people want QTI 2.0 export, I'll implement the numerical question type and submit the code.
Note: at this point, import of QTI 2.0 is not supported by my code - it's export-only.
Please respond if you want to see this code in Moodle!
As a kludge that serves our purposes, we've also created code that does a quiz-level QTI 2.0 export. I'd be happy to share this, too - although it's not so pretty at the moment.
If you're wondering what we're using this code for - we're using it to allow Moodle quizzes to be taken using a flash player.
I'm also interested in your use of flash for quizzes, I've developed a quiz flash player myself but it only handles mcqs and I haven't tried to wire it up to a server database for logging (hence interest in exporting and quizzes open to guests). I origonally did it because I thought my team would want to mix up multi media with mcqs but they haven't bitten that bait at all.
I think it would be very good if this could go into the Moodle code as soon as possible. Several people are developing software for QTI v.2 and this will give a boost to the effort.
Yes ; using Flash to deliver quizzes and get results back would be
wonderful! How would this impact future upgrades to Moodle?
Even though I'm still working on the problem, I have found out a few things that can be useful to achieve this goal and I would like to share them. Besides, I have seen a few postings (like the one I'm responding to now) related to this issue and I have also received private messages inquiring about the status of this enterprise which have prompted me to send this message. I'm sorry if the same message is posted in various forums, but I cannot think of any other way to reach the people I want to reach.
OK, here is what has changed since the last time I posted a message concerning this issue. It is a rather long message, but please bear with me if you are interested in making it possible to integrate Flash with Moodle.
My first problem at the moment is that I can't find anybody that can help
me with the Moodle side of things. For my project, I am working with some good professionals that are building the type of Flash applications I need but they are totally at a loss when it comes to make them interact with Moodle since they don't know anything about Moodle and my knowledge of Moodle is limited to the user/administrator perspective.
So before I go on, this is an open call for any developer or Moodle Partner who wants to work with me in this project. I know everybody is busy with their own priorities and for this reason I am prepared to pay decently for your time an effort. My only conditions are a) that the people who take the job are knowleadgeable enough about the Moodle environment and have the required competency to do a decent job, and b) that they don't ask for an arm and a leg to do this. I do have some money that actually I need to spend before the end of december. However, there are two considerations: first, it is not a huge amount of money and second, whatever we build I will make available for the whole Moodle community, so everybody can benefit from it, including, of course, the people who put their work and they are paid for it. This is also a call to other people who want to contribute some money to this goal. I imagine that if we join efforts we can make it better and faster.
If the main Moodlers think it appropriate, I would like to include this as a module or as a part of an existing module (the quiz module seems the most appropriate but it doesn't have to be restricted to it). If the main problem related to being able to "connect" the Flash applet with the Moodle data base is solved, it should be relatively easy to create different forms (similar to the forms one currently has to create quizzes) adapted to the different types of Flash applets one is able to build. If we add to this that Flash MX can work with the so called 'components', one can imagine the enormous flexibility users would have to work with the inventory of created applets (I would also hope that the Open Source spirit Moodle is built upon would favor the free exchange of these applets as well) to customize them, adapt them and extend them to fit their specific needs.
OK, after this SOS call, let me tell you what I have so far. The first thing
I did was to contact Martin at Moodle.com to ask him if he could take on the job. He was too busy with other projects at the moment to be able to help me, but he did offer some guidance about where one should start. What he told me was that, as long as as we could find some way for a Flash applet to manipulate hidden form fields on the same web page where it is embedded, then it should be possible to do what we want (if he is reading this, he can correct me if I misinterpreted him). He added that "Moodle does now have a modular system for new question types so it shouldn't be too hard to do this". So, basically, if Flash can change the values of hidden fields in a form (of the type <input type="hidden" name="secretfield" value="secretword">)
Now, it turns out that things are not that easy. Talking to a friend who has worked on similar issues outside Moodle, he told me the following:
But my friend also pointed out that the problem is not only the limitation to work with one browser. There is an added problem with this way of doing things that is related to efficiency. Flash is much more efficient and fast if it can get data directly to and from the data base. In fact it works even better if it can get the data from an XML server since otherwise we need an additional PHP or Perl script to act as a bridge (which is pretty much the standard way of doing things).
Even though my friend is not familiar with Moodle, he assumes that due to its internal architecture it must be easier to leverage the standard approach of getting the data from the hidden fields in the HTML page. However, this would certainly not be the most efficient way of working with Flash. And, furthermore, he suggests that we should try to build some kind of bridge between the Moodle data base and Flash so that the latter could work with any type of quiz or exercise. He thinks this should not be too difficult. He has done similar things in other platforms and they worked perfectly. Unfortunately this friend, besides not being familiar with Moodle, works full time and cannot take this job.
So this is where I'm at. If anyone thinks that they can join me from here, please answer me in any of the forums where I have posted this message or contact me directly. Even if they are not interested in taking this job, if some Moodle guru reads this message and sees a problem with what I'm saying or has any helpful suggestion as to what direction to take, I will HUGELY appreciate it.
In my former company, we wrote the best selling books on Macromedia Flash, Flash 4 Creative Web Animation, Flash 5 Creative Web Animation, etc. I have worked on many projects requiring this type of integration.
I would suggest that you use Flash to display the quizzes and submit the information back to Moodle using XML to a separate page built to accept the input. This will be more difficult initially, but will be much more robust in the future. If done properly, this would be a very efficient integration.
I am new to Moodle (1 week) however, I have spent that week trying to write variables from our flash tests to Moodle. I think what I need is an expert in PHP and mysql.
I have a budget available for someone to help me complete my task and am actively looking for someone.
Clearly it would be best to use the existing tables within moodle so that the internal reporting tools could be used for the data I want to capture. The php mysql expert should therefore be moodle familiar.
If our aims are similar, then maybe we can collaborate?
There is an article about integrating flash to php mysql http://webmonkey.wired.com/webmonkey/multimedia/shockwave_flash/
but please bear in mind that not all moodle users are using MYSQL, so I think that it will be necessary to use the functions provided by moodle for manipulating the generic database.
But as Mark Lane says above, it is probably best to communicate using XML. He mentions returning the results using XML but perhaps ideally moodle quiz would export itself in real time as the quiz XML (already produced by Howard, but not available in real time now) so that they can be rendered by a flash applet as well as by the standard moodle attempt.php/feedback.php.
I would really like to be able to contribute some funds to this since, as I say, I am scared that at the next meeting I go to, I will be told that as moodle uses html its quizes are not secure, and that we should go with the java applet based competitor. As far as I know flash can do anything that Java can do, and usually with less problems, so a flash front end for the quiz would be great.
If there is some delinateable chunk of coding, with a definable function, for which someone can quote, produce reciepts and deliver (and then wait a month or two to be paid) then I may, I mean may, be able to get about $1000 from my university. They have just given me about $400 to order "quizes in a new window". At last some money spent upon Moodle.
There is a good chance I would pay someone something.
Flash is a much smaller download if the student's don't have it (~1MB). If possible, write the specs to use Flash 6 and Actionscript 1 (rather than the more advanced AS 2.0) as that will make it compatible with many more student's computers out of the box.
The main problem I see now is to find a developer that is part of or has some access to the main Moodle developing team so that we can guarantee that whatever gets done, it can be properly integrated into Moodle. That is to say, I'm sure nobody here wants a simple hack that we can use use now for a while but that would become obsolete once a new version of Moodle comes up. For this, we need to be very sure that what is done follows the specifications and requirements for full Moodle integration.
A different consideration is whether this can become integrated as a standard part of Moodle. I suppose that whoever decides these kinds of things will decide one way or another. For me, at least, that wouldn't be so important (although, somehow I would love for something like this to be part of the standard Moodle distributions) as long as this product was built as some sort of plugin that one can plug into his/her/their Moodle easily as happens with some of the non-standard modules other people have developped and could also be sure that it would work with future versions of Moodle. In summary, my main concern is that whoever does it can guarantee that is totally compatible with the Moodle arquitecture and will work smoothly with future versions of Moodle. What do you think?
I'm becoming a bit pessimistic about this, though, because from what I'm able to see many of the main Moodle developpers are very busy with things that they consider more of a priority (and perhaps they are in the larger scheme of things) and so they wouldn't be interested in taking on this job at this point. I posted the same message in the General Developer forum and I haven't gotten any response. Maybe I sound very impatient but time is running fast for me. I've been after this feature for the last two years (before I discovered Moodle) and by the middle of December I will lose the money I had been given to develop this (and other things) if I don't use it.
My wife is a Flash eLearning designer but not much of coder beyond a little ActionScript, and I would love to see a Flash data interface for moodle so I can use her design skills for some ideas I want to prototype.
I would be willing to toss another $500 into the kitty to support this effort.
Maybe if we can get a few more people to pledge some actual...
It's one of those things that will undoubtedly spawn uses we can't imagine yet.
I still want to develop the handler for the calculated-type questions before submitting the code.
Sorry if I neglected this thread for a few days - there was busyness, there was sickness, and there were holidays ;).
The code is available at http://opensource.mediagonal.ch/moodle/patches/qti-export/
See Bug 1987 for a history.
Below is the readme.txt from this release:
This code allows for an ims-qti version 2.0 compatible export of moodle questions.
There are two possible modes to export questions - question-category level (the
standard moodle question export) and quiz level.
Question-category level export description:
A new directory is created to hold all of the export files:
- one imsmanifest.xml file
- one xml file for each question
- a copy of each image or media file specified in the question editor drop-down image selector
Quiz-level export description:
- One imsmanifest file is created. In this file all the questions for the quiz
are embedded. The idea behind this quiz-level export, is that you can use it
to feed the information into an alternative question presentation system. Links to
all image or media files are linked to through moodle's quizfile.php.
To see a demonstration of what we've done with a partner company, go to
http://demo.lernfrage.ch u/p : gast/gast (german only, sorry).
- to get a quiz level export, access mod/quiz/imsattempt.php, passing it
either id (course module id), or q (quiz id).
The code handles all standard question types, except for "calculated" questions.
The cloze question export is currently limited to handling multichoice and
short answer subquestions, but it could easily be extended to handle the other
cloze-supported subquestion types.
For question-category level exports, images or other media files that are
referenced directly in the question text field are currently not copied to
the export directory. For these, the link to the file remains unchanged
in the export files.
Overwrite the current mod/quiz/format/qti directory with the contents
To enable quiz level exports, copy code/mod/quiz/imsattempt.php to your
IMPORTANT INSTALLATION NOTE:
For the installation, note that the templates_c subdirectory must be writeable
by the user under whose id the web server is running. This is where the templates
used for creating the export files are created. Of course, if necessary, this
directory can be moved outside the document root. If you do change the location
of the templates_c directory, be sure to change the value of $smarty->compile_dir
( in the function init_smarty() ) to point to the appropriate directory.
The code was tested with version 2005012800 (1.5 UNSTABLE DEVELOPMENT).
Some of the code is, for a vanilla moodle installation, unneccessary -
but it works fine for vanilla moodle installations.
It handles, for instance, the drag and drop question type, which we
will soon release to moodle community. It also specifies the width,
height and mimetype of images or other media elements, if those values
are available from the database (we modified our moodle to store those values).
Author: Brian King < brian _AT_ mediagonal _DOT_ ch >
License: GNU General Public License
I'm not so sure that this will be easily added to the CVS version as it works in a very different way to the existing export code, but I mean to have a proper/look think (on the grounds that it might be better!). For example this exports a complete quiz, existing export exports the category. Any thoughts?
Acutally, it does export a category of questions if you go through the normal export process. This should be completely standard and moodle-compatible behaviour - you do the same thing you do to export in other formats, and you choose qti for the export type.
It also allows for an export at the quiz level. However, quiz-level exports are not available through the normal user interface. I didn't build a hook for this into moodle anyplace because we use an external flash player to access the quiz-level exports.
To do a quiz-level export, you need to call the script mod/quz/imsattempt.php, passing it either id (course module id), or q (quiz id).
The idea behind a quiz-level export is to allow an external player to present the quiz. The external player makes a request to imsattempt.php. This script actually starts a quiz attempt, and then outputs xml in the form of an all-in-one imsmanifest. This means that all the questions are included in their entirety in this one xml response. In the case of a quiz-level export, any pictures or other media files remain linked through moodle. When the user finishes the quiz, the external player posts a response to imsattempt.php. imsattempt.php then stores the quiz results in moodle.
If you view a quiz, your title bar shows something like:
mymoodle » mycourse » Quizzes » myquiz
your browser location bar will show something like:
If you change this url to
you will get a bunch of xml (you may need to "View -> Page source" in your browser to see the xml). This xml is the quiz-level export.
I have given it a quick test and it seems to work - I need to add some help text which I will do in a minute.
The only change I have made is that the Smarty compile directory is created under $CFG->dataroot which more or less guarantees that the web server can write to it.
Can those interested give this some testing and let me and/or Brian know if there are any problems.
I plan to make actually getting the export files a bit more intuitive, so I will probably make qti export export a single zip file in the very near future!
I am using moodle 1.5 and I currently have problems with the export. As I also described in http://moodle.org/mod/forum/discuss.php?d=25444 I get following error, when exporting questions as QTI 2.0:
Warning: _compile_resource(c:\programme\easyphp\www\moodle\lib\smarty\internals\core.write_compiled_resource.php): failed to open stream: No such file or directory in c:\programme\easyphp\www\moodle\lib\smarty\Smarty.class.php on line 1425
Fatal error: _compile_resource(): Failed opening required 'c:\programme\easyphp\www\moodle\lib\smarty\internals\core.write_compiled_resource.php' (include_path='.;C:\Programme\EasyPHP\php\pear\') in c:\programme\easyphp\www\moodle\lib\smarty\Smarty.class.php on line 1425
c:\programme\easyphp\www\moodle\lib\smarty\internals\ should actually be writable. I also tried to change the smarty compile directory, but I am not sure how to make this (define('SMARTY_COMPILE_DIR', '%dir%') in config.php?)
Any help would be appreciated.
I'm replying back to your orginal question because the issue has come up.
>>But now, I'm wondering - is this going to be useful for anyone? Or is all the current software only using QTI 1.2?<<
Will your code be compatible with applications that only support IMS QTI 1.2?
If not, your export capability will be pretty limited since most applications that support IMS QTI only do so up through IMS QTI 1.2. From what I understand, it will still be a good year before we start seeing wide adoption of IMS QTI 2.0.
As pointed out by a colleague, it looks like Moodle "figured they could "leap frog" IMS QTI 1.2. But now they are in a pond of their own."