0 Favourites

Set questions from xml to show up in the middle of the game

  • Hi

    I am making a game and after some time it will be interupted by a question. The user will answer it, continue to play, a new one will come up after some time etc

    I want to set in my textboxes questions and answers from an xml file.

    I want to count the number of questions and add their number to a variable

    I want to shuffle answers and questions every time, but i dont want them to show up more than one time until the user losses (no more lives or time)

    I want to set the algorithm to check if the question is right (in the xml) and procceed

    my xml structure is like this

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

    <questions>

    <question id=""1"" text=""blah blah"">

    <answer qid=""2"" correct=""true"">a</answer>

    <answer qid=""3"" correct=""false"">b</answer>

    <answer qid=""4"" correct=""false"">c</answer>

    <answer qid=""5"" correct=""false"">d</answer>

    </question>

    </questions>

    I saw all the tutorials but i cant do what i want so far.

    Thanks in advance

  • ps

    The xml is loaded with ajax, set to xml with ajax.lastdata, but after this im completly lost (especially with the xml files in general)

  • Try RexRainbow's Hash plugin.

    We use JSON inputs and parse it with Rex's Hash plugin, but I believe it accepts XML too.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Thanks

    Anyway, i changed my xml to this and now it works like a charm

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

    <appquestions>

    <question>blah blah</question>

    <answer id="11" correct="true">a</answer>

    <answer id="12" correct="false">b</answer>

    <answer id="13" correct="false">c</answer>

    <answer id="14" correct="false">d</answer>

    <question>duh duh duh</question>

    <answer id="21" correct="true">2a</answer>

    <answer id="22" correct="false">2b</answer>

    <answer id="23" correct="false">2c</answer>

    <answer id="24" correct="false">2d</answer>

    </appquestions>

    The only think that i need to do now is to load the next question after every one displayed

    and to specify wich one is the correct

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread sticky
763 305,728
asikanddestroy's avatar
asikanddestroy
Unread hot topic
353 32,112
yojona's avatar
yojona
Unread hot topic
232 177,694
Tetriser's avatar
Tetriser