if (e instanceof IllegalDataAccessException) { errorMessage = "message.error.notAuthorized.create.evaluation.during.exan.period"; }
    public String editWrittenTest() throws Exception {        final List<String> executionCourseIDs = new ArrayList<String>();        executionCourseIDs.add(this.getExecutionCourseID().toString());        final List<String> curricularCourseScopeIDs = new ArrayList<String>();        ExecutionCourse executionCourse = rootDomainObject.readExecutionCourseByOID(getExecutionCourseID());        for (CurricularCourse curricularCourse : executionCourse.getAssociatedCurricularCourses()) {            for (CurricularCourseScope curricularCourseScope : curricularCourse.getScopes()) {                if (curricularCourseScope.getCurricularSemester().getSemester().equals(                        executionCourse.getExecutionPeriod().getSemester())) {                    curricularCourseScopeIDs.add(curricularCourseScope.getIdInternal().toString());                }            }        }                List<String> curricularCourseContextIDs = new ArrayList<String>();        final Season season = (getSeason() != null) ? new Season(getSeason()) : null;        final Object[] args = { this.getExecutionCourseID(), this.getBegin().getTime(), this.getBegin().getTime(),                 this.getEnd().getTime(), executionCourseIDs, curricularCourseScopeIDs, curricularCourseContextIDs,                 null, this.evaluationID, season, this.getDescription() };        try {            ServiceUtils.executeService(getUserView(), "EditWrittenEvaluation", args);        } catch (Exception e) {            String errorMessage = e.getMessage();            if (e instanceof NotAuthorizedFilterException) {                errorMessage = "message.error.notAuthorized";            }            this.setErrorMessage(errorMessage);            return "";        }        final String originPage = getOriginPage();        if (originPage != null) {            final StringBuilder stringBuilder = new StringBuilder();            stringBuilder.append(getApplicationContext());            stringBuilder.append("/sop/searchWrittenEvaluationsByDate.do?method=returnToSearchPage&amp;page=0&date=");            stringBuilder.append(DateFormatUtil.format("yyyy/MM/dd", this.getBegin().getTime()));            stringBuilder.append("&");            stringBuilder.append(SessionConstants.EXECUTION_PERIOD_OID);            stringBuilder.append("=");            stringBuilder.append(executionCourse.getExecutionPeriod().getIdInternal());            if (selectedBegin != null && selectedBegin.length() > 0 && selectedBegin.equals("true")) {                stringBuilder.append("selectedBegin=");                stringBuilder.append(DateFormatUtil.format("HH:mm", this.getBegin().getTime()));            }            if (selectedEnd != null && selectedEnd.length() > 0 && selectedEnd.equals("true")) {                stringBuilder.append("selectedEnd=");                stringBuilder.append(DateFormatUtil.format("HH:mm", this.getEnd().getTime()));            }            FacesContext.getCurrentInstance().getExternalContext().redirect(stringBuilder.toString());            return originPage;        } else {            return this.getEvaluation().getClass().getSimpleName();        }    }