TestScope testScope = TestScope.readByDomainObject(TestScope.class, executionCourseId);
TestScope testScope = TestScope.readByDomainObject(ExecutionCourse.class, executionCourseId);
    public InfoSiteStudentTestFeedback run(Integer executionCourseId, Integer testId, Response[] responses, String[] questionCodes,            String[] optionShuffle, TestType testType, CorrectionAvailability correctionAvailability, Boolean imsfeedback, String testInformation,            String path) throws FenixServiceException, ExcepcaoPersistencia {        InfoSiteStudentTestFeedback infoSiteStudentTestFeedback = new InfoSiteStudentTestFeedback();        this.path = path.replace('\\', '/');        Test test = rootDomainObject.readTestByOID(testId);        if (test == null)            throw new FenixServiceException();        double totalMark = 0;        int responseNumber = 0;        int notResponseNumber = 0;        List<String> errors = new ArrayList<String>();        TestScope testScope = TestScope.readByDomainObject(TestScope.class, executionCourseId);        if (testScope == null) {            ExecutionCourse executionCourse = rootDomainObject.readExecutionCourseByOID(executionCourseId);            if (executionCourse == null)                throw new InvalidArgumentsServiceException();            testScope = DomainFactory.makeTestScope(executionCourse);        }        InfoDistributedTest infoDistributedTest = new InfoDistributedTest();        infoDistributedTest.setIdInternal(testId);        infoDistributedTest.setInfoTestScope(InfoTestScope.newInfoFromDomain(testScope));        infoDistributedTest.setTestType(testType);        infoDistributedTest.setCorrectionAvailability(correctionAvailability);        infoDistributedTest.setImsFeedback(imsfeedback);        infoDistributedTest.setTestInformation(testInformation);        infoDistributedTest.setTitle(test.getTitle());        infoDistributedTest.setNumberOfQuestions(test.getTestQuestionsCount());        List<InfoStudentTestQuestion> infoStudentTestQuestionList = getInfoStudentTestQuestionList(questionCodes, optionShuffle,                responses, infoDistributedTest, testId);        if (infoStudentTestQuestionList.size() == 0)            return null;        for (InfoStudentTestQuestion infoStudentTestQuestion : infoStudentTestQuestionList) {            if (infoStudentTestQuestion.getResponse().isResponsed()) {                responseNumber++;                IQuestionCorrectionStrategyFactory questionCorrectionStrategyFactory = QuestionCorrectionStrategyFactory.getInstance();                IQuestionCorrectionStrategy questionCorrectionStrategy = questionCorrectionStrategyFactory                        .getQuestionCorrectionStrategy(infoStudentTestQuestion);                String error = questionCorrectionStrategy.validResponse(infoStudentTestQuestion);                if (error == null) {                    if ((!infoDistributedTest.getTestType().equals(new TestType(TestType.INQUIRY)))                            && infoStudentTestQuestion.getQuestion().getResponseProcessingInstructions().size() != 0) {                        infoStudentTestQuestion = questionCorrectionStrategy.getMark(infoStudentTestQuestion);                    }                    totalMark += infoStudentTestQuestion.getTestQuestionMark().doubleValue();                } else {                    notResponseNumber++;                    responseNumber--;                    errors.add(error);                    if (infoStudentTestQuestion.getQuestion().getQuestionType().getType().intValue() == QuestionType.LID)                        infoStudentTestQuestion.setResponse(new ResponseLID());                    else if (infoStudentTestQuestion.getQuestion().getQuestionType().getType().intValue() == QuestionType.STR)                        infoStudentTestQuestion.setResponse(new ResponseSTR());                    else if (infoStudentTestQuestion.getQuestion().getQuestionType().getType().intValue() == QuestionType.NUM)                        infoStudentTestQuestion.setResponse(new ResponseNUM());                }            } else                notResponseNumber++;        }        infoSiteStudentTestFeedback.setResponseNumber(Integer.valueOf(responseNumber));        infoSiteStudentTestFeedback.setNotResponseNumber(Integer.valueOf(notResponseNumber));        infoSiteStudentTestFeedback.setErrors(errors);        infoSiteStudentTestFeedback.setInfoStudentTestQuestionList(infoStudentTestQuestionList);        return infoSiteStudentTestFeedback;    }