[Xerte] Xerte Dynamic Templates tutorial - clarification

Johnathan Kemp johnathan.kemp at cxstaffs.co.uk
Thu Jul 16 14:32:36 BST 2009


The tutorial ends with the creation of an xtp file which you then use by
opening it in Xerte.
 
What is missing is any instructions that would show you how to add your
template to the Xerte Page Templates or to Xerte Toolkits templates so
that you could use the templates that already exist and your own new
template in the same project.
 
Kind regards
 
Johnathan
 

Johnathan Kemp
IT Dev. Manager
Connexions Staffordshire
www.cxstaffs.co.uk <http://www.cxstaffs.co.uk/> 
01785 355714


 

 

________________________________

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Patrick
Lockley
Sent: 16 July 2009 14:21
To: Xerte discussion list
Subject: RE: [Xerte] Xerte Dynamic Templates tutorial - clarification



Does the tutorial have a part in out about making your template work on
toolkits?

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Johnathan
Kemp
Sent: 16 July 2009 14:23
To: Xerte discussion list
Subject: RE: [Xerte] Xerte Dynamic Templates tutorial - clarification

 

Thanks for all your help :-).

 

Anyone following the instructions in the help file or XerteDynamic
Templates.pdf file may find the following helpful when using the
tutorial.

 

By downloading the sample code and referring to it you should be able to
complete your fully working template. I will omit cosmetic stuff like x
and y settings and adding page titles

 

1. The help version of the tutorial omits a "prompt" node in the xml
file, this is shown in the pdf file version of the tutorial.

 

2. Learning Object - Setup

There is much more script than is shown in the tutorial - this includes
the defining of quizData and the setting up of arrays for

tracking

built

answers

 

3. options - protoOption - judge

The script shown omits the code to store the answer

 

4. options

I think the default for the "perpetual" value is 0 and this needs
setting to 1

 

5. options - protoOption

The tutorial does not show how values are set for "y" to cause each
option to appear below the previous one, and for "label" to select the
correct label for each option.

 

Kind regards

 

Johnathan

Johnathan Kemp
IT Dev. Manager
Connexions Staffordshire
www.cxstaffs.co.uk <http://www.cxstaffs.co.uk/> 
01785 355714

 

 

 

________________________________

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 16 July 2009 12:34
To: Xerte discussion list
Subject: RE: [Xerte] Xerte Dynamic Templates tutorial - clarification

Icon is the script icon you are excuting code in

Icon.nextSibling is the next icon 

Icon.nextSibling.firstChild is the first child of the next icon and so
on.

Icon.nextSibling.childNodes is an array of all the children

Icon.nextSibling.chidNodes[2] is th second child and so on.

 

TemplateData and quizData are probably the same thing.

 

Icon.parentNode.index() returns the index of the aprent Icon, so it will
be a question number, not the number or questions.

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Johnathan
Kemp
Sent: Thursday, July 16, 2009 11:52 AM
To: Xerte discussion list
Subject: RE: [Xerte] Xerte Dynamic Templates tutorial - clarification

 

I am sorry I did not make myself clear.

 

I understand that the reference to 'value'  was a variable and that
duplicate would result in duplication of the icon, what I was struggling
with was 

 

a) the apparent discrepancy between the code in the image which refers
to 

 

icon.nextSibling.childNodes[2]

 

and the code referred to in the accompanying text which refers to 

 

icon.nextSibling.firstChild 

 

b) trying to figure out what icon.nextSibling.childNodes[2] was actually
identifying in the document tree and why that was so.

 

Similarly I was struggling to figure out, by tracking back up the
document tree how it was that on page 11 in the pdf file (no page number
in the xerte help file, but it is in the section 5 create the template
logic section)

 

icon.ParentNode.index( ) -2          would return the number of
questions.

 

Also I was puzzled by the reference later in the same section to
quizData as I was not sure where this object had been defined.

Is it the case that since earlier we set templateDate to point to the
quiz.xml file that quizData is effectively the same as templateData?

 

I am trying not just to duplicate the actions in the tutorial but to
understand them, so that I can create my own templates.

 

Kind regards

 

Johnathan

Johnathan Kemp
IT Dev. Manager
Connexions Staffordshire
www.cxstaffs.co.uk <http://www.cxstaffs.co.uk/> 
01785 355714

 

 

 

________________________________

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 15 July 2009 20:20
To: Xerte discussion list
Subject: RE: [Xerte] Xerte Dynamic Templates tutorial - clarification

the parameter just describes how many times you want to duplicate the
icon - don't run it twice!

 

(value) is just a variable, a number, for how many times you want to
duplicate the icon.

 

________________________________

From: xerte-bounces at lists.nottingham.ac.uk on behalf of Johnathan Kemp
Sent: Wed 15/07/2009 17:02
To: Xerte discussion list
Subject: [Xerte] Xerte Dynamic Templates tutorial - clarification

 

 I am part way through the simple quiz example in the dynamic templates
tutorial as described in the document XerteDynamicTemplates.pdf

I am following through the example step by step and trying to ensure
that I understand the logic behind each step, so that I will then be
able to apply this to creating my own templates.

Can I seek clarification on the following points?

Page 10
The code uses icon.nextSibling.childNodes[2].duplicate(quesCount -1)
But the text refers to icon.nextSibling.firstChild.duplicate(value)

Is this a typing error? Are both statements required in the code?

Page 11
Why does icon.parentNode.index( ) - 2 = the number of questions?

Page 12
Where does the quizData object come from, there appears to be no
previous reference to it?

And a general question - is there a way of easily identifying which node
is being referenced at any time by an expression?
E.g. is there a way of echoing a value for
icon.nextSibling.firstChild.name or .value

I guess I am looking for any tricks you have picked up along the way
that aid you in debugging your template creation.

Kind regards

Johnathan Kemp
IT Dev. Manager
Connexions Staffordshire
www.cxstaffs.co.uk
01785 355714



This email and any files transmitted with it are confidential and are
intended solely for the use of the individual(s) or entity(s) to whom
they are addressed. All messages are monitored for virus, high risk
files and inappropriate content. As a result users should be aware that
this mail maybe accessed, read and the right is reserved to reject,
return, remove attachments or delete if considered to be inappropriate
or unsuitable. Liability cannot be accepted for any loss or damage
arising from this email (or any attachments) or from scripts or any
virus transmitted.



This communication represents the originator's personal views and
opinions, which do not necessarily reflect those of Connexions
Staffordshire. If you are not the original recipient or the person
responsible for delivering the email to the intended recipient, be
advised that you have received this email in error, and that any use,
dissemination, forwarding, printing, or copying of this email is
strictly prohibited. If you received this email in error, please
immediately reply to the sender or notify postmaster at cxstaffs.co.uk





Connexions Staffordshire Limited is registered in England No.4355170

Registered office: Foregate House, 70 Foregate Street, Stafford,
Staffordshire, ST16 2PX

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

________________________________

This email and any files transmitted with it are confidential and are
intended solely for the use of the individual(s) or entity(s) to whom
they are addressed. All messages are monitored for virus, high risk
files and inappropriate content. As a result users should be aware that
this mail maybe accessed, read and the right is reserved to reject,
return, remove attachments or delete if considered to be inappropriate
or unsuitable. Liability cannot be accepted for any loss or damage
arising from this email (or any attachments) or from scripts or any
virus transmitted. This communication represents the originator's
personal views and opinions, which do not necessarily reflect those of
Connexions Staffordshire. If you are not the original recipient or the
person responsible for delivering the email to the intended recipient,
be advised that you have received this email in error, and that any use,
dissemination, forwarding, printing, or copying of this email is
strictly prohibited. If you received this email in error, please
immediately reply to the sender or notify postmaster at cxstaffs.co.uk
Connexions Staffordshire Limited is registered in England No.4355170
Registered office: Foregate House, 70 Foregate Street, Stafford,
Staffordshire, ST16 2PX

________________________________

This email and any files transmitted with it are confidential and are
intended solely for the use of the individual(s) or entity(s) to whom
they are addressed. All messages are monitored for virus, high risk
files and inappropriate content. As a result users should be aware that
this mail maybe accessed, read and the right is reserved to reject,
return, remove attachments or delete if considered to be inappropriate
or unsuitable. Liability cannot be accepted for any loss or damage
arising from this email (or any attachments) or from scripts or any
virus transmitted. This communication represents the originator's
personal views and opinions, which do not necessarily reflect those of
Connexions Staffordshire. If you are not the original recipient or the
person responsible for delivering the email to the intended recipient,
be advised that you have received this email in error, and that any use,
dissemination, forwarding, printing, or copying of this email is
strictly prohibited. If you received this email in error, please
immediately reply to the sender or notify postmaster at cxstaffs.co.uk
Connexions Staffordshire Limited is registered in England No.4355170
Registered office: Foregate House, 70 Foregate Street, Stafford,
Staffordshire, ST16 2PX

This email and any files transmitted with it are confidential and are intended solely for the use of the individual(s) or entity(s) to whom they are addressed. All messages are monitored for virus, high risk files and inappropriate content. As a result users should be aware that this mail maybe accessed, read and the right is reserved to reject, return, remove attachments or delete if considered to be inappropriate or unsuitable. Liability cannot be accepted for any loss or damage arising from this email (or any attachments) or from scripts or any virus transmitted.

This communication represents the originator's personal views and opinions, which do not necessarily reflect those of Connexions Staffordshire. If you are not the original recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error, and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you received this email in error, please immediately reply to the sender or notify postmaster at cxstaffs.co.uk


Connexions Staffordshire Limited is registered in England No.4355170
Registered office: Foregate House, 70 Foregate Street, Stafford, Staffordshire, ST16 2PX
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20090716/7ead5fcd/attachment.html


More information about the Xerte mailing list