Search in sources :

Example 11 with TestPlan

use of uk.ac.ed.ph.jqtiplus.state.TestPlan in project openolat by klemens.

the class AssessmentTestDisplayController method createNewTestSessionStateAndController.

private TestSessionController createNewTestSessionStateAndController(NotificationRecorder notificationRecorder) {
    TestProcessingMap testProcessingMap = getTestProcessingMap();
    /* Generate a test plan for this session */
    final TestPlanner testPlanner = new TestPlanner(testProcessingMap);
    if (notificationRecorder != null) {
        testPlanner.addNotificationListener(notificationRecorder);
    }
    final TestPlan testPlan = testPlanner.generateTestPlan();
    final TestSessionState testSessionState = new TestSessionState(testPlan);
    final TestSessionControllerSettings testSessionControllerSettings = new TestSessionControllerSettings();
    testSessionControllerSettings.setTemplateProcessingLimit(computeTemplateProcessingLimit());
    testProcessingMap.reduceItemProcessingMapMap(testPlan.getTestPlanNodeList());
    /* Create controller and wire up notification recorder */
    final TestSessionController result = new TestSessionController(qtiService.jqtiExtensionManager(), testSessionControllerSettings, testProcessingMap, testSessionState);
    if (notificationRecorder != null) {
        result.addNotificationListener(notificationRecorder);
    }
    return result;
}
Also used : TestSessionControllerSettings(uk.ac.ed.ph.jqtiplus.running.TestSessionControllerSettings) TestProcessingMap(uk.ac.ed.ph.jqtiplus.state.TestProcessingMap) TestPlanner(uk.ac.ed.ph.jqtiplus.running.TestPlanner) TestSessionState(uk.ac.ed.ph.jqtiplus.state.TestSessionState) TestPlan(uk.ac.ed.ph.jqtiplus.state.TestPlan) TestSessionController(uk.ac.ed.ph.jqtiplus.running.TestSessionController)

Example 12 with TestPlan

use of uk.ac.ed.ph.jqtiplus.state.TestPlan in project openolat by klemens.

the class QTI21AssessmentDetailsController method updateModel.

protected void updateModel() {
    List<AssessmentTestSessionStatistics> sessionsStatistics = qtiService.getAssessmentTestSessionsStatistics(entry, subIdent, assessedIdentity);
    List<QTI21AssessmentTestSessionDetails> infos = new ArrayList<>();
    for (AssessmentTestSessionStatistics sessionStatistics : sessionsStatistics) {
        AssessmentTestSession testSession = sessionStatistics.getTestSession();
        TestSessionState testSessionState = qtiService.loadTestSessionState(testSession);
        TestPlan testPlan = testSessionState.getTestPlan();
        List<TestPlanNode> nodes = testPlan.getTestPlanNodeList();
        int responded = 0;
        int numOfItems = 0;
        for (TestPlanNode node : nodes) {
            TestNodeType testNodeType = node.getTestNodeType();
            ItemSessionState itemSessionState = testSessionState.getItemSessionStates().get(node.getKey());
            TestPlanNodeKey testPlanNodeKey = node.getKey();
            if (testPlanNodeKey != null && testPlanNodeKey.getIdentifier() != null && testNodeType == TestNodeType.ASSESSMENT_ITEM_REF) {
                numOfItems++;
                if (itemSessionState.isResponded()) {
                    responded++;
                }
            }
        }
        infos.add(new QTI21AssessmentTestSessionDetails(testSession, numOfItems, responded, sessionStatistics.getNumOfCorrectedItems()));
    }
    Collections.sort(infos, new AssessmentTestSessionDetailsComparator());
    tableModel.setObjects(infos);
    tableEl.reloadData();
    tableEl.reset();
    if (resetButton != null) {
        resetButton.setVisible(!sessionsStatistics.isEmpty());
    }
}
Also used : TestPlanNode(uk.ac.ed.ph.jqtiplus.state.TestPlanNode) AssessmentTestSession(org.olat.ims.qti21.AssessmentTestSession) TestSessionState(uk.ac.ed.ph.jqtiplus.state.TestSessionState) AssessmentTestSessionStatistics(org.olat.ims.qti21.model.jpa.AssessmentTestSessionStatistics) TestPlan(uk.ac.ed.ph.jqtiplus.state.TestPlan) ItemSessionState(uk.ac.ed.ph.jqtiplus.state.ItemSessionState) ArrayList(java.util.ArrayList) TestNodeType(uk.ac.ed.ph.jqtiplus.state.TestPlanNode.TestNodeType) TestPlanNodeKey(uk.ac.ed.ph.jqtiplus.state.TestPlanNodeKey)

Aggregations

TestPlan (uk.ac.ed.ph.jqtiplus.state.TestPlan)12 TestPlanNode (uk.ac.ed.ph.jqtiplus.state.TestPlanNode)10 TestPlanNodeKey (uk.ac.ed.ph.jqtiplus.state.TestPlanNodeKey)10 ItemSessionState (uk.ac.ed.ph.jqtiplus.state.ItemSessionState)8 HashMap (java.util.HashMap)6 AssessmentSectionSessionState (uk.ac.ed.ph.jqtiplus.state.AssessmentSectionSessionState)6 TestNodeType (uk.ac.ed.ph.jqtiplus.state.TestPlanNode.TestNodeType)6 TestSessionState (uk.ac.ed.ph.jqtiplus.state.TestSessionState)6 ArrayList (java.util.ArrayList)4 LinkedHashMap (java.util.LinkedHashMap)4 Map (java.util.Map)4 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)4 ConcurrentMap (java.util.concurrent.ConcurrentMap)4 AssessmentTestSession (org.olat.ims.qti21.AssessmentTestSession)4 TestPartSessionState (uk.ac.ed.ph.jqtiplus.state.TestPartSessionState)4 Date (java.util.Date)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 AssessmentSessionAuditLogger (org.olat.ims.qti21.AssessmentSessionAuditLogger)2 InMemoryAssessmentTestSession (org.olat.ims.qti21.model.InMemoryAssessmentTestSession)2 AssessmentTestSessionStatistics (org.olat.ims.qti21.model.jpa.AssessmentTestSessionStatistics)2