Using Bold is breaking my HTML Upload.. Please Help

Using Bold is breaking my HTML Upload.. Please Help

by Kristin Dougherty -
Number of replies: 9

Moodle Version: 1.9.3

File Format: Moodle XML Format

Hello Fellow Moodlers,

I am having a problem with bulk uploading questions that have a bold word within them. I started out having problems with using quotes, apostrophes, ampersand, etc. but I came across a website that has a “Special HTML Characters” codes list that helped me out but BOLD wasn’t an option. If anyone else is having problems with character codes, I recommend checking out the following website… http://www.tedmontgomery.com/tutorial/htmlchrc.html

Anyway.. back to my current problem. I searched for all the codes to upload a word to appear bold and every code I chose gives the following error (refer to attachment below)

The codes I tried were…

<b>              </b>

<strong>       </strong>

<div style="font-weight: bold">        </div>

<span style="font-weight: bold;">    </span>

Does anyone know why Moodle would not import my questions that used bold in the text but had no problem with all the other ones.

Attachment 7-7-2010_3-58-38_PM.gif
Average of ratings: -
In reply to Kristin Dougherty

Re: Using Bold is breaking my HTML Upload.. Please Help

by Itamar Tzadok -
Well, are you using CDATA? See below part of the import code for MC question in Moodle XML as an example. smile

<question type='multichoice'>
<name><text><![CDATA[PLTRNSRP251]]></text></name>
<questiontext format='html'><text>
<![CDATA[<p>Translate the following sentence using the provided dictionary.</p><table cellpadding='3px' style='border:1px solid #dddddd;'><tr><td valign='top'><b>a:</b></td><td valign='top'>Andrea</td><td valign='top'><b>Fx:</b></td><td valign='top'>x is a film class</td><td valign='top'><b>Txy:</b></td><td valign='top'>x takes y</td></tr><tr><td valign='top'><b>b:</b></td><td valign='top'>Babak</td><td valign='top'><b>Lx:</b></td><td valign='top'>x is a logic class</td><td valign='top'><b>Wxy:</b></td><td valign='top'>x does well at y</td></tr><tr><td valign='top'><b></b></td><td valign='top'></td><td valign='top'><b>Px:</b></td><td valign='top'>x is a philosophy major</td><td valign='top'><b></b></td><td valign='top'></td></tr><tr><td valign='top'><b></b></td><td valign='top'></td><td valign='top'><b>Rx:</b></td><td valign='top'>x is well rounded</td><td valign='top'><b></b></td><td valign='top'></td></tr><tr><td valign='top'><b></b></td><td valign='top'></td><td valign='top'><b>Yx:</b></td><td valign='top'>x is a student at York</td><td valign='top'><b></b></td><td valign='top'></td></tr></table><p style='font-size:120%;font-weight:bold;'>Andrea took either a logic or a film class.</p>]]>
</text></questiontext>
<penalty>0</penalty>
<hidden>0</hidden>
<shuffleanswers>1</shuffleanswers>
<single>true</single>
In reply to Kristin Dougherty

Re: Using Bold is breaking my HTML Upload.. Please Help

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Wrap your HTML section in CDATA. It's mentioned in the docs.... Moodle_XML.

You can't embed HTML. The XML parser doesn't know it isn't XML and it breaks the import.
In reply to Howard Miller

Re: Using Bold is breaking my HTML Upload.. Please Help

by Kristin Dougherty -

Thank you Itamar & Howard!  I was missing the <![CDATA[        ]]>  from my code.  Everything worked now. 

Thanks again,

Kristin

In reply to Kristin Dougherty

Re: Using Bold is breaking my HTML Upload.. Please Help

by Kristin Dougherty -

Hey Guys,

I was wondering if you could help me out with an additional issue I ran into concerning uploading bulk questions. I notice that one of my questions wasn't fully uploaded. What I mean is the entire question wasn't uploaded so the question text in Moodle appears to be cut off. Is there a character limit?

Thanks,

Kristin

Example just in case:

Question Text:

Using the 3M APR DRG methodology, the normative value (the average of the Premier Perspective database) is applied to the number of patients in each APR DRG severity of illness level for an end result of a severity of-illness-adjusted APR DRG expected value.

Appears in Moodle:

Please indicate if the following statement is True or False:
Using the 3M APR DRG methodology, the normative value (the average of the Premier Perspective database) is applied to the number of patients in each APR DRG severity of illness level for an end result of a severity of-illness-adjusted APR DRG expected val

In reply to Kristin Dougherty

Re: Using Bold is breaking my HTML Upload.. Please Help

by Itamar Tzadok -
Even if there is a character limit your example is nowhere near it. If it's just this question, something in its import code may be broken (e.g. non-printable special characters). smile
In reply to Kristin Dougherty

Re: Using Bold is breaking my HTML Upload.. Please Help

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Just guessing : a stray umlaut on valüe?
Anyway it's impossible to help you out from the question text you copied here. We really need the complete import file you used, in order to check it.
Joseph
In reply to Joseph Rézeau

Re: Using Bold is breaking my HTML Upload.. Please Help

by Kristin Dougherty -

<?xml version="1.0" encoding="UTF-8"?>
<quiz>


<!-- question: 16  -->
  <question type="truefalse">
    <name><text>3M APR DRG risk methodology</text>
</name>
    <questiontext format="html">
<text>Please indicate if the following statement is True or False:

Using the 3M APR DRG methodology, the normative value (the average of the Premier Perspective database) is applied to the number of patients in each APR DRG severity of illness level for an end result of a severity of-illness-adjusted APR DRG expected val</text>
    </questiontext>
    <defaultgrade>1</defaultgrade>
    <penalty>1</penalty>
    <hidden>0</hidden>
    <shuffleanswers>0</shuffleanswers>
    <answer fraction="100">
      <text>true</text>
    </answer>
    <answer fraction="0">
      <text>false</text>
    </answer>
</question>

</quiz>

In reply to Kristin Dougherty

Re: Using Bold is breaking my HTML Upload.. Please Help

by Kristin Dougherty -
The weird part is it is cut off here but not in the excel spreadsheet that I did the mail merge from.
In reply to Kristin Dougherty

Re: Using Bold is breaking my HTML Upload.. Please Help

by Yulia I -
try Moodle XML Converter(http://moodle.heroku.com). It will convert your question to Moodle XML format.

For your question post to quiz form

truefalse
Q1. Please indicate if the following statement is True or False:
Using the 3M APR DRG methodology, the normative value (the average of the Premier Perspective database) is applied to the number of patients in each APR DRG severity of illness level for an end result of a severity of-illness-adjusted APR DRG expected val
Answer: true

To use boldness use <b></b> tags

Converter supports all HTML tags.