Use Moodle's code to import and export many more formats

turadg - May 26, 2009 - 21:43
Project:Quiz
Version:6.x-4.x-dev
Component:Code - Quiz module
Category:feature request
Priority:normal
Assigned:turadg
Status:closed
Issue tags:gsoc2009-sivaji, questions_export
Description

To make quiz questions authored in the Quiz module useful to other learning content managements systems (LCMS) like Moodle, we need some facility to export the questions into shared formats.

#1

turadg - May 26, 2009 - 21:48

Attached is a new questions_export module. It works like the questions_import module, which was used as a starting point.

At the moment it exports only in GIFT format, but it's designed to re-use Moodle's variety of export formats. I'm uploading to get some feedback before I continue.

(Also, how does one go about requesting CVS commit access?)

AttachmentSize
questions_export.zip 43.48 KB

#2

sivaji - May 26, 2009 - 22:28

Hug you!! its a part of my GSoC proposal you made it simple for me. Its 4 am now, time to sleep i will test it and let you know.

Regarding CVS access
1. You need to apply for drupal CVS account here http://drupal.org/cvs-application/requirements
2. mbutcher has to give CVS commit access to quiz module.

#3

sivaji - May 27, 2009 - 22:08
Status:needs review» needs work

Great!! Your module works fine though there are two things to be changed. I am still struggling create a quiz and test the quiz questions_export output file to work with moodle.

Here the changes you need to do
* questions_export.info says querypath module is a dependency but your code seems to be not using that module anywhere.
* I haven't seen a Drupal module files with .php

Other things looks fine, please re-roll the patch with above changes. Your module will be ported only in quiz 4.x because quiz 3.x has already entered beta release.

#4

turadg - June 2, 2009 - 22:15

@sivaji, thanks for reviewing. I will incorporate your feedback.

since it's an completely new feature that doesn't interact with existing features, I hope it can be released before 4.0. why not 3.1?

@mbutcher, do you support granting me CVS access? reading the FAQ, they expect a public record of the maintainer supporting a new CVS account.

#5

turadg - June 5, 2009 - 04:27
Title:Export to different quiz data formats» Use Moodle's code to import and export many more formats

I spent more time on this and implemented a bridge to Moodle's question formats so we can import and export all that Moodle can (with some kinks as of yet).

Import formats now supported:
Aiken (now more than M/C)
QTI 1.2 (mbutcher's)
Blackboard 6.x
ExamView
GIFT
Hotpotatoes 5.0 and 6.0
Learnwise
WebCT

Export formats now supported:
GIFT
QTI 2.0
Moodle XML

There are kinks in many of the formats but the work is in place to use Moodle's format code. It even creates the correct zip file with IMS manifest for QTI 2.0 export. The problems are currently empty, but I won't be able to spend more time on this for a week or two.

I tried making a patch with all this but the new files I added aren't being included. (I'm using "cvs diff -up > ~/quiz-[issue-number].patch" as stated on the CVS page for the project.) Since I don't have commit access yet and can't make a patch, I'm attaching a zip of the "includes" folder, which has everything. (Including /views, which I didn't touch.)

The ZIP is pretty big; that's because there's a lot of code.

AttachmentSize
includes for using Moodle formats.zip 379.98 KB

#6

sivaji - June 9, 2009 - 17:39

@turadg

great you have done a wonderful job. I have been testing this patch for last two days, it still needs work. I will commit this patch now to 4.x (gsoc) branch. so that we can works simultaneously on this.

Here a short review about your patch :

1. You should follow the drupal coding standard http://drupal.org/coding-standards.
2. If you want to print some message on the screen use drupal_set_message() NOT print or echo or print_r(). I could see a plain text page displayed after the file has been imported.
3. I spent much time on searching for sample file for each import type, will be good if you are able to have a sample file for each import format, it will be easy for others who are not proficient with moodle to test your patch.
4. I could test only 5 import format of which 3 (learnwise, GIFT, Aiken) works out of box.

hotpot and Blackboard import return fatal error

Fatal error: qformat_hotpot::require_once() [function.require]: Failed opening required 'sites/all/modules/quiz-DRUPAL-6--4/includes/moodle/lib/filelib.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/sivaji/Public/quiz-dev4/sites/all/modules/quiz-DRUPAL-6--4/includes/moodle/question/format/hotpot/format.php on line 46

warning: require_once(sites/all/modules/quiz-DRUPAL-6--4/includes/moodle/lib/tcpdf/html_entity_decode_php4.php) [function.require-once]: failed to open stream: No such file or directory in /home/sivaji/Public/quiz-dev4/sites/all/modules/quiz-DRUPAL-6--4/includes/moodle/question/format/blackboard/format.php on line 17.

After searching on moodle cvs i came to know that html_entity_decode_php4.php is a dead file. It seems they are trying to require a file which doesn't exists in patch. please suggest a way to fix this.

I could not get sample import file for other three import type webCT, blackboard and ExamView, will be good if you give a link or attach a sample file.

On the whole you have done a great job. I hope this patch will avoid the need to install moodle for drupal site to some extend. Lets work together to get this patch committed and fully functional for it users.

#7

turadg - June 23, 2009 - 00:24

Thanks for all the feedback, Sivaji.

1. I'll be sure to follow Drupal coding standards before checking into CVS. The one exception I think should be the Moodle code. It's better to keep that in the Moodle coding standard for file comparisons.

2. I left those in for debugging. I'm now using dprint_r and also wrapping it in a check for the devel module because without that enabled dprint_r() throws an error.

3. I've attached a sample of the WebCT and HotPotatoes (JQZ) formats.

4. WebCT importer worked on example file attached. HotPotatoes importer relies on Moodle's filelib.php and a bunch of server path conversions. Until there's a strong pull for that format, I'm going to leave that hairiness alone.

I've also attached a patch that wraps dprint_r(), enables the WebCT importer, and fixes a user message typo.

AttachmentSize
quiz-473628-2.patch 3 KB
webct_example.txt 901 bytes
hotpot_example.jqz_.zip 3.18 KB

#8

sivaji - June 23, 2009 - 20:05

Thank you for your patch WebCT works fine, Hotpotatoes importer returns the following error message

Fatal error: qformat_hotpot::require_once() [function.require]: Failed opening required 'sites/all/modules/quiz-DRUPAL-6--4/includes/moodle/lib/filelib.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/sivaji/Public/quiz-dev4/sites/all/modules/quiz-DRUPAL-6--4/includes/moodle/question/format/hotpot/format.php on line 46

We still need sample import file for Blackboard and ExamView.

[FYI : whenever you submit a patch to issue queue you should set the status to "need review" ]

#9

turadg - June 23, 2009 - 20:33
Status:needs work» needs review

HotPotatatoes, ExamView or Blackboard because they depend on Moodle's filelib. Because of that, I won't be implementing them at this time.

I submit that this goal of this ticket, to use Moodle's code to import and export more formats, has been achieved. When we want to add support for more formats, we can have separate issues for those and the issue submitter can include example files.

#10

mbutcher - June 23, 2009 - 22:12

turadg,

Thanks for shepherding this through. I'd like to have you as a committer for this project. When you apply for CVS access, make sure to mention this post.

Thanks,

Matt

#11

sivaji - June 24, 2009 - 19:55

other importer (that doesn't depends on Moodle's filelib) seems to be working fine. I would like to do a complete testing before marking this thread as fixed. Thanks a lot for the great patches you have submitted to this issue.

#12

AjK - June 25, 2009 - 21:41

@mbutcher
@turadg

CVS account app approved.

#13

turadg - June 26, 2009 - 21:37

@AjK, thanks much. I have been able to login to Drupal CVS now.

@mbutcher (or any other Quiz maintainer), I just need to be granted commit access on this module now. I'm not in the list yet, http://drupal.org/node/26481/committers

Eager to join in pushing Quiz forward,
turadg

#14

gayathriAthi - July 28, 2009 - 05:20

#15

sivaji - July 17, 2009 - 14:13

1. Don't hijack the discussion. This question supposed to be in a new issue.
2. No there is no gradebook-quiz module integration as of now. If you like to have this feature please do create an issue under feature request category. We may port it depends on other users feedback.

#16

turadg - July 26, 2009 - 23:22
Version:6.x-3.x-dev» 6.x-4.x-dev
Status:needs review» fixed

I just added support for importing "matching" type questions.

I'm moving this from "needs review" to "fixed". This is a big set of functionality, so any issues that crop up can be filed as separate tickets. (Also moved to 4.x since that's where the code is.)

#17

System Message - August 11, 2009 - 05:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.