Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model AiLive.Models.QuestionSet
- @{
- foreach (var question in Model.Questions)
- {
- <span class="sepratorLine"></span>
- <li>@question.Text
- <ul>
- <li>@Html.RadioButton(question.QuestionId + "_1", 1, new { @class = "styled", @id = "Question" }
- <label class="forRadioText margin15px">@question.AnswerOption1</label>
- </li>
- <li>@Html.RadioButton(question.QuestionId + "_1", 2, new { @class = "styled", @id = "Question" })
- <label class="forRadioText margin15px">@question.AnswerOption2</label></li>
- <li>@Html.RadioButton(question.QuestionId + "_1", 3, new { @class = "styled", @id = "Question" })
- <label class="forRadioText margin15px">@question.AnswerOption3</label></li>
- <li>@Html.RadioButton(question.QuestionId + "_1", 4, new { @class = "styled", @id = "Question" })
- <label class="forRadioText margin15px">@question.AnswerOption4</label></li>
- </ul>
- </li>
- }
- public interface IQuestion
- {
- int QuestionId { get; set; }
- string Type { get; set; }
- string Text { get; set; }
- string SetNumber { get; set; }
- string AnswerOption1 { get; set; }
- string AnswerOption2 { get; set; }
- string AnswerOption3 { get; set; }
- string AnswerOption4 { get; set; }
- int Answer { get; set; }
- }
- public interface IQuestionSet
- {
- List<IQuestion> Questions { get; set; }
- }
- public class Question : IQuestion
- {
- public int QuestionId { get; set; }
- public string Type { get; set; }
- public string Text { get; set; }
- public string SetNumber { get; set; }
- public string AnswerOption1 { get; set; }
- public string AnswerOption2 { get; set; }
- public string AnswerOption3 { get; set; }
- public string AnswerOption4 { get; set; }
- public int Answer { get; set; }
- }
- public class QuestionSet : IQuestionSet
- {
- public List<IQuestion> Questions { get; set; }
- public QuestionSet()
- {
- Questions = new List<Question>().Cast<IQuestion>().ToList();
- }
- }
- [AllowAnonymous]
- [HttpPost]
- public virtual ActionResult PunctuationTest(QuestionSet questionModel)
- {
- QuestionSet q = questionModel;
- QuestionSetViewModel model = (new CaptionerTestBAL().FetchQuestions("Punctuation", 1));
- return View(model);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement