Search in sources :

Example 16 with AssessmentEntryStatus

use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.

the class IQIdentityListCourseNodeController method doUpdateCourseNode.

private void doUpdateCourseNode(List<AssessmentTestSession> testSessionsToComplete, AssessmentTest assessmentTest, AssessmentEntryStatus status) {
    if (testSessionsToComplete == null || testSessionsToComplete.isEmpty())
        return;
    Double cutValue = QtiNodesExtractor.extractCutValue(assessmentTest);
    for (AssessmentTestSession testSession : testSessionsToComplete) {
        UserCourseEnvironment assessedUserCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(testSession.getIdentity(), getCourseEnvironment());
        ScoreEvaluation scoreEval = ((IQTESTCourseNode) courseNode).getUserScoreEvaluation(assessedUserCourseEnv);
        BigDecimal finalScore = testSession.getFinalScore();
        Float score = finalScore == null ? null : finalScore.floatValue();
        Boolean passed = scoreEval.getPassed();
        if (testSession.getManualScore() != null && finalScore != null && cutValue != null) {
            boolean calculated = finalScore.compareTo(BigDecimal.valueOf(cutValue.doubleValue())) >= 0;
            passed = Boolean.valueOf(calculated);
        }
        AssessmentEntryStatus finalStatus = status == null ? scoreEval.getAssessmentStatus() : status;
        ScoreEvaluation manualScoreEval = new ScoreEvaluation(score, passed, finalStatus, scoreEval.getUserVisible(), scoreEval.getFullyAssessed(), scoreEval.getCurrentRunCompletion(), scoreEval.getCurrentRunStatus(), testSession.getKey());
        ((IQTESTCourseNode) courseNode).updateUserScoreEvaluation(manualScoreEval, assessedUserCourseEnv, getIdentity(), false, Role.coach);
    }
}
Also used : AssessmentTestSession(org.olat.ims.qti21.AssessmentTestSession) ScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) BigDecimal(java.math.BigDecimal)

Example 17 with AssessmentEntryStatus

use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.

the class GTAManagerImpl method convertToAssessmentEntrystatus.

@Override
public AssessmentEntryStatus convertToAssessmentEntrystatus(Task task, GTACourseNode cNode) {
    TaskProcess status = task.getTaskStatus();
    TaskProcess firstStep = firstStep(cNode);
    AssessmentEntryStatus assessmentStatus;
    if (status == firstStep) {
        assessmentStatus = AssessmentEntryStatus.notStarted;
    } else if (status == TaskProcess.review || status == TaskProcess.correction || status == TaskProcess.grading) {
        assessmentStatus = AssessmentEntryStatus.inReview;
    } else if (status == TaskProcess.graded) {
        assessmentStatus = AssessmentEntryStatus.done;
    } else {
        assessmentStatus = AssessmentEntryStatus.inProgress;
    }
    return assessmentStatus;
}
Also used : TaskProcess(org.olat.course.nodes.gta.TaskProcess) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus)

Example 18 with AssessmentEntryStatus

use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.

the class AssessmentEntryOutcomesListener method updateOutcomes.

@Override
public void updateOutcomes(Float updatedScore, Boolean updatedPassed, Double completion) {
    AssessmentEntryStatus assessmentStatus = AssessmentEntryStatus.inProgress;
    assessmentEntry.setCompletion(completion);
    assessmentEntry.setAssessmentStatus(assessmentStatus);
    assessmentEntry = assessmentService.updateAssessmentEntry(assessmentEntry);
    boolean firstStart = start.getAndSet(false);
    if (firstStart && !authorMode) {
        ThreadLocalUserActivityLogger.log(QTI21LoggingAction.QTI_START_AS_RESOURCE, getClass());
    }
}
Also used : AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus)

Example 19 with AssessmentEntryStatus

use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.

the class IdentityListCourseNodeController method getSearchParameters.

protected SearchAssessedIdentityParams getSearchParameters() {
    SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(courseEntry, courseNode.getIdent(), referenceEntry, assessmentCallback);
    List<FlexiTableFilter> filters = tableEl.getSelectedFilters();
    List<FlexiTableFilter> extendedFilters = tableEl.getSelectedExtendedFilters();
    List<AssessmentEntryStatus> assessmentStatus = null;
    if (filters != null && filters.size() > 0) {
        assessmentStatus = new ArrayList<>(filters.size());
        for (FlexiTableFilter filter : filters) {
            if ("passed".equals(filter.getFilter())) {
                params.setPassed(true);
            } else if ("failed".equals(filter.getFilter())) {
                params.setFailed(true);
            } else if (AssessmentEntryStatus.isValueOf(filter.getFilter())) {
                assessmentStatus.add(AssessmentEntryStatus.valueOf(filter.getFilter()));
            }
        }
    }
    params.setAssessmentStatus(assessmentStatus);
    List<Long> businessGroupKeys = null;
    if (group != null) {
        businessGroupKeys = Collections.singletonList(group.getKey());
    } else if (extendedFilters != null && extendedFilters.size() > 0) {
        businessGroupKeys = new ArrayList<>(extendedFilters.size());
        for (FlexiTableFilter extendedFilter : extendedFilters) {
            if (StringHelper.isLong(extendedFilter.getFilter())) {
                businessGroupKeys.add(Long.parseLong(extendedFilter.getFilter()));
            }
        }
    }
    params.setBusinessGroupKeys(businessGroupKeys);
    params.setSearchString(tableEl.getQuickSearchString());
    return params;
}
Also used : SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) ArrayList(java.util.ArrayList) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus)

Example 20 with AssessmentEntryStatus

use of org.olat.modules.assessment.model.AssessmentEntryStatus in project openolat by klemens.

the class PortfolioServiceImpl method updateAssessmentEntry.

private void updateAssessmentEntry(Identity assessedIdentity, Binder binder, Set<AssessmentSection> assessmentSections, Identity coachingIdentity) {
    boolean allPassed = true;
    int totalSectionPassed = 0;
    int totalSectionClosed = 0;
    BigDecimal totalScore = new BigDecimal("0.0");
    AssessmentEntryStatus binderStatus = null;
    for (AssessmentSection assessmentSection : assessmentSections) {
        if (assessmentSection.getScore() != null) {
            totalScore = totalScore.add(assessmentSection.getScore());
        }
        if (assessmentSection.getPassed() != null && assessmentSection.getPassed().booleanValue()) {
            allPassed &= true;
            totalSectionPassed++;
        }
        Section section = assessmentSection.getSection();
        if (section.getSectionStatus() == SectionStatus.closed) {
            totalSectionClosed++;
        }
    }
    Boolean totalPassed = null;
    if (totalSectionClosed == assessmentSections.size()) {
        totalPassed = new Boolean(allPassed);
    } else {
        if (assessmentSections.size() == totalSectionPassed) {
            totalPassed = Boolean.TRUE;
        }
        binderStatus = AssessmentEntryStatus.inProgress;
    }
    // order status from the entry / section
    RepositoryEntry entry = binder.getEntry();
    if ("CourseModule".equals(entry.getOlatResource().getResourceableTypeName())) {
        ICourse course = CourseFactory.loadCourse(entry);
        CourseNode courseNode = course.getRunStructure().getNode(binder.getSubIdent());
        if (courseNode instanceof PortfolioCourseNode) {
            PortfolioCourseNode pfNode = (PortfolioCourseNode) courseNode;
            ScoreEvaluation scoreEval = new ScoreEvaluation(totalScore.floatValue(), totalPassed, binderStatus, true, true, null, null, binder.getKey());
            UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity, course);
            pfNode.updateUserScoreEvaluation(scoreEval, userCourseEnv, coachingIdentity, false, Role.coach);
        }
    } else {
        OLATResource resource = ((BinderImpl) binder.getTemplate()).getOlatResource();
        RepositoryEntry referenceEntry = repositoryService.loadByResourceKey(resource.getKey());
        AssessmentEntry assessmentEntry = assessmentService.getOrCreateAssessmentEntry(assessedIdentity, null, binder.getEntry(), binder.getSubIdent(), referenceEntry);
        assessmentEntry.setScore(totalScore);
        assessmentEntry.setPassed(totalPassed);
        assessmentEntry.setAssessmentStatus(binderStatus);
        assessmentService.updateAssessmentEntry(assessmentEntry);
    }
}
Also used : PortfolioCourseNode(org.olat.course.nodes.PortfolioCourseNode) ScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) OLATResource(org.olat.resource.OLATResource) ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) AssessmentSection(org.olat.modules.portfolio.AssessmentSection) Section(org.olat.modules.portfolio.Section) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) BigDecimal(java.math.BigDecimal) AssessmentSection(org.olat.modules.portfolio.AssessmentSection) BinderImpl(org.olat.modules.portfolio.model.BinderImpl) CourseNode(org.olat.course.nodes.CourseNode) PortfolioCourseNode(org.olat.course.nodes.PortfolioCourseNode) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean)

Aggregations

AssessmentEntryStatus (org.olat.modules.assessment.model.AssessmentEntryStatus)30 ScoreEvaluation (org.olat.course.run.scoring.ScoreEvaluation)10 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)8 RepositoryEntry (org.olat.repository.RepositoryEntry)8 BigDecimal (java.math.BigDecimal)6 ArrayList (java.util.ArrayList)6 Identity (org.olat.core.id.Identity)6 ICourse (org.olat.course.ICourse)6 AssessmentEntry (org.olat.modules.assessment.AssessmentEntry)6 HashMap (java.util.HashMap)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)4 SearchAssessedIdentityParams (org.olat.course.assessment.model.SearchAssessedIdentityParams)4 IQTESTCourseNode (org.olat.course.nodes.IQTESTCourseNode)4 AssessmentSection (org.olat.modules.portfolio.AssessmentSection)4 Section (org.olat.modules.portfolio.Section)4 CourseNode (org.olat.course.nodes.CourseNode)3 PortfolioCourseNode (org.olat.course.nodes.PortfolioCourseNode)3 SelfAssessableCourseNode (org.olat.course.nodes.SelfAssessableCourseNode)3 BinderImpl (org.olat.modules.portfolio.model.BinderImpl)3