use of org.olat.course.nodes.IQTESTCourseNode in project openolat by klemens.
the class QTI21IdentityListCourseNodeToolsController method doConfirmPullSession.
private void doConfirmPullSession(UserRequest ureq, AssessmentTestSession session) {
retrieveConfirmationCtr = new QTI21RetrieveTestsController(ureq, getWindowControl(), session, (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 klemens.
the class QTI21IdentityListCourseNodeToolsController method doConfirmDeleteData.
private void doConfirmDeleteData(UserRequest ureq) {
resetDataCtrl = new QTI21ResetDataController(ureq, getWindowControl(), courseEntry, (IQTESTCourseNode) courseNode, assessedIdentity);
listenTo(resetDataCtrl);
String title = translate("reset.test.data.title");
cmc = new CloseableModalController(getWindowControl(), null, resetDataCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
use of org.olat.course.nodes.IQTESTCourseNode in project openolat by klemens.
the class IQEditReplaceWizard method doStep2.
private void doStep2(UserRequest ureq) {
String nodeTitle = courseNode.getShortTitle();
if (results != null && !results.isEmpty()) {
exportDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
UserManager um = UserManager.getInstance();
String charset = um.getUserCharset(ureq.getIdentity());
QTIExportManager qem = QTIExportManager.getInstance();
Long repositoryRef = results.get(0).getResultSet().getRepositoryRef();
List<QTIItemObject> qtiItemObjectList = new QTIObjectTreeBuilder().getQTIItemObjectList(repositoryRef);
QTIExportFormatter formatter;
if (courseNode instanceof IQTESTCourseNode) {
formatter = new QTIExportFormatterCSVType1(ureq.getLocale(), "\t", "\"", "\r\n", false);
} else if (courseNode instanceof IQSELFCourseNode) {
formatter = new QTIExportFormatterCSVType1(ureq.getLocale(), "\t", "\"", "\r\n", false);
((QTIExportFormatterCSVType1) formatter).setAnonymous(true);
} else {
formatter = new QTIExportFormatterCSVType3(ureq.getLocale(), null, "\t", "\"", "\r\n", false);
}
Map<Class<?>, QTIExportItemFormatConfig> qtiItemConfigs = getQTIItemConfigs(qtiItemObjectList);
formatter.setMapWithExportItemConfigs(qtiItemConfigs);
resultExportFile = qem.exportResults(formatter, results, qtiItemObjectList, courseNode.getShortTitle(), exportDir, charset, ".xls");
vcStep2 = createVelocityContainer("replacewizard_step2");
String[] args1 = new String[] { Integer.toString(learners.size()) };
vcStep2.contextPut("information", translate("replace.wizard.information.paragraph1", args1));
String[] args2 = new String[] { exportDir.getName(), resultExportFile };
vcStep2.contextPut("information_par2", translate("replace.wizard.information.paragraph2", args2));
vcStep2.contextPut("nodetitle", nodeTitle);
showFileButton = LinkFactory.createButton("replace.wizard.showfile", vcStep2, this);
} else {
// it exists no result
String[] args = new String[] { Integer.toString(numberOfQtiSerEntries) };
vcStep2 = createVelocityContainer("replacewizard_step2");
vcStep2.contextPut("information", translate("replace.wizard.information.empty.results", args));
vcStep2.contextPut("nodetitle", nodeTitle);
}
nextBtn = LinkFactory.createButton("replace.wizard.next", vcStep2, this);
setNextWizardStep(translate("replace.wizard.title.step2"), vcStep2);
}
use of org.olat.course.nodes.IQTESTCourseNode in project openolat by klemens.
the class ScoreAccountingHelper method createCourseResultsOverview.
public static void createCourseResultsOverview(List<Identity> identities, List<AssessableCourseNode> nodes, ICourse course, Locale locale, ZipOutputStream zout) {
try (OutputStream out = new ShieldOutputStream(zout)) {
zout.putNextEntry(new ZipEntry("Course_results.xlsx"));
createCourseResultsOverviewXMLTable(identities, nodes, course, locale, out);
zout.closeEntry();
} catch (IOException e) {
log.error("", e);
}
for (AssessableCourseNode node : nodes) {
String dir = "Assessment_documents/" + StringHelper.transformDisplayNameToFileSystemName(node.getShortName());
if (node instanceof IQTESTCourseNode || node.getModuleConfiguration().getBooleanSafe(MSCourseNode.CONFIG_KEY_HAS_INDIVIDUAL_ASSESSMENT_DOCS, false)) {
for (Identity assessedIdentity : identities) {
List<File> assessmentDocuments = course.getCourseEnvironment().getAssessmentManager().getIndividualAssessmentDocuments(node, assessedIdentity);
if (assessmentDocuments != null && !assessmentDocuments.isEmpty()) {
String name = assessedIdentity.getUser().getLastName() + "_" + assessedIdentity.getUser().getFirstName() + "_" + assessedIdentity.getName();
String userDirName = dir + "/" + StringHelper.transformDisplayNameToFileSystemName(name);
for (File document : assessmentDocuments) {
String path = userDirName + "/" + document.getName();
ZipUtil.addFileToZip(path, document, zout);
}
}
}
}
}
}
use of org.olat.course.nodes.IQTESTCourseNode in project openolat by klemens.
the class QTI21ResetDataController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (courseNode instanceof IQTESTCourseNode) {
IQTESTCourseNode testCourseNode = (IQTESTCourseNode) courseNode;
RepositoryEntry testEntry = courseNode.getReferencedRepositoryEntry();
RepositoryEntry courseEntry = courseEnv.getCourseGroupManager().getCourseEntry();
ICourse course = CourseFactory.loadCourse(courseEntry);
archiveData(course, options);
qtiService.deleteAssessmentTestSession(identities, testEntry, courseEntry, courseNode.getIdent());
for (Identity identity : identities) {
ScoreEvaluation scoreEval = new ScoreEvaluation(null, null, AssessmentEntryStatus.notStarted, null, Boolean.FALSE, 0.0d, AssessmentRunStatus.notStarted, null);
IdentityEnvironment ienv = new IdentityEnvironment(identity, studentRoles);
UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, courseEnv);
testCourseNode.updateUserScoreEvaluation(scoreEval, uce, getIdentity(), false, Role.coach);
testCourseNode.updateCurrentCompletion(uce, getIdentity(), null, AssessmentRunStatus.notStarted, Role.coach);
}
} else if (assessedEntry != null) {
archiveData(assessedEntry);
qtiService.deleteAssessmentTestSession(identities, assessedEntry, null, null);
}
fireEvent(ureq, Event.CHANGED_EVENT);
}
Aggregations