Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. @model AiLive.Models.QuestionSet
  2. @{
  3. foreach (var question in Model.Questions)
  4. {
  5. <span class="sepratorLine"></span>
  6. <li>@question.Text
  7. <ul>
  8. <li>@Html.RadioButton(question.QuestionId + "_1", 1, new { @class = "styled", @id = "Question" }
  9. <label class="forRadioText margin15px">@question.AnswerOption1</label>
  10. </li>
  11. <li>@Html.RadioButton(question.QuestionId + "_1", 2, new { @class = "styled", @id = "Question" })
  12.  
  13. <label class="forRadioText margin15px">@question.AnswerOption2</label></li>
  14. <li>@Html.RadioButton(question.QuestionId + "_1", 3, new { @class = "styled", @id = "Question" })
  15.  
  16. <label class="forRadioText margin15px">@question.AnswerOption3</label></li>
  17.  
  18. <li>@Html.RadioButton(question.QuestionId + "_1", 4, new { @class = "styled", @id = "Question" })
  19.  
  20. <label class="forRadioText margin15px">@question.AnswerOption4</label></li>
  21. </ul>
  22. </li>
  23. }
  24.  
  25. public interface IQuestion
  26. {
  27. int QuestionId { get; set; }
  28. string Type { get; set; }
  29. string Text { get; set; }
  30. string SetNumber { get; set; }
  31. string AnswerOption1 { get; set; }
  32. string AnswerOption2 { get; set; }
  33. string AnswerOption3 { get; set; }
  34. string AnswerOption4 { get; set; }
  35. int Answer { get; set; }
  36. }
  37. public interface IQuestionSet
  38. {
  39. List<IQuestion> Questions { get; set; }
  40. }
  41. public class Question : IQuestion
  42. {
  43. public int QuestionId { get; set; }
  44. public string Type { get; set; }
  45. public string Text { get; set; }
  46. public string SetNumber { get; set; }
  47. public string AnswerOption1 { get; set; }
  48. public string AnswerOption2 { get; set; }
  49. public string AnswerOption3 { get; set; }
  50. public string AnswerOption4 { get; set; }
  51. public int Answer { get; set; }
  52. }
  53. public class QuestionSet : IQuestionSet
  54. {
  55. public List<IQuestion> Questions { get; set; }
  56.  
  57. public QuestionSet()
  58. {
  59. Questions = new List<Question>().Cast<IQuestion>().ToList();
  60. }
  61. }
  62.  
  63. [AllowAnonymous]
  64. [HttpPost]
  65. public virtual ActionResult PunctuationTest(QuestionSet questionModel)
  66. {
  67. QuestionSet q = questionModel;
  68. QuestionSetViewModel model = (new CaptionerTestBAL().FetchQuestions("Punctuation", 1));
  69. return View(model);
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement