use of org.olat.ims.qti21.ui.assessment.model.AssessmentItemListEntry in project OpenOLAT by OpenOLAT.
the class CorrectionIdentityAssessmentItemNavigationController method doPrevious.
private void doPrevious(UserRequest ureq) {
AssessmentItemListEntry currentEntry = getAssessmentItemSession();
List<? extends AssessmentItemListEntry> assessmentEntryList = getAssessmentEntryList();
int index = assessmentEntryList.indexOf(currentEntry) - 1;
if (index >= 0 && index < assessmentEntryList.size()) {
AssessmentItemListEntry nextEntry = assessmentEntryList.get(index);
fireEvent(ureq, new SelectAssessmentItemEvent(nextEntry));
} else {
previousItemLink.setEnabled(false);
}
}
use of org.olat.ims.qti21.ui.assessment.model.AssessmentItemListEntry in project openolat by klemens.
the class CorrectionAssessmentItemListController method updatePreviousNext.
private void updatePreviousNext() {
if (identityItemCtrl != null) {
AssessmentItemListEntry itemSession = identityItemCtrl.getAssessmentItemSession();
List<? extends AssessmentItemListEntry> selectedItemSessions = identityItemCtrl.getAssessmentEntryList();
String previousText = translate("previous.user");
String nextText = translate("next.user");
boolean previousEnable = false;
boolean nextEnable = false;
int index = selectedItemSessions.indexOf(itemSession);
if (index - 1 >= 0 && selectedItemSessions.size() > index - 1) {
previousText = selectedItemSessions.get(index - 1).getLabel();
previousEnable = true;
}
if (index + 1 >= 0 && selectedItemSessions.size() > index + 1) {
nextText = selectedItemSessions.get(index + 1).getLabel();
nextEnable = true;
}
identityItemCtrl.updatePreviousNext(previousText, previousEnable, nextText, nextEnable);
}
}
use of org.olat.ims.qti21.ui.assessment.model.AssessmentItemListEntry in project openolat by klemens.
the class CorrectionIdentityAssessmentItemNavigationController method doPrevious.
private void doPrevious(UserRequest ureq) {
AssessmentItemListEntry currentEntry = getAssessmentItemSession();
List<? extends AssessmentItemListEntry> assessmentEntryList = getAssessmentEntryList();
int index = assessmentEntryList.indexOf(currentEntry) - 1;
if (index >= 0 && index < assessmentEntryList.size()) {
AssessmentItemListEntry nextEntry = assessmentEntryList.get(index);
fireEvent(ureq, new SelectAssessmentItemEvent(nextEntry));
} else {
previousItemLink.setEnabled(false);
}
}
use of org.olat.ims.qti21.ui.assessment.model.AssessmentItemListEntry in project openolat by klemens.
the class CorrectionIdentityAssessmentItemNavigationController method doNext.
private void doNext(UserRequest ureq) {
AssessmentItemListEntry currentEntry = getAssessmentItemSession();
List<? extends AssessmentItemListEntry> assessmentEntryList = getAssessmentEntryList();
int index = assessmentEntryList.indexOf(currentEntry) + 1;
if (index >= 0 && index < assessmentEntryList.size()) {
AssessmentItemListEntry nextEntry = assessmentEntryList.get(index);
fireEvent(ureq, new SelectAssessmentItemEvent(nextEntry));
} else {
nextItemLink.setEnabled(false);
}
}
use of org.olat.ims.qti21.ui.assessment.model.AssessmentItemListEntry in project openolat by klemens.
the class CorrectionAssessmentItemListController method doSelect.
private void doSelect(UserRequest ureq, AssessmentItemListEntry listEntry, List<? extends AssessmentItemListEntry> selectedItemSessions) {
removeAsListenerAndDispose(identityItemCtrl);
doUnlock();
AssessmentItemRef itemRef = listEntry.getItemRef();
AssessmentItemSession reloadItemSession = null;
if (listEntry.getItemSession() != null) {
reloadItemSession = qtiService.getAssessmentItemSession(listEntry.getItemSession());
}
// lock on item, need to check the lock on identity / test
String lockSubKey = "item-" + listEntry.getAssessedIdentity().getKey() + "-" + listEntry.getItemRef().getIdentifier().toString();
OLATResourceable testOres = OresHelper.clone(model.getTestEntry().getOlatResource());
lockResult = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(testOres, getIdentity(), lockSubKey);
if (lockResult.isSuccess()) {
Identity assessedIdentity = listEntry.getAssessedIdentity();
AssessmentTestSession candidateSession = listEntry.getTestSession();
TestSessionState testSessionState = qtiService.loadTestSessionState(listEntry.getTestSession());
List<TestPlanNode> nodes = testSessionState.getTestPlan().getNodes(itemRef.getIdentifier());
if (nodes.size() == 1) {
TestPlanNode itemNode = nodes.get(0);
ItemSessionState itemSessionState = testSessionState.getItemSessionStates().get(itemNode.getKey());
AssessmentItemCorrection itemCorrection = new AssessmentItemCorrection(assessedIdentity, candidateSession, testSessionState, reloadItemSession, itemSessionState, itemRef, itemNode);
itemCorrection.setItemSession(reloadItemSession);
identityItemCtrl = new CorrectionIdentityAssessmentItemNavigationController(ureq, getWindowControl(), model.getTestEntry(), model.getResolvedAssessmentTest(), itemCorrection, listEntry, selectedItemSessions, model);
listenTo(identityItemCtrl);
updatePreviousNext();
stackPanel.pushController(listEntry.getLabel(), identityItemCtrl);
}
} else {
String lockOwnerName = userManager.getUserDisplayName(lockResult.getOwner());
showWarning("warning.assessment.item.locked", new String[] { lockOwnerName });
}
}
Aggregations