IMS QTI Importer Beta for Moodle 1.6

IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
Number of replies: 120
I have just finished a beta script to import quiz questions from Respondus 3.5 to Moodle 1.6.

This script will import all question types from Respondus 3.5 to moodle 1.6.  It currently has image support (.jpg, .bmp, .gif) as well as support for most common sound formats. Currently there is no support for vidieo or .swf files, but this functionality will probably be added in the final version.

Please note that this is a beta script.  Please back-up your database before installing it and do not install it on production side servers (without testing beforehand).

Please email me any suggestions and/or problems you have concerning scripts.  I will be happy to recieve any feedback.  This is my first moodle-related script, and I am finding that debugging it is very time-consuming.  So, If you spot any problems or have any suggestions, feel free to let me know.

The included Readme has installation instructions.
Average of ratings: -
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Elijah.... thanks for this. I am looking forward to seeing some feedback on this one (I am not a respondus user myself).

I had a quick look and it is very nicely written and documented smile Hopefully, we can include in 1.7!
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
I looked at this script after posting it the other day and discovered a major flaw.  Apparently GIF images would not display.  This has now been fixed.

I have also added .swf support.  A complete documentation on this script is still forthcoming, but if anyone has any questions please dont hesitate to post to this forum or to email me.

To make this script work properly, you must use the Ims Qti 1.x personality in Respondus 3.5.  You must also save your quiz as the .zip file with the IMS content packaging option.  You may save the file with either points as decimals or points as percentages.
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Taylor Chapman -
Hi,
Thanks for your work on this- it will be so useful! I tried to install it today, but when I go to the import screen I get this:
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/tchapman/public_html/staff/resourcecenter/question/format/imsqti/format.php on line 79

Any suggestions?
In reply to Taylor Chapman

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
Are you installing the script in the moodle 1.6 environment?  So far, this is the only version of moodle that this script works for.
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Colin McQueen -
Hi

I have 1.6 installed (original release not +) and also get:

Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in c:\program files\easyphp1-8\www\moodle1-6\question\format\imsqti\format.php on line 79

when clicking on the import or export tabs

Any ideas?
In reply to Colin McQueen

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
hmmmmm The only thing I can think of that would cause this is a difference in the required classname.

With my 1.6 beta the required format for the classes in format.php is:

class qformat_classname extends qformat_default {

}

so for this class (class declaration around line 75), I have

class qformat_imsqti extends qformat_default {
    .....
    .....
}

I developed this using the 1.6 beta, it is possible that there were changes in this class structure with the release of 1.6 for use after the beta.

I'll download the current version of 1.6 and see how it works.

I'll try to get back to ya soon.
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
I downloaded the regular version of 1.6 and the class structure is the same as the one I developed this script with.

I have no idea what is causing this script, as my script does not give me an error when I run it.  I am, however still running it on localhost.

I'm going to debug it and try uploading it to my network.  Let me know if you figure anything out.
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Jean-Michel Védrine -
Hello Elijah,
Most probably this is a PHP version problem. With what PHP version did you developp this script ? And with what PHP version are Colin and Taylor trying to test it ?
I have no real respondus file to test it, but with a fake one I don't get this error with a PHP 5.1.2 setup.
In reply to Jean-Michel Védrine

Re: IMS QTI Importer Beta for Moodle 1.6

by Taylor Chapman -
That could be the problem. I don't know about Elijah or Colin, but I'm on 4.4.1. Possibly it needs version 5 to work?
In reply to Taylor Chapman

Re: IMS QTI Importer Beta for Moodle 1.6

by Colin McQueen -
I'm on 4.3.10 the minimum for 1.6 is 4.3.0 I believe. So maybe it is needing PHP5. Would changing to that upset other modules I wonder?

BTW The error stops you using any filters as halts the page with the import choices on it. I guess the error occurs when the menu of formats is built up. I had to remove the format folder to be able to use the import pages for any import.
In reply to Jean-Michel Védrine

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
Oooooooooooooooooooo dang!!!! I forgot to tell people that I developed this with PHP 5.1.1.

I'm really sorry guys, this is my first moodle development project and release,  so I didn't really know what to include in the beta release notes.  Well, from now on, I'll make sure to put which version of php I used into my releases.  smile

Try upgrading to php 5.1.1, and see if that fixes it.  Everything works fine on my server.

Also,  I am almost done with adding moodle 1.5 functionality to this script.  I may be done with it today.  If I am, I will post it to this thread.
Average of ratings: Useful (1)
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
see my post at the bottom and disregard the parent of this post. smile
In reply to Jean-Michel Védrine

Re: IMS QTI Importer Beta for Moodle 1.6

by Bob Clarke -

Jean-Michel

Our specific quiz application is a large (>6000 questions) database of questions which we use to create both self and graded assessments for students. We have all the questions in Respondus (currently 3.0) which has an export format choice of IMS QTI. We have been using Blackboard and uploading the files directly as Respondus will not output these types of files. As we are moving more fully into Moodle (supported by OKTechnologies, thanks Mike) for our courses, we are dropping out of Blackboard support and so will need the IMS QTI import function.

I can send you a Respondus IMS file. Would this be helpful?

Bob Clarke

In reply to Bob Clarke

Re: IMS QTI Importer Beta for Moodle 1.6

by Colin McQueen -
Hi Bob

Any chance you could either post here or send me an example Respondus file to try out?

Thanks
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Colin McQueen -
Great work!

Anyone got an example file I could use to test the import with swf and gif files in it?
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
Ok, so, I figured out the problem with the class.  I was using php 5.1.1 to define class variables that really didnt need to be defined.  I just moved those variables outside of the class (and removed the public keyword), and now everything seems to be working.

I think it will work now without installing php 5.1.1.  Let me know.

Attached is the revision of the beta.
Average of ratings: Useful (1)
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
Ok, so for anyone using Moodle 1.5.......

I have gotten all the question imports to work, except for the Algorithmic question type.

When making algorithmic questions in respondus, a swf file containing the algorithmic question is created.  My script attempts to embed this script using HTML into the body of a multi choice question.

Upon uploading the respondus question containing a swf, the swf is visible in the results of the upload.  But when you click on the acutal question, the Swf is not there.

I have no idea why this would occur.... I have enabled the Multimedia filter on my moodle 1.5 install, but this didn't seem to do anything.
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Bob Clarke -

Elijah,

We have been looking for your solution for a long time. We use Respondus as a question database creator and the only direct exportable file is IMS QTI. We have been uploading to a Blackboard application but were faced with saving quizzes in the default print file format and converting to an "Aiken" format. Thanks for your work.

Bob Clarke

In reply to Bob Clarke

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
Bob,

I'm glad that you will be able to make use of this script.  Have you tried importing your quiz from respondus using it yet?  Let me know how it works.  This script is still in the beta stages.  There are several bugs I need to work out still.  However, it is almost fully functional.

Thank you for your assistance,

Elijah
Average of ratings: Useful (1)
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Colin McQueen -
I've installed your new version and it doesn't give the error on going to the import screen anymore. So that's working with a version 4 PHP setup now. Well done approve

I need a file to try out the import though anyone got an interesting one preferably with some science questions I could use in a K12 school   wink
In reply to Colin McQueen

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
All I have are debugging files that I have made.  I'll attach one of these files.  The questions are not acutally ment to be used in a quiz however. smile

The attached file was made to test the functionality of the Multichoice and true-false questiontype import functions.
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Colin McQueen -
Hi

Tried both example files attached above but get:-

Fatal error: Call to undefined function: htmlspecialchars_decode() in c:\program files\easyphp1-8\www\moodle1-6\question\format\imsqti\format.php on line 1609

when clicking the upload button. Any ideas?

MySQL    4.1.18
PHP        4.3.10

Windows XP and Apache
In reply to Colin McQueen

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
hmmm...dang.  I guess that function doesnt work with php 4.

I patched this function:

if (!function_exists('htmlspecialchars_decode')) {
       function htmlspecialchars_decode($str, $options="") {
               $trans = get_html_translation_table(HTML_SPECIALCHARS, $options);

               $decode = ARRAY();
               foreach ($trans AS $char=>$entity) {
                       $decode[$entity] = $char;
               }

               $str = strtr($str, $decode);

               return $str;
       }
    }

into the file before the class.  This should allow the htmlspecialchars_decode function to work on php < 5.1.1.

Let me know if it works.
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
Here is the most current version of this script.

I fixed an issue preventing .swf files from showing up in moodle 1.5 questions.

Here is the .zip.  Let me know how it works.

Thanks!
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6 - Errors

by John Harris -
Yes, another newbie question.  I am receiving the follow errors.  I am posting the first couple of lines of code that is pages long (error code repeats itself). The program imports a couple of questions and then stops.  For some QTI packages, it does not import any questions.

Warning: get_html_translation_table() expects parameter 2 to be long, string given in /home/joh/public_html/johnh/question/format/imsqti/format.php on line 90

Warning: Invalid argument supplied for foreach() in /home/joh/public_html/johnh/question/format/imsqti/format.php on line 93

Warning: get_html_translation_table() expects parameter 2 to be long, string given in /home/joh/public_html/johnh/question/format/imsqti/format.php on line 90

Warning: Invalid argument supplied for foreach() in /home/joh/public_html/johnh/question/format/imsqti/format.php on line 93

Any ideas?

John


In reply to John Harris

Re: IMS QTI Importer Beta for Moodle 1.6 - Errors

by Elijah Atkinson -
Looks like there is some problem with my attempt to fix the htmlspecialchars_decode function to work on php 4.

I'm gonna have to look @ it on monday however, cause I'm just finishing up my shift.

I'll let you know what I find.
In reply to John Harris

Re: IMS QTI Importer Beta for Moodle 1.6 - Errors

by Elijah Atkinson -
Ok, I think I fixed the problem causing this issue.  See my post entitled "IMS QTI Importer 1.2.1" near the bottom.
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Adrian Fox -
Useful Importer for conversion of Respondus 3.5 to moodle 1.6 files.

As part of a user community that utilizes QuestionMark & Blackboard and currently evaluating Moodle, a question that keeps being asked is "how do we take all this QuestionMark work and import into Moodle".  I have looked at the various threads about IMS QTI importers etc and am looking for advice/guidance on the next stage and is anyone else needing/working on importing QuestionMark.
In reply to Adrian Fox

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
I don't know.  Currently, I haven't done any work whatsoever with Blackboard, and I've never heard of QuestionMark.

Try starting a thread concerning your question in the Quiz module forum.  Good luck! smile
In reply to Elijah Atkinson

IMS QTI Importer 1.2.1

by Elijah Atkinson -
I think I have fixed the issue with the htmlspecialchars_decode function not working.  I have also fixed a couple of bugs that I knew of previously.

Let me know how this script runs on php 4.  Thanks! smile

(Attached is the most recent version of the IMS QTI Importer script)
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1

by Elijah Atkinson -
I fixed the .swf embed code for moodle 1.5 so that .swf files can be embedded into questions.

This required an extra step in instalationl, so be sure to check the readme.txt file in the zip.
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1

by Colin McQueen -
Hurrah!

This imports the example file with all the pretty animal pictures.

Moodle 1.6 + (2006050506)

Name Information Report Status
database mysql version 4.1.16 is required and you are running 4.1.18 OK
php
version 4.3.0 is required and you are running 4.3.10 OK
php_extension iconv is recommended to be installed/enabled Check
php_extension mbstring is recommended to be installed/enabled OK

Excellent!

BTW Great to meet people at MoodleMoot'06 in the UK. Hi Tim - thanks for the help and encouragement.
In reply to Colin McQueen

Re: IMS QTI Importer 1.2.1

by Elijah Atkinson -
YAY!!!!! :D

Cool!

Let me know if any other issues crop up.

Thanks for testing my script everyone! smile
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1

by Maraike Reimer -

hi..

it doesn't work sad(
i have installed moodle 1.6.1 and PHP 5.1.4 and your qti impoter tool 1.2.1.

i can import an IMS QTI Format: but then, i always get the same error message:

PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

do you have an idea??

In reply to Maraike Reimer

Re: IMS QTI Importer 1.2.1

by Elijah Atkinson -
First off, what line number does the error message give you?

This seems like an error regarding the moodledata directory.  Do you have a moodledata folder?  This script makes use of this directory to upload all the images and other related files so they can be linked to.

Another possible cause of this error could be you're Respondus version.

This script was only designed to import quizes from Respondus 3.5 to Moolde 1.5 or 1.6.  I have not tested this script on any versions of Respondus prior or later (if there are any) than 3.5, and I do not know if there are significant enough changes in different versions of Respondus to cause this.

So, let me know, and I'll try to get this fixed.

P.S.  Try using the most current version of the IMS QTI importer (version 1.2.2) as well.


In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1

by Maraike Reimer -

hi,

i don't get an error line number sad
i don't use respondus - it's a tool for creating qti-files, right?

i tried to import some of your qti files and i have my own tool for creating qti, but i always get the same error message...

i have a moodledata folder, there are some qti regarding files in the temp directory.

i don't have any idea what to do... sad

 

In reply to Maraike Reimer

Re: IMS QTI Importer 1.2.1

by Maraike Reimer -

hi,

i tried it with moodle 1.5.3, 1.6 and 1.6+ and with php 5.1.1 and php 5.1.4

but i always get the same error message sad

need help

In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1

by Maraike Reimer -

oh.. i'm a foolish.

i have always upload xml files and not zip archive ;)
now, i can see all the nice animals.. great!

but unfortunately i can't import my own qti files..

this is the error message:

Warning: implode() [function.implode]: Bad arguments. in C:\Programme\xampp\htdocs\moodle1_6+\question\format\imsqti\format.php on line 1689
Error: Unfamilliar questiontype


can anybody take a look??
i can't see my failure??

thanks

In reply to Maraike Reimer

Re: IMS QTI Importer 1.2.1

by Elijah Atkinson -
Sorry It took me so long to get back to you. I went camping for the weekend.

Yeah, this script only takes .zip files. Uploading a .xml file will make it have some kind of crazy errors.

Secondly, this script currently supports only IMS QTI files generated by Respondus 3.5.  I don't know if any IMS QTI files from earlier versions of Respondus will work.  If you want to get this script to work properly, you will need to use Respondus 3.5.

What program are you useing to edit/create IMS QTI files?
In reply to Maraike Reimer

Re: IMS QTI Importer 1.2.1

by Elijah Atkinson -
Basically the reason your file wont upload is because my IMS QTI script can't Identify the questiontype of the question to be imported into Moodle.

The IMS QTI script was written to specifically identify IMS QTI quiz questions from Respondus 3.5 and to convert them to their appropriate Moodle quiz question.

If your quiz question does not follow the format of any of the quiz questions output by Respondus 3.5 it is very unlikely that it will import into Moodle properly.

If you wish to check what format you should use for your own IMS QTI files, you can unzip the attached file and open the .xml file that is not the imsmanifest.xml file.

This file contains one question of every questiontype that can be exported from Respondus 3.5. The questions match Respondus questiontypes in this order:

1) Multiple Choice
2) True / False
3) Essay
4) Matching
5) Fill in the blank
6) Multiple answer
7) Algorithmic.

You may be able to re-create all of these questiontypes, except the algorithmic questiontype, by following the proper format in your IMS QTI files. Respondus makes a .swf file for its Algorithmic questiontype, this pretty much prevents anyone from duplicating it with just IMS QTI script.

Let me know if this helps at all. smile  Thanks for showing interest in my script.
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1

by Maraike Reimer -

thanks a lot for your help...
i have solved some problems but there's still one.
perhaps, you can help me ?

i want to insert text like this:
<mattext>answer1</mattext>

moodle always show me: >frage1

i tried to change the following lines in your php-file so that i don't need the CDATA-thing. but it doesn't work. do you have any idea how to change it?

//gets the appropriate line containg the question text.
$currentTextBlock = extractstr($haystack, "<mattext texttype=", "</mattext>", $j, $j);
//get the question text in the currentTextBlock.
$currentText = extractstr($currentTextBlock, "<![CDATA[", "]]>");

my idea: $currentText = extractstr($currentTextBlock, "", "");   >> it doesn't work!!

when i try to insert an image, it also doesn't really work - i can see the image, but not the text anymore. 

<material>
<mattext>answer1</mattext>
<matimage imagtype="image/jpg" uri="picture.jpg" />
</material>

if i use the html-style, i will get the text "answer1" two times.

<material>
<mattext texttype="text/html"><![CDATA[answer1]]></mattext>
<matimage imagtype="image/jpg" uri="picture.jpg" />
</material>

please, can you help me?

thanks, maraike

In reply to Maraike Reimer

Re: IMS QTI Importer 1.2.1

by Elijah Atkinson -
Ok, First off, the reason why

$currentText = extractstr($currentTextBlock, "", "");

doesnt work is because the extractstr function attempts to get the text in the string $cuttentTextBlock that falls between the first occurance of the first string perameter (in this case, the first blank string: i.e ""), and the first occurance of the second string perameter (in this case, the second blank string: i.e "").

Using the code:

$currentText = extractstr($currentTextBlock, "", "", 1, 2);

would attempt to get the text in the string $currentTextBlock that falls between the first occurance of "" and the second occurance of "".

BUT, since there are no blank strings (i.e. "") in the string you are searching, this function will not work properly.

The leaving the CDATA tag in the code allows the required text to be extracted because there are unique strings on either side.

$currentText = extractstr($currentTextBlock, "<![CDATA[", "]]>");

This allows the extractstr function to remove the question text from the string $currentTextBlock.

If this is in any way confusing, you can examin the definition of the extractstr function at the bottom of the format.php file.  There is a pretty detailed comment about how it functions.

I have come up with 3 possible solutions to your problem here:

1) Instead of writing your code like this:

   
<mattext>answer1</mattext>

    Write it like this:

   
<mattext><![CDATA[answer1]]></mattext>.

    That way, the extractstr function will opperate properly and your answer1 text will come out ok.

2) Put a different unique identifier on either end of your text. Something like this:

    <mattext>~answer1*</mattext>

    Then change the extractstr call:

   
$currentText = extractstr($currentTextBlock, "<![CDATA[", "]]>");

    to:

   
$currentText = extractstr($currentTextBlock, "~", "*");.

3) Just use the line:

    <mattext>answer1</mattext>

    and change the call to extractstr to:

    $currentText = extractstr($currentTextBlock, "<mattext>", "</mattext>");.

    If you do this, you MUST make sure that there are no other "<mattext>" or "</mattext>" strings
    in the string to search ($currentTextBlock). You can debug this by putting two lines before and
    after the extractstr call:
   
    //For debugging only:
    echo "Debugging contents of \$currentTextBlock:<br><br>$currentTextBlock<br><br>";

    $currentText = extractstr($currentTextBlock, "<mattext>", "</mattext>");.

    //For debugging only:
    echo "Debugging contents of \$currentText:<br><br>$currentText";

    After you see what kind of output you get, you can adapt your code accordingly.

I'm sorry this is proving to be difficult. I know it must be frusterating.  If you told me how you are editing your IMS QTI files, I would be able to assist you more.  Are you using another program? Or are you doing it manually?

As far as the images go, you are probably not writing your code in a format that my script can read.  Attached is a file that has some true/false questios and some multichoice questions with images.  The formatting for images should hold for any other questiontype as well.

I hope this has helped.  Let me know how these suggestions work.
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1

by Maraike Reimer -

thank you very much for your help and your extensive post,
i chose your suggestion number three and it works.. smile

actually, i should have this idea by my own ;) - it's not so difficult!!

ok, unfortunatelly i still have the problem with the images...
i had a look at your example:

<material>
<mattext texttype="text/html"><![CDATA[Whats this image of?<br>
<span style=" color:#000000;">]]></mattext>
<matimage imagtype="image/jpg" uri="Bird.jpg" />
<mattext texttype="text/html"><![CDATA[</span><span style=" color:#000000;"> </span>]]></mattext>
</material>

i don't understand how it works and i don't find the lines in your format.php where this part is defined.
i deleted the texttype="text/html"-tag and the CDATA-tag, now i can't realize the import of an image like the way in your example above.

is there a possibility to change some of the code to import images like this:

<material>
<mattext>Whats this image of</mattext>
<matimage imagtype="image/jpg" uri="Bird.jpg" />
</mattext>
</material>

 i have programmed my own little application for editing multiple-choice-tests in the qti format to import it into moodle.

any ideas for my still existing image problem?
i would be very thankful for your help.

 
In reply to Maraike Reimer

Re: IMS QTI Importer 1.2.1

by Elijah Atkinson -
Im glad you got part of it working smile
I think I have a solution to your image problem.

Your below code should work.

<material>
<mattext>Whats this image of</mattext>
<matimage imagtype="image/jpg" uri="Bird.jpg" />
</mattext>
</material>

But, you need to place the image inside of the .zip file you are uploading.  If they are not in the .zip file, the script won't work.

Let me know if you are already uploading .zips with the images in them. If not, try that, and let me know what happens.


In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1

by Maraike Reimer -

i already have the image inside my .zip-file, but it doesn't work..

did you try it with your code above? did it work?
there's a </mattext>-end-tag, but  no begin-tag?!?! is that right?
(sry, i have done this mistake in my last posting!)

perhaps, i have to change something in the sourcecode of the format.php

i change..
in line #1520:
$currentTextBlock = extractstr($haystack, "<mattext texttype=", "</mattext>", $j, $j);
$currentTextBlock = extractstr($haystack, "<mattext>", "</mattext>", $j, $j);

in line #1523:
$currentText = extractstr($currentTextBlock, "<![CDATA[", "]]>");
$currentText = extractstr($currentTextBlock, "<mattext>", "</mattext>");

in line #1618:
$text = extractstr($haystack, "<![CDATA[", "]]>");
$text = extractstr($haystack, "<mattext>", "</mattext>");

that's all. 

In reply to Maraike Reimer

Re: IMS QTI Importer 1.2.1

by Elijah Atkinson -
ok sooooooooo I think I know what the problem is.

<material>
<mattext>Whats this image of</mattext>
<matimage imagtype="image/jpg" uri="Bird.jpg" />
</mattext>
</material>

The second </mattext> should not be there in this code.  <matimage> tags do not need a closing tag.  Remove this, and your Image should import properly.
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1

by Maraike Reimer -

yeah.. i got it!!!!

it wasn't the redundant </mattext>-tag.
i find the reason for my problem with the help of your debugging-lines because the currentText-variable was always empty..
so, i change line #1528:

$currentText = htmlspecialchars_decode($currentText);
$currentText = $currentTextBlock;

Now, i see the text and the image.. but i see the text twice, therefore i additionally change the for-loop:

for($i = 1; $i <= ($audioSize + $imageSize + $swfSize); $i++)
$j = $i ;


it's a little bit tricky, but it really works smile
thanks a lot for your help..

In reply to Maraike Reimer

Re: IMS QTI Importer 1.2.1

by Elijah Atkinson -
Im glad you got it working smile

Let me know if you need any more help with it.
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Eduardo Hernandez -
Hello people,

It's good to know that we have an IMS QTI Importer. I sent Respondus an e-mail and they told that if this plugin is going to be included in the standard Moodle distribution package, they will promote Moodle in their site as a supported CMS.

Any plans to include it?
In reply to Eduardo Hernandez

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Elijah Atkinson -
That would be pretty cool. Just to let ya know however, this script does not import ALL Imsqti. Just IMS QTI that is exported by Respondus 3.5.  It might work on later versions of Respondus as well, but I have not tested it.  I do know that this script will have several issues importing IMS QTI from Respondus versions previous to 3.5.
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Eduardo Hernandez -
Elijah,

I have installed IMS QTI Importer 1.2.2 on Moodle 1.6, and I found Respondus 2.0.8 in our institution.

I use simple MC and ESSAY questions, and both types working correctly with my Respondus 2.0.8, your importer 1.2.2 and Moodle 1.6

I'm all smiles
In reply to Eduardo Hernandez

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Elijah Atkinson -
Awsome!  I'm glad to hear that the script is working properly with Respondus 2.0.8.

When I first started developing the IMS QTI importer script,  I was using an earlier trial version of Respondus, I think it was 1.0 or somethling like that. I remember that they had a certian way of putting text before / bettween / and after images that drastically changed in 3.5.  Because of this, I had to re-write the function to accomidate the 3.5 way of nesting text with images, and now the script wont properly import MC questions with images in them if you are using that earlier form of Respondus.

In the end, I do not know if Respondus made the change in their code regarding images and text in Multiple choice questions before 3.5 or just in 3.5.  So, you should try importing a quiz that has some MC questions with images in them and seeing if everything came out ok.

Let me know how it works smile
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Eduardo Hernandez -
Elijah,

I tried adding a JPG file to a question Wording and it worked great.

Then I added 2 new questions:  a question with an equation and a MC question where answers are images not text. Moodle is able to import it but it leaves some "trash" before and after the image. But it works...at least technically smile

The following image is what I get.

NOTE: My Respondus application suggested me to upgrade to 2.0.9. So I did.


Attachment respondus.jpg
In reply to Eduardo Hernandez

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Elijah Atkinson -
Yeah,  due to the differences between respondus versions, placing images in multiple choice answers (weather or not there is text wrapped around the image) will cause that kind of "trash" to be displayed.

You could just edit the text out with moodle, or you could attempt to fix the importer code.

If you go for the latter option, I would suggest looking at these specific functions in the format.php file:

1) process_multichoice()
          This function calls several other functions of importance to the image           importing process, as well as gathers all required multiple choice    
          information into an object.

2) get_question_text()
          This function attempts to get the body of the question.  This function           will call get_option_text().

3) get_option_text()
          The function that gets the text for any field of a question.  This
          function actually gets the text for the question body as well as the
          images that may go into that body. This function calls get_image().

4) get_image()
          Returns an array containing all names of images that are associated to           the question.  These images will be inserted into the correct question
          area by the get_option_text() function.

I hope that this gives you somewhere to start, if you do choose to modify the script to get your questions to import properly.  However, manually editing the questions after importing might prove more time efficient.
      
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Eduardo Hernandez -
Elijah,

Thank you so so much for your time and explantations, but my University has decided to buy new licenses of Respondus 3.5 as we have been trying it and it seems work perfect!

Thank u so much one again.

Eduardo
In reply to Eduardo Hernandez

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Elijah Atkinson -
Cool.  The importer should work perfectly with Respondus 3.5.  Let me know if you encounter any errors / bugs.
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Russ LeWinter -
Elijah,

While importing an exam, I noticed that if a word has an apostrophe in front and back of the question it gives me the following error message:

Cannot import question

This is an exact example of the question:

1. Identify the following 'fake' headline as representing macroeconomics or microeconomics.

Intel decides to open a new manufacturing plant in Palm Beach. (5 points)

When I remove the apostrophe's from the word 'fake' it imports fine.

Please advise,
In reply to Eduardo Hernandez

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
This can probably go in as a Respondus 3.5+ importer (no-way an IMS QTI importer because of the hysteria that would cause smile ).

My concern with including import plugins in the distribution is that someone has to maintain them. I loosely maintain the quiz import/export stuff, but there's not much I can do for packages I don't use or have access to. There's already a couple of examples of less than perfect importers where the original developers have now vanished without trace and that can be a bit of a quality issue.
In reply to Howard Miller

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I would be much happier if this just got checked in to the contrib area of the Moodle CVS repository, and then a clear page of instructions were put on Moodle Docs, explaining to people how need it how to install this plugin and use it.

(If you need that repeated in English, not geek-speak, I can.)

We don't need anything and everything to be thrown into Moodle core. (Long-time followers of the Mozilla project may remember the this bug report.) Moodle has a plug-in architecture for a reason.
In reply to Tim Hunt

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I won't argue with that. I'm still recovering from the inclusion of the BB6+ importer which turned out to be terribly buggy - and that was all my fault blush

I suppose we need some sort of 'policy' on what goes in the release and what doesn't, but it probably starts with being used successfully from contrib for a while. Having said that the BB6+ importer was in contrib for over a year and everybody seemed to like it. Oh well.

I assume your geek-speak remark wasn't aimed at me Tim? I can do the geek-speak with the best of them big grin
In reply to Howard Miller

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I assume your geek-speak remark wasn't aimed at me Tim?

No. It was for anyone else reading the thread. I knew you would understand the shorthand and was too lazy to type a full description.

I am just aware that this forum is mainly a quiz user's forum, but is seem to be hijacking it and using it as developer's forum as well. Does anyone object to that?


we need some sort of 'policy' on what goes in the release and what doesn't

The policy is that the module maintiner decides, and you can appeal to Martin D or the wider community if you disagree with me.

My policy is that almost nothing else goes into core. I am about to write a new question type, and it is going into contrib, which will be more work for me than just putting it in core.

However, for this policy to be viable, the procedure to install a plugin has to be no more complicated than:
  1. Find the plugin you want in the Modules and plugins list.
  2. Click on the link there to download a zip file.
  3. Unzip the zip.
  4. Copy the 'moodle' folder from on top of the top-level moodle folder of your install to add all the new files. This must not overwrite any existing files.
  5. Log in to your site as admin and visit the admin page to set up the database tables.
Of course, upgrading a plugin is a bit harder.

If it is not possible for it to be that simple, then we have a bug in the architecture. At the moment I am aware of a couple of issues with quetsiontype plugins, which I want to fix when I have a moment. Quiz reports and Question import/export filters are that pluggable, I think.
In reply to Tim Hunt

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Ray Lawrence -
I am just aware that this forum is mainly a quiz user's forum, but is seem to be hijacking it and using it as developer's forum as well. Does anyone object to that?

INAD and it is still  fine for me... smile
In reply to Howard Miller

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by Michael Penney -
Well Cal State (where Elijah works at CSU Humboldt) has 4 campuses using Moodle, and a site license for Respondus (which is a really pretty nice offline quiz generator, if you haven't used it). I think someone here (CSU) will maintain it if it's put into core, and the benefits to Moodle of having Respondus note us as a supported LMS might well be worth the work of maintaining an importer, anyway.

Having companies like Horizon, Turnitin, and Respondus promote Moodle helps put us in the 'big leagues' in CIOs eyes, one thing they make decisions on is how well an LMS 'plays well with others' (part of the reason common cartridge is so important). The code is key, but mindshare is another key, IMHO.
In reply to Michael Penney

Re: IMS QTI Importer 1.2.1 (ready for standard Moodle? )

by John Rodgers -
Do you think Respondus might consider helping out with maintenance (perhaps give you a break on the liscense).  I can also see a big advantage for Respondus to have their name in the drop down list of the quiz module.
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Jessica Miss -
I'm currently using Moodle 1.54.  I have been trying to use the IMS OTI importer, and I am having no luck.  When I try to upload the file to Moodle, I always get an error so the file never uploads.   Can you help????
In reply to Jessica Miss

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
Sorry about the late response sad  I forgot to check this board (I've bee busy).

To get the IMS QTI importer to upload files properly, they have to be .zip files output from Respondus 3.5+

Calling it an 'IMS QTI' importer is a bit misleading as its only coded to work with the IMS QTI that is used in Respondus 3.5+

It MAY work with previous versions of IMS QTI, but I am uncertian and have not tested this.

Let me know if this helps.

Good Luck smile
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Cristina Berisso -

  Hello everyone,

I am new to Moodle, but desperate to get my courses up and running with this open source that I hear so good things about. My Math courses have been seriously damaged in the migration my College did from WebCT version 4 to version 6, and I would like to get away as soon as possible from the WebCT platform. I have TONS of quizzes and question databases created in Respondus 3.5 and would like to use the importing tool mentioned in this forum to do it.

I have followed all the steps given in the "readme" text document prepared by Elijah which comes in the ZIP file for the importing tool, until I got to the last one:

* Add the line:

             $string['imsqti'] = 'IMS QTI format';

    to  "your moodle install path"/lang/"your default language folder"/quiz.php.

    BACKUP YOUR QUIZ.PHP FILE FIRST!!!!

What does this mean? Where is it that I have to add a line? Do I have to edit a php file? Sorry for being so ignorant in this language. I would appreciate any help you could provide.

Thank you for your time

M.Cristina Berisso, Math Department, Shasta College, CA

In reply to Cristina Berisso

Re: IMS QTI Importer Beta for Moodle 1.6

by Eduardo Hernandez -
Hi Cristina,

Yes, you must edit a PHP file for Moodle to add this new line of text (a.k.a string). You must do this, as Moodle reads text fromo PHP files, making it very easy for translations.

In your Moodle server you must go to the directory where Moodle has beein installed, then go to /lang/en_utf8 (if you are using Moodle 1.6) and then open the quiz.php file with any text editor, such as vi for Linux or Notepad if you are using Windows. Add the line

$string['imsqti'] = 'IMS QTI format';

You can add the line at the end of the file, but before the closing ?> tag. Of course, I would suggest to insert the line keeping the alphabetical order, and not at the end of the file, even when the final effect is the same, it is just to keep everything in order. smile



In reply to Eduardo Hernandez

Re: IMS QTI Importer Beta for Moodle 1.6

by Cristina Berisso -

Thank you both Eduardo and Elijah for your prompt reply,

I did what you suggested. I was not easy since when I edited the quiz.php file with Notepad I did not see an order sequence of lines but all lines cranched in a long string and with some strange symbols (looking like rectangles) replacing what I believe are "linefeed" entries. Here is a screen capture of what I saw:

Notepad view

I did insert the line before the ?> (in fact between the two little rectangles just before those characters) and replaced the quiz file in the appropriate directory of my moodle server. Then I tried the importing of one of my Respondus quiz files by saving it in the "IMS QTI" format that the Respondus 3.5 version I am using allows. I was careful to select the "ZIP" format file when saving the file with Respondus. And then I tried importing it within Moodle, but some of the images did not seem to get transfered (since I teach Math, most of the "meat" in the quizzes is given by images of equations, graphs or math expressions) 

Here is how one of the questions looked in the original Respondus file:

Respondus look

And here is what it looked like after the transfer to my Moodle course:

Moodle look of same question

Is there anything very obvious that I am missing?

Any help will be enormously appreciated...

Thank you

Cristina Berisso

In reply to Cristina Berisso

Re: IMS QTI Importer Beta for Moodle 1.6

by Eduardo Hernandez -
hi Cristina,

Ah!. that's becasue PHP files are in a special format and NOTEPAD can not read them correctly. You could do it with edit (the old DOS application). I use UltraEdit, a very good editor for Windows. If you have Dreamweaver you could open it with that application.

Eduardo
In reply to Cristina Berisso

Re: IMS QTI Importer Beta for Moodle 1.6

by Bob Clarke -
Christina,
I have sent you a direct reply as well.
I have been waiting for the version 1.6 to come into play to do just what you are wanting to do. We have a large number of test banks (approximately 8000 questions) that we  maintain in Respondus. Since we adopted Moodle we initially imported the Blackboard exams we were using but this was not completely satisfactors as we do all our bank management in Respondus like you do.
 
We have upgraded to version 1.6.2 (Our Hosting group at OK Technologies does all the heavy lifting for us - Thanks Mike). He may be able to help you in this regard.
 
This has added two features which appear to now allow us to move forward quickly. We, now have a standardized Activity Locking feature which allows much instructotr control on when activities are performed and even seen. We are also able to backup any group or individual block in a course. Several of our base courses are quite large (up to 149 topics with content, media and assessments) so this has allowed us to customize quit effectively.
 
The most important addition and the one which you are interested in is the IMS QTI Importer. After some issues with images (make sure to include the images in the imsqti zip file) it is working well. There are a few little gliches such as; occasionally a correct answer will  have a <b> beside the value. Fortunately all this appears to do is make all the answers bold rather that the correct one only. Another gliche appears to be the inability to read all of the questions. I have up to 100 questions in each chapter and somnetimes I have to import it by sections. All, eventually get there though.
 
The IMS QTI zip file created by Respondus does not embed the graphics so you will need to do this after. But apart from that, it appears to be working smoothly.
 
Elijah, we all thank you for making our lives bearable again. And also for letting us get the Blackboard/WebCT elephant off our backs.
 
Hope this helps
 
Bob
In reply to Bob Clarke

Re: IMS QTI Importer Beta for Moodle 1.6

by Russ LeWinter -
Elijah,

While importing an exam, I noticed that if a word has an apostrophe in front and back of the question it gives me the following error message:

Cannot import question

This is an exact example of the question:

1. Identify the following 'fake' headline as representing macroeconomics or microeconomics.

Intel decides to open a new manufacturing plant in Palm Beach. (5 points)

When I remove the apostrophe's from the word 'fake' it imports fine.

Please advise,
In reply to Russ LeWinter

Re: IMS QTI Importer Beta for Moodle 1.6

by Barry Bookout -
We were having the same problem. I added the following line

$question = mysql_real_escape_string($question);

immediately after the line

$question = implode("", $questionStringArray);

in the file /moodle_dir/question/format/imsqti/format.php, in the parse_as_question_strings function (around line 1690), using IMS_QTI_Importer_1.2.2

I'm not sure if this is the best way to fix the problem--I tried similar changes in other places with varying success, but so far it seems to be working.

Any improvements or comments on this would be welcome. In particular, I haven't tested answers with single quotes in them.

Barry
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Cristina Berisso -

I am having problems importing into Moodle any multiple choice question created in Respondus under the "IMS QTI 1.1+" profile. I get an error message from Moodle that reads: "Cannot import question" just with the first multiple choice (1 answer) question. I have read in this forum many messages of moodlers succeeding with importing hundreds of quizzes, so I believe there is something wrong with my settings of either Respondus or Moodle.

Could someone please try to import this Respondus zip file (attached) with four multiple choice questions (the first one does not have any image, and the last three use images to show math expressions) and tell me please if they succeed with the importation? If everybody gets the same error message, it must be my Respondus 3.5 that is giving me the headache...

Thanks for the help!

Cristina

In reply to Cristina Berisso

Re: IMS QTI Importer Beta for Moodle 1.6

by Eduardo Hernandez -
Hello Cristina,

I have not seen the ZIP file you attached, but in the University where I work, one of the teachers is facing the same problem you are describing. When she sends me her QTI ZIP files, and I try to import them into Moodle, it fails, but If I go and create -in my Respondus installation- the same question; it works. She is also inserting pictures. and I use her pictures. sad I don't know what could be producing this problem and I haven't had the time to check this with more details; however I see 1 difference between our teacher and my Respondus.

She formats fonts with bold and size, and I use the default font settings.
In reply to Cristina Berisso

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
Im sorry that this script is so tempermental. It was my first Moodle script so I did very little to Moodle standard when I wrote it. I think I'll be able to fix these current bugs and I will re-write this script to be more stable once I get the time.

Cristina, The reason you are getting garbage on either side of your images is because the importer expects text before and after an image. When It doesnt get an image wrapped by text, it freaks out. Looking back, I have no idea why I wrote the script like this...but I CAN change it (its just going to take time). Untill then, try putting a blank space (or a return) before and after your image. This might prove to be a temporary fix.

Thanks for your patience. smile
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Maureen O'Halloran -

I just installed 1.2.2 importer on Moodle 1.7 and it worked great - I had a Word file with images and was able to use Respondus 3.5 to  import to moodle - this will save me a ton of time since I upload quizzes for instructors in both Blackboard and Moodle and when I can use Respondus it takes me very little time to go from what they give me to a Respondus readable file.  Respondus is very tolerant of white space - the Moodle formats I tried where very inflexible as to white space characters. 

All I had to do with the Word file I was given was to change the fonts to default (the instructor likes Comic Sans) and move the images so they were right after the text of the question.  (She made the images in Powerpoint so she could label parts of them, saved as jpg, cropped them in Paint then just copied directly from Paint to Word.  Yes there are better image editing programs but she uses the tools she in comfortable with.) 

Anyway - thanks for writing this. 

In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Raviraj Kale -

Hi Elijah,

First of all, i would like to Congratulate you on creating the "IMS QTI Importer".

I am aware about the fact that the importer tool made by you, upon integrating with Moodle 1.6 (using PHP 4.4.4 & MySQL 4.1.21),  works well, but with only Respondus 3.5 generated QTI xml file.

You might be having some good reasons in mind for implementing the "IMS QTI Importer" which works for ONLY Respondus 3.5 generated QTI xml file smile

Can you please suggest me the required modifications, so that the "IMS QTI Importer" works well for any "IMS QTI file" and not only for Respondus 3.5 generated QTI xml file.

Thanks in advance.

Raviraj

In reply to Elijah Atkinson

Re: Respondus (?) Importer Beta for Moodle 1.6

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Elijah,

I just wanted to confirm with you that this is specifically an importer for Respondus? I wonder if I could ask you to change the name to reflect that. I am getting quite a few enquiries along the lines of when is the IMS-QTI importer ready? - meaning a general purpose one, and that's a different matter entirely smile

Cheers!
In reply to Howard Miller

Re: Respondus (?) Importer Beta for Moodle 1.6

by Eduardo Hernandez -
Hi Howard,

I have asked our Respondus Account Manager for info on how IMS QTI is supported by Respondus. I asked them if Respondus had added some extensions to QTI.

Is there any plan to include this into the core code?. I mean the QTI importer or to keep it as a plugin?.

Eduardo
In reply to Eduardo Hernandez

Re: Respondus (?) Importer Beta for Moodle 1.6

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That decision will be for Tim Hunt. However, I strongly suspect that he will be keen to keep it as a plugin for the time being.

Has it even found its way into contrib CVS yet - that would be a start!
In reply to Howard Miller

Re: Respondus (?) Importer Beta for Moodle 1.6

by Elijah Atkinson -
Yes, this is specifically a Respondus Importer. It MAY work with other IMS QTI files (if they follow the same format that Respondus 3.5+ does), but I have not tested this functionality and did not write the script with it in mind.

A name change sounds appropriate, though I will have to talk to Michael Penny about it first.
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Justin Rogers -
I am using Moodle 1.7 and the latest version of the importer.

Got the importer installed and it gives me this error:

Cannot insert question

When I try to import the attached Respondus IMS file.

Any ideas. The script looks like it processes the first question on the screen.
In reply to Justin Rogers

Re: IMS QTI Importer Beta for Moodle 1.6

by Cristina Berisso -

Hello Justin,

The importer is not working for all Respondus files as it is now. There are problems for example if you have used the "Power Edit" tool in Respondus while creating the questions, since it seems to introduce some font tags that the importer can not handle right now. Elijah Atkinson is aware of this and has been trying to work a way around it. He has been trying to help in his little extra time.  I am patiently waiting until he comes with some solution so I'll be able to import the thousands of questions in my quiz banks.

In reply to Cristina Berisso

Re: IMS QTI Importer Beta for Moodle 1.6

by Justin Rogers -
Thanks for the response, turns out that someone had specified a different font on some of the questions in respondus and that was causing the import to fail. They removed the special font and it imported just fine.

Thanks!
In reply to Justin Rogers

Re: IMS QTI Importer Beta for Moodle 1.6

by Elijah Atkinson -
Glad you got it to work. Im very sorry it has taken me so long to get back to you all concerning this importer. I have been spending all my development time on a bug fix for the database module recently. I recently resolved the issue though, so I should be able to devote some solid time to fixing the issues with the IMS QTI importer.

Currently the issue I know of now is that the importer malfunctions whenever it encounters different font tags from the standard font. I will attempt to re-code to adapt for font changes.

Thank you for being patient. Don't hesitate to bring anything you might have noticed in the code to my attention or to make any suggestions.

Thanks!
In reply to Elijah Atkinson

Re: IMS QTI Importer Beta for Moodle 1.6

by Cristina Berisso -

Hello Elijah,

Great news that you are back to work on the Respondus importer. There is something that I would like to bring to your attention since I think may cause some problems. I have noticed that your import tool places all the images into a unique folder, no matter whether they came from different quizzes. I wonder if it is possible to create different folders for the images (for example with the quiz name for identification...), and to store the images in these different folders organized by quiz, so there is no chance of repeated names, overwriting and problems of the sort. In the case of quizzes with large number of images (like in the case of math graphs, numerical tables, different algebraic expressions for the question and the many options for answers) one may have saved images with the same names within Respondus and without difficulty since they go to entirely different folders.

Is creating different folders for storing quiz related images something feasible for your importing tool?

Cristina

In reply to Cristina Berisso

Re: IMS QTI Importer Beta for Moodle 1.6

by Anton Pienaar -
Hi All,

Thanks for all the hard work Elijah. We now have this hassle as well. However, does the IMS QTI Importer Beta for Moodle 1.6 work on 1.7.1? Is there anybody that does this yet?
In reply to Anton Pienaar

Re: IMS QTI Importer 1.2.2

by Rosario Carcò -

I am testing with Moodle 1.7 and Importer 1.2.2

But it stalls after the first question and aborts. Here is the file, a rather simple one, though.

In reply to Rosario Carcò

Re: IMS QTI Importer 1.2.2

by Jacques Monnard -
Hi Rosario,

After some tweaking to both your file and the conversion script (see attachment), I managed to import your questions into Moodle :
  • As mentioned above in this thread, <font> tags are not supported by the conversion script, and your file has a lot of them! Basically, you should avoid using them in Respondus. However, once in place, they are quite difficult to remove in Respondus itself. What I did was doing a search and replace with a text editor to strip all font tags in the XML file, and recreate the zip archive with the new file.
  • The conversion script has some problems with feedbacks :
    • Firstly, if some answers in a multi-answer question don't have a feedback, the question is not imported (because of a "Null" value). I just modified "format.php" to put empty feedbacks for all questions before further processing (line 688 in attached file).
    • Secondly, in Moodle quizzes, it's not possible to attach a "General Feedback" to all answers for a question, as you can do in Respondus. If you want to have the same feedback for all answers, you must copy it. So I also modified the conversion script (lines 541-542, a very quick fix), but only for True-False questions (since they were causing problems), and they are now accepted. However, these questions should be modified afterwards in Moodle, because the feedback will only appear in one of the two answers.
As a conclusion, I would just suggest that Elijah has a look at what happen when not all answers have feedbacks (the problem of "General Feedback" isn't really one in my opinion; since this is not supported by Moodle quizzes, it shouldn't be used in Respondus in the first place).
In reply to Jacques Monnard

Re: IMS QTI Importer 1.2.2

by Elijah Atkinson -
Thanks for your input and work Jacques! I've been attempting to work on this script more now that my other projects are completed...

As I mentioned earlier on in this thread (several months ago), this script was my first ever Moodle project. Needless to say, there are some issues with it. smile

I've been working on the <font> tag issue currently, But I will make sure to implement your changes and take a closer look at feedback for various question types.

Thanks again!

(Feel free to make any comments / changes to the script, I greatly appreciate everyone's input ^_^)
In reply to Rosario Carcò

Re: IMS QTI Importer 1.2.2

by Clark Moodler -
Hi,

I too am testing with Moodle 1.7 and IMS QTI importer 1.2.2 - and I know it it isn't mentioned to actually work with 1.7, but I thought I'd try. smile

Attached is the file I exported from Respondus (via an eCollege quiz)

I get the following error when importing:

1. (Kochen 2) Das Getränk ist warm.

Could not insert quiz answer "true")!


An error occurred during import processing

I have a lot of questions with German umlauts in them üäößÜÖÄ - will those cause problems at all?

In the case of the question above, it got the whole thing, but the answer should be False, and I'm not sure what happened there.

Thanks!
clark
In reply to Clark Moodler

Re: IMS QTI Importer 1.2.2

by Elijah Atkinson -
It seems that Jacques' patch 2 posts up takes care of your import issue (tested on a moodle 1.6.4 install). Try using his format.php file (rename and keep your old one to be safe). It should import properly.

I'm currently attempting to make this importer more friendly with special characters and tags... It could take me awhile unless I get more help with string cleaning for moodle. lol.
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.2

by Rich Schumaker -
Is 1.2.2 considered stable for Moodle 1.7? I have a production system but I would really like to get some quizzes out of Respondus and into Moodle without having to change them to Gift. I don't want to blow out my system though.
In reply to Rich Schumaker

Re: IMS QTI Importer 1.2.2

by Elijah Atkinson -
There are still some issues I am attempting to fix with this script. The incompatibility with Respondus' "Power Edit" feature is the main problem.
In reply to Elijah Atkinson

IMS QTI Importer 1.2.2

by Kevin Johnson -
I know it is only a few weeks since you last posted but I was wondering if there was any update on importing Respondus 3.5 QTI exported files into Moodle 1.7 or 1.8?

I appreciate all the work that has been done to date on this and after reading through the thread here I can see that this has been going on for a while so well done to all involved.

any information or updates would be greatly welcomed.
In reply to Kevin Johnson

Re: IMS QTI Importer 1.2.2

by Cristina Berisso -

Hello Kevin,

We have been working on a PHP module for importing Respondus questions into Moodle. It uses the "QTIXML.zip" file that can be exported by Respondus when using its "IMS QTI 1.1+" personality. A lot of progress has been made: Right now the importer stores the images associated with the questions in an individual folder named after the zip-file name, so there is no concern about storing images with the same name in a unique folder when importing several Respondus quizzes. The other BIG problem that has been completely taken care of is the handling of extra fonts that was causing the previous importing tool to fail. I have been for the last few hours ago happily importing my Respondus files with hundreds of equations and symbol fonts into Moodle version 1.6 with no problem (the quizzes built with "Power Edit" are not a problem any more, they import cleanly)

I have not done the PHP work, but just provided the Respondus files with problems which could not be imported before by Moodle. The PHP heavy lifting work was done by Greg Mushial (the code writer who developed the on-screen graphing calculator that I use in my Math classes). He is right now trying to get the handling of the "Matching questions" with image answers solved. I asked him about releasing this to the Moodle community and he has no problem, but would like to "tidy up" the module before releasing it. According to his words it should be a matter of about a week.

I wanted to share this great piece of news with the other Moodlers that like me have been patiently (and anxiously) waiting for a Respondus importing tool.

Cheers

Cristina

In reply to Cristina Berisso

Re: IMS QTI Importer 1.2.2

by greg mushial -

The top of the day those that might be waiting for the above mentioned code - an early version is available for downloading : www.gmdr.com/MoodleStuff/format.php and www.gmdr.com/MoodleStuff/QTIimporterReadMe.txt . This work is still based on Elijah's code (based on Blackboard importer etc), where the .php link is to a replacement for his module of the same name; the readme contains update info vs. his. We're in the process of writing an entire replacment module. When we're ready to release such we'll package it more like his (more user friendly)...  but until we're there: people wishing to use our updates still need to download his package, then drop our updated format.php on top, then they'll be good to go. (Right button click the links and Save Target As... the files)

This first set of changes appear to fix the following:

1) image etc file name collisions - the new code uploads each question bank into a separate directory (name based on assessment title, with hrefs and links adjusted accordingly). (assumes no name collisions pre-built into a bank)

2) fixed the (n+m)^4 performance problem (n, m being number of questions in a bank, m the number of choices). New code is O(2n). Importing 100 question banks is now a millisecond proposition now.

3) "cannot insert" problem, where questions with explicit fonts failed to load / import.

Cristina has been using the mods for the last week plus now and with zero issues. Hopefully they're be of use to others. When we have the replacement format.php done we'll post here.

Otherwise, we're expecting to spend most of the summer on and off working on Moodle and getting her moved off webct6 ("webct666") and onto 1.6. As other changes become available we'll try to make them available.

greg

In reply to greg mushial

Re: IMS QTI Importer 1.2.2

by m e -
Thanks you Greg for sharing the work you have done.

Unfortunately when I try access www.gmdr.com/MoodleStuff/format.php

What I get is a file containing

Notice: Undefined variable: CFG in C:\Inetpub\domains\g\gmdr.com\MoodleStuff\format.php on line 77

Warning: main(/lib/uploadlib.php): failed to open stream: No such file or directory in C:\Inetpub\domains\g\gmdr.com\MoodleStuff\format.php on line 77

Fatal error: main(): Failed opening required '/lib/uploadlib.php' (include_path='.;c:\php4\pear') in C:\Inetpub\domains\g\gmdr.com\MoodleStuff\format.php on line 77




In reply to m e

Re: IMS QTI Importer 1.2.2

by Cristina Berisso -

Hello ... m. e.??

What you need to do is to download the code to replace the previous "format.php" with this new one. To do such don't left click on the link trying to run it, but follow the instructions that Greg posted to download it: RIGHT click on the link and select "Save Target As..." to save it in the directory where the previous code was.

By the way, although I read somewhere within this topic thread that the feedback on Respondus questions will not be imported, I have not had any problem with "text" feedback. It seems to import cleanly now. Has anyone else had the same experience? I am importing question banks of about 100 questions each without experiencing any failure due to non-default fonts or apostrophes in the main text that used to fail the whole importing process ending with the "Cannot import question..."  message. Hope the people that had the same type of problems in the past and had to import their question banks in small pieces can do it much faster now. Any feedback will be greatly appreciated!

Cristina

In reply to Cristina Berisso

Re: IMS QTI Importer 1.3

by m e -

Thank you for the response, I have tried this and keep getting the same error.  It seems that the gmdr.com webserver is interpreting the php code and sending its response instead of sending the actual format.php code.  If someone would be so kind as to attach the code to a reply or point me in another direction to obtain this it would be greatly appreciated.

In reply to m e

Re: IMS QTI Importer 1.3

by Cristina Berisso -

Hello m. e.,

Is I.E. your browser? It may be that other browsers like "firefox" will not give you the right hand click options: "Print Target", "Save Target As,..." , "Create Shortcut", etc.  Anyhow I sent to the e-mail listed for you among the Moodle participants (hope it is still valid) a message with the two files as attachments.  Hope you get them and can use them to make your importing easier.

Please let me know if you did not get the e-mail, and I will try again...

Have fun!

In reply to greg mushial

Re: IMS QTI Importer 1.2.2

by Elijah Atkinson -
Thank you so much for Addressing the problems in the 1.2.2 version of the QTI importer!

Your link to the format.php file gives me a connection error no matter how I try to download it. I think the link is attempting to run the php file when its clicked... If you renamed the file to format.php.txt I think I would be able to download it.

Thanks for everything

-Elijah
In reply to Cristina Berisso

Re: IMS QTI Importer 1.2.2

by Cristina Berisso -

Just a quick update on where we are with regards of the "Matching Questions" with images as answers (which are most of the matching questions with math expressions that I need to import from Respondus) in the Respondus importer. Greg has modified the code that does the display to render the image options in a table (and each one identified with labels: Choice A, Choice B, etc), immediately below the question's text. The drop down menus for choosing the match now render the "Choice A", "Choice B", etc. He says he needs to work a bit more on it, but I have been able to test the import of some of my matching questions. Here is a screen capture:

Imported Matching question with images as answers

The important message: There is hope...!

Greg is finishing with this task and tackling next the issue of "garbage" around images that were not accompanied by any text. I believe he will be posting the final code in this forum when he has it "more cleaned up" and ready for possible other users.

In reply to Cristina Berisso

Re: IMS QTI Importer 1.2.2

by Kevin Johnson -
Thanks for the great work guys..

Am going to try installing this evening now and start importing some more Respondus 3.5 QTI spec files so i will keep ye posted if there is any trouble from this end

Thanks
Kevin
In reply to Cristina Berisso

Re: IMS QTI Importer 1.2.2

by Cristina Berisso -

Another quick update on the status of the Respondus IMS-QTI personality importer: Two other problems have been taken care of.

1.- The "dropping" of numerical answers "0" (zero) in Multiple Choice and Matching question types importing is now completely fixed. In the Multiple Choice questions zero numerical answers would directly disappear in the importing before; now they are transferred correctly. In the matching type questions this "dropping of zero value" used to be reflected in a ridiculously big number been shown as the correct pair in place of the dropped "0"; now the importing is clean. Two screen captures of "Before" and "After" the fix for a matching question with a zero numerical answer are shown below:

Before:

Matching question with zero answer with the previous importer

After:

Matching question with zero answer with new importer

2.- The problem of "garbage" around imported images is also fixed. Here I am attaching two images of "before" and "after" the fix.

Before:

Garbage around images with previous importer

After:

Same question with the new importer

Hopefully this will help other moodlers to identify the problems they might have experienced while importing from Respondus. The files I am importing were originated in different formats by different programs, had been installed  over the years in WebCT 4 and WebCT 6 courses and lately imported to Respondus 3.5 from those courses as the only way of rescuing them more or less intact (WebCT 4 and WebCT6 corrupt the exporting of certain numerical answers and quiz settings and in some cases do not allow the exporting at all).

Greg is still working on the final details of the matching questions with images for answers. I believe he is just working on the display code and we consider the importer part "format.php" done. He will be posting the package as soon as he is done. I am very glad that there is now a way of rescuing our courses and the huge amount of work we had put on them over the years!

In reply to Cristina Berisso

Re: IMS QTI Importer 1.2.2

by Tony Beld -
Will calculated questions import correctly with the IMS QTI Importer 1.2.2?
In reply to Tony Beld

Re: IMS QTI Importer 1.2.2

by greg mushial -

Tony -

If you have a QTI file containing a single calculated question... and can forward it to cristina, we'll give it a try...  but in general would expect it to work.

greg

In reply to Tony Beld

Re: IMS QTI Importer 1.2.2

by Cristina Berisso -

Hello Tony,

I guess this question is related to your other posting regarding the large number of calculated questions that the instructor in your institution has in WebCT. You may be thinking about doing the importing via Respondus...

There is a very important issue you need to be aware of: WebCT and Moodle use a similar type of "calculated question" format; i.e. a type of "short answer" display where the student types a numerical answer in a text box.

On the other hand, when you create a question of this type in the "IMS-QTI" personality of Respondus (or change to this personality from a WebCT4 one, to be able to create an IMS-QTI zip with the questions) the question format is something like a convoluted Multiple choice question with five answers: A, B, C, D, E. They create a javascript where the actual question you typed is shown, and which you have to run in order to not only be able to read the question's text, but to find which letter option you need to select in the original window. You will notice that Respondus in the IMS-QTI personality does not show a "calculated" question option; it is called "algorithmic" in this personality.

So the conversion from whatever you had in WebCT to Respondus IMS-QTI personality is not going to maintain the original question format as nice and straightforward as the instructor had. You may show him what Respondus does to his questions to see if he will be happy with it (I doubt it...).

I have not done any serious importing of "algorithmic"  (IMS-QTI) type questions from Respondus, since they do not work well for me (the pop-up blockers and other security issues in the students' computers (and also in mine) make the running of the Javascript created by Respondus very cumbersome and in most cases impossible, so I prefer to write questions of that type directly in Moodle. I just tried using Greg's importer with a simple "algorithmic type" case and I saw that the basic structure (multiple choice base page with a javascript embedded and the appropriate link to run it) was transferred exactly as it looked in Respondus, but as I said before I have no clue if the javascript runs correctly since in this computer I have never been able to cleanly run those javascripts created by Respondus (I do not have the compatible security settings).

In reply to Cristina Berisso

Re: IMS QTI Importer 1.2.2

by Tony Beld -
Christina and Greg,
Thanks for the reply. I have a test zip file from my colleague. He said he can deal with the javascript if we can just get a clean import in Moodle. Could someone test this file out? I appreciate your comments and help...

-Tony
From my colleague (LINK TO ZIP):
Here’s a QTI zip with three questions: (1) matching, because our WebCT export/Moodle import got it backward, (2) multiple choice with images, because we didn’t get them, and (3) calculated.

In reply to Tony Beld

Re: IMS QTI Importer 1.2.2

by Cristina Berisso -

Hello Tony,

I tried importing your zip file and got the following:

Matching question:

matching question

Multiple choice question with images:

multiple choice question with images

Calculated question:

calculated question

which is the "standard" look for the front gate of the calculated questions exported by Respondus in IMS-QTI format, but when I clicked in the link to view the question, a javascript tried to start but only rendered a black screen. No flash file was run. I looked at the folder with the imported files and realized that the ".swf" file was not there. Even uploading manually the swf file in the folder did not help. I mentioned the issue to Greg. He says that he has not tested any importing of flash objects in the code, since I had none of those,  but that he will look at it as soon as he finds a break in his schedule.

In reply to Cristina Berisso

Re: IMS QTI Importer 1.2.2

by Tony Beld -
Thanks so much Christina. This looks promising. Much better than the test imports in Moodle 1.8 using the Web CT importer. If we can get the flash to come through I we'll be in business... Thanks for looking at it Greg!
In reply to Tony Beld

Re: IMS QTI Importer 1.2.2

by Elijah Atkinson -
Hi all,

Attached is the most recent revision of the IMS QTI importer.
I revised Greg's changes to the QTI importer to fix the true/false import bug as well as the .swf embed bug.

The .swf files for Algorithmic questions will now be uploaded properly, and embedded in the body of the question instead of a popup.

I've been testing the importer in moodle 1.8 and everything seems to work as of now.

-Elijah
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.2

by Elijah Atkinson -
Attached is the Respondus QTI import script after several more bug fixes and a name change (for clarity).
In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.2

by Respondus Inc. -

Respondus Inc. is pleased to announce its sponsorship and maintenance of the Respondus QTI Importer going forward.  Much thanks goes to the original creators of this script; Elijah Atkinson and Greg Mushial.  Version 1.4 of the Respondus QTI Importer works on Moodle 1.5 and above.  Full details can be found in the following Moodle plug-in catalog entry:

http://moodle.org/mod/data/view.php?d=13&rid=986

If you have any questions about the plug-in or encounter any issues, please use the Respondus eSupport ticket system at http://www.respondus.com/esupport.

In reply to Respondus Inc.

Re: IMS QTI Importer 1.2.2

by Respondus Inc. -

Respondus Inc. is pleased to announce an update to the Respondus QTI Importer plug-in. The individual files for version 1.4.1 can be downloaded today from:

http://moodle.cvs.sourceforge.net/moodle/contrib/plugins/question/format/respondusqti/

Starting tomorrow, a zip package for version 1.4.1 can be downloaded from:

http://download.moodle.org/plugins/question/format/respondusqti.zip

Full details can be found in the following Moodle plug-in catalog entry:

http://moodle.org/mod/data/view.php?d=13&rid=986

If you have any questions about the plug-in or encounter any issues, please use the Respondus eSupport ticket system at:

http://www.respondus.com/esupport

In reply to Elijah Atkinson

Re: IMS QTI Importer 1.2.2

by Raviraj Kale -

Hi Elijah,

First of all, i would like to Congratulate you on creating the "IMS QTI Importer".

I am aware about the fact that the importer tool made by you, upon integrating with Moodle 1.6 (using PHP 4.4.4 & MySQL 4.1.21),  works well, but with only Respondus 3.5 generated QTI xml file.

You might be having some good reasons in mind for implementing the "IMS QTI Importer" which works ONLY for Respondus 3.5 generated QTI xml file smile

Can you please suggest me the required modifications, so that the "IMS QTI Importer" works well for any "IMS QTI file" and not only for Respondus 3.5 generated QTI xml file.

Thanks in advance.

Raviraj