ASP.net quiz engine, sort of
I am adding some basic functionality to my companies website. When a potential employee clicks on a link to apply for a job, there will be a list of questions with yes/no radio butto开发者_如何转开发ns to prequalify applicants. I have looked through several tutorials on setting up a quiz engine since that is basically what I am doing but my company execs want the questions listed on one page and not one quesiton per page.
I am having trouble with two parts of this (heck, can't sort out how to do it at all really). First issue is on how to display the questions, I was thinking that I should use a repeater.
Second issue is passing the answers back to the database, I would assume I should use a for-each loop. As a noob webdev on a one person team, I am having a hard time doing this as well.
I don't want someone to do this for me as I want/need to learn the right way but if anyone can point me in the right direction, it would be much appreciated.
I was thinking that I should use a repeater
Yep!
Second issue is passing the answers back to the database, I would assume I should use a for-each loop.
This will work : Here's how:
From: ASP .NET - How to Iterate through a repeater?
foreach(RepeaterItem item in myRepeater.Items){
if(item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem){
// do something with the item
RadioButtonList radioChoices = (RadioButtonList) item.FindControl("myControl") ;
}
}
精彩评论