re; GIFT Format exporting tags

re; GIFT Format exporting tags

Davo .發表於
Number of replies: 8

re; GIFT Format exporting <p>  </p> tags


I exported some questions from Moodle 2.7 in GIFT format, however it added the HTML <p>  </p> tags to every text line that was exported. When I imported it into Adobe Captivate 8, it imported these html control tags. This is a problem, especially if you have to import allot of question data.

 

Is there a fix or way around this, so you don't have to manually edit and delete every <p> </p> wrapper on every imported line of question text.


Is  HTML tags <p>  </p>   part of the GIFT format standard?

 

COPY OF IMPORTED GIFT question data below;

 

<p>What state is Melbourne in ?</p>

 

彩蛋  A) <p>NSW</p>

彩蛋  B) <p>QLD</p>

(*)  C) <p>VIC</p>

彩蛋  D) <p>WA</p>

彩蛋  E) <p>NT</p>

 

Thanks.

David

4 July 2014

評比平均分數: -
In reply to Davo .

Re: re; GIFT Format exporting tags

Christian Herman發表於

If written using the HTML editor (the rich editor is visible), the questions and answers are in HTML format so tags will be included on export.  Not much you can do about that.  What you can do is use a decent text editor with a replace function to delete the <p> and </p> tags.

In reply to Christian Herman

Re: re; GIFT Format exporting tags

Davo .發表於

Hmm, would be good if there was an export option to strip out any html tags. There doesn't seem any option to select plain format, which appears to be part of GIFT standard. Going by Moodle Docs on GIFT format, the default format seems to be [moodle] whatever that is. There is a [plain] format that's supported by GIFT, but not option to select that in the export function. If indeed that aspect is relevant to my query.

"[...format...] The format of the following bit of text. Options are [html], [moodle], [plain] and [markdown]. The default is [moodle] for the question text, other parts of the question default to the format used for the question text."

Moodle Docs refhttp://docs.moodle.org/23/en/GIFT_format



In reply to Davo .

Re: re; GIFT Format exporting tags

G. M.發表於

Hello David,

Did you check:

** The Hints and Tips section?

http://docs.moodle.org/23/en/GIFT_format#Hints_and_Tips

You can specify markup if you need to format the question by setting [html], [moodle], [plain] or [markdown] just before the question text. See more about this in the reference pdf below.

See example under:

http://docs.moodle.org/23/en/GIFT_format#Percentage_Answer_Weights

** The related Formatting text page?

http://docs.moodle.org/23/en/Formatting_text

In reply to Davo .

Re: re; GIFT Format exporting tags

Christian Herman發表於

The documentation describes only how to write quesitons in GIFT.  When writing from scratch you have control over what format the text takes.  Although I am myself a bit confused on what "moodle" format is (it seems to be plain text that accepts basic HTML text formatting tags), you can write questions in plain text using the GUI by disabling the rich text editor.  You'd still have the [plain] operator to contend with on export, though.

Keep in mind that the GIFT format is just a way to structure the question-answer relationship.  It does not define formatting of text but instead "partners" with text formaters to handle the job.  Whether importing or exporting, Moodle retains whatever format of the text was defined.  You may want to open an issue on the tracker to add the ability to strip HTML tags from exports.

In reply to Davo .

Re: re; GIFT Format exporting tags

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片

GIFT is not a standard, or only a de-facto standard. It is something that some Moodle developers just made up a long time ago. See https://github.com/moodle/moodle/commit/43bf9fc2d71450ec1fb91cd739814a5b20dad12a and https://moodle.org/mod/forum/discuss.php?d=4004 - Wow! look at that tiny discussion id 微笑 Detailed credits at the end of this post: https://moodle.org/mod/forum/discuss.php?d=4004#p18031

I did not know that Adobe captivate had implemented it. I guess that is a testament to Moodle's popularity. While the captivate documentation http://helpx.adobe.com/captivate/using/import-questions-gift-format-files.html gives the expansion of the name as 'General Import Format Technology' I am pretty sure that is a reverse backronym. I can't remember who told me, but it was someone quite trustworthy, that they originally called it GIFT because it was their gift to the Moodle community[citation needed].

It seems there are also Perl libraries for parsing it: http://search.cpan.org/~casiano/Gift-0.6/lib/Gift.pm. It is wonderful how this useful little format has spread. 微笑

In reply to Tim Hunt

Re: re; GIFT Format exporting tags

Martin Dougiamas發表於
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片

In fact "General Import Format Technology" is actually correct, it was Paul Shew who came up with that.  I thought it was a bit too generic however (it could also describe XML) so we never really published it that way.  And yeah it's cool how formats spread.

In reply to Martin Dougiamas

Re: re; GIFT Format exporting tags

Davo .發表於

Hi people. Thanks for the interesting responses. I presume it's possible to easily re-edit the Moodle questions in Moodle to remove html tags? i.e. by simply using the plain text editor mode on existing question data? Though you then loose all formatting work. 

It does sound to me that an elegant solution is a tick option to strip all html tags in the export process.


e.g.   [x] Exclude html tags


etc...

In reply to Davo .

Re: re; GIFT Format exporting tags

G. M.發表於

Hi David,

Formatting is done via HTML tags, actually.

bold, <strong>
italic, <em>
underline, <u>
red color, <span style="color: #ff0000;">

and paragraph, is also formatting.