Search in sources :

Example 31 with CourseEnvironment

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);
}
Also used : Path(java.nio.file.Path) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) Translator(org.olat.core.gui.translator.Translator)

Example 32 with CourseEnvironment

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);
    }
}
Also used : CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) SubscriptionContext(org.olat.core.commons.services.notifications.SubscriptionContext) File(java.io.File)

Example 33 with CourseEnvironment

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);
    }
}
Also used : CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 34 with CourseEnvironment

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");
    }
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) QTI12ResultsExportMediaResource(org.olat.ims.qti.resultexport.QTI12ResultsExportMediaResource) MediaResource(org.olat.core.gui.media.MediaResource) QTI21ResultsExportMediaResource(org.olat.ims.qti21.resultexport.QTI21ResultsExportMediaResource) Identity(org.olat.core.id.Identity) QTI21ResultsExportMediaResource(org.olat.ims.qti21.resultexport.QTI21ResultsExportMediaResource) QTI12ResultsExportMediaResource(org.olat.ims.qti.resultexport.QTI12ResultsExportMediaResource)

Example 35 with CourseEnvironment

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();
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) AssessmentToolOptions(org.olat.modules.assessment.AssessmentToolOptions) QTI21ResetDataController(org.olat.ims.qti21.ui.QTI21ResetDataController)

Aggregations

CourseEnvironment (org.olat.course.run.environment.CourseEnvironment)80 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)64 RepositoryEntry (org.olat.repository.RepositoryEntry)34 Identity (org.olat.core.id.Identity)28 ICourse (org.olat.course.ICourse)18 VFSContainer (org.olat.core.util.vfs.VFSContainer)16 File (java.io.File)14 Date (java.util.Date)14 CourseNode (org.olat.course.nodes.CourseNode)14 Test (org.junit.Test)12 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)12 BusinessGroup (org.olat.group.BusinessGroup)12 ModuleConfiguration (org.olat.modules.ModuleConfiguration)12 ArrayList (java.util.ArrayList)10 OlatRootFolderImpl (org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl)10 IdentityEnvironment (org.olat.core.id.IdentityEnvironment)10 IQTESTCourseNode (org.olat.course.nodes.IQTESTCourseNode)10 Path (java.nio.file.Path)8 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)8 OLATResourceable (org.olat.core.id.OLATResourceable)8