Beispiel #1
0
        public void create(Test test, int subjectId)
        {
            SqlLiteSimpleExecute.execute(queryConfigurator.createTest(
                                             EncryptWorker.getInstance().encrypt(test.Name), subjectId));

            int id = DataSetConverter.fromDsToSingle.toInt.convert(SqlLiteSimpleExecute.
                                                                   execute(queryConfigurator.getObjectIdInDevelopStatus(DbTypes.test)));

            SqlLiteSimpleExecute.execute(queryConfigurator.
                                         setTestsQuestionsNumber(id, test.QuestionsNumber));

            SqlLiteSimpleExecute.execute(queryConfigurator.
                                         setTestsRequeredUnswersNumber(id, test.RequeredUnswersNumber));

            for (int i = 0; i < test.Questions.Count; i++)
            {
                questionManipulator.create(test.Questions.ElementAt(i), id);
            }
            SqlLiteSimpleExecute.execute(queryConfigurator.setApproveStatusToObject(
                                             DbTypes.test));
        }