use of org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityAssessmentItemRow in project openolat by klemens.
the class CorrectionIdentityAssessmentItemListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
if ("select".equals(cmd)) {
CorrectionIdentityAssessmentItemRow row = tableModel.getObject(se.getIndex());
doSelect(ureq, row);
}
}
} else if (saveButton == source) {
List<AssessmentTestSession> sessions = Collections.singletonList(candidateSession);
AssessmentTest assessmentTest = model.getResolvedAssessmentTest().getRootNodeLookup().extractIfSuccessful();
fireEvent(ureq, new CompleteAssessmentTestSessionEvent(sessions, assessmentTest, AssessmentEntryStatus.done));
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityAssessmentItemRow in project openolat by klemens.
the class CorrectionIdentityAssessmentItemTableSort method sort.
@Override
protected void sort(List<CorrectionIdentityAssessmentItemRow> rows) {
int columnIndex = getColumnIndex();
IdentityItemCols column = IdentityItemCols.values()[columnIndex];
switch(column) {
case itemType:
Collections.sort(rows, new QuestionTypeComparator());
break;
case corrected:
Collections.sort(rows, new CorrectedComparator());
break;
case notCorrected:
Collections.sort(rows, new NotCorrectedComparator());
break;
default:
super.sort(rows);
}
}
use of org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityAssessmentItemRow in project openolat by klemens.
the class NotCorrectedFlexiCellRenderer method render.
@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source, URLBuilder ubu, Translator trans) {
Object obj = source.getFlexiTableElement().getTableDataModel().getObject(row);
if (obj instanceof CorrectionRow) {
CorrectionRow itemRow = (CorrectionRow) obj;
if (itemRow.isManualCorrection() && itemRow.getNumNotCorrected() > 0) {
target.append(itemRow.getNumNotCorrected());
target.append(" <i class='o_icon o_icon_fw o_icon_error'> </i> ");
}
} else if (obj instanceof CorrectionIdentityAssessmentItemRow) {
CorrectionIdentityAssessmentItemRow itemRow = (CorrectionIdentityAssessmentItemRow) obj;
if (itemRow.isManualCorrection() && itemRow.getManualScore() == null) {
target.append("<i class='o_icon o_icon_fw o_icon_error'> </i>");
}
}
}
use of org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityAssessmentItemRow in project OpenOLAT by OpenOLAT.
the class CorrectionIdentityAssessmentItemListController method loadModel.
private void loadModel(boolean reset) {
ResolvedAssessmentTest resolvedAssessmentTest = model.getResolvedAssessmentTest();
Map<Identifier, AssessmentItemRef> identifierToRefs = new HashMap<>();
for (AssessmentItemRef itemRef : resolvedAssessmentTest.getAssessmentItemRefs()) {
identifierToRefs.put(itemRef.getIdentifier(), itemRef);
}
List<AssessmentItemSession> allItemSessions = qtiService.getAssessmentItemSessions(candidateSession);
Map<String, AssessmentItemSession> identifierToItemSessions = new HashMap<>();
for (AssessmentItemSession itemSession : allItemSessions) {
identifierToItemSessions.put(itemSession.getAssessmentItemIdentifier(), itemSession);
}
// reorder to match the list of assessment items
List<CorrectionIdentityAssessmentItemRow> rows = new ArrayList<>();
TestSessionState testSessionState = model.getTestSessionStates().get(assessedIdentity);
List<TestPlanNode> nodes = testSessionState.getTestPlan().getTestPlanNodeList();
for (TestPlanNode node : nodes) {
if (node.getTestNodeType() == TestNodeType.ASSESSMENT_ITEM_REF) {
TestPlanNodeKey key = node.getKey();
AssessmentItemRef itemRef = identifierToRefs.get(key.getIdentifier());
AssessmentItemSession itemSession = identifierToItemSessions.get(key.getIdentifier().toString());
ResolvedAssessmentItem resolvedAssessmentItem = resolvedAssessmentTest.getResolvedAssessmentItem(itemRef);
ManifestMetadataBuilder metadata = model.getMetadata(itemRef);
AssessmentItem item = resolvedAssessmentItem.getRootNodeLookup().extractIfSuccessful();
ItemSessionState itemSessionState = testSessionState.getItemSessionStates().get(key);
boolean manualCorrection = model.isManualCorrection(itemRef);
CorrectionIdentityAssessmentItemRow row = new CorrectionIdentityAssessmentItemRow(assessedIdentity, item, itemRef, metadata, candidateSession, itemSession, itemSessionState, manualCorrection);
row.setTitle(title);
row.setTitleCssClass("o_icon_user");
rows.add(row);
}
}
tableModel.setObjects(rows);
tableEl.reset(reset, reset, true);
}
use of org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityAssessmentItemRow in project OpenOLAT by OpenOLAT.
the class NotCorrectedFlexiCellRenderer method render.
@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source, URLBuilder ubu, Translator trans) {
Object obj = source.getFlexiTableElement().getTableDataModel().getObject(row);
if (obj instanceof CorrectionRow) {
CorrectionRow itemRow = (CorrectionRow) obj;
if (itemRow.isManualCorrection() && itemRow.getNumNotCorrected() > 0) {
target.append(itemRow.getNumNotCorrected());
target.append(" <i class='o_icon o_icon_fw o_icon_error'> </i> ");
}
} else if (obj instanceof CorrectionIdentityAssessmentItemRow) {
CorrectionIdentityAssessmentItemRow itemRow = (CorrectionIdentityAssessmentItemRow) obj;
if (itemRow.isManualCorrection() && itemRow.getManualScore() == null) {
target.append("<i class='o_icon o_icon_fw o_icon_error'> </i>");
}
}
}
Aggregations