<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:m =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD><TITLE>Having problems duplicating nodes</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16735" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: SimSun;
}
@font-face {
        font-family: SimSun;
}
@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: @SimSun;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 72.0pt 72.0pt 72.0pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman","serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
P.msochpdefault {
        FONT-SIZE: 10pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman","serif"; mso-style-name: msochpdefault; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
LI.msochpdefault {
        FONT-SIZE: 10pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman","serif"; mso-style-name: msochpdefault; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
DIV.msochpdefault {
        FONT-SIZE: 10pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: "Times New Roman","serif"; mso-style-name: msochpdefault; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.emailstyle17 {
        COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-name: emailstyle17
}
SPAN.EmailStyle19 {
        COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-reply
}
.MsoChpDefault {
        FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-GB vLink=purple link=blue>
<DIV dir=ltr align=left>
<DIV dir=ltr align=left><SPAN class=094124122-09122008><FONT face=Verdana><FONT
color=#0000ff><FONT size=2>Making progress ... but not using your
suggestion.<SPAN class=514233023-09122008> I came up with a different
way.</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=094124122-09122008><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=094124122-09122008><FONT face=Verdana
color=#0000ff size=2>I started to think that my lesson1quiz array was not being
appended to, but overwritten, when using the following code:</FONT></SPAN></DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New"
size=2>lesson1Counter = 0; // counter for number of
questions</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New" size=2>// loop
through all questions to get lesson 1<BR>for (i = 0; i <
quizData.question.length; i++) {</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New" size=2> if
(quizData.question[i].lesson == '1') {<BR> <BR>
<FONT color=#ff0000>lesson1quiz[lesson1Counter].question =
quizData.question[i];<BR></FONT>
lesson1Counter++;</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New" size=2> } //
end of quizData.question[i] conditional</FONT></SPAN></DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New"
size=2>}</FONT></SPAN></DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff size=2>but
by changing it to:</FONT></SPAN></DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New"
size=2>lesson1Counter = 0; // counter for number of
questions</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New" size=2>// loop
through all questions to get lesson 1<BR>for (i = 0; i <
quizData.question.length; i++) {</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New" size=2> if
(quizData.question[i].lesson == '1') {<BR> <BR>
<FONT
color=#008000>lesson1quiz.push(quizData.question[i]);</FONT><BR>
lesson1Counter++;</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New" size=2> } //
end of quizData.question[i] conditional</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face="Courier New"
size=2>}</FONT></SPAN></DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff size=2>and
then changing the references that display the questions to
{lesson1quiz[questIndex].prompt}, I am getting the questions and answers to
display within the individual lesson. My only problem now is that if the user
tries to navigate back within the question framework, the page appears blank.
questIndex is set by this statement:</FONT></SPAN></DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2>questIndex = icon.parentNode.index() - 1;</FONT></SPAN></DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff size=2>The
page that the questIndex code is on is the first page of my lesson1quiz
framework, with an Entry Pane preceeding it. Any thoughts on
that?</FONT></SPAN></DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2>Again, thanks for all the help. And a special thanks to Dave B, who
offered to take a look at my file and offer suggestions (even though I didn't
take him up on it).</FONT></SPAN></DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=094124122-09122008><FONT face=Verdana color=#0000ff
size=2>Paul</FONT></SPAN></DIV>
<DIV dir=ltr align=left><BR></DIV></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Julian
Tenney<BR><B>Sent:</B> Tuesday, December 09, 2008 1:39 AM<BR><B>To:</B> Xerte
discussion list<BR><B>Subject:</B> RE: [Xerte] Having problems duplicating
nodes<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">I’d
use decision icons, set to randomUnused to present the questions – then
there’s no need to randomise your arrays. Pick out each question using
icon.parentNode.index() or similar, with a page on the deision for each
question – but you’ll make those with duplicate(). You will still need
to build some arrays for sec1Questions, sec2Questions though. I might be
tempted to make those arrays of xmlNodes rather than the bits of templateData.
You can get the pre-XML2Object xml from your file with the variable extXML.
I’d loop over that, picking out your nodes and adding them to your arrays,
then use those arrays to drive your code.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">HTH?<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">J<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<DIV>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><B><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Julian
Tenney<BR><B>Sent:</B> Monday, December 08, 2008 10:52 PM<BR><B>To:</B> Xerte
discussion list<BR><B>Subject:</B> RE: [Xerte] Having problems duplicating
nodes<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><o:p> </o:p></P>
<DIV id=idOWAReplyText56773>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'">how
fussy are you about the .xml format?</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">could you work
with:</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"><questions></SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> <question
section="1"></SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
<!--data for question here --></SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
</question></SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
<!--etc--></SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"></questions></SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">and generally, what
does the .rlo need to do? Present a framework of content for each section, and
then show the quiz (on the last page?). Do the page types
vary?</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">and then a final
section framework summarises and then shows all questions,
randomised?</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><o:p> </o:p></P>
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center"
align=center>
<HR align=center width="100%" SIZE=2>
</DIV>
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 36pt; MARGIN-RIGHT: 0cm; mso-margin-top-alt: 0cm"><B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
xerte-bounces@lists.nottingham.ac.uk on behalf of Paul Swanson<BR><B>Sent:</B>
Mon 08/12/2008 19:15<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B>
RE: [Xerte] Having problems duplicating nodes</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Commenting
out the two randomQuizData lines doesn't change anything. I've moved the
statement that randomizes the questions to the button that launches the final
test, rather than have it in the setup script.</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Maybe
I'm just going about this entirely the wrong way. What I want to accomplish is
to have all my test questions within one setup.xml file. I have six lessons,
and some of the questions will also be presented at the end of each lesson. So
I need to parse which questions are for lesson 1, which are for lesson 2, etc.
Once the student has completed all of the lessons, they must take a test to
pass the course. This test will be comprised of all of the questions for all
of the lessons, with the questions randomized. Am I on the right track with
what I've been trying to do, or do I need to take a different
approach?</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Paul</SPAN><o:p></o:p></P>
<BLOCKQUOTE
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; MARGIN: 5pt 0cm 5pt 3.75pt; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><o:p> </o:p></P>
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center"
align=center><SPAN lang=EN-US>
<HR align=center width="100%" SIZE=2>
</SPAN></DIV>
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 36pt; MARGIN-RIGHT: 0cm; mso-margin-top-alt: 0cm"><B><SPAN
lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Julian
Tenney<BR><B>Sent:</B> Thursday, December 04, 2008 11:32 PM<BR><B>To:</B>
Xerte discussion list<BR><B>Subject:</B> RE: [Xerte] Having problems
duplicating nodes</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P>
<DIV id=idOWAReplyText25401>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'">You
are creating references to the same array.</SPAN><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">quizData =
templateData.quiz[0]; // non-randomized questions</SPAN><o:p></o:p></P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P></DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">randomQuizData =
templateData.quiz[0]; // for randomized
questions<BR>randomQuizData.question.randomize(); // randomize the list of
questions</SPAN><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">.</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">quizData.question
is also randomised.</SPAN><o:p></o:p></P></DIV></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><o:p> </o:p></P>
<DIV class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center"
align=center> <o:p></o:p></DIV></DIV></BLOCKQUOTE></DIV></DIV></BLOCKQUOTE></BODY></HTML>