final Question question = rootDomainObject.readQuestionByOID(questionId); final DistributedTest distributedTest = rootDomainObject.readDistributedTestByOID(distributedTestId);
    public List<InfoSiteDistributedTestAdvisory> run(Integer executionCourseId,            Integer distributedTestId, Double newMark, Integer questionId, Integer studentId,            TestQuestionStudentsChangesType studentsType, String path) throws FenixServiceException,            ExcepcaoPersistencia {        List<InfoSiteDistributedTestAdvisory> infoSiteDistributedTestAdvisoryList = new ArrayList<InfoSiteDistributedTestAdvisory>();        path = path.replace('\\', '/');        List<StudentTestQuestion> studentsTestQuestionList = new ArrayList<StudentTestQuestion>();        if (studentsType.getType().intValue() == TestQuestionStudentsChangesType.THIS_STUDENT) {        	final Question question = rootDomainObject.readQuestionByOID(questionId);        	final DistributedTest distributedTest = rootDomainObject.readDistributedTestByOID(distributedTestId);        	final Student student = rootDomainObject.readStudentByOID(studentId);        	studentsTestQuestionList.add(StudentTestQuestion.findStudentTestQuestion(question, student, distributedTest));        } else if (studentsType.getType().intValue() == TestQuestionStudentsChangesType.STUDENTS_FROM_TEST_VARIATION) {        	final Question question = rootDomainObject.readQuestionByOID(questionId);        	final DistributedTest distributedTest = rootDomainObject.readDistributedTestByOID(distributedTestId);            studentsTestQuestionList.addAll(StudentTestQuestion.findStudentTestQuestions(question, distributedTest));        } else if (studentsType.getType().intValue() == TestQuestionStudentsChangesType.STUDENTS_FROM_TEST) {        	final Question question = rootDomainObject.readQuestionByOID(questionId);        	final DistributedTest distributedTest = rootDomainObject.readDistributedTestByOID(distributedTestId);        	final Student student = rootDomainObject.readStudentByOID(studentId);        	final StudentTestQuestion studentTestQuestion = StudentTestQuestion.findStudentTestQuestion(question, student, distributedTest);            studentsTestQuestionList.addAll(distributedTest.findStudentTestQuestionsByTestQuestionOrder(studentTestQuestion.getTestQuestionOrder()));        } else if (studentsType.getType().intValue() == TestQuestionStudentsChangesType.ALL_STUDENTS) {        	final Question question = rootDomainObject.readQuestionByOID(questionId);            studentsTestQuestionList.addAll(question.getStudentTestsQuestionsSet());        }        for (StudentTestQuestion studentTestQuestion : studentsTestQuestionList) {            InfoSiteDistributedTestAdvisory infoSiteDistributedTestAdvisory = new InfoSiteDistributedTestAdvisory();            infoSiteDistributedTestAdvisory.setInfoDistributedTest(InfoDistributedTest                    .newInfoFromDomain(studentTestQuestion.getDistributedTest()));            infoSiteDistributedTestAdvisory.setInfoAdvisory(null);            List<InfoStudent> group = new ArrayList<InfoStudent>();            studentTestQuestion.setTestQuestionMark(newMark);            if (!group.contains(studentTestQuestion.getStudent().getPerson()))                group.add(InfoStudent.newInfoFromDomain(studentTestQuestion.getStudent()));            if (studentTestQuestion.getDistributedTest().getTestType().equals(                    new TestType(TestType.EVALUATION))) {                if (studentTestQuestion.getResponse() == null) {                    Response response = null;                    InfoStudentTestQuestion infoStudentTestQuestion = InfoStudentTestQuestionWithInfoQuestionAndInfoDistributedTest                            .newInfoFromDomain(studentTestQuestion);                    try {                        ParseQuestion parse = new ParseQuestion();                        infoStudentTestQuestion = parse.parseStudentTestQuestion(                                infoStudentTestQuestion, path);                    } catch (Exception e) {                        throw new FenixServiceException(e);                    }                    if (infoStudentTestQuestion.getQuestion().getQuestionType().getType().intValue() == QuestionType.STR) {                        response = new ResponseSTR("");                    } else if (infoStudentTestQuestion.getQuestion().getQuestionType().getType()                            .intValue() == QuestionType.NUM) {                        response = new ResponseNUM("");                    } else if (infoStudentTestQuestion.getQuestion().getQuestionType().getType()                            .intValue() == QuestionType.LID) {                        response = new ResponseLID(new String[] { null });                    }                    response.setResponsed();                    ByteArrayOutputStream out = new ByteArrayOutputStream();                    XMLEncoder encoder = new XMLEncoder(out);                    encoder.writeObject(response);                    encoder.close();                    final String outString = out.toString();                    studentTestQuestion.setResponse(outString);                } else {                    OnlineTest onlineTest = studentTestQuestion.getDistributedTest().getOnlineTest();                    ExecutionCourse executionCourse = rootDomainObject                            .readExecutionCourseByOID(executionCourseId);                    Attends attend = studentTestQuestion.getStudent().readAttendByExecutionCourse(                            executionCourse);                    Mark mark = onlineTest.getMarkByAttend(attend);                    final String markValue = getNewStudentMark(studentTestQuestion.getDistributedTest(),                            studentTestQuestion.getStudent());                    if (mark == null) {                        mark = DomainFactory.makeMark(attend, onlineTest, markValue);                    } else {                        mark.setMark(markValue);                    }                    if (mark.getPublishedMark() != null) {                        mark.setPublishedMark(markValue);                    }                }            }            StudentTestLog studentTestLog = DomainFactory.makeStudentTestLog();            studentTestLog.setDistributedTest(studentTestQuestion.getDistributedTest());            studentTestLog.setStudent(studentTestQuestion.getStudent());            studentTestLog.setDate(Calendar.getInstance().getTime());            ResourceBundle bundle = ResourceBundle.getBundle("resources.ApplicationResources");            studentTestLog.setEvent(MessageFormat.format(bundle                    .getString("message.changeStudentMarkLogMessage"), new Object[] { newMark }));            infoSiteDistributedTestAdvisory.setInfoStudentList(group);            infoSiteDistributedTestAdvisoryList.add(infoSiteDistributedTestAdvisory);        }        return infoSiteDistributedTestAdvisoryList;    }