use of uk.ac.ed.ph.jqtiplus.state.TestSessionState in project OpenOLAT by OpenOLAT.
the class AssessmentTestDisplayController method processNextItem.
private void processNextItem(UserRequest ureq) {
if (checkConcurrentExit(ureq)) {
return;
}
Date requestTimestamp = ureq.getRequestTimestamp();
if (testSessionController.hasFollowingNonLinearItem()) {
TestPlanNode selectedNode = testSessionController.selectFollowingItemNonLinear(requestTimestamp);
TestPlanNodeKey selectedNodeKey = (selectedNode == null ? null : selectedNode.getKey());
NotificationRecorder notificationRecorder = new NotificationRecorder(NotificationLevel.INFO);
TestSessionState testSessionState = testSessionController.getTestSessionState();
CandidateEvent candidateEvent = qtiService.recordCandidateTestEvent(candidateSession, testEntry, entry, CandidateTestEventType.NEXT_ITEM, null, selectedNodeKey, testSessionState, notificationRecorder);
candidateAuditLogger.logCandidateEvent(candidateEvent);
}
}
use of uk.ac.ed.ph.jqtiplus.state.TestSessionState in project OpenOLAT by OpenOLAT.
the class AssessmentTestDisplayController method resumeSession.
private TestSessionController resumeSession(UserRequest ureq) {
Date requestTimestamp = ureq.getRequestTimestamp();
final NotificationRecorder notificationRecorder = new NotificationRecorder(NotificationLevel.INFO);
TestSessionController controller = createTestSessionController(notificationRecorder);
if (!controller.getTestSessionState().isEnded() && !controller.getTestSessionState().isExited()) {
controller.unsuspendTestSession(requestTimestamp);
TestSessionState testSessionState = controller.getTestSessionState();
TestPlanNodeKey currentItemKey = testSessionState.getCurrentItemKey();
if (currentItemKey != null) {
TestPlanNode currentItemNode = testSessionState.getTestPlan().getNode(currentItemKey);
ItemProcessingContext itemProcessingContext = controller.getItemProcessingContext(currentItemNode);
ItemSessionState itemSessionState = itemProcessingContext.getItemSessionState();
if (itemProcessingContext instanceof ItemSessionController && itemSessionState.isSuspended()) {
ItemSessionController itemSessionController = (ItemSessionController) itemProcessingContext;
itemSessionController.unsuspendItemSession(requestTimestamp);
}
}
}
return controller;
}
use of uk.ac.ed.ph.jqtiplus.state.TestSessionState in project OpenOLAT by OpenOLAT.
the class AssessmentTestDisplayController method processSelectItem.
private void processSelectItem(UserRequest ureq, String key) {
if (checkConcurrentExit(ureq)) {
return;
}
TestPlanNodeKey nodeKey = TestPlanNodeKey.fromString(key);
Date requestTimestamp = ureq.getRequestTimestamp();
TestPlanNode selectedNode = testSessionController.selectItemNonlinear(requestTimestamp, nodeKey);
/* Record and log event */
TestPlanNodeKey selectedNodeKey = (selectedNode == null ? null : selectedNode.getKey());
NotificationRecorder notificationRecorder = new NotificationRecorder(NotificationLevel.INFO);
TestSessionState testSessionState = testSessionController.getTestSessionState();
CandidateEvent candidateEvent = qtiService.recordCandidateTestEvent(candidateSession, testEntry, entry, CandidateTestEventType.SELECT_MENU, null, selectedNodeKey, testSessionState, notificationRecorder);
candidateAuditLogger.logCandidateEvent(candidateEvent);
}
use of uk.ac.ed.ph.jqtiplus.state.TestSessionState in project OpenOLAT by OpenOLAT.
the class AssessmentTestDisplayController method doCancel.
private void doCancel(UserRequest ureq) {
VelocityContainer cancelledVC = createVelocityContainer("cancelled");
mainPanel.setContent(cancelledVC);
// only cancel unfinished test (prevent concurrent pull session / cancel to delete the data)
if (candidateSession.getFinishTime() == null) {
TestSessionState testSessionState = testSessionController.getTestSessionState();
qtiService.cancelTestSession(candidateSession, testSessionState);
}
fireEvent(ureq, Event.CANCELLED_EVENT);
candidateSession = null;
}
use of uk.ac.ed.ph.jqtiplus.state.TestSessionState in project OpenOLAT by OpenOLAT.
the class AssessmentTestDisplayController method processReviewTestPart.
private void processReviewTestPart() {
NotificationRecorder notificationRecorder = new NotificationRecorder(NotificationLevel.INFO);
TestSessionState testSessionState = testSessionController.getTestSessionState();
// assertSessionNotTerminated(candidateSession);
if (testSessionState.getCurrentTestPartKey() == null || !testSessionState.getCurrentTestPartSessionState().isEnded()) {
candidateAuditLogger.logAndThrowCandidateException(candidateSession, CandidateExceptionReason.CANNOT_REVIEW_TEST_PART, null);
logError("CANNOT_REVIEW_TEST_PART", null);
return;
}
/* Record and log event */
final CandidateEvent candidateTestEvent = qtiService.recordCandidateTestEvent(candidateSession, testEntry, entry, CandidateTestEventType.REVIEW_TEST_PART, null, null, testSessionState, notificationRecorder);
candidateAuditLogger.logCandidateEvent(candidateTestEvent);
this.lastEvent = candidateTestEvent;
}
Aggregations