OOo template to write exams and convert to GIFT format

Re: OOo template to write exams and convert to GIFT format

by Enrique Castro -
Number of replies: 13
Picture of Core developers Picture of Particularly helpful Moodlers
Hi all,
At last, I am re-entering Moodle stuff after my disconnection this summer (I had to push forward my day job in Neuroscience). In the meanwhile, OOo 2.0 was released by October but it had a nasty bug that precluded numbering/bullet styles to work at all. Now OOo 2.0.1 is out (RC5) and working quite well (at least for this task).
I have revised the template to write Exams and Quizzes and convert into GIFT format to import to work with OOo 2.0.1 (and only this or superior, please do not use with OOo 2.0, guaranteed it will not work). You may found version 0.5 attached.
This version export styling format as HTML, not XHTML as the former, there are new subtleties in OOo->XHTML XSLT filters that are not well documented. As soon as I understand what is hapenning with encoding I will update this template to be XHTML compliant.

I haved tested the macros on Windows, but they should work identical on Linux. The test bank is rather simple because here we use quite standarized exam forms, so please, test it in the weirdest ways possible and with different question types. I am willing to add new features, if requested.

Enrique

In reply to Enrique Castro

Re: OOo template to write exams and convert to GIFT format

by Matti Teräslahti -
Hi,
This is exactly what I was looking for. There's just one problem: it's not working. I don't know why, but it throws an error when I try to add any quiz element.
Here's the error when I try to add a MultipleOption:

"A Scripting Framework erroroccurred while running the Basic script vnd.sun.star.script:GIFT_Convert.Module1.InsertQ_MultipleOption?language=Basic&location=application.

Message: BasicProviderImpl::getScript: no script!"

And I just installed OOo 2.0.1.
In reply to Matti Teräslahti

Re: OOo template to write exams and convert to GIFT format

by Dave Adams -
I'm just trying this out after I got the Word templates working correctly, because I would prefer to work in Ooo.  I got the same Scripting Framework error that you got.

Did anyone ever figure out how to fix this error?

I guess it might help to make sure the template is installed correctly. I will look into that.

In reply to Dave Adams

Re: OOo template to write exams and convert to GIFT format

by Vyatcheslav Yatskovskiy -
I had the same error. But i have fixed it by just following the installation instructions provided in attached pdf file.

● Open an empty OOo Writer document
● Select menu Tools > Macros > Organize Macros > OpenOffice.org Basic
● Click on the Organizer button.
● Select the Libraries Tab
● Make certain that "My Macros & Dialogs" is selected in the Location drop down list box.
● Use the Append button to add this new macro library and select either
Moodle_Quizz_Template.ott or Moodle_Quizz_Example.odt from the file dialog
● Make sure to tick the checkbox by “GIFT_Convert” and leave unchecked the “Standard” entry before you accept the import of this library


In reply to Vyatcheslav Yatskovskiy

Re: OOo template to write exams and convert to GIFT format

by Dusa Adrian -
Hello,

In the attached PDF file I couldn't find any installation instructions, so I followed yours.
Everything looks exactly as you describe them, except for the last point, when I have to tick the "GIFT_Convert" tickbox.
I cannot find it... sad
After using the Append button and selecting either Moodle_Quizz_Template.ott or Moodle_Quizz_Example.odt, there is nothing to tick but the "Standard" checkbox!

Is there anything in particular that I should do?
I use OpenOffice 1.9.129 which comes with the standard CD in the Kubuntu 5.10 Breezy Badger.

Thank you in advance,
Adrian
In reply to Dusa Adrian

Re: OOo template to write exams and convert to GIFT format

by Vyatcheslav Yatskovskiy -
"I use OpenOffice 1.9.129"
Just to the point. My previous posts apply only to OO 2.x. I didn't even try the macros with earlier versions of OO.
In reply to Enrique Castro

Re: OOo template to write exams and convert to GIFT format

by Vyatcheslav Yatskovskiy -
Thank you. I very interested in your quiz template for OpenOffice 2.x. Having used it for a while, I came up with the following suggestions.

1) I prefer to separate questions by a blank line. But since making line breakes by hitting Enter don't change current paragraph style, I need to set the empty paragraph style to  'Default' every time.  Is there a simple way?

2) Some my quiz questions concern programming languages and contain source code fragments. When I set Courier font for leftmost words, I obtain GIFT output like

...<FONT face='Courier'>some short answer text fragment {</FONT>
=...
=...
}


That is, closing formatting teg (</FONT> is this example, but also other tags like </CODE> or </PRE>) is always found after the opening bracket and is recognized by Moodle import filter as first answer.

OO source fragment (from contents.xml) :
<text:p text:style-name="Standard" />
<text:list text:style-name="questions" text:continue-numbering="true">
  <text:list-item>
         <text:p text:style-name="ShortAnswerQ">
                Rewrite the following statement using Pascal operators:
                <text:span text:style-name="T5">if X greater than or equal to Y then subtract 10 from Y;</text:span>
    <text:span text:style-name="T6" />
    <text:span text:style-name="T4">(don't insert unnecessary spaces)    </text:span>
          </text:p>
  </text:list-item>
</text:list>


To summarize, I want to claim my attention to future improvement of this very useful, time-saving template and turn developers' attention to the particulart needs of computer science teachers.
In reply to Vyatcheslav Yatskovskiy

Re: OOo template to write exams and convert to GIFT format

by colin melville -
I've managed to install the macro and get everything working using the helpful PDF.It looks excellent big grin. One problem is that I'm having problems getting it to distinguish between separate questions, and this is throwing up errors on parsing prior to GIFT conversion.

Does this relate to newline or other invisible characters? thoughtful

 
In reply to Enrique Castro

Re: OOo template to write exams and convert to GIFT format

by Fred Frazelle -
Enrique!! Thanks a million! i'm starting to use this with OOo 2.3.0 under PCLinuxOS and it seems to work great! ¡Supergracias!

Thanks again and have a great evening! smile
In reply to Enrique Castro

Re: OOo template to write exams and convert to GIFT format

by Gary Lyon -
I am running the GIFT macros on OO 3.2.0 and am getting the following error message when I run the "check all questions" button:

"There is a problem with this questions. Have a look into enunciate or answers."

Anyone else running it on 3.2.0? If so did you have to make any changes to the macro?

Thanks for any feedback or suggestions.

In reply to Gary Lyon

Re: OOo template to write exams and convert to GIFT format

by Marc Grober -
Just installed 3.2 today so will try to see what gives...
In reply to Gary Lyon

Re: OOo template to write exams and convert to GIFT format

by Marc Grober -
I have upgraded to 3.2 and using the check all question icon I get no issue with the questions I added....

So... it could be an issue with one of your questions (you can send me your file and I can check it out); it could be an issue with one particular type of question (I did not run an exhaustive test); it could be an issue with the installation (did you install macros or use the extension that I created from the macros); or it could be an issue of whether you upgraded or did a new install of 3.2.

Since you are the person with the bug, its your move ;=} There is a debugger for the macros.

Average of ratings: Useful (1)
In reply to Marc Grober

Re: OOo template to write exams and convert to GIFT format

by Gary Lyon -
An important element not mentioned in the most current instructions. It turns out the issue was caused by a lack of blank lines before the first question, between each question, and following the last question. And, each blank line needs to be formatted in the "Default" style.

The giveaway was in the "Importing "GIFT" Format Files" help in Moodle; "Each question is delimited by at least one blank line". Would probably be a good thing to add to the template instructions.

Much thanks to Marc for queuing me on the question formatting, testing my file and superfast response.

Cheers!
Average of ratings: Useful (1)
In reply to Enrique Castro

Re: OOo template to write exams and convert to GIFT format

by Ashiq Irphan -

As on date the latest version of Open Office is 4.1.0, Will this template still work ??