[Xerte] Having problems with Xerte 2.10 not opening xml file

Paul Swanson Paul.Swanson at harlandfs.com
Wed Jul 7 23:07:32 BST 2010


The "broken" xml file is opened in the working directory and parsed just
fine. Good idea, though. That would indicate the problem is in my rlo
...

The first part of the .rlo file, including the first script where I
assign the xml data to variables, is:
[start copy]

	<LO templateData="FileLocation + 'setup.xml'" defaultSize="14"
statusBarColour="0x00529B" defaultFont="Verdana" stageSize="800,605"
stageColour="0xD4E1EE" name="DepositPro Admin">
		<SCR name="setup"><![CDATA[// setup.xml is read into the
templateData object, which contains all
// the data from the xml file. The quiz node contains all of the test
// information (questions, answers, which is correct).

// get course info from xml file
courseInfo = templateData.course[0];

// get setup info
courseSetup = courseInfo.setup[0];

// productName
productName = courseSetup.product[0];

// set course title
courseTitle = courseSetup.title[0];

// set course id
sku = courseSetup.sku[0];

// set passing grade, must equal or exceed to pass test
passingGrade = courseSetup.passingGrade[0];
//debug(passingGrade);

// The pool of questions may vary in length, but only quesCount will be
selected.
quesCount = courseSetup.questionCount[0]; // the number of test
questions to be presented.


//debug(quesCount);

// The quiz data will be randomized so the order of questions will be
// different each time the test is taken.
quizData = courseInfo.quiz[0];

// create the right number of questions
icon.parentNode.lastChild.previousSibling.childNodes[12].childNodes[3].c
hildNodes[1].duplicate(quesCount - 1);

quizData.question.randomize(); // randomize the list of question.


// We need an array to store the results in so we can score
tracking = new Array();

// we also need to keep track of which pages have been built
built = new Array();

// and keep track of which answers the user chose
answers = new Array();

// set security to allow access to scripts in our domain.
System.security.allowDomain('*.harlandds.com');
System.security.allowDomain('localhost');

// initialize lesson complete variables
overviewComplete = false;
lesson1complete = false;
lesson2complete = false;
lesson3complete = false;
lesson4complete = false;
lesson5complete = false;
lesson6complete = false;
quizComplete = false;

// create array with HTML entities as the key and the unicode equivalent
as the value
HTMLentities = Array();

HTMLentities["&nbsp;"]   = "\u00A0"; // non-breaking space
HTMLentities["&iexcl;"]  = "\u00A1"; // inverted exclamation mark
HTMLentities["&cent;"]   = "\u00A2"; // cent sign
HTMLentities["&pound;"]  = "\u00A3"; // pound sign
HTMLentities["&curren;"] = "\u00A4"; // currency sign
HTMLentities["&yen;"]    = "\u00A5"; // yen sign
HTMLentities["&euro;"]   = "\u20AC"; // Euro sign
HTMLentities["&brvbar;"] = "\u00A6"; // broken vertical bar (|)
HTMLentities["&sect;"]   = "\u00A7"; // section sign
HTMLentities["&uml;"]    = "\u00A8"; // diaeresis
HTMLentities["&copy;"]   = "\u00A9"; // copyright sign
HTMLentities["&reg;"]    = "\u00AE"; // registered sign
HTMLentities["&trade;"]  = "\u2122"; // trademark sign
HTMLentities["&deg;"]    = "\u00B0"; // degree sign
HTMLentities["&plusmn;"] = "\u00B1"; // plus-minus sign
HTMLentities["&sup1;"]   = "\u00B9"; // superscript one
HTMLentities["&sup2;"]   = "\u00B2"; // superscript two
HTMLentities["&sup3;"]   = "\u00B3"; // superscript three
HTMLentities["&acute;"]  = "\u00B4"; // acute accent
HTMLentities["&micro;"]  = "\u00B5"; // micro sign
HTMLentities["&frac14;"] = "\u00BC"; // vulgar fraction one quarter
HTMLentities["&frac12;"] = "\u00BD"; // vulgar fraction one half
HTMLentities["&frac34;"] = "\u00BE"; // vulgar fraction three quarters
HTMLentities["&iquest;"] = "\u00BF"; // inverted question mark
HTMLentities["&Agrave;"] = "\u00C0"; // Latin capital letter A with
grave
HTMLentities["&Aacute;"] = "\u00C1"; // Latin capital letter A with
acute
HTMLentities["&Acirc;"]  = "\u00C2"; // Latin capital letter A with
circumflex
HTMLentities["&Atilde;"] = "\u00C3"; // Latin capital letter A with
tilde
HTMLentities["&Auml;"]   = "\u00C4"; // Latin capital letter A with
diaeresis
HTMLentities["&Aring;"]  = "\u00C5"; // Latin capital letter A with ring
above
HTMLentities["&AElig;"]  = "\u00C6"; // Latin capital letter AE
HTMLentities["&Ccedil;"] = "\u00C7"; // Latin capital letter C with
cedilla
HTMLentities["&Egrave;"] = "\u00C8"; // Latin capital letter E with
grave
HTMLentities["&Eacute;"] = "\u00C9"; // Latin capital letter E with
acute
HTMLentities["&Ecirc;"]  = "\u00CA"; // Latin capital letter E with
circumflex
HTMLentities["&Euml;"]   = "\u00CB"; // Latin capital letter E with
diaeresis
HTMLentities["&Igrave;"] = "\u00CC"; // Latin capital letter I with
grave
HTMLentities["&Iacute;"] = "\u00CD"; // Latin capital letter I with
acute
HTMLentities["&Icirc;"]  = "\u00CE"; // Latin capital letter I with
circumflex
HTMLentities["&Iuml;"]   = "\u00CF"; // Latin capital letter I with
diaeresis
HTMLentities["&ETH;"]    = "\u00D0"; // Latin capital letter ETH
HTMLentities["&Ntilde;"] = "\u00D1"; // Latin capital letter N with
tilde
HTMLentities["&Ograve;"] = "\u00D2"; // Latin capital letter O with
grave
HTMLentities["&Oacute;"] = "\u00D3"; // Latin capital letter O with
acute
HTMLentities["&Ocirc;"]  = "\u00D4"; // Latin capital letter O with
circumflex
HTMLentities["&Otilde;"] = "\u00D5"; // Latin capital letter O with
tilde
HTMLentities["&Ouml;"]   = "\u00D6"; // Latin capital letter O with
diaeresis
HTMLentities["&Oslash;"] = "\u00D8"; // Latin capital letter O with
stroke
HTMLentities["&Ugrave;"] = "\u00D9"; // Latin capital letter U with
grave
HTMLentities["&Uacute;"] = "\u00DA"; // Latin capital letter U with
acute
HTMLentities["&Ucirc;"]  = "\u00DB"; // Latin capital letter U with
circumflex
HTMLentities["&Uuml;"]   = "\u00DC"; // Latin capital letter U with
diaeresis
HTMLentities["&Yacute;"] = "\u00DD"; // Latin capital letter Y with
acute
HTMLentities["&THORN;"]  = "\u00DE"; // Latin capital letter THORN
HTMLentities["&szlig;"]  = "\u00DF"; // Latin small letter sharp s =
ess-zed
HTMLentities["&agrave;"] = "\u00E0"; // Latin small letter a with grave
HTMLentities["&aacute;"] = "\u00E1"; // Latin small letter a with acute
HTMLentities["&acirc;"]  = "\u00E2"; // Latin small letter a with
circumflex
HTMLentities["&atilde;"] = "\u00E3"; // Latin small letter a with tilde
HTMLentities["&auml;"]   = "\u00E4"; // Latin small letter a with
diaeresis
HTMLentities["&aring;"]  = "\u00E5"; // Latin small letter a with ring
above
HTMLentities["&aelig;"]  = "\u00E6"; // Latin small letter ae
HTMLentities["&ccedil;"] = "\u00E7"; // Latin small letter c with
cedilla
HTMLentities["&egrave;"] = "\u00E8"; // Latin small letter e with grave
HTMLentities["&eacute;"] = "\u00E9"; // Latin small letter e with acute
HTMLentities["&ecirc;"]  = "\u00EA"; // Latin small letter e with
circumflex
HTMLentities["&euml;"]   = "\u00EB"; // Latin small letter e with
diaeresis
HTMLentities["&igrave;"] = "\u00EC"; // Latin small letter i with grave
HTMLentities["&iacute;"] = "\u00ED"; // Latin small letter i with acute
HTMLentities["&icirc;"]  = "\u00EE"; // Latin small letter i with
circumflex
HTMLentities["&iuml;"]   = "\u00EF"; // Latin small letter i with
diaeresis
HTMLentities["&eth;"]    = "\u00F0"; // Latin small letter eth
HTMLentities["&ntilde;"] = "\u00F1"; // Latin small letter n with tilde
HTMLentities["&ograve;"] = "\u00F2"; // Latin small letter o with grave
HTMLentities["&oacute;"] = "\u00F3"; // Latin small letter o with acute
HTMLentities["&ocirc;"]  = "\u00F4"; // Latin small letter o with
circumflex
HTMLentities["&otilde;"] = "\u00F5"; // Latin small letter o with tilde
HTMLentities["&ouml;"]   = "\u00F6"; // Latin small letter o with
diaeresis
HTMLentities["&oslash;"] = "\u00F8"; // Latin small letter o with stroke
HTMLentities["&ugrave;"] = "\u00F9"; // Latin small letter u with grave
HTMLentities["&uacute;"] = "\u00FA"; // Latin small letter u with acute
HTMLentities["&ucirc;"]  = "\u00FB"; // Latin small letter u with
circumflex
HTMLentities["&uuml;"]   = "\u00FC"; // Latin small letter u with
diaeresis
HTMLentities["&yacute;"] = "\u00FD"; // Latin small letter y with acute
HTMLentities["&thorn;"]  = "\u00FE"; // Latin small letter thorn
HTMLentities["&yuml;"]   = "\u00FF"; // Latin small letter y with
diaeresis
HTMLentities["&ndash;"]  = "\u2013"; // N-dash
HTMLentities["&mdash;"]  = "\u2014"; // M-dash
HTMLentities["&quot;"]   = "\u0022"; // Quotation mark
HTMLentities["&amp;"]    = "\u0026"; // Ampersand
HTMLentities["&lt;"]     = "\u003C"; // Less-than sign
HTMLentities["&gt;"]     = "\u003E"; // Greater-than sign
HTMLentities["&radic;"]  = "\u221A"; // Square root symbol
HTMLentities["&infin;"]  = "\u221E"; // Infinity symbol
HTMLentities["&loz;"]    = "\u25CA"; // Lozenge shape
HTMLentities["&spades;"] = "\u2660"; // Spade suit
HTMLentities["&clubs;"]  = "\u2663"; // Club suit / shamrock
HTMLentities["&hearts;"] = "\u2665"; // Heart suit / valentine
HTMLentities["&diams;"]  = "\u2666"; // Diamond suit
HTMLentities["&larr;"]   = "\u2190";  // Leftwards arrow
HTMLentities["&uarr;"]   = "\u2191";  // Upwards arrow
HTMLentities["&rarr;"]   = "\u2192";  // Rightwards arrow
HTMLentities["&darr;"]   = "\u2193";  // Downwards arrow
HTMLentities["&harr;"]   = "\u2194";  // Left Right arrow
HTMLentities["&crarr;"]  = "\u21B5";  // Downwards arrow with corner
leftwards (carriage return)
HTMLentities["&lArr;"]   = "\u21D0";  // Leftwards double arrow
HTMLentities["&uArr;"]   = "\u21D1";  // Upwards double arrow
HTMLentities["&rArr;"]   = "\u21D2";  // Rightwards double arrow
HTMLentities["&dArr;"]   = "\u21D3";  // Downwards double arrow
HTMLentities["&hArr;"]   = "\u21D4";  // Left Right double
arrow]]></SCR>

[end copy]

If the full .rlo file is needed, I can provide that, but it's 432KB.

The setup.xml file looks like (an abbreviated version, <quiz> contains
more questions, there are both a </quiz> and </course> closing tags
towards the end of the full file):
[start copy]
<course>

<setup>

<!-- 

This section supplies basic setup information about the course/exam: 

  product = Product Name
  title = Course Name
  sku = SKU (item number from price book)
  passingGrade = Percentage of correct answers needed to pass exam
  questionCount = Number of questions to be presented to user in the
final test

-->

  <product>DepositPro</product>
  <title>Admin</title>
  <sku>1007</sku>
  <passingGrade>80</passingGrade>
  <questionCount>20</questionCount>

</setup>


<quiz>

  <!-- Lesson 1 -->

  <question lesson="1">
    <prompt>What section of General System Setup allows you to establish
access rights to various levels of program use?</prompt>
    <answer correct="false">Tools > Security</answer>
    <answer correct="false">File > View Licenses</answer>
    <answer correct="false">General > Institution Setup</answer>
    <answer correct="true">Personnel > Access Groups</answer>
    <answer correct="false">Libraries > Financial Institution</answer>
  </question>

[end copy]

But I don't believe the xml file is the problem, it seems to me to be a
problem with the templateData="FileLocation + 'setup.xml'" part in the
.rlo file. Looks okay, but acts like the 'setup.xml' part is missing.

Paul

> -----Original Message-----
> From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-
> bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
> Sent: Wednesday, July 07, 2010 2:36 PM
> To: Xerte list
> Subject: RE: [Xerte] Having problems with Xerte 2.10 not opening xml
> file
> 
> 
> >I've tried replacing the xml file with another from a working course,
> and also with just a bare-bones xml file, but it makes no difference.
> 
> 
> 
> And vice versa?
> 
> "Broken" xml into a working directory?
> 




More information about the Xerte mailing list