Solved

getting external data...

Posted on 2006-11-08
4
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

691 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