use of org.olat.course.run.environment.CourseEnvironment in project openolat by klemens.
the class PFCourseNode method archiveNodeData.
@Override
public boolean archiveNodeData(Locale locale, ICourse course, ArchiveOptions options, ZipOutputStream exportStream, String charset) {
CourseEnvironment courseEnv = course.getCourseEnvironment();
Path sourceFolder = Paths.get(courseEnv.getCourseBaseContainer().getBasefile().getAbsolutePath(), PFManager.FILENAME_PARTICIPANTFOLDER, getIdent());
Translator translator = Util.createPackageTranslator(PFRunController.class, locale);
return FileSystemExport.fsToZip(exportStream, sourceFolder, this, null, translator);
}
use of org.olat.course.run.environment.CourseEnvironment in project openolat by klemens.
the class PFCourseNode method cleanupOnDelete.
@Override
public void cleanupOnDelete(ICourse course) {
super.cleanupOnDelete(course);
// mark the subscription to this node as deleted
SubscriptionContext folderSubContext = CourseModule.createTechnicalSubscriptionContext(course.getCourseEnvironment(), this);
NotificationsManager.getInstance().delete(folderSubContext);
// delete filesystem
CourseEnvironment courseEnv = course.getCourseEnvironment();
File root = Paths.get(courseEnv.getCourseBaseContainer().getRelPath(), PFManager.FILENAME_PARTICIPANTFOLDER, getIdent()).toFile();
if (root.exists()) {
FileUtils.deleteDirsAndFiles(root, true, true);
}
}
use of org.olat.course.run.environment.CourseEnvironment in project openolat by klemens.
the class QTI21RetrieveTestsController method doRetrieveTest.
private void doRetrieveTest(AssessmentTestSession session) {
session = qtiService.getAssessmentTestSession(session.getKey());
session = qtiService.pullSession(session, getSignatureOptions(session), getIdentity());
if (courseNode != null) {
RepositoryEntry courseEntry = session.getRepositoryEntry();
CourseEnvironment courseEnv = CourseFactory.loadCourse(courseEntry).getCourseEnvironment();
UserCourseEnvironment assessedUserCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(session.getIdentity(), courseEnv);
courseNode.pullAssessmentTestSession(session, assessedUserCourseEnv, getIdentity(), Role.coach);
}
}
use of org.olat.course.run.environment.CourseEnvironment in project openolat by klemens.
the class IQIdentityListCourseNodeController method doExportResults.
private void doExportResults(UserRequest ureq) {
List<Identity> identities = getIdentities();
if (identities != null && !identities.isEmpty()) {
MediaResource resource;
CourseEnvironment courseEnv = getCourseEnvironment();
if (isTestQTI21()) {
resource = new QTI21ResultsExportMediaResource(courseEnv, identities, (IQTESTCourseNode) courseNode, getLocale());
} else {
resource = new QTI12ResultsExportMediaResource(courseEnv, getLocale(), identities, (IQTESTCourseNode) courseNode);
}
ureq.getDispatchResult().setResultingMediaResource(resource);
} else {
showWarning("error.no.assessed.users");
}
}
use of org.olat.course.run.environment.CourseEnvironment in project openolat by klemens.
the class IQIdentityListCourseNodeController method doConfirmResetData.
private void doConfirmResetData(UserRequest ureq) {
AssessmentToolOptions asOptions = getOptions();
CourseEnvironment courseEnv = getCourseEnvironment();
resetDataCtrl = new QTI21ResetDataController(ureq, getWindowControl(), courseEnv, asOptions, (IQTESTCourseNode) courseNode);
listenTo(resetDataCtrl);
String title = translate("tool.reset");
cmc = new CloseableModalController(getWindowControl(), null, resetDataCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
Aggregations