Search in sources :

Example 61 with AssessmentEntry

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

the class AssessmentItemEditorController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (tabbedPane == source) {
        Controller selectedCtrl = tabbedPane.getSelectedController();
        if (selectedCtrl instanceof SyncAssessmentItem) {
            ((SyncAssessmentItem) selectedCtrl).sync(ureq, itemBuilder);
        } else if (selectedCtrl == displayCtrl) {
            if (testEntry != null) {
                AssessmentEntry assessmentEntry = assessmentService.getOrCreateAssessmentEntry(getIdentity(), null, testEntry, null, testEntry);
                displayCtrl = new AssessmentItemPreviewController(ureq, getWindowControl(), resolvedAssessmentItem, itemRef, testEntry, assessmentEntry, rootDirectory, itemFile);
            } else {
                displayCtrl = new AssessmentItemPreviewController(ureq, getWindowControl(), resolvedAssessmentItem, rootDirectory, itemFile);
            }
            listenTo(displayCtrl);
            tabbedPane.replaceTab(displayTabPosition, displayCtrl);
        } else if (selectedCtrl == solutionCtrl) {
            solutionCtrl = new AssessmentItemPreviewSolutionController(ureq, getWindowControl(), resolvedAssessmentItem, rootDirectory, itemFile);
            listenTo(displayCtrl);
            tabbedPane.replaceTab(solutionTabPosition, solutionCtrl);
        }
    }
}
Also used : ChoiceScoreController(org.olat.ims.qti21.ui.editor.interactions.ChoiceScoreController) FIBEditorController(org.olat.ims.qti21.ui.editor.interactions.FIBEditorController) HottextEditorController(org.olat.ims.qti21.ui.editor.interactions.HottextEditorController) MatchEditorController(org.olat.ims.qti21.ui.editor.interactions.MatchEditorController) HotspotChoiceScoreController(org.olat.ims.qti21.ui.editor.interactions.HotspotChoiceScoreController) MatchScoreController(org.olat.ims.qti21.ui.editor.interactions.MatchScoreController) UploadEditorController(org.olat.ims.qti21.ui.editor.interactions.UploadEditorController) BasicController(org.olat.core.gui.control.controller.BasicController) KPrimEditorController(org.olat.ims.qti21.ui.editor.interactions.KPrimEditorController) AssessmentItemDisplayController(org.olat.ims.qti21.ui.AssessmentItemDisplayController) MultipleChoiceEditorController(org.olat.ims.qti21.ui.editor.interactions.MultipleChoiceEditorController) HotspotEditorController(org.olat.ims.qti21.ui.editor.interactions.HotspotEditorController) FIBScoreController(org.olat.ims.qti21.ui.editor.interactions.FIBScoreController) EssayEditorController(org.olat.ims.qti21.ui.editor.interactions.EssayEditorController) TrueFalseEditorController(org.olat.ims.qti21.ui.editor.interactions.TrueFalseEditorController) SingleChoiceEditorController(org.olat.ims.qti21.ui.editor.interactions.SingleChoiceEditorController) Controller(org.olat.core.gui.control.Controller) DrawingEditorController(org.olat.ims.qti21.ui.editor.interactions.DrawingEditorController) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry)

Example 62 with AssessmentEntry

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

the class QTI21AssessmentDetailsController method doUpdateEntry.

private void doUpdateEntry(AssessmentTestSession session) {
    AssessmentEntry assessmentEntry = assessmentService.loadAssessmentEntry(assessedIdentity, entry, null, entry);
    assessmentEntry.setScore(session.getFinalScore());
    assessmentEntry.setAssessmentId(session.getKey());
    assessmentService.updateAssessmentEntry(assessmentEntry);
}
Also used : AssessmentEntry(org.olat.modules.assessment.AssessmentEntry)

Example 63 with AssessmentEntry

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

the class IdentityListCourseNodeController method doUpdateCompletion.

private void doUpdateCompletion(Double completion, AssessmentRunStatus status, AssessedIdentityElementRow row) {
    row.getCurrentCompletion().setCompletion(completion);
    boolean endedRow = row.getCurrentCompletion().isEnded();
    boolean endedEvent = status != null && AssessmentRunStatus.done.equals(status);
    row.getCurrentCompletion().setEnded(endedEvent);
    if (endedEvent && !endedRow) {
        IdentityRef assessedIdentity = new IdentityRefImpl(row.getIdentityKey());
        AssessmentEntry assessmentEntry = assessmentToolManager.getAssessmentEntries(assessedIdentity, courseEntry, courseNode.getIdent());
        row.setAssessmentEntry(assessmentEntry);
        tableEl.getComponent().setDirty(true);
    }
}
Also used : IdentityRefImpl(org.olat.basesecurity.model.IdentityRefImpl) IdentityRef(org.olat.basesecurity.IdentityRef) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry)

Example 64 with AssessmentEntry

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

the class IdentityListCourseNodeController method loadModel.

protected void loadModel(@SuppressWarnings("unused") UserRequest ureq) {
    SearchAssessedIdentityParams params = getSearchParameters();
    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));
    List<AssessedIdentityElementRow> rows = new ArrayList<>(assessedIdentities.size());
    for (Identity assessedIdentity : assessedIdentities) {
        AssessmentEntry entry = entryMap.get(assessedIdentity.getKey());
        CompletionItem currentCompletion = new CompletionItem("current-completion-" + (++counter), getLocale());
        if (entry != null) {
            currentCompletion.setCompletion(entry.getCurrentRunCompletion());
            AssessmentRunStatus status = entry.getCurrentRunStatus();
            currentCompletion.setEnded(status != null && AssessmentRunStatus.done.equals(status));
        }
        FormLink toolsLink = uifactory.addFormLink("tools_" + (++counter), "tools", "", null, null, Link.NONTRANSLATED);
        toolsLink.setIconLeftCSS("o_icon o_icon_actions o_icon-lg");
        AssessedIdentityElementRow row = new AssessedIdentityElementRow(assessedIdentity, entry, currentCompletion, toolsLink, userPropertyHandlers, getLocale());
        toolsLink.setUserObject(row);
        rows.add(row);
    }
    usersTableModel.setObjects(rows);
    List<FlexiTableFilter> filters = tableEl.getSelectedFilters();
    if (filters != null && filters.size() > 0 && filters.get(0) != null) {
        usersTableModel.filter(Collections.singletonList(filters.get(0)));
    }
    tableEl.reset();
    tableEl.reloadData();
}
Also used : FlexiTableElement(org.olat.core.gui.components.form.flexible.elements.FlexiTableElement) Util(org.olat.core.util.Util) IdentityEnvironment(org.olat.core.id.IdentityEnvironment) RepositoryService(org.olat.repository.RepositoryService) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssessmentToolManager(org.olat.course.assessment.AssessmentToolManager) Role(org.olat.modules.assessment.Role) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) Autowired(org.springframework.beans.factory.annotation.Autowired) CourseNode(org.olat.course.nodes.CourseNode) IdentityRef(org.olat.basesecurity.IdentityRef) AssessmentToolSecurityCallback(org.olat.modules.assessment.ui.AssessmentToolSecurityCallback) CourseNodeFactory(org.olat.course.nodes.CourseNodeFactory) OLATResourceable(org.olat.core.id.OLATResourceable) AssessmentToolOptions(org.olat.modules.assessment.AssessmentToolOptions) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) GenericEventListener(org.olat.core.util.event.GenericEventListener) OresHelper(org.olat.core.util.resource.OresHelper) Map(java.util.Map) SortKey(org.olat.core.commons.persistence.SortKey) Group(org.olat.basesecurity.Group) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ICourse(org.olat.course.ICourse) IdentityCourseElementCols(org.olat.course.assessment.ui.tool.IdentityListCourseNodeTableModel.IdentityCourseElementCols) AssessmentModule(org.olat.course.assessment.AssessmentModule) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) WindowControl(org.olat.core.gui.control.WindowControl) STCourseNode(org.olat.course.nodes.STCourseNode) ScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation) AssessmentFormEvent(org.olat.modules.assessment.ui.event.AssessmentFormEvent) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler) Set(java.util.Set) AssessedIdentityElementRow(org.olat.modules.assessment.ui.AssessedIdentityElementRow) Component(org.olat.core.gui.components.Component) LinkFactory(org.olat.core.gui.components.link.LinkFactory) AssessedIdentityListState(org.olat.modules.assessment.ui.AssessedIdentityListState) AssessedIdentityController(org.olat.modules.assessment.ui.AssessedIdentityController) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) List(java.util.List) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) CalculatedAssessableCourseNode(org.olat.course.nodes.CalculatedAssessableCourseNode) Align(org.olat.core.gui.components.stack.TooledStackedPanel.Align) Identity(org.olat.core.id.Identity) AssessmentRunStatus(org.olat.modules.assessment.model.AssessmentRunStatus) CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) BaseSecurity(org.olat.basesecurity.BaseSecurity) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) Roles(org.olat.core.id.Roles) TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) FormEvent(org.olat.core.gui.components.form.flexible.impl.FormEvent) HashMap(java.util.HashMap) CourseFactory(org.olat.course.CourseFactory) RepositoryEntry(org.olat.repository.RepositoryEntry) FormItem(org.olat.core.gui.components.form.flexible.FormItem) ArrayList(java.util.ArrayList) CompletionItem(org.olat.modules.assessment.ui.component.CompletionItem) 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) ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) 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) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) Link(org.olat.core.gui.components.link.Link) CompletionEvent(org.olat.modules.assessment.ui.event.CompletionEvent) ShowDetailsEvent(org.olat.course.assessment.ui.tool.event.ShowDetailsEvent) IdentityRefImpl(org.olat.basesecurity.model.IdentityRefImpl) FlexiTableSearchEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent) Controller(org.olat.core.gui.control.Controller) UserManager(org.olat.user.UserManager) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) AssessmentToolContainer(org.olat.modules.assessment.ui.AssessmentToolContainer) UserCourseEnvironmentImpl(org.olat.course.run.userview.UserCourseEnvironmentImpl) BusinessGroup(org.olat.group.BusinessGroup) FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) UserRequest(org.olat.core.gui.UserRequest) Collections(java.util.Collections) CoordinatorManager(org.olat.core.util.coordinate.CoordinatorManager) AssessmentRunStatus(org.olat.modules.assessment.model.AssessmentRunStatus) HashMap(java.util.HashMap) AssessedIdentityElementRow(org.olat.modules.assessment.ui.AssessedIdentityElementRow) ArrayList(java.util.ArrayList) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) CompletionItem(org.olat.modules.assessment.ui.component.CompletionItem) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) Identity(org.olat.core.id.Identity)

Example 65 with AssessmentEntry

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

the class GTACoachedGroupGradingController method loadMembers.

private void loadMembers() {
    // load participants, load datas
    List<Identity> identities = businessGroupService.getMembers(assessedGroup, GroupRoles.participant.name());
    Map<Identity, AssessmentEntry> identityToEntryMap = new HashMap<>();
    List<AssessmentEntry> assessmentEntries = assessmentManager.getAssessmentEntries(assessedGroup, gtaNode);
    for (AssessmentEntry entry : assessmentEntries) {
        identityToEntryMap.put(entry.getIdentity(), entry);
    }
    List<AssessmentRow> rows = new ArrayList<>(identities.size());
    for (Identity identity : identities) {
        AssessmentEntry entry = identityToEntryMap.get(identity);
        AssessmentRow row = new AssessmentRow(identity, false);
        rows.add(row);
        if (withScore && entry != null) {
            String pointVal = AssessmentHelper.getRoundedScore(entry.getScore());
            row.setScore(pointVal);
        }
        if (withPassed && entry != null) {
            row.setPassed(entry.getPassed());
        }
        if (withComment) {
            FormLink commentLink = null;
            String comment = null;
            if (entry != null && StringHelper.containsNonWhitespace(entry.getComment())) {
                comment = entry.getComment();
                commentLink = uifactory.addFormLink("comment-" + CodeHelper.getRAMUniqueID(), "comment", "comment", null, flc, Link.LINK);
                commentLink.setIconLeftCSS("o_icon o_icon_comments");
                commentLink.setUserObject(row);
            }
            row.setComment(comment);
            row.setCommentTooltipLink(commentLink);
        }
    }
    model.setObjects(rows);
    table.reset();
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Identity(org.olat.core.id.Identity) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry)

Aggregations

AssessmentEntry (org.olat.modules.assessment.AssessmentEntry)150 Identity (org.olat.core.id.Identity)88 RepositoryEntry (org.olat.repository.RepositoryEntry)70 Test (org.junit.Test)50 ICourse (org.olat.course.ICourse)38 AssessmentTestSession (org.olat.ims.qti21.AssessmentTestSession)32 File (java.io.File)26 Date (java.util.Date)26 HashMap (java.util.HashMap)22 BigDecimal (java.math.BigDecimal)20 ArrayList (java.util.ArrayList)20 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)20 UserNodeAuditManager (org.olat.course.auditing.UserNodeAuditManager)16 CourseNode (org.olat.course.nodes.CourseNode)16 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)16 ScoreEvaluation (org.olat.course.run.scoring.ScoreEvaluation)14 AssessmentChangedEvent (org.olat.course.assessment.AssessmentChangedEvent)12 AssessmentManager (org.olat.course.assessment.AssessmentManager)12 BusinessGroup (org.olat.group.BusinessGroup)12 List (java.util.List)10