Search in sources :

Example 6 with AssessmentEntryStatus

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

the class IQTESTCourseNode method pullAssessmentTestSession.

public void pullAssessmentTestSession(AssessmentTestSession session, UserCourseEnvironment assessedUserCourseenv, Identity coachingIdentity, Role by) {
    Boolean visibility;
    AssessmentEntryStatus assessmentStatus;
    if (IQEditController.CORRECTION_MANUAL.equals(getModuleConfiguration().getStringValue(IQEditController.CONFIG_CORRECTION_MODE))) {
        assessmentStatus = AssessmentEntryStatus.inReview;
        visibility = Boolean.FALSE;
    } else {
        assessmentStatus = AssessmentEntryStatus.done;
        visibility = Boolean.TRUE;
    }
    ScoreEvaluation sceval = new ScoreEvaluation(session.getScore().floatValue(), session.getPassed(), assessmentStatus, visibility, Boolean.TRUE, 1.0d, AssessmentRunStatus.done, session.getKey());
    updateUserScoreEvaluation(sceval, assessedUserCourseenv, coachingIdentity, true, by);
}
Also used : ScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus)

Example 7 with AssessmentEntryStatus

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

the class OLATUpgrade_11_0_0 method processAssessmentPropertyForGTA.

private void processAssessmentPropertyForGTA(Identity assessedIdentity, AssessmentEntryImpl entry, GTACourseNode cNode, RepositoryEntry courseEntry) {
    List<Task> tasks = gtaManager.getTasks(assessedIdentity, courseEntry, cNode);
    if (tasks != null && tasks.size() > 0) {
        Task task = tasks.get(0);
        AssessmentEntryStatus status = gtaManager.convertToAssessmentEntrystatus(task, cNode);
        entry.setStatus(status.name());
        String details = gtaManager.getDetails(assessedIdentity, courseEntry, cNode);
        entry.setDetails(details);
    }
}
Also used : Task(org.olat.course.nodes.gta.Task) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus)

Example 8 with AssessmentEntryStatus

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

the class AssessmentEntryOutcomesListener method submit.

@Override
public void submit(Float submittedScore, Boolean submittedPass, Double completion, Long assessmentId) {
    AssessmentEntryStatus assessmentStatus;
    if (needManualCorrection) {
        assessmentStatus = AssessmentEntryStatus.inReview;
    } else {
        assessmentStatus = AssessmentEntryStatus.done;
    }
    assessmentEntry.setAssessmentStatus(assessmentStatus);
    if (submittedScore == null) {
        assessmentEntry.setScore(null);
    } else {
        assessmentEntry.setScore(new BigDecimal(Float.toString(submittedScore)));
    }
    assessmentEntry.setPassed(submittedPass);
    assessmentEntry.setCompletion(completion);
    assessmentEntry.setAssessmentId(assessmentId);
    assessmentEntry = assessmentService.updateAssessmentEntry(assessmentEntry);
    boolean firstClose = close.getAndSet(false);
    if (firstClose && !authorMode) {
        ThreadLocalUserActivityLogger.log(QTI21LoggingAction.QTI_CLOSE_AS_RESOURCE, getClass());
    }
}
Also used : AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) BigDecimal(java.math.BigDecimal)

Example 9 with AssessmentEntryStatus

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

the class BinderAssessmentController method loadModel.

private void loadModel() {
    List<AssessmentSection> aSections = portfolioService.getAssessmentSections(binder, null);
    Map<Section, AssessmentSection> aSectionsMap = new HashMap<>();
    for (AssessmentSection aSection : aSections) {
        aSectionsMap.put(aSection.getSection(), aSection);
    }
    // binder done only is an owner is present
    // and all owners have done the binder
    boolean binderDone = false;
    List<Identity> assessedIdentities = portfolioService.getMembers(binder, PortfolioRoles.owner.name());
    int countDone = 0;
    for (Identity assessedIdentity : assessedIdentities) {
        AssessmentEntryStatus status = portfolioService.getAssessmentStatus(assessedIdentity, binder);
        if (status == AssessmentEntryStatus.done) {
            countDone++;
        }
    }
    binderDone = (countDone > 0 && countDone == assessedIdentities.size());
    boolean allClosed = true;
    List<Section> sections = portfolioService.getSections(binder);
    List<AssessmentSectionWrapper> rows = new ArrayList<>();
    Map<Section, AssessmentSectionWrapper> sectionToRows = new HashMap<>();
    for (Section section : sections) {
        AssessmentSection assessmentSection = aSectionsMap.get(section);
        AssessmentSectionWrapper row = new AssessmentSectionWrapper(section, assessmentSection);
        sectionToRows.put(section, row);
        if (secCallback.canViewAssess(section) || secCallback.canAssess(section)) {
            rows.add(row);
        }
        allClosed &= section.getSectionStatus() == SectionStatus.closed;
    }
    List<Page> pages = portfolioService.getPages(binder, null);
    for (Page page : pages) {
        AssessmentSectionWrapper row = sectionToRows.get(page.getSection());
        if (row != null) {
            row.setNumOfPages(row.getNumOfPages() + 1);
        }
    }
    boolean allowedToAssess = false;
    boolean allowedToAssessBinder = secCallback.canAssess(binder);
    for (AssessmentSectionWrapper row : rows) {
        boolean canAssess = secCallback.canAssess(row.getSection());
        if (canAssess && !binderDone) {
            forgeAssessmentSection(row);
            allowedToAssess = true;
        }
    }
    reopenLink.setVisible(allowedToAssessBinder && binderDone);
    saveAndDoneLink.setVisible(allowedToAssessBinder && !binderDone && allClosed);
    saveButton.setVisible(allowedToAssess);
    cancelButton.setVisible(allowedToAssess);
    model.setObjects(rows);
    tableEl.reset();
    tableEl.reloadData();
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Page(org.olat.modules.portfolio.Page) AssessmentSection(org.olat.modules.portfolio.AssessmentSection) Section(org.olat.modules.portfolio.Section) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) AssessmentSection(org.olat.modules.portfolio.AssessmentSection) Identity(org.olat.core.id.Identity)

Example 10 with AssessmentEntryStatus

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

the class OLATUpgrade_11_0_0 method processAssessmentPropertyForGTA.

private void processAssessmentPropertyForGTA(Identity assessedIdentity, AssessmentEntryImpl entry, GTACourseNode cNode, RepositoryEntry courseEntry) {
    List<Task> tasks = gtaManager.getTasks(assessedIdentity, courseEntry, cNode);
    if (tasks != null && tasks.size() > 0) {
        Task task = tasks.get(0);
        AssessmentEntryStatus status = gtaManager.convertToAssessmentEntrystatus(task, cNode);
        entry.setStatus(status.name());
        String details = gtaManager.getDetails(assessedIdentity, courseEntry, cNode);
        entry.setDetails(details);
    }
}
Also used : Task(org.olat.course.nodes.gta.Task) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus)

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