iBooks Author: Creating Review questions with XML
Summary
In iBooks Author, you can use XML to create a set of questions for the Review widget.
Products Affected
iBooks Author
In a plain text editor, such as TextEdit, you can create an XML document containing questions and answers for a Review widget in iBooks Author.
Use these elements to create your document:
|
Element |
Attributes |
Notes |
|
review |
|
The contents of your Review widget should be contained within this element. |
|
question |
type |
These types are supported:
|
|
text |
alt |
The text of your question should be contained within this element. Optional: Use "alt" to specify different accessibility text. |
|
main-image |
src alt |
Specify the filename of the main image in your question. Not used for multiple-choice or multiple-choice-images. Optional: Use "alt" to specify accessibility text. |
|
choice |
correct-answer src target-x target-y alt target-alt
|
|
|
line-break |
|
This element does not have any content, so empty-element syntax is recommended. It specifies a line break in question or answer text. |
For example, a Review with a multiple-choice-images question and a drag-label-to-target question may look like this:
<review> <question type="multiple-choice-images"> <text>Which of the following do <line-break />all living things need to survive?</text> <choice image-src="oxygen.gif" alt="Oxygen" /> <choice image-src="water.jpg" alt="Water" correct-answer="yes" /> <choice image-src="carbondioxide.jpeg" alt="Carbon Dioxide" /> </question> <question type="drag-label-to-target"> <text>Drag the labels to the appropriate area of the atom</text> <main-image src="atom.jpg" alt="Picture of an atom" /> <choice target-x="0.23" target-y="0.34">Neutron</choice> <choice target-x="61" target-y="75">Electron</choice> <choice target-x="0.12" target-y="0.34">Proton</choice> </question> </review>
Once you have created your XML document:
- Save your file as a plain-text document with a .review file extension in a folder.
- Copy each image used in your Review widget to the same folder that contains the .review file.
- Drag the .review file in to your iBooks Author book where you would like the review to appear.
If desired, you can continue editing your Review widget with the Widget inspector in iBooks Author.
Twitter
Facebook