// PUBLIC // ============================================================================================= public TestQuestionDTO UpsertQuestion(TestQuestionDTO questionReceived) { var id = questionReceived.id; test_question question; if (id == 0) { question = new test_question(); TestQuestionMapper.CopyValues(questionReceived, question); _questionRepository.Add(question); } else { question = _questionRepository.Get(id); _questionRepository.SetNewValues(questionReceived, question); } return(TestQuestionMapper.GetDTO(question)); }
// --------------------------------------------------------------------------------------------- private List <TestQuestionDTO> QuestionDtosForModule(edumodule module) { return(TestQuestionMapper.GetQuestionListDTO(QuestionsForModule(module))); }