Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4243958
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:38:44+00:00 2026-05-21T03:38:44+00:00

I want to make a template for questionnaires in Flex 3, that reads dynamic

  • 0

I want to make a template for questionnaires in Flex 3, that reads dynamic XML file and creates a questionnaire. An exemplary XML:

<test>

<question>
  <q>Who was born earlier?</q>
  <answer value="true">Vincent van Gogh</answer>
  <answer value="false">Piet Mondrian</answer>
</question>

<question>
  <q>What color is Dutch national flag?</q>
  <answer value="false">blue, red and green</answer>
  <answer value="false">green, red and white</answer>
  <answer value="true">blue, red and white</answer>
</question>

<question>
  <q>Which season is the coldest?</q>
  <answer value="false">fall</answer>
  <answer value="true">winter</answer>
  <answer value="false">spring</answer>
  <answer value="false">summer</answer>
</question>

</test>

The amount of questions and answers may vary. The plan was to use nested repeaters with radio buttons (one for the questions and then another inside for the answers). I can save all question.q to an ArrayCollection, but how should I handle my answers, if there are few of them with the same “answer” tag within each question? And how can I access “value” property of each, to check if the user chose correct answer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T03:38:45+00:00Added an answer on May 21, 2026 at 3:38 am

    You need to create a domain model from the XML. Don’t skip this step because it’s easy to do and more straightforward than you think. Start by creating a simple class:

    public class Question {
       public var question : String;
       public var answers : ArrayCollection = new ArrayCollection();
    
       public Question( node : XML ) {
          question = node.q.text();
          for each( var answer : XML in question.answer ) {
              answers.addItem( new Answer( answer ) );
          }
       }
    }
    
    public class Answer {
       public var text : String;
       public var correct : Boolean;
    
       public Answer( node : XML ) {
          text = node.text();
          correct = Boolean(node.@value);
       }
    }
    

    Populate an ArrayCollection of your nodes like so:

    var questions = new ArrayCollection();
    for each( var node : XML in xml.question ) {
       questions.addItem( new Question( node ) );
    }
    

    That’s roughly it. Then your questions array can serve as the dataProvider for the repeater. And question.answers can serve as the repeater for the inner repeater.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

so i want to make a code, that creates a binary tree, that holds
So i want to make a code, that creates a binary tree, that holds
I want to make a custom file template for .cpp and .h files in
I want to know what language can make my template being dynamic. Example HTML
I want to make a dynamic filling list that fill the screen what ever
Let's imagine I want to make a templated function that returns the first element
I want to make an etag that matches what Apache produces. How does apache
I want to make a table in SqlServer that will add, on insert, a
I want to make an entity that has an autogenerated primary key, but also
How do I create another project template in XCode ? I want to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.