Solved

getting external data...

Posted on 2006-11-08
4
167 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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