Hello, i want to create a quiz engine. I have already watched the videos and searched online and i would like your opinion.
I want my quiz to have a prev/next button. What do you suggest me to use? A ListView? And also in order to create the prev/next buttons i have to use a datareader? Can i use the Listview's next previous buttons without losing the user's choices? Is there
a way to keep all the user's choices (from radiobuttons) in "memory" and when clicking "Finish" evaluate the result?
Which do you think will be the best way to do this?
Thanks!
[Just `cause you feel it, doesn`t mean it`s there.] - Radiohead
You may want to have a look at this one: http://forums.asp.net/t/1785879.aspx/1?questionnaire+application+multiple+inserts+ASP+C+
It has all questions on the page at once. However, you could adapt it by using a FormView or DetailsView instead of a GridView. If you turn on Paging on these, chances are you will be able to get it to work quite quickly.
And of course you can ask.
Superguppie.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
The link you suggest is about the Inserts of the Quiz. I have already done that and i don't have a problem with it.
Can i an use the datapager of a data control e.g Listview, or the Pager of the Wizard control to move through the answers? I want the user to click on an answer an then move to another question but if he likes he can move to previous page. How can i keep
the radiobutton's value in a listview after i click the "Next". I think that i have to use a session parameter or a viewstate. Im not sure.
If that is not possible what do you suggest for creating next/previous buttons and keeping the data at the same time?
[Just `cause you feel it, doesn`t mean it`s there.] - Radiohead
Hello, i have already seen this quiz. I was thinking of using xml but i want to store data for the user taking the quiz. Data such as which answers is correct or incorect and why ( show somekind of explanation of the answer) and also store the score for
the quiz. Is this possible to be done with xml? I have never worked with xml before. And also, how can i create a previous button?
Thanks a lot :)
[Just `cause you feel it, doesn`t mean it`s there.] - Radiohead
I will look this more i will get back to you. What about the previous button?
Edit: Actually to be honest i just think that in order to do the xml quiz i have to change my web application entirely. And i dont want that. I have already did the inserts and stuff. If i choose the xml option i have to do them all from the start and i
dont know so much of using xml data sources :(
[Just `cause you feel it, doesn`t mean it`s there.] - Radiohead
I just set AllowPaging="true" and PageSize="1" on the GridView in the example in the thread I refered to. The GridView showed 1 question at a time. Editing worked. Paging worked. It should work when replacing GridView with any Control that can do Paging
as well. (Although for DetailsView and FormView there is no need to set PageSize="1" as these already show only one record at a time.)
Superguppie.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
Hey superguppie i have already have my pagesize equal to 1. My problem is:
How to keep the radiobutton's value after i click "Next Question" or "Previous Question". Let me show you what i have done so far...
I want when i click next to show another question and keep the value the user clicked and when i click previous to "read" the value that the user clicked on the previous question. From my search so far i think that i have to do something with the QuestionGroups
and use a session or a viewstate to keep the value. Sorry but I dont know much and i am trying to learn :(
Which do you think will be the best way to do this?
I would rather choose not give the back option there first. Secondly my database will contain bunch of options for levels in different professions. e.g database could be a major field, same like dotnet, oop, se, datastructure and so on. And for each level
there would be so many different questions.
You can then force to select the career level then randomly give the question with the options and also time restrictions.
Visit My Blog "A candle loses nothing by lighting another candle."
Ophelia
Member
231 Points
214 Posts
Suggestions for a Quiz
Apr 03, 2012 04:35 PM|LINK
Hello, i want to create a quiz engine. I have already watched the videos and searched online and i would like your opinion.
I want my quiz to have a prev/next button. What do you suggest me to use? A ListView? And also in order to create the prev/next buttons i have to use a datareader? Can i use the Listview's next previous buttons without losing the user's choices? Is there a way to keep all the user's choices (from radiobuttons) in "memory" and when clicking "Finish" evaluate the result?
Which do you think will be the best way to do this?
Thanks!
superguppie
All-Star
48225 Points
8679 Posts
Re: Suggestions for a Quiz
Apr 04, 2012 07:45 AM|LINK
You may want to have a look at this one: http://forums.asp.net/t/1785879.aspx/1?questionnaire+application+multiple+inserts+ASP+C+
It has all questions on the page at once. However, you could adapt it by using a FormView or DetailsView instead of a GridView. If you turn on Paging on these, chances are you will be able to get it to work quite quickly.
And of course you can ask.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
Ophelia
Member
231 Points
214 Posts
Re: Suggestions for a Quiz
Apr 04, 2012 09:16 PM|LINK
The link you suggest is about the Inserts of the Quiz. I have already done that and i don't have a problem with it.
Can i an use the datapager of a data control e.g Listview, or the Pager of the Wizard control to move through the answers? I want the user to click on an answer an then move to another question but if he likes he can move to previous page. How can i keep the radiobutton's value in a listview after i click the "Next". I think that i have to use a session parameter or a viewstate. Im not sure.
If that is not possible what do you suggest for creating next/previous buttons and keeping the data at the same time?
Qin Dian Tan...
All-Star
113532 Points
12480 Posts
Microsoft
Re: Suggestions for a Quiz
Apr 05, 2012 08:46 AM|LINK
Hi,
I suggest you use FormView with xml:
http://www.codeproject.com/Articles/2786/Online-Quiz
Thanks,
If you have any feedback about my replies, please contactmsdnmg@microsoft.com.
Microsoft One Code Framework
Ophelia
Member
231 Points
214 Posts
Re: Suggestions for a Quiz
Apr 05, 2012 08:52 AM|LINK
Hello, i have already seen this quiz. I was thinking of using xml but i want to store data for the user taking the quiz. Data such as which answers is correct or incorect and why ( show somekind of explanation of the answer) and also store the score for the quiz. Is this possible to be done with xml? I have never worked with xml before. And also, how can i create a previous button?
Thanks a lot :)
Qin Dian Tan...
All-Star
113532 Points
12480 Posts
Microsoft
Re: Suggestions for a Quiz
Apr 05, 2012 08:54 AM|LINK
Hi,
Actually you can save and read data from xml through DataSet.WriteXml/ReadXml method. So you can use DataSet or DataTable instead DataReader.
Thanks,
If you have any feedback about my replies, please contactmsdnmg@microsoft.com.
Microsoft One Code Framework
Ophelia
Member
231 Points
214 Posts
Re: Suggestions for a Quiz
Apr 05, 2012 09:07 AM|LINK
I will look this more i will get back to you. What about the previous button?
Edit: Actually to be honest i just think that in order to do the xml quiz i have to change my web application entirely. And i dont want that. I have already did the inserts and stuff. If i choose the xml option i have to do them all from the start and i dont know so much of using xml data sources :(
superguppie
All-Star
48225 Points
8679 Posts
Re: Suggestions for a Quiz
Apr 05, 2012 10:04 AM|LINK
I just set AllowPaging="true" and PageSize="1" on the GridView in the example in the thread I refered to. The GridView showed 1 question at a time. Editing worked. Paging worked. It should work when replacing GridView with any Control that can do Paging as well. (Although for DetailsView and FormView there is no need to set PageSize="1" as these already show only one record at a time.)
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
Ophelia
Member
231 Points
214 Posts
Re: Suggestions for a Quiz
Apr 05, 2012 11:50 AM|LINK
Hey superguppie i have already have my pagesize equal to 1. My problem is:
How to keep the radiobutton's value after i click "Next Question" or "Previous Question". Let me show you what i have done so far...
I want when i click next to show another question and keep the value the user clicked and when i click previous to "read" the value that the user clicked on the previous question. From my search so far i think that i have to do something with the QuestionGroups and use a session or a viewstate to keep the value. Sorry but I dont know much and i am trying to learn :(
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1"> <AlternatingItemTemplate> <span style=""> <asp:RadioButton ID="RadioButton1" runat="server" GroupName="Questions" value="1" Text='<%# Eval("Answer1") %>' /> <br /> <asp:RadioButton ID="RadioButton2" runat="server" GroupName="Questions" value="2" Text='<%# Eval("Answer2") %>' /> <br /> <asp:RadioButton ID="RadioButton3" runat="server" GroupName="Questions" value="3" Text='<%# Eval("Answer3") %>' /> <br /> <asp:RadioButton ID="RadioButton4" runat="server" GroupName="Questions" value="4" Text='<%# Eval("Answer4") %>' /> <br /> </span> </AlternatingItemTemplate> <EmptyDataTemplate> <span>No data was returned.</span> </EmptyDataTemplate> <ItemTemplate> <span style=""> <asp:RadioButton ID="RadioButton1" runat="server" GroupName="Questions" value="1" Text='<%# Eval("Answer1") %>' /> <br /> <asp:RadioButton ID="RadioButton2" runat="server" GroupName="Questions" value="2" Text='<%# Eval("Answer2") %>' /> <br /> <asp:RadioButton ID="RadioButton3" runat="server" GroupName="Questions" value="3" Text='<%# Eval("Answer3") %>' /> <br /> <asp:RadioButton ID="RadioButton4" runat="server" GroupName="Questions" value="4" Text='<%# Eval("Answer4") %>' /> <br /> </span> </ItemTemplate> <LayoutTemplate> <div id="itemPlaceholderContainer" runat="server" style=""> <span runat="server" id="itemPlaceholder" /> </div> <div style=""> <asp:DataPager ID="DataPager1" runat="server" PageSize="1"> <Fields> <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="False" ShowLastPageButton="False" /> </Fields> </asp:DataPager> </div> </LayoutTemplate> <SelectedItemTemplate> <span style=""> <asp:RadioButton ID="RadioButton1" runat="server" GroupName="Questions" value="1" Text='<%# Eval("Answer1") %>' /> <br /> <asp:RadioButton ID="RadioButton2" runat="server" GroupName="Questions" value="2" Text='<%# Eval("Answer2") %>' /> <br /> <asp:RadioButton ID="RadioButton3" runat="server" GroupName="Questions" value="3" Text='<%# Eval("Answer3") %>' /> <br /> <asp:RadioButton ID="RadioButton4" runat="server" GroupName="Questions" value="4" Text='<%# Eval("Answer4") %>' /> <br /> </span> </SelectedItemTemplate> </asp:ListView> </ContentTemplate> </asp:UpdatePanel>mhbalti
Participant
961 Points
347 Posts
Re: Suggestions for a Quiz
Apr 05, 2012 11:57 AM|LINK
I would rather choose not give the back option there first. Secondly my database will contain bunch of options for levels in different professions. e.g database could be a major field, same like dotnet, oop, se, datastructure and so on. And for each level there would be so many different questions.
You can then force to select the career level then randomly give the question with the options and also time restrictions.
"A candle loses nothing by lighting another candle."