Search in sources :

Example 1 with SequencerModel

use of org.olat.modules.scorm.server.servermodels.SequencerModel in project OpenOLAT by OpenOLAT.

the class NavigationViewer method hasManifestChanged.

/**
 * A method to let us know if the manifest has been updated since it was last
 * loaded into JDOM. If it has been chnaged then the time stamp will be
 * updated - and so it will be different to the timestamp we have recorded in
 * out settings file - so we compare the two.
 *
 * @return true or false
 */
public boolean hasManifestChanged() {
    String manifestTimeStamp = Long.toString(getFile().lastModified());
    SequencerModel sequence = new SequencerModel(settings.getScoItemSequenceFile(), settings);
    String storedLastModified = sequence.getManifestModifiedDate();
    return (manifestTimeStamp.equals(storedLastModified));
}
Also used : SequencerModel(org.olat.modules.scorm.server.servermodels.SequencerModel)

Example 2 with SequencerModel

use of org.olat.modules.scorm.server.servermodels.SequencerModel in project openolat by klemens.

the class ScormAssessmentManager method getSequencerModel.

/**
 * Load the SequencerModel
 * @param username
 * @param courseEnv
 * @param node
 * @return can be null if the user hasn't visited the course
 */
public SequencerModel getSequencerModel(String username, CourseEnvironment courseEnv, ScormCourseNode node) {
    VFSContainer scoDirectory = ScormDirectoryHelper.getScoDirectory(username, courseEnv, node);
    if (scoDirectory == null)
        return null;
    VFSItem reloadSettingsFile = scoDirectory.resolve(RELOAD_SETTINGS_FILE);
    if (reloadSettingsFile instanceof LocalFileImpl) {
        LocalFileImpl fileImpl = (LocalFileImpl) reloadSettingsFile;
        return new SequencerModel(fileImpl.getBasefile(), null);
    } else if (reloadSettingsFile != null) {
        throw new OLATRuntimeException(this.getClass(), "Programming error, SCORM results must be file based", null);
    }
    return null;
}
Also used : OLATRuntimeException(org.olat.core.logging.OLATRuntimeException) SequencerModel(org.olat.modules.scorm.server.servermodels.SequencerModel) VFSContainer(org.olat.core.util.vfs.VFSContainer) VFSItem(org.olat.core.util.vfs.VFSItem) LocalFileImpl(org.olat.core.util.vfs.LocalFileImpl)

Example 3 with SequencerModel

use of org.olat.modules.scorm.server.servermodels.SequencerModel in project OpenOLAT by OpenOLAT.

the class ScormAssessmentManager method getSequencerModel.

/**
 * Load the SequencerModel
 * @param username
 * @param courseEnv
 * @param node
 * @return can be null if the user hasn't visited the course
 */
public SequencerModel getSequencerModel(String username, CourseEnvironment courseEnv, ScormCourseNode node) {
    VFSContainer scoDirectory = ScormDirectoryHelper.getScoDirectory(username, courseEnv, node);
    if (scoDirectory == null)
        return null;
    VFSItem reloadSettingsFile = scoDirectory.resolve(RELOAD_SETTINGS_FILE);
    if (reloadSettingsFile instanceof LocalFileImpl) {
        LocalFileImpl fileImpl = (LocalFileImpl) reloadSettingsFile;
        return new SequencerModel(fileImpl.getBasefile(), null);
    } else if (reloadSettingsFile != null) {
        throw new OLATRuntimeException(this.getClass(), "Programming error, SCORM results must be file based", null);
    }
    return null;
}
Also used : OLATRuntimeException(org.olat.core.logging.OLATRuntimeException) SequencerModel(org.olat.modules.scorm.server.servermodels.SequencerModel) VFSContainer(org.olat.core.util.vfs.VFSContainer) VFSItem(org.olat.core.util.vfs.VFSItem) LocalFileImpl(org.olat.core.util.vfs.LocalFileImpl)

Example 4 with SequencerModel

use of org.olat.modules.scorm.server.servermodels.SequencerModel in project OpenOLAT by OpenOLAT.

the class PrerequisiteManager method populateFromDisk.

/**
 * Method to get the disk version of the package (what/what hasn't has been
 * completed)
 *
 * @param org
 * @return true is successful
 */
protected boolean populateFromDisk(String org) {
    _sequencerModel = new SequencerModel(settings.getScoItemSequenceFile(), settings);
    _prereqTable = _sequencerModel.getItemsAsHash(org);
    return (_prereqTable != null);
}
Also used : SequencerModel(org.olat.modules.scorm.server.servermodels.SequencerModel)

Example 5 with SequencerModel

use of org.olat.modules.scorm.server.servermodels.SequencerModel in project openolat by klemens.

the class NavigationViewer method hasManifestChanged.

/**
 * A method to let us know if the manifest has been updated since it was last
 * loaded into JDOM. If it has been chnaged then the time stamp will be
 * updated - and so it will be different to the timestamp we have recorded in
 * out settings file - so we compare the two.
 *
 * @return true or false
 */
public boolean hasManifestChanged() {
    String manifestTimeStamp = Long.toString(getFile().lastModified());
    SequencerModel sequence = new SequencerModel(settings.getScoItemSequenceFile(), settings);
    String storedLastModified = sequence.getManifestModifiedDate();
    return (manifestTimeStamp.equals(storedLastModified));
}
Also used : SequencerModel(org.olat.modules.scorm.server.servermodels.SequencerModel)

Aggregations

SequencerModel (org.olat.modules.scorm.server.servermodels.SequencerModel)6 OLATRuntimeException (org.olat.core.logging.OLATRuntimeException)2 LocalFileImpl (org.olat.core.util.vfs.LocalFileImpl)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2 VFSItem (org.olat.core.util.vfs.VFSItem)2