use of uk.ac.ed.ph.jqtiplus.state.TestPlanNodeKey in project OpenOLAT by OpenOLAT.
the class AssessmentTestComponent method getResponseUniqueIdentifier.
@Override
public String getResponseUniqueIdentifier(ItemSessionState itemSessionState, Interaction interaction) {
TestPlanNodeKey tpnk = null;
for (Map.Entry<TestPlanNodeKey, ItemSessionState> entry : testSessionController.getTestSessionState().getItemSessionStates().entrySet()) {
if (entry.getValue() == itemSessionState) {
tpnk = entry.getKey();
break;
}
}
String id = "oo" + (tpnk.toString().replace(":", "_")) + "_" + interaction.getResponseIdentifier().toString();
responseIdentifiersMap.put(id, interaction);
return id;
}
use of uk.ac.ed.ph.jqtiplus.state.TestPlanNodeKey in project OpenOLAT by OpenOLAT.
the class AssessmentTreeComponent method getCurrentTestPartNode.
public TestPlanNode getCurrentTestPartNode() {
TestSessionState sessionState = getTestSessionController().getTestSessionState();
TestPlanNodeKey testPlanNodeKey = sessionState.getCurrentTestPartKey();
return testPlanNodeKey == null ? null : sessionState.getTestPlan().getNode(testPlanNodeKey);
}
use of uk.ac.ed.ph.jqtiplus.state.TestPlanNodeKey in project OpenOLAT by OpenOLAT.
the class AssessmentTreeComponentRenderer method renderNavigationAssessmentItem.
private void renderNavigationAssessmentItem(StringOutput sb, AssessmentTreeComponent component, TestPlanNode itemNode, Translator translator, RenderingRequest options) {
// check if currently rendered item is the active item
boolean active = false;
TestSessionController sessionCtr = component.getTestSessionController();
if (sessionCtr != null && itemNode != null) {
TestSessionState sessionState = sessionCtr.getTestSessionState();
if (sessionState != null && sessionState.getCurrentItemKey() != null) {
TestPlanNodeKey testPlanNodeKey = sessionState.getCurrentItemKey();
active = (testPlanNodeKey.getIdentifier().equals(itemNode.getIdentifier()));
}
}
sb.append("<li class='o_assessmentitem").append(" active", active).append("'>");
try {
renderAssessmentItemMark(sb, component, itemNode, translator);
renderAssessmentItemAttempts(sb, component, itemNode, translator);
renderItemStatus(sb, component, itemNode, translator, options);
renderAssessmentItemLink(sb, component, itemNode, translator);
} catch (IllegalStateException ex) {
log.error("", ex);
sb.append("<span class='o_danger'>ERROR</span>");
}
sb.append("</li>");
}
use of uk.ac.ed.ph.jqtiplus.state.TestPlanNodeKey in project openolat by klemens.
the class QTI21ServiceImpl method reopenTestPart.
private TestPlanNodeKey reopenTestPart(TestPlanNode lastItem, TestSessionState testSessionState) {
TestPlan plan = testSessionState.getTestPlan();
List<TestPlanNode> testPartNodes = lastItem.searchAncestors(TestNodeType.TEST_PART);
if (testPartNodes.isEmpty()) {
return null;
}
// reopen the test part of the selected item
TestPlanNode partNode = testPartNodes.get(0);
TestPlanNodeKey partKey = partNode.getKey();
TestPartSessionState partState = testSessionState.getTestPartSessionStates().get(partKey);
partState.setEndTime(null);
partState.setExitTime(null);
// reopen all sections the test part
for (Map.Entry<TestPlanNodeKey, AssessmentSectionSessionState> sectionEntry : testSessionState.getAssessmentSectionSessionStates().entrySet()) {
TestPlanNodeKey sectionKey = sectionEntry.getKey();
TestPlanNode sectionNode = plan.getNode(sectionKey);
if (sectionNode.hasAncestor(partNode)) {
AssessmentSectionSessionState sectionState = sectionEntry.getValue();
sectionState.setEndTime(null);
sectionState.setExitTime(null);
}
}
// reopen all items the test part
for (Map.Entry<TestPlanNodeKey, ItemSessionState> itemEntry : testSessionState.getItemSessionStates().entrySet()) {
TestPlanNodeKey itemKey = itemEntry.getKey();
TestPlanNode itemNode = plan.getNode(itemKey);
if (itemNode.hasAncestor(partNode)) {
ItemSessionState itemState = itemEntry.getValue();
itemState.setEndTime(null);
itemState.setExitTime(null);
}
}
return partKey;
}
use of uk.ac.ed.ph.jqtiplus.state.TestPlanNodeKey in project openolat by klemens.
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);
}
Aggregations