How do I Use XML attributes?

Just started using Construct 2? Post your questions here

Post » Thu Sep 11, 2014 9:41 am

Hi every one, sorry from my english I'm from spain. I'm making a multilingual quiz wich questions appair randomly. I'm storing texts from some XMLs, this is the structure:

<ques>
<q>question</q>
<op>option1</op>
<op>option2</op>
<op correct=true>option3</op>
<ques>

I want to use the atribute correct to set te correct answer because the correct answers is not always the third obviusly. How can I do that or is there an other way to make easier to set the correct question?

Thanks you every one
B
9
S
2
Posts: 13
Reputation: 601

Post » Thu Sep 11, 2014 2:27 pm

Here is an example of simple quiz depends on XML

I used this xml
<?xml version="1.0" encoding="utf-8"?>

<questions>
<question no="1">
<title>Capital of France</title>
<correct>3</correct>
<answer>Lyon</answer>
<answer>Marseille</answer>
<answer>Paris</answer>
</question>

<question no="2">
<title>3x2</title>
<correct>2</correct>
<answer>5</answer>
<answer>6</answer>
<answer>7</answer>
</question>
</questions>

If you change global variable you can skip to other questions
You do not have the required permissions to view the files attached to this post.
B
21
S
8
G
6
Posts: 177
Reputation: 8,134

Post » Thu Sep 11, 2014 8:29 pm

Thank you :)
B
9
S
2
Posts: 13
Reputation: 601


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 6 guests