473,686 Members | 2,318 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying a set of questions

Hi, I am using Visual C# window to dispaly a set of questions with their
answers. The users should be able to move to the next question by clicking on
next button. I am going to use only one panel to display one question and
move to next question. Can someone please help me with the codes on coding
"Next" button?
Thanks
--
Nejadian
Jun 27 '08 #1
16 2097

"Tammy Nejadian" <Ta***********@ discussions.mic rosoft.comwrote in message
news:16******** *************** ***********@mic rosoft.com...
Hi, I am using Visual C# window to dispaly a set of questions with their
answers. The users should be able to move to the next question by clicking
on
next button. I am going to use only one panel to display one question and
move to next question. Can someone please help me with the codes on
coding
"Next" button?
Thanks
You need to hook up a datagrid with horizontal and vertical bars to move up
and down the questions or left or right on a question, with all the
questions being asked on one screen maybe two the at most.

From an end-user standpoint, there is nothing worst than going through 100
screens of individual questions (one question per screen) because the
programmer couldn't come up with something else that was better.

All the end-user is going to say is "who wrote this thing".

Jun 27 '08 #2
<snip>

Mr. Arnold: regarding your comments:
From an end-user standpoint, there is nothing worst than going through 100
screens of individual questions (one question per screen) because the
programmer couldn't come up with something else that was better.
This is just plain bad advice and/or guidance. There are many good reasons
to present one question at a time. Online examinations typically present one
question at a time, with the ability at the end to jump directly back to any
question to review the answer before completing the exam. Over the years I
have passed 19 Microsoft certification exams, and every one of them presents
one question at a time, with 'next' and 'back' buttons, like what the OP
apparently wants to provide.

-RC

Jun 27 '08 #3

"Robert Cramer" <A@B.comwrote in message
news:up******** ******@TK2MSFTN GP05.phx.gbl...
<snip>

Mr. Arnold: regarding your comments:
>From an end-user standpoint, there is nothing worst than going through
100 screens of individual questions (one question per screen) because
the programmer couldn't come up with something else that was better.

This is just plain bad advice and/or guidance. There are many good reasons
to present one question at a time. Online examinations typically present
one question at a time, with the ability at the end to jump directly back
to any question to review the answer before completing the exam. Over the
years I have passed 19 Microsoft certification exams, and every one of
them presents one question at a time, with 'next' and 'back' buttons, like
what the OP apparently wants to provide.

You don't know what the case or the scope of the questions will be for a
given solution.

I have worked on insurance applications that asked the insurance agent or
broker over 900 questions in various categories, with all of it being
displayed on one ASP.net page by selecting the various categories from combo
boxes with any where from 1 to 50 questions at a time with the answers to
questions given in combo, textbox and radio controls in a table or grid, and
all of it being built on the fly.

I have also done the same thing with questionnaire surveys for car companies
and their dealerships with their customers when asking about features in
cars based on make and model.

You can pass 10,000 MS certification tests with screen by screen questions.
That doesn't make it a standard that should be followed.

There was this one programmer who did just that. He developed a solution for
some in-house users that went screen by screen or page by page asking
questions, they wouldn't use his application, and they talked about him
like a dog.

You don't know the scope of the of this, what I have suggest my be the best
approach, and the OP doesn't know that or doesn't know any better, not to go
screen by screen.

One programs the screen by screen solution may be a viable solution, but on
the other hand, it may not be a viable solution too.
Jun 27 '08 #4
Responses inline:

>Mr. Arnold: regarding your comments:
>>From an end-user standpoint, there is nothing worst than going through
100 screens of individual questions (one question per screen) because
the programmer couldn't come up with something else that was better.

This is just plain bad advice and/or guidance. There are many good
reasons to present one question at a time. Online examinations typically
present one question at a time, with the ability at the end to jump
directly back to any question to review the answer before completing the
exam. Over the years I have passed 19 Microsoft certification exams, and
every one of them presents one question at a time, with 'next' and 'back'
buttons, like what the OP apparently wants to provide.


You don't know what the case or the scope of the questions will be for a
given solution.

I have worked on insurance applications that asked the insurance agent or
broker over 900 questions in various categories, with all of it being
displayed on one ASP.net page by selecting the various categories from
combo boxes with any where from 1 to 50 questions at a time with the
answers to questions given in combo, textbox and radio controls in a table
or grid, and all of it being built on the fly.
It sounds like you provided an excellent solution for their specific
problem. You are to be commended.

I have also done the same thing with questionnaire surveys for car
companies and their dealerships with their customers when asking about
features in cars based on make and model.
You apparently did a good thing, yet again.

You can pass 10,000 MS certification tests with screen by screen
questions. That doesn't make it a standard that should be followed.
I never stated or implied that what I was recommending was a standard. The
point I was making was that for some tests, it is perfectly reasonable to
present one question at a time. By bringing up the MS certification exams, I
was simply illustrating a real-world example of where this might be the best
approach. By stating the number of exams, I was pointing out that my
observations and experience are not entirely unique to one special case.

There was this one programmer who did just that. He developed a solution
for some in-house users that went screen by screen or page by page asking
questions, they wouldn't use his application, and they talked about him
like a dog.
So apparently he did the wrong thing. But that doesn't mean that presenting
one question at a time is always the wrong thing. Apparently you are
unfamiliar with progressive tests whereby expertise in some subject matter
is being measured via some "progressiv ely determined" or dynamic set of
questions... whereby answers to early questions determine which questions
are presented next. Where expertise is confirmed early in a test, future
questions on that subject domain are omitted. Where expertise is not clearly
demonstrated, additional questions within the subject domain are dynamically
added to the exam... all this in an effort to get a more accurate
understanding of the expertise being measured. There is a lot of theory that
goes into these types of tests. You can google "psychometr ics" for more.

Furthermore, what about plain ole' wizards. Sometimes they will present a
single question that determines what successive wizard pages are presented.

You don't know the scope of the of this, what I have suggest my be the
best approach, and the OP doesn't know that or doesn't know any better,
not to go screen by screen.
You don't know enough about the OP's motivations either, and jumped to a
conclusion that the OP doesn't know any better. I was simply pointing out
that you are wrong about that, provided some real-world examples (at least
19 that I have firsthand knowledge of).

My intention is to not be confrontational - but where somebody (the OP in
this case) is given bad advice, I'll point that out.... as doing so helps to
maintain the value of these NGs.

One programs the screen by screen solution may be a viable solution, but
on the other hand, it may not be a viable solution too.
Great! Apparently we agree. It's too bad that you didn't consider that with
your response to the OP and instead had to imply that the OP was doing
something wrong and proceeded to give very explicit advice to do something
based on your assumptions. To quote you: "You need to hook up a datagrid
with horizontal and vertical bars to move up and down the questions or left
or right on a question...". There is nothing there, or elsewhere in your
post, that helps the OP to solve their original problem.
-RC

Jun 27 '08 #5

"Robert Cramer" <A@B.comwrote in message
news:u5******** ******@TK2MSFTN GP03.phx.gbl...
Responses inline:

Great! Apparently we agree. It's too bad that you didn't consider that
with your response to the OP and instead had to imply that the OP was
doing something wrong and proceeded to give very explicit advice to do
something based on your assumptions. To quote you: "You need to hook up a
datagrid with horizontal and vertical bars to move up and down the
questions or left or right on a question...". There is nothing there, or
elsewhere in your post, that helps the OP to solve their original problem.

My goodness, It was a suggestion, and you made it much ado about nothing.
You would have been better off just posting to the OP, IMO.
Jun 27 '08 #6
One of your previous questions indicated you have a class containing the
question and the potential answers. Presuming this is still the case, I
recommend you create a user control which has a property for your Question
class.

The user control then handles the display of the question and answers. Your
form will have this control on it, as well as the Questions list of Question
objects. You then just incriment a counter in the list to go with the [Next]
button. Trap the condition where you are at the end of the list.

You can also add a [Previous] button which decriments the counter. In each
of these buttons you would simply update the Question object for the user
control and it would then display the new question.

"Tammy Nejadian" wrote:
Hi, I am using Visual C# window to dispaly a set of questions with their
answers. The users should be able to move to the next question by clicking on
next button. I am going to use only one panel to display one question and
move to next question. Can someone please help me with the codes on coding
"Next" button?
Thanks
--
Nejadian
Jun 27 '08 #7
On Apr 20, 10:53 pm, Tammy Nejadian
<TammyNejad...@ discussions.mic rosoft.comwrote :
Hi, I am using Visual C# window to dispaly a set of questions with their
answers. The users should be able to move to the next question by clicking on
next button. I am going to use only one panel to display one question and
move to next question. Can someone please help me with the codes on coding
"Next" button?
Thanks
--
Nejadian
you don't provide enough information to determine what you really
want;
Is the set of questions displayed, or is a single question displayed
ata a time?
You say one question on one panel - but do you mean you want to
display many panels on the window simultaneously or a single panel on
the window, whose contents change (to the next question) when the next
button is preessed (like a wizard).

You also don't say how your questions (and answers) are stored. Are
they a collection of objects, a dataset, or something else?

Whatever the answers to the above, the essential code when clicking
the next button would be;

if (!WereLookingAt TheLastQuestion ())
{
LookAtTheNextQu estion();
}

What you now need to figure out, is what will be in the two methods
WereLookingAtTh eLastQuestion() and LookAtTheNextQu estion()

Assuming the questions are in an array, this could be as simple as
checking the current index against the array bounds, and incrementing
the current index and calling your 'display a question' method.

Good luck - and don't listen to those that tell you you're doing the
wrong thing when they don't know what you are doing!

..\\axxx
Jun 27 '08 #8
Thanks for your sugestions and advice. I am really appricated. I should be
more specific and explain my problem more clear. Actuly I suppose to read
from xml file and display the elements as questions and their answers. I am
able to create a panel and display the question in created label and display
the answers using radio buttons so the users can intract with them. I should
use one panel and display each question at the time and each time the user
click on button it will collect the information and display (or move to) the
next question. There should be another button which allows the user to go
back to last question if he/she wants to do that. However for now I am stock
in moving to next quesion. Could you please help me on that.
--
Nejadian
".\\\\axxx" wrote:
On Apr 20, 10:53 pm, Tammy Nejadian
<TammyNejad...@ discussions.mic rosoft.comwrote :
Hi, I am using Visual C# window to dispaly a set of questions with their
answers. The users should be able to move to the next question by clicking on
next button. I am going to use only one panel to display one question and
move to next question. Can someone please help me with the codes on coding
"Next" button?
Thanks
--
Nejadian

you don't provide enough information to determine what you really
want;
Is the set of questions displayed, or is a single question displayed
ata a time?
You say one question on one panel - but do you mean you want to
display many panels on the window simultaneously or a single panel on
the window, whose contents change (to the next question) when the next
button is preessed (like a wizard).

You also don't say how your questions (and answers) are stored. Are
they a collection of objects, a dataset, or something else?

Whatever the answers to the above, the essential code when clicking
the next button would be;

if (!WereLookingAt TheLastQuestion ())
{
LookAtTheNextQu estion();
}

What you now need to figure out, is what will be in the two methods
WereLookingAtTh eLastQuestion() and LookAtTheNextQu estion()

Assuming the questions are in an array, this could be as simple as
checking the current index against the array bounds, and incrementing
the current index and calling your 'display a question' method.

Good luck - and don't listen to those that tell you you're doing the
wrong thing when they don't know what you are doing!

..\\axxx
Jun 27 '08 #9

"Tammy Nejadian" <Ta***********@ discussions.mic rosoft.comwrote in message
news:90******** *************** ***********@mic rosoft.com...
Thanks for your sugestions and advice. I am really appricated. I should be
more specific and explain my problem more clear. Actuly I suppose to read
from xml file and display the elements as questions and their answers. I
am
able to create a panel and display the question in created label and
display
the answers using radio buttons so the users can intract with them. I
should
use one panel and display each question at the time and each time the user
click on button it will collect the information and display (or move to)
the
next question. There should be another button which allows the user to go
back to last question if he/she wants to do that. However for now I am
stock
in moving to next quesion. Could you please help me on that.
You read the XML with the tags of questions, you make an QuestionAnswer
object containing a property for the Question and a property for the Answer,
you load each QuestionAnswer with the Question from the XML, and you load
the QuestionAnswer object in to a List of QuestionAnswer objects. or you can
use an ArrayList too.

With the reading of each XML Question Element, you create the Object and
you load the question from the XML. It could be something like this.

private void LoadIntitialQue stions()
{

List<QuestionAn swerquestionsan swers = new <QuestionAnswer >();
Read XML Question with a read loop;

QuestionAnswer qa = new QuestionAnswer( );
qa.Question = XML.Question;
qa.Answer = null; // or whatever it takes to set it to not used.

questionsanswer s .Add(qa);

}

Now you have all the initial QuestionAnswer objects in a List where you can
use an index to apply the Next or Back button as you move up and down the
List by index with 0 being the first element in the list and
questionsanswer s.Count being the last possible element in the List.

Idx = 0;

Label1.Text = questionsanswer s [idx].question;
textbox1.Text = questionsanswer s[idx].answer;

Next button will increment idx = idx++ // by 1 until it hits the max count

You do the Back button the same way but idx = idx-- decrement by 1 until it
hits 0.

If you want to save the answer to a question to the object, it would be like
this.

questionsanswer s[idx].answer = textbox1.text;

It's all based off of the QuestionAnswer object being loaded into a List or
ArrayList of QuestionsAnswer s, and then you can move up and down the List of
objects and address them using an Index into the List of objects.



Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1918
by: Steven | last post by:
Hi there, I have a list of values that I am displaying in a table (Not using a loop) I want to be able to put a graphic next to the item with the hightest price. I have all of the prices in a table. Any ideas?
5
2070
by: Mystery | last post by:
Can anyone point me to a script that will allow me to list x number of records per page and give me a page selector and information like the one in the subject header? Thanks.
1
349
by: tapan t | last post by:
Hello, I've two SQL tables. Q_Master(Q_ID,Question_DET,DIS_MODE) and ANS_MASTER(ANS_ID,ANSWERS,QUESTION_ID,SCORE) There are lot of questions in the database and answers for that respective questions..What I need is, in my ASP page I need to display all the questions and Answers for that respective questions. for example: Question1 : How old are you?
13
3602
by: Aladdin | last post by:
I have an MS Access form on which I have a listbox listing tables in that database. I want to be able to click on any of those tables and view its contents on the same form using subforms or any grid control. I tried many grid controls (DBGrid, DataGrid, MSFlexGrid), the ADO Data Control and everything I can think of, with no success. Here are the contraints I faced: (1) Populating any of the grid controls manually is too slow for my...
3
1108
by: Frank | last post by:
Hi! I just run into a problem wich some of you might be able to solve really quickly so i decided to give this group a shot. In the database a have 2 tables (well, to make it easy here). 1) Question 2) Answer Each question has multiple answers attached to it. this means that
18
1849
by: John | last post by:
Hi I am trying to display an image in a dialog using the following code; Dim frm As New frmImage Dim z As System.Drawing.Bitmap z.FromFile("c:\temp\image.gif") frm.picImage.Image = z frm.ShowDialog()
15
22310
by: Jameson | last post by:
Happy New Year, Everyone! I am trying to figure out how to display a bunch of images (mainly JPEGs, but possibly a few GIFs and PNGs as well) that are stored in a local directory on the system. I can do this with the glob() function, but I can't seem to put in a directory other than one within the webroot. For example, I can only put "/uploads" and not "/Volumes/jray/Pictures...". Any ideas how to get around this? If I can't use the...
4
2508
by: Drew | last post by:
I posted this to the asp.db group, but it doesn't look like there is much activity on there, also I noticed that there are a bunch of posts on here pertaining to database and asp. Sorry for cross-posting. I am trying to build a "checklist", where a user can navigate to an ASP page on the intranet which shows a list of "questions" that the user can check off. I am trying to figure out how to do this so that it is scalable, but I am...
0
8517
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8780
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6441
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2947
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.