use of org.olat.ims.qti21.ui.components.FeedbackResultFormItem in project OpenOLAT by OpenOLAT.
the class AssessmentResultController method initFormItemResult.
private Results initFormItemResult(FormLayoutContainer layoutCont, TestPlanNode node, Map<Identifier, AssessmentItemRef> identifierToRefs, Map<TestPlanNode, Results> resultsMap) {
TestPlanNodeKey testPlanNodeKey = node.getKey();
Identifier identifier = testPlanNodeKey.getIdentifier();
AssessmentItemRef itemRef = identifierToRefs.get(identifier);
ResolvedAssessmentItem resolvedAssessmentItem = resolvedAssessmentTest.getResolvedAssessmentItem(itemRef);
AssessmentItem assessmentItem = resolvedAssessmentItem.getRootNodeLookup().extractIfSuccessful();
QTI21QuestionType type = QTI21QuestionType.getType(assessmentItem);
AssessmentItemSession itemSession = identifierToItemSession.get(identifier.toString());
Results r = new Results(false, node.getSectionPartTitle(), type.getCssClass(), options.isQuestionSummary());
// init
r.setSessionStatus(null);
r.setItemIdentifier(node.getIdentifier().toString());
ItemSessionState sessionState = testSessionState.getItemSessionStates().get(testPlanNodeKey);
if (sessionState != null) {
r.setSessionState(sessionState);
SessionStatus sessionStatus = sessionState.getSessionStatus();
if (sessionState != null) {
r.setSessionStatus(sessionStatus);
}
}
ItemResult itemResult = assessmentResult.getItemResult(identifier.toString());
if (itemResult != null) {
extractOutcomeVariable(itemResult.getItemVariables(), r);
}
if (itemSession != null) {
if (itemSession.getManualScore() != null) {
r.setScore(itemSession.getManualScore());
r.setManualScore(itemSession.getManualScore());
}
r.setComment(itemSession.getCoachComment());
}
// update max score of section
if (options.isUserSolutions() || options.isCorrectSolutions()) {
InteractionResults interactionResults = initFormItemInteractions(layoutCont, sessionState, resolvedAssessmentItem);
r.setInteractionResults(interactionResults);
if (options.isCorrectSolutions()) {
String correctSolutionId = "correctSolutionItem" + count++;
FeedbackResultFormItem correctSolutionItem = new FeedbackResultFormItem(correctSolutionId, resolvedAssessmentItem);
initInteractionResultFormItem(correctSolutionItem, sessionState);
layoutCont.add(correctSolutionId, correctSolutionItem);
r.setCorrectSolutionItem(correctSolutionItem);
}
}
updateSectionScoreInformations(node, r, resultsMap);
return r;
}
use of org.olat.ims.qti21.ui.components.FeedbackResultFormItem in project openolat by klemens.
the class AssessmentResultController method initFormItemResult.
private Results initFormItemResult(FormLayoutContainer layoutCont, TestPlanNode node, Map<Identifier, AssessmentItemRef> identifierToRefs, Map<TestPlanNode, Results> resultsMap) {
TestPlanNodeKey testPlanNodeKey = node.getKey();
Identifier identifier = testPlanNodeKey.getIdentifier();
AssessmentItemRef itemRef = identifierToRefs.get(identifier);
ResolvedAssessmentItem resolvedAssessmentItem = resolvedAssessmentTest.getResolvedAssessmentItem(itemRef);
AssessmentItem assessmentItem = resolvedAssessmentItem.getRootNodeLookup().extractIfSuccessful();
QTI21QuestionType type = QTI21QuestionType.getType(assessmentItem);
AssessmentItemSession itemSession = identifierToItemSession.get(identifier.toString());
Results r = new Results(false, node.getSectionPartTitle(), type.getCssClass(), options.isQuestionSummary());
// init
r.setSessionStatus(null);
r.setItemIdentifier(node.getIdentifier().toString());
ItemSessionState sessionState = testSessionState.getItemSessionStates().get(testPlanNodeKey);
if (sessionState != null) {
r.setSessionState(sessionState);
SessionStatus sessionStatus = sessionState.getSessionStatus();
if (sessionState != null) {
r.setSessionStatus(sessionStatus);
}
}
ItemResult itemResult = assessmentResult.getItemResult(identifier.toString());
if (itemResult != null) {
extractOutcomeVariable(itemResult.getItemVariables(), r);
}
if (itemSession != null) {
if (itemSession.getManualScore() != null) {
r.setScore(itemSession.getManualScore());
r.setManualScore(itemSession.getManualScore());
}
r.setComment(itemSession.getCoachComment());
}
// update max score of section
if (options.isUserSolutions() || options.isCorrectSolutions()) {
InteractionResults interactionResults = initFormItemInteractions(layoutCont, sessionState, resolvedAssessmentItem);
r.setInteractionResults(interactionResults);
if (options.isCorrectSolutions()) {
String correctSolutionId = "correctSolutionItem" + count++;
FeedbackResultFormItem correctSolutionItem = new FeedbackResultFormItem(correctSolutionId, resolvedAssessmentItem);
initInteractionResultFormItem(correctSolutionItem, sessionState);
layoutCont.add(correctSolutionId, correctSolutionItem);
r.setCorrectSolutionItem(correctSolutionItem);
}
}
updateSectionScoreInformations(node, r, resultsMap);
return r;
}
Aggregations