GIFT Format Quiz import won’t work on 1.9.4!

GIFT Format Quiz import won’t work on 1.9.4!

by Farzaneh CTY -
Number of replies: 20

GIFT Format Quiz import won’t work on 1.9.4!

Please help! We need to change a huge test (50 questions!), but the quiz import for the GIFT format is not working. When trying to import a quiz, we get the following error message:

Parsing questions from import file.

Cannot read import file (or file is empty)

An error occurred during import processing

When choosing to NOT stop on error, the error still halts the import.

Our environment is:

Moodle version 1.9.4

PHP 5.2.3

MySQL 5.0.51

Windows NT 5.2 build

The strangest thing, is only 3 months ago, we upgraded to 1.9.4 from 1.9.2. On 1.9.2 we had no errors whatsoever.

We tried on a 1.9.5 Moodle Windows package and no problems! Why is this happening? Are we missing sth?

We’d appreciate ANY suggestions!

Average of ratings: -
In reply to Farzaneh CTY

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Frank Ralf -
Hi Farzaneh,

This might be caused by some faulty UTF-8 file (the standard encoding for all Moodle files). Please see UTF-8 and BOM for further information.

hth
Frank
In reply to Frank Ralf

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Farzaneh CTY -

Hi Frank,

Thanks a lot for your kind reply.

I even tried to download one quiz -which is already in moodle and working- from it and then re-upload it to moodle, it gave the same error again!

-Farzaneh

In reply to Farzaneh CTY

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
So... if you attach the file we'll look at it and tell you what's wrong. There's no point guessing.
In reply to Farzaneh CTY

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Please post an example that you are having problems with and I'll be happy to check it out.
In reply to Howard Miller

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Farzaneh CTY -

Hi Howard,

Thanks a lot for the reply.

Here is the example ( It is originally a text file), I have also attached the error:


// question: 1 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which of the following is NOT CORRECT about plug-ins? {
~Plug-ins provide browsers with additional functionality.
~Plug-ins enable the use of enhanced media types, such as real-time audio. 
=IE, Firefox, and Opera are examples of plug-ins.
~When embedding a multimedia file, it will be opened in the browser using the plug-in if it’s installed.
}

// question: 2 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which of the following is NOT CORRECT about players? {
~Players enable users to run multimedia applications on their computer.
~Flash, Shockwave, and QuickTime are examples of players.
~When linking to a multimedia file, clicking the link will open the file in a compatible player.
=None of the above.
}

// question: 3 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which is of the following is NOT CORRECT about the following code?<br />&lt;a href&&#92;#61;&quot;file:&#47;&#47;&#47;C:&#47;mysite.com&#47;media&#47;performance.wmv&quot;&gt; &lt;img src&&#92;#61;&quot;file:&#47;&#47;&#47;C:&#47; mysite.com &#47;media&#47;performance.jpg&quot; alt&&#92;#61;&quot;Me Performing&quot;&gt;&lt;&#47;a&gt; {
~An image is displayed for the user to click on to open the file.
=It references files on the server-at mysite.com.
~The video can play in Windows Media Player if the user has it installed.
~None of the above.
}

// question: 4 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Using the  &lt;EMBED&gt; element is not standard and a web page that uses it is not valid.  {
=True
~False
}

// question: 5 name: MultipleChoiceQ
::MultipleChoiceQ::[html]When using the &lt;object&gt; tag to embed a video, the type and data attributes are used to… {
=specify the MIME type and location and name of the movie
~set controls of  a player
~set the dimensions of a player
~none of the above
}

// question: 6 name: MultipleChoiceQ
::MultipleChoiceQ::[html]The &lt;param&gt; tag is used to…  {
~format caption text for table headers
=define parameters or variables for an object element.
~substitute the &lt;object&gt; element
~none of the above
}

// question: 7 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which of the following is NOT CORRECT about the code below? &lt;object type&&#92;#61;&quot;application&#47;x-shockwave-flash&quot;<br /><br />data&&#92;#61;&quot;http:&#47;&#47;www.youtube.com&#47;v&#47;TW708ksBw3k&quot; width&&#92;#61;&quot;425&quot;  height&&#92;#61;&quot;344&quot;&gt;<br />&lt;param name&&#92;#61;&quot;movie&quot;  value&&#92;#61;http:&#47;&#47;www.youtube.com&#47;v&#47;TW708ksBw3k  name&&#92;#61;&quot;allowFullScreen&quot; value&&#92;#61;&quot;false&quot; &#47;&gt;<br />&lt;param name&&#92;#61;&quot;allowscriptaccess&quot; value&&#92;#61;&quot;always&quot; &#47;&gt;<br />&lt;&#47;object&gt; {
~Javascript  is turned on
~The viewer will not be able to view the video full screen.
=The movie file is located on the user’s local computer
~Flash player is used to play the video
}

// question: 8 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which of the following is CORRECT about Flash? {
~Flash is an animated image and graphics format.
~Flash files are distributed and published in a file format that has an extension of .swf
~Flash has a comparatively small file size when published. 
=All of the above
}

// question: 9 name: MultipleChoiceQ
::MultipleChoiceQ::[html]You can use a &lt;param&gt; tag with the name attribute set to &quot;hidden&quot; and the value attribute set to &quot;true&quot; to completely hide the controller for an embedded audio file. {
=True
~False
}

// question: 10 name: MultipleChoiceQ
::MultipleChoiceQ::[html]When using the &lt;object&gt; element to embed mp3s you must use IE conditional comments to hide the second nested &lt;object&gt; element from IE, so that IE ignores it and only reads the first, outer &lt;object&gt; element.  {
=True
~False
}

// question: 11 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which of the following code correctly inserts an image link that will open the multimedia file when clicked? {
~&lt;a src &&#92;#61;&quot;file:&#47;&#47;&#47;C:&#47;IWD&#47;Unit6&#47;music_concert.wmv&quot;&gt;&lt;img&&#92;#61;&quot;file:&#47;&#47;&#47;C:&#47;IWD&#47;Unit6&#47;music_concert.jpg&quot; alt&&#92;#61;&quot; Listen to the concert &quot;&gt;&lt;&#47;a&gt;
~&lt;a src&&#92;#61;&quot;http:&#47;&#47;mysite.com&#47;media&#47;music_concert.wmv&quot;&gt;Listen to the concert&lt;&#47;a&gt;
~&lt;a href &&#92;#61;&quot;file:&#47;&#47;&#47;C:&#47;IWD&#47;Unit6&#47;music_concert.wmv&quot;&gt;&lt;img&&#92;#61; file:&#47;&#47;&#47;C:&#47;IWD&#47;Unit6&#47;music_concert.jpg &#47;&gt;
=&lt;a href&&#92;#61;&quot;http:&#47;&#47;mysite.com&#47;media&#47;music_concert.wmv&quot;&gt; &lt;img src&&#92;#61;&quot;http:&#47;&#47;mysite.com&#47;media&#47;music_concert.jpg&quot; alt&&#92;#61;&quot;Listen to the concert&quot;&gt;&lt;&#47;a&gt;
}

// question: 12 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which of the following code plays the mp3 file as background sound and with no player controls as the page is loaded? {
~&lt;object type&&#92;#61;&quot;audio&#47;mpeg&quot; width&&#92;#61;&quot;110&quot; height&&#92;#61;&quot;16&quot;&gt;<br />&lt;param name&&#92;#61;&quot;src&quot; value&&#92;#61;&quot;http:&#47;&#47;mysite.com&#47;media&#47;music.mp3&quot; &#47;&gt;<br />&lt;param name&&#92;#61;&quot;controller&quot; value&&#92;#61;&quot;true&quot; &#47;&gt;<br />&lt;param name&&#92;#61;&quot;autoplay&quot; value&&#92;#61;&quot;false&quot; &#47;&gt;<br />&lt;&#47;object&gt;
=&lt;object type&&#92;#61;&quot;audio&#47;mpeg&quot;data&&#92;#61;&quot;http:&#47;&#47;mysite.com&#47;media&#47;music.mp3&quot;&gt;<br />&lt;param name&&#92;#61;&quot;src&quot; value&&#92;#61;&quot;http:&#47;&#47;mysite.com&#47;media&#47;music.mp3&quot; &#47;&gt;<br />&lt;param name&&#92;#61;&quot;controller&quot; value&&#92;#61;&quot;false&quot; &#47;&gt;<br />&lt;param name&&#92;#61;&quot;autoplay&quot; value&&#92;#61;&quot;true&quot; &#47;&gt;<br />&lt;&#47;object&gt;
~&lt;object type&&#92;#61;&quot;audio&#47;mpeg&quot;data&&#92;#61;&quot;http:&#47;&#47;mysite.com&#47;media&#47;music.mp3&quot;&gt;<br />&lt;param name&&#92;#61;&quot;src&quot; value&&#92;#61;&quot;http:&#47;&#47;mysite.com&#47;media&#47;music.mp3&quot; &#47;&gt;<br />&lt;&#47;object&gt;
~&lt;object &gt;<br />&lt;param name&&#92;#61;&quot;src&quot; value&&#92;#61;&quot;http:&#47;&#47;mysite.com&#47;media&#47;music.mp3&quot; &#47;&gt;<br />&lt;param name&&#92;#61;&quot;controller&quot; value&&#92;#61;&quot;false&quot; &#47;&gt;<br />&lt;param name&&#92;#61;&quot;autoplay&quot; value&&#92;#61;&quot;true&quot; &#47;&gt;<br />&lt;&#47;object&gt;
}

// question: 13 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which of the elements below define the beginning and end of a table? {
~&lt;td&gt;&lt;&#47;td&gt;
~&lt;tr&gt;&lt;&#47;tr&gt;
~&lt;tb&gt;&lt;&#47;tb&gt;
=&lt;table&gt;&lt;&#47;table&gt;
}

// question: 14 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which of the elements below define the beginning and end of a table row? {
~&lt;td&gt;&lt;&#47;td&gt;
~&lt;tbrow&gt;&lt;&#47;tbrow&gt;
=&lt;tr&gt;&lt;&#47;tr&gt;
~&lt;tb&gt;&lt;&#47;tb&gt;
}

// question: 15 name: MultipleChoiceQ
::MultipleChoiceQ::[html]
In the code below, the table consists of ____________ cells?<br /><br />&lt;table&gt; <br />&lt;tr&gt;&lt;td&gt;This is data&lt;&#47;td&gt;&lt;&#47;tr&gt; <br />&lt;tr&gt;&lt;td&gt;&lt;&#47;td&gt;&lt;&#47;tr&gt; <br />&lt;tr&gt;&lt;td&gt;&lt;&#47;td&gt;&lt;&#47;tr&gt; <br />&lt;&#47;table&gt; {
~1
~2
=3
~4
}

// question: 16 name: MultipleChoiceQ
::MultipleChoiceQ::[html]
The ____________ attribute specifies the amount of space between the content of the cell and the edge of the cell. {
~cellspacing
~cellmargin
=cellpadding
~cellwidth
}

// question: 17 name: MultipleChoiceQ
::MultipleChoiceQ::[html]To add a border to a table, the border attribute should be placed… {
~Before the opening table tag.
~After the opening table tag.
=Within the opening table tag.
~Within the first table row tag.
}

// question: 18 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which code example below correctly creates an invisible table? {
~&lt;table&gt;&lt; border&&#92;#61;&quot;0&quot;&gt;
=&lt;table border&&#92;#61;&quot;0&quot;&gt;
~&lt;table border&&#92;#61;&quot;none&quot; &gt;
~&lt;&#47;table border&&#92;#61;&quot;0&quot;&gt;
}

// question: 19 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which table tag prints enclosed text in a centered bold font? {
~&lt;CAP&gt;
~&lt;TD&gt;
=&lt;TH&gt;
~&lt;TB&gt;
}

// question: 20 name: MultipleChoiceQ
::MultipleChoiceQ::[html]The ALIGN attribute may be used in which of the following tags: {
~&lt;TABLE&gt;
~&lt;TH&gt;
~&lt;TD&gt;
=all of the above
}

// question: 21 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which of the following is not a valid value for the ALIGN attribute? {
=middle
~left
~center
~right
}

// question: 22 name: MultipleChoiceQ
::MultipleChoiceQ::[html]An HTML table is comprised of ______ and ______. {
~text and a grid
~title and records
=rows and columns
~none of the above
}

// question: 23 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which is true about the following code: <br /><br />&lt;table border&&#92;#61;&quot;1&quot; width&&#92;#61;&quot;75%&quot;&gt;&lt;tr&gt;&lt;td&gt;1&lt;&#47;td&gt;&lt;td&gt;2&lt;&#47;td&gt;&lt;td&gt;3&lt;&#47;td&gt;&lt;td&gt;3&lt;&#47;td&gt;&lt;&#47;tr&gt;&lt;tr&gt;&lt;td&gt;1&lt;&#47;td&gt;&lt;td&gt;2&lt;&#47;td&gt;&lt;td&gt;3&lt;&#47;td&gt;&lt;td&gt;3&lt;&#47;td&gt;&lt;&#47;tr&gt;&lt;tr&gt;&lt;td&gt;1&lt;&#47;td&gt;&lt;td&gt;2&lt;&#47;td&gt;&lt;td&gt;3&lt;&#47;td&gt;&lt;td&gt;3&lt;&#47;td&gt;&lt;&#47;tr&gt; &lt;&#47;table&gt; {
=creates a table with four columns that have three rows.
~creates a table with three columns that have four rows.
~creates a table with three columns that has three rows.
~does not create a table since the above is not valid code.
}

// question: 24 name: MultipleChoiceQ
::MultipleChoiceQ::[html]The colspan attribute allows you to: {
~create new rows in a table.
~Create new columns in a table.
=Straddle a cell across columns.
~Create a set spanned columns.
}

// question: 25 name: MultipleChoiceQ
::MultipleChoiceQ::[html]The width attribute, used in &lt;table width&&#92;#61;&quot;75%&quot;&gt; {
=sets the percentage of the screen that the table occupy.
~sets the width of the table border.
~Sets the percentage of content the table can hold.
~sets the percentage of pixels used for the table.
}

// question: 26 name: MultipleChoiceQ
::MultipleChoiceQ::[html]You can change the background color of individual cells with the ____________ attribute: {
~color
=bgcolor
~tdcolor
~cellcolor
}

// question: 27 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Cellspacing is… {
~a method of resizing table columns.
=the border gap between the cells of a table.
~a method for setting  the size of a cell.
~used for text alignment within cells.
}

// question: 28 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Setting the width and the height of a table can be done by... {
~using the size attribute
~using absolute pixel values to set the table dimensions
~setting the percentage of the browser window the table should occupy
=both a and b
~none of the above
}

// question: 29 name: MultipleChoiceQ
::MultipleChoiceQ::[html]Which of the following is CORRECT about the table in the code below?<br /><br />&lt;TABLE ALIGN&&#92;#61;&quot;center&quot; WIDTH&&#92;#61;&quot;50%&quot; HEIGHT&&#92;#61;&quot;50%&quot;&gt; {
~the table's width and height are 50% proportional to the size of the browser window
~As you resize the browser, the table will adjust its size automatically
~The table is centered in the browser display
=all of the above
}

// question: 30 name: MultipleChoiceQ
::MultipleChoiceQ::[html]The ALIGN and VALIGN attributes specify how the content of a row or a cell should be aligned horizontally and vertically {
=True
~False
}

Thanks a lot,

Farzaneh

Attachment error.JPG
In reply to Farzaneh CTY

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Mmm... worked perfectly for me.

I have attached my version of the file in case it makes a difference. However, I suggest you try again with Debugging switched on. You should see some additional error messages that will help diagnose this problem.
In reply to Farzaneh CTY

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Frank Ralf -
If this is an encoding problem we won't catch that with copy&pasting. Please upload your problematic file.

tia
Frank
In reply to Frank Ralf

Re: GIFT Format Quiz import won’t work on 1.9.4!

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 doubt that's the problem. Smacks of some problem with the actual file upload to me.

I guess this begs the question does anything work? Can XML Format be "round tripped". Debugging should reveal the cause.
In reply to Frank Ralf

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Farzaneh CTY -

Hi All,

Thanks for the replies.

I have attached the file.

Thanks alot,

Farzaneh

In reply to Farzaneh CTY

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
As I suspected it would... it works fine for me. No errors.

Have you tried with Debugging switched on yet? I'm reasonably sure that will reveal the problem.
In reply to Howard Miller

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Farzaneh CTY -

I did it with debugging enabled, I have attached the result.

Thanks.

Attachment Debug.JPG
In reply to Farzaneh CTY

Re: GIFT Format Quiz import won’t work on 1.9.4!

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 take it you have installed the non-standard regexp question type? Are you absolutely sure you have the latest version of that? As it is quite popular I'm surprised it is throwing errors.
In reply to Howard Miller

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Farzaneh CTY -

Thanks Howard.

Where is it possible to get the latest version from?

In reply to Farzaneh CTY

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In reply to Howard Miller

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Farzaneh CTY -
Hello Howard,

How is it possible to uninstall the previous plug in or access it? Is it possible to access it via Moodle administration block?!

Thanks,
Farzaneh

In reply to Farzaneh CTY

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Hubert Chathi -
The file includes a BOM. Could this be what's causing the problem? See http://moodle.org/mod/forum/discuss.php?d=128016
In reply to Hubert Chathi

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Farzaneh CTY -

Thanks Hubert.

I believe this file was originally created in word but in order to use the MS Word template for GIFT format, you have to save the file as a regular text file.

How can you tell my file includes a BOM? I am not able to see it! and how do I get rid of it?!

In reply to Farzaneh CTY

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Hubert Chathi -
I've attached a file that has the BOM stripped. Try it and see if it works for you. I'm not sure how to strip the BOM in Windows, but in UNIX-like systems, you can download a bomstrip utility.
In reply to Hubert Chathi

Re: GIFT Format Quiz import won’t work on 1.9.4!

by Farzaneh CTY -

Thanks a lot Hubert.

I tried it I receive the same error!