use of org.olat.course.nodes.IQTESTCourseNode in project OpenOLAT by OpenOLAT.
the class IQIdentityListCourseNodeController method initStatusColumns.
@Override
protected void initStatusColumns(FlexiTableColumnModel columnsModel) {
super.initStatusColumns(columnsModel);
IQTESTCourseNode testCourseNode = (IQTESTCourseNode) courseNode;
if (testCourseNode != null && testCourseNode.hasCompletion()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(IdentityCourseElementCols.currentCompletion));
}
RepositoryEntry qtiTestEntry = getReferencedRepositoryEntry();
if (testCourseNode != null && testCourseNode.hasQTI21TimeLimit(qtiTestEntry)) {
int timeLimitInSeconds = testCourseNode.getQTI21TimeLimitMaxInSeconds(qtiTestEntry);
boolean suspendEnabled = isSuspendEnable();
FlexiCellRenderer renderer = new ExtraTimeCellRenderer(!suspendEnabled, timeLimitInSeconds, getLocale());
String header = suspendEnabled ? "table.header.extra.time" : "table.header.end.date";
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(header, IdentityCourseElementCols.details.ordinal(), renderer));
}
}
use of org.olat.course.nodes.IQTESTCourseNode in project OpenOLAT by OpenOLAT.
the class IQIdentityListCourseNodeController method doStartCorrection.
private void doStartCorrection(UserRequest ureq) {
AssessmentToolOptions asOptions = getOptions();
correctionIdentitiesCtrl = new CorrectionOverviewController(ureq, getWindowControl(), stackPanel, getCourseEnvironment(), asOptions, (IQTESTCourseNode) courseNode);
if (correctionIdentitiesCtrl.getNumberOfAssessedIdentities() == 0) {
showWarning("grade.nobody");
correctionIdentitiesCtrl = null;
} else {
listenTo(correctionIdentitiesCtrl);
stackPanel.pushController(translate("correction.test.title"), correctionIdentitiesCtrl);
}
}
use of org.olat.course.nodes.IQTESTCourseNode in project OpenOLAT by OpenOLAT.
the class IQIdentityListCourseNodeController method doConfirmPull.
private void doConfirmPull(UserRequest ureq) {
AssessmentToolOptions asOptions = getOptions();
RepositoryEntry testEntry = getReferencedRepositoryEntry();
CourseEnvironment courseEnv = getCourseEnvironment();
if (ImsQTI21Resource.TYPE_NAME.equals(testEntry.getOlatResource().getResourceableTypeName())) {
retrieveConfirmationCtr = new QTI21RetrieveTestsController(ureq, getWindowControl(), courseEnv, asOptions, (IQTESTCourseNode) courseNode);
} else {
retrieveConfirmationCtr = new QTI12PullTestsToolController(ureq, getWindowControl(), courseEnv, asOptions, (IQTESTCourseNode) courseNode);
}
listenTo(retrieveConfirmationCtr);
String title = translate("tool.pull");
cmc = new CloseableModalController(getWindowControl(), null, retrieveConfirmationCtr.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
use of org.olat.course.nodes.IQTESTCourseNode in project OpenOLAT by OpenOLAT.
the class IQIdentityListCourseNodeController method doUpdateCourseNode.
private void doUpdateCourseNode(List<AssessmentTestSession> testSessionsToComplete, AssessmentTest assessmentTest, AssessmentEntryStatus status) {
if (testSessionsToComplete == null || testSessionsToComplete.isEmpty())
return;
Double cutValue = QtiNodesExtractor.extractCutValue(assessmentTest);
for (AssessmentTestSession testSession : testSessionsToComplete) {
UserCourseEnvironment assessedUserCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(testSession.getIdentity(), getCourseEnvironment());
ScoreEvaluation scoreEval = ((IQTESTCourseNode) courseNode).getUserScoreEvaluation(assessedUserCourseEnv);
BigDecimal finalScore = testSession.getFinalScore();
Float score = finalScore == null ? null : finalScore.floatValue();
Boolean passed = scoreEval.getPassed();
if (testSession.getManualScore() != null && finalScore != null && cutValue != null) {
boolean calculated = finalScore.compareTo(BigDecimal.valueOf(cutValue.doubleValue())) >= 0;
passed = Boolean.valueOf(calculated);
}
AssessmentEntryStatus finalStatus = status == null ? scoreEval.getAssessmentStatus() : status;
ScoreEvaluation manualScoreEval = new ScoreEvaluation(score, passed, finalStatus, scoreEval.getUserVisible(), scoreEval.getFullyAssessed(), scoreEval.getCurrentRunCompletion(), scoreEval.getCurrentRunStatus(), testSession.getKey());
((IQTESTCourseNode) courseNode).updateUserScoreEvaluation(manualScoreEval, assessedUserCourseEnv, getIdentity(), false, Role.coach);
}
}
use of org.olat.course.nodes.IQTESTCourseNode in project OpenOLAT by OpenOLAT.
the class IQIdentityListCourseNodeController method doLaunchStatistics.
private void doLaunchStatistics(UserRequest ureq) {
Controller statisticsCtrl;
RepositoryEntry testEntry = getReferencedRepositoryEntry();
if (ImsQTI21Resource.TYPE_NAME.equals(testEntry.getOlatResource().getResourceableTypeName())) {
statisticsCtrl = new QTI21StatisticsToolController(ureq, getWindowControl(), stackPanel, getCourseEnvironment(), getOptions(), (IQTESTCourseNode) courseNode);
} else {
statisticsCtrl = new QTI12StatisticsToolController(ureq, getWindowControl(), stackPanel, getCourseEnvironment(), getOptions(), (IQTESTCourseNode) courseNode);
}
listenTo(statisticsCtrl);
stackPanel.pushController(translate("button.stats"), statisticsCtrl);
}
Aggregations