Search in sources :

Example 26 with AssessmentEntryStatus

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

the class GTAManagerImpl method syncAssessmentEntry.

private void syncAssessmentEntry(TaskImpl taskImpl, GTACourseNode cNode, Role by) {
    if (taskImpl == null || taskImpl.getTaskStatus() == null || cNode == null)
        return;
    RepositoryEntry courseRepoEntry = taskImpl.getTaskList().getEntry();
    AssessmentEntryStatus assessmentStatus = convertToAssessmentEntrystatus(taskImpl, cNode);
    if (GTAType.group.name().equals(cNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
        // update whole group
        assessmentService.updateAssessmentEntries(taskImpl.getBusinessGroup(), courseRepoEntry, cNode.getIdent(), null, assessmentStatus);
    } else {
        Identity assessedIdentity = taskImpl.getIdentity();
        assessmentService.updateAssessmentEntry(assessedIdentity, courseRepoEntry, cNode.getIdent(), null, assessmentStatus);
        dbInstance.commit();
        ICourse course = CourseFactory.loadCourse(courseRepoEntry);
        UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity, course);
        cNode.updateLastModifications(userCourseEnv, taskImpl.getIdentity(), by);
    }
}
Also used : UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) Identity(org.olat.core.id.Identity) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus)

Example 27 with AssessmentEntryStatus

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

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 28 with AssessmentEntryStatus

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

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 29 with AssessmentEntryStatus

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

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 30 with AssessmentEntryStatus

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

the class AssessedIdentityListController method updateModel.

protected void updateModel(String searchString, List<FlexiTableFilter> filters, List<FlexiTableFilter> extendedFilters) {
    SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(testEntry, null, testEntry, assessmentCallback);
    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 (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(searchString);
    List<Identity> assessedIdentities = assessmentToolManager.getAssessedIdentities(getIdentity(), params);
    List<AssessmentEntry> assessmentEntries = assessmentToolManager.getAssessmentEntries(getIdentity(), params, null);
    Map<Long, AssessmentEntry> entryMap = new HashMap<>();
    assessmentEntries.stream().filter((entry) -> entry.getIdentity() != null).forEach((entry) -> entryMap.put(entry.getIdentity().getKey(), entry));
    Map<Long, Date> initialLaunchDates = userInfosMgr.getInitialLaunchDates(testEntry.getOlatResource());
    List<AssessedIdentityElementRow> rows = new ArrayList<>(assessedIdentities.size());
    for (Identity assessedIdentity : assessedIdentities) {
        AssessmentEntry entry = entryMap.get(assessedIdentity.getKey());
        AssessedIdentityElementRow row = new AssessedIdentityElementRow(assessedIdentity, entry, null, null, userPropertyHandlers, getLocale());
        row.setInitialCourseLaunchDate(initialLaunchDates.get(assessedIdentity.getKey()));
        rows.add(row);
    }
    usersTableModel.setObjects(rows);
    if (filters != null && filters.size() > 0 && filters.get(0) != null) {
        usersTableModel.filter(Collections.singletonList(filters.get(0)));
    }
    tableEl.reloadData();
    searchParams = params;
    updateTools(assessedIdentities);
}
Also used : FlexiTableElement(org.olat.core.gui.components.form.flexible.elements.FlexiTableElement) Util(org.olat.core.util.Util) RepositoryHandlerFactory(org.olat.repository.handlers.RepositoryHandlerFactory) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssessmentToolManager(org.olat.course.assessment.AssessmentToolManager) Date(java.util.Date) UserCourseInformationsManager(org.olat.course.assessment.manager.UserCourseInformationsManager) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) Autowired(org.springframework.beans.factory.annotation.Autowired) RepositoyUIFactory(org.olat.repository.ui.RepositoyUIFactory) AssessmentToolOptions(org.olat.modules.assessment.AssessmentToolOptions) RepositoryHandler(org.olat.repository.handlers.RepositoryHandler) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) Map(java.util.Map) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) AssessmentModule(org.olat.course.assessment.AssessmentModule) WindowControl(org.olat.core.gui.control.WindowControl) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) IdentityCourseElementCols(org.olat.modules.assessment.ui.AssessedIdentityListTableModel.IdentityCourseElementCols) Component(org.olat.core.gui.components.Component) LinkFactory(org.olat.core.gui.components.link.LinkFactory) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) List(java.util.List) Align(org.olat.core.gui.components.stack.TooledStackedPanel.Align) Identity(org.olat.core.id.Identity) BaseSecurity(org.olat.basesecurity.BaseSecurity) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) FormEvent(org.olat.core.gui.components.form.flexible.impl.FormEvent) HashMap(java.util.HashMap) RepositoryEntry(org.olat.repository.RepositoryEntry) FormItem(org.olat.core.gui.components.form.flexible.FormItem) ArrayList(java.util.ArrayList) Event(org.olat.core.gui.control.Event) FormBasicController(org.olat.core.gui.components.form.flexible.impl.FormBasicController) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) FormItemContainer(org.olat.core.gui.components.form.flexible.FormItemContainer) ContextEntry(org.olat.core.id.context.ContextEntry) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) BaseSecurityModule(org.olat.basesecurity.BaseSecurityModule) StringHelper(org.olat.core.util.StringHelper) StateEntry(org.olat.core.id.context.StateEntry) FlexiTableDataModelFactory(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableDataModelFactory) BusinessGroupService(org.olat.group.BusinessGroupService) Link(org.olat.core.gui.components.link.Link) AssessmentStatusCellRenderer(org.olat.course.assessment.ui.tool.AssessmentStatusCellRenderer) FlexiTableSearchEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent) SearchBusinessGroupParams(org.olat.group.model.SearchBusinessGroupParams) Controller(org.olat.core.gui.control.Controller) UserManager(org.olat.user.UserManager) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) AssessmentToolConstants(org.olat.course.assessment.ui.tool.AssessmentToolConstants) AssessedIdentityListProvider(org.olat.course.assessment.ui.tool.AssessedIdentityListProvider) BusinessGroup(org.olat.group.BusinessGroup) UserRequest(org.olat.core.gui.UserRequest) Collections(java.util.Collections) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) Date(java.util.Date) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) Identity(org.olat.core.id.Identity)

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