public void EditQuestion(int questionId, RealExamQuestion newQuestion) { questionAssign model = questionAssignRepository.GetById(questionId); model.title = newQuestion.title; model.score = newQuestion.score; model.type = newQuestion.type; EditQuestion(model); }
public static StudentQuestionTable RealQuestionToStudentQuestion(RealExamQuestion question, int score, int examId, OptionAssignController optionAssignController) { string[] studentAnswers = question.answer; List <string> studentAnswersIds = new List <string>(); foreach (string studentAnswer in studentAnswers) { studentAnswersIds.Add(optionAssignController.GetByNameAndQuestionId(studentAnswer, question.questionId).Id.ToString()); } return(new StudentQuestionTable { score = score, questionId = question.questionId, studentAnswerIds = string.Join(",", studentAnswersIds.ToArray()), studentExamId = examId }); }