Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
@foreach (var item in ViewBag.mcqLst as List<examinationsystem.models.mcqquestion>)
{

#here item represent mcq question have
choice a /choice b/choice c/choice d
and model answer
}

i want take the answer from the student as radio button click

my problem is
when i write
@Html.RadioButton(@item.MCQ_ModelAnswer,"A")
@Html.RadioButton(@item.MCQ_ModelAnswer,"B")
@Html.RadioButton(@item.MCQ_ModelAnswer,"C")
@Html.RadioButton(@item.MCQ_ModelAnswer,"D")

it works correctly if the exam one question at the view
but at multi mcq question

doesn't work correctly it seems like the radio button shared between all
the questions not per one question


i wanna make it some thing like grouping the radio buttons per each question

What I have tried:

i tried to do
@Html.RadioButton(@item.MCQ_ModelAnswer,@item.ID)

it not works also
the radio button shared among all the page not for each question individual

the second matter if it works how here i can write A ,B,C or d


thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900