Moodle in English

Posts made in Moodle in English

Moodle in English -> Quiz Images in answers - base_64? -> Re: Images in answers - base_64?

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Would it be possible to write a PHP/SQL script that batch converts images embedded as Base64 inside HTML fragments into separate image files inside in Moodle?
It would need to find questions containing HTML with such images, extract the Base64 image, create a corresponding image file, place it in the appropriate file location, then replace the Base64 image with an appropriate HTML anchor link pointing to the right file.
Such code might be easier to write, and more universally useful, than changing the XML question import code to convert base 64 encoding into separate images.
A separate step or automated cron job could be used to have the script traverse the questions (or other course resources) and fix them up for IE.

A question author could then use Word+VB+XSL to create single Moodle Question XML+Base64 files for easy importing, and preview them using Firefox, and finally convert them once they are all finished and included in a quiz.

Moodle in English -> Quiz New question type: fill in the blank -> Re: New question type: fill in the blank

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

A couple of attempts have been made at simplifying Cloze question input.
See http://tracker.moodle.org/browse/MDL-16154

I installed the contributed code multianswer.zip file (from Mohamed Alsharaf) attached to this issue onto my test Moodle set, so you can try the interface in action at:
http://www.moodle2word.net/question/question.php?category=72&courseid=2&returnurl=http%3A%2F%2Fwww.moodle2word.net%2Fquestion%2Fedit.php%3Fcourseid%3D2&qtype=multianswer (click on "Show Sub-Question Builder" to see the JavaScript dialog box).
You will need to log in (use username/password mcqstudent/mcq) to view the page.

I couldn't get the original code in the attachment cloze_generator.html (contributed by Dominik Anonymous, I think) to work.
The file clozegen.zip contains a HTTP 404 page error, not any code.

I have also created a Word-based alternative question interface which supports Cloze question input (cf. http://www.moodle2word.net/), which uses formatting (bold, italic) to represent different gap types.

Moodle in English -> Quiz Language strings in new question import format

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
I'm trying to create a new import format in Moodle 1.9.x, following the instructions in
http://docs.moodle.org/en/Development:Question_import/export_formats
and
http://docs.moodle.org/en/Development:Places_to_search_for_lang_strings
and have encountered 2 separate problems.

I am placing the plug-in in the directory
question/format/wordtable,
and associated language strings in
question/format/wordtable/lang/en_utf8/qformat_wordtable.php

However, the strings are not displayed by default, I think because the lib/moodlelib.php function places_to_search_for_lang_strings()
does not contain a reference to
qformat_, i.e. 'qformat_' => array('question/format'), so Moodle doesn't look for language strings in question/format subdirectories.

Am I missing something? I found that copying the plugin strings file to the main lang/en_utf8 folder also works, but this doesn't seem like the right thing to do.

The second problem is that the real name of the new import/export format does not appear in the 'File format' lists on the Question Import or Export pages. It seems that the format name string must be defined in the main Quiz string file lang/en_utf8/quiz.php

Is there a way around this?


Average of ratings: -

Moodle in English -> Quiz What is the correct structure for xml code being exported into moodle? -> Re: What is the correct structure for xml code being exported into moodle?

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Oops, forgot about markup escaping.
<xml version=1.0?>
should be
<xml version="1.0"?>

Also, I meant the Question editing interface within your own Moodle server installation, not the Hub.
If you don't have your own Moodle, see
http://demo.moodle.net/question/question.php?category=6&courseid=5&returnurl=http%3A%2F%2Fdemo.moodle.net%2Fquestion%2Fedit.php%3Fcourseid%3D5&qtype=multichoice

You can create a question using the interface, then export it to XML format to see what it looks like.