[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

getting external data...

I'm working on something - just started on it - that I hope to be able to use for displaying quiz questions.

Currently, I have a form with a label and a radio button.  I'm thinking of just creating a text file with the questions and answers, so I can interchange these and run different quizzes based upon the file supplied.

I foresee a couple of snags though, so I thought I'd get some guidance here... :^)

First of all, I have a single label for the question, but some of my questions are in the form of
This is the scenario
  > This has been done
  > This has been done
  > This has been done
What comes next?

So, I'm not sure that I can accomplish this correctly with a simple text file and still have the question laid out with the bulleted list properly...any suggestions on that?

Secondly, some questions will have multiple answers - and some will have more selections than others.  Most will default to four (A-D), but some may offer as much as 5 or 6 options.  So, I was thinking of just having the one radio button, and just create a new control dynamically for each one I need.

Then in my text file, I would list the correct answer along with the question.  My text file is something like this:

Q:  This is the question (1) '--> meaning element 1, in this case Option2, is the correct answer
A:  Option1 (or element 0)
A:  Option2
A:  Option3
[etc]
E:  This would be the explanation, if there is one

Then the text would just loop over and over.  I'm just not certain this is the right direction to take this project though - any words of advice?  Presumably I could just have (13) for the 'answers' if there are multiple, but does that have other potential problems?
0
sirbounty
Asked:
sirbounty
  • 2
  • 2
1 Solution
 
AlexFMCommented:
I think that XML format is the way to keep such information. Typical question can look like this:

<Question Type="SingleSelection" Answer="3" Text="5 + 10 = ?">
    <Choice>100</Choice>
    <Choice>0</Choice>
    <Choice>15</Choice>
</Question>

Maybe there are questions with multiple answers, questions with "Other" answers requiring free text reply etc. XML format looks flexible enough to build such model. Except of this, possibly questions can be kept in some hierarchy, like:

<General questions>
    <Part 1>
      <Question> ... </Question>
      <Question> ... </Question>
    </Part 1>
    <Part 2>
      <Question> ... </Question>
      <Question> ... </Question>
    </Part 2>
</General questions>
<Bonus>
    <Question> ... </Question>
    <Question> ... </Question>
</Bonus>

This can be done only in XML file. Maybe you don't think about too complicated structure, but text file in any case looks like simplified solution.
Top level structure can be shown as tree. Selecting specific question shows it in details. For each question type you can have set of controls, for example:
Single selection - group of radio buttons.
Multiple selection - check boxes.
Textbox for free text.
etc.
0
 
sirbountyAuthor Commented:
Hmm - maybe this is going to be more difficult than I imagined...

Here, you're suggesting that the backend files that are read, are in xml format?
0
 
AlexFMCommented:
Yes. BTW, you can define XML schema for such files, which improves file validation - file which doesn't match schema, throws exception when programs tries to open it.
However, if you want to implement simplest case, text file is OK. I just tried to imagine possible cases for this task.
0
 
sirbountyAuthor Commented:
I decided to go with a database backend (MS Access) - I'm a bit more familiar and I need the practice...
I may have to ask another question on it later though.  Thanx for the help.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now