KAAU

I am developing an ITS System , in the Evaluation Stage , can someone help me with the outlines for developing the evaluation :

What is the most approciate way for storing the Questions and Answers : Multiple Choices , TRUE / FALSE , and any other Questions and Answers form

and ...

What is the best way for Representing the Questions and Answers to the Learner

and ... Finally

Thank you so much :)



Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

Ken_L

If all have access to a SQL server create tables that house the questions and answers - one table for each. The question table should reference the correct answer in the answers table. This way you can have multiple possible answers for the same question.

If the users do not have access to a SQL DB, use XML

As for your best was to represent; that you have to ask the users. Almost every test and practice test I have seen is the same, whether web based or desktop based. That is, one question, set of answers with checkboxes. An index and an review.






Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

KAAU

Ken_L wrote:

If all have access to a SQL server create tables that house the questions and answers - one table for each. The question table should reference the correct answer in the answers table. This way you can have multiple possible answers for the same question.

If the users do not have access to a SQL DB, use XML

As for your best was to represent; that you have to ask the users. Almost every test and practice test I have seen is the same, whether web based or desktop based. That is, one question, set of answers with checkboxes. An index and an review.

mmmm i am not sure i understood that , you mean one table for the questions and another table for the answers, and to make the questions table point to the answers table , how can i do it in microsoft access and in the programming with visual C#

all this is a desktop based ( standalone )





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

Ken_L

DO the same thing in Access as I said in SQL.

Create a table named questions. In the table have and ID, Question, and a correct response. The correct response should point just be a pointer to the correct answer ID in the Answers table. The Answers table should be ID, Text, Question#. Question# should be the question the answer corresponds with.






Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

cverdon

Hi,

You need something like this:

Table Questions:
QuestionId
QuestionText

Table Answers:
AnswerId
QuestionId
AnswerText
IsCorrectAnswer

To display the questionnaire, select all the data from the table questions and show all the answers linked to the question (ie Questions.QuestionId = Answers.QuestionId).

To validate the right answer you use the information in the IsCorrectAnswer field.

Good luck,
Charles





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

KAAU

cverdon wrote:

Hi,

You need something like this:

Table Questions:
QuestionId
QuestionText

Table Answers:
AnswerId
QuestionId
AnswerText
IsCorrectAnswer

To display the questionnaire, select all the data from the table questions and show all the answers linked to the question (ie Questions.QuestionId = Answers.QuestionId).

To validate the right answer you use the information in the IsCorrectAnswer field.

Good luck,
Charles

thank you so much charles :)





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

KAAU

cverdon wrote:

Hi,

You need something like this:

Table Questions:
QuestionId
QuestionText

Table Answers:
AnswerId
QuestionId
AnswerText
IsCorrectAnswer

To display the questionnaire, select all the data from the table questions and show all the answers linked to the question (ie Questions.QuestionId = Answers.QuestionId).

To validate the right answer you use the information in the IsCorrectAnswer field.

Dear charles back to you again

i am not sure about the field ( IsCorrectAnswer ) how can i use it , i mean i am getting the answer and i should compare it to the ( AnswerText ) if it matches then the answer is correct , if it doesn't the the answer is wrong , why and how i have to use the field ( IsCorrectAnswer ) and thank you so much again





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

cverdon

Well the schema above assumed that is was a multiple answer question where the user just pick one or a combination of answers. In that situation you just have to check if the answer is correct by verifying the IsCorrectAnswer field.

From your description it sounds like users have to type their own answers to the question. In that case, you don't need the Answers table and you just need a CorrectAnswer field in the question table to validate the user's answer against.

Charles





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

KAAU

okay i have many kind of questions ( True/False , Multiple Choices, Fill in Blank , etc )

let me tell you what i am doing , see if i am on the right path !

i have combined the questions and answers tables to be all in one table

which have the following fields

question_ID

question_type

question_text

answer_text

feed_back

now for example ( the TRUE/FALSE questions )

1 - show ( question_text ) from the table :

1 - Question

* True

* False

2 - get the ( user answer )

3 - compare the ( user answer ) with the ( answer_text )

4 - if Comparison is true ----------> show message ( answer is correct )

else show message ( answer is false ) and show ( feed_back )

is that fine





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

cverdon

Well it would be a better database design to keep the answer table separate from the question table:

Table Questions:
QuestionId
QuestionType ("M1" Multiple - choose one, "M" Multiple - choose one or more, "TF" true/false, "FB" Fill blank)
QuestionText
CorrectAnswer - TF and FB : correct answer text
Feedback

Table Answers:
AnswerId
QuestionId
AnswerText
IsCorrectAnswer : M1 and M: this answer is correct

The algo would be:

  1. Get the Question record
  2. Use a different user control depending on the question type
  3. The user control for the types M1 and M request the list of answers for this questionId anddynamicly build the ui for the answers
  4. The user control validates the user's answer
  5. The main form show the mesage box and the feedback if needed.

Charles





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

KAAU

okay charles let's go through this one by one

to show the question to the user i am using the DataReader :

I'm using a label control to show the question text

if i tried this line

while (MyReader.Read())

{

label2.Text = MyReader["Question_Text"].ToString();

}

it only shows the last recod ( the last question in the table ) !!

and if i have a button for ( next question ) what is the code should be behind this button to get the next question

forgive me my silly questions , i am newbie in C# !!





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

cverdon

Why are you doing it the harder way

Use a dataset instead. Project/Add new item/Dataset. The dataset will become the data layer of your application.

In the dataset designer, drag all your tables from the server explorer. The server explorer is accessed from View/Server Explorer. You can add a new data connection to your database (sql server, access, odbc...). Save and compile.

Now in the Form_Load do something like

questionTableAdapter.Fill(evaluationDataset.Questions);
currentPosition = 0;
ShowQuestion();

void ShowQuestion()
{
label2.Text = evaluationDataset.Questions.Rows[currentPosition].QuestionText;
}

And in the Next button you increment currentPosition and call ShowQuestion.

By the way you should really rename label2 to something meaningful and here's your code commented to show you why it does not work:

//for each record in the reader
while
(MyReader.Read())

{

//set the questiontext in label2

label2.Text = MyReader["Question_Text"].ToString();

}

So at the end of the loop, the question on the screen is the last question in the db.

Charles





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

KAAU

cverdon wrote:

void ShowQuestion()
{
label2.Text = evaluationDataset.Questions.Rows[currentPosition].QuestionText;
}

And in the Next button you increment currentPosition and call ShowQuestion.

okay i just did exactly what you told me !! now i can't find the ( QuestionsText) field !! and where should i put the variable ( currentPosition) so i can use it here !!

i am so sorry :(





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

cverdon

Well you have to replace QuestionText by the name you gave the field in the dataset designer. Question_Text

You can declare currentPosition as a member of the class. ie
private int currentPosition = 0;

Charles





Re: Visual C# Express Edition Questions / Answers : Evaluation Outlines !!!

KAAU

fields of the table should appear in the drop down list when i type dot ( . ) !!!

well i gave up the harder way to make a connection and add a dataset

let me tel you what i did

as you told me

from Project ---> Add new item ---> dataset ---- > evaluationDataSet

then i added a connection to the databse and i then dragged and dropped the tables and then build and run

and then i added a datasetAdapter

and from the tool box i add both ( evaluationDataset , evaluationDataAdapter)  to the form  , now everything is okay when i add the code but in that point i can't find the field ( Question_Text ) or any of the tables fields after

labels2.Text = evaluationDataSet.Questions.Rows[currentPosition]. -------------       here fields of the table don't appear in the intellisense