Exemple #1
0
        // 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));
        }
Exemple #2
0
 // ---------------------------------------------------------------------------------------------
 private List <TestQuestionDTO> QuestionDtosForModule(edumodule module)
 {
     return(TestQuestionMapper.GetQuestionListDTO(QuestionsForModule(module)));
 }