Solved

getting external data...

Posted on 2006-11-08
4
165 Views
Last Modified: 2010-08-05
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
Comment
Question by:sirbounty
  • 2
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 17897748
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
 
LVL 67

Author Comment

by:sirbounty
ID: 17898910
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
 
LVL 48

Expert Comment

by:AlexFM
ID: 17900716
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
 
LVL 67

Author Comment

by:sirbounty
ID: 17905742
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question