Esempio n. 1
0
 public ActionResult Edit_Create_Answer(int questionID, int?answerID = null)
 {
     ViewBag.NavBarActive = "ტესტები";
     if (answerID != null)
     {
         ViewBag.ActionName = "პასუხის რედაქტირება";
         return(View(repository.getAnswerByID((int)answerID)));
     }
     ViewBag.ActionName = "პასუხის დამატება";
     return(View(new Answer()
     {
         QuestionId = questionID, Question = repository.getQuestionByID(questionID)
     }));
 }
Esempio n. 2
0
 private bool isRightAnswer(IEnumerable <AnswerViewModel> answers)
 {
     foreach (AnswerViewModel ans in answers)
     {
         if (repository.getAnswerByID(ans.ID).IsRight == "No" && ans.Checked == true)
         {
             return(false);
         }
         if (ans.Checked == false && repository.getAnswerByID(ans.ID).IsRight == "Yes")
         {
             return(false);
         }
     }
     return(true);
 }