Search in sources :

Example 11 with LMSResultsBean

use of org.olat.modules.scorm.server.beans.LMSResultsBean in project OpenOLAT by OpenOLAT.

the class OLATApiAdapter method isItemCompleted.

// </OLATCE-289>
/**
 * @param itemId
 * @return true if the item is completed
 */
public boolean isItemCompleted(String itemId) {
    // TODO:gs make method faster by caching lmsBean, but when to set out of date?
    LMSDataFormBean lmsDataBean = new LMSDataFormBean();
    lmsDataBean.setItemID(itemId);
    lmsDataBean.setLmsAction("get");
    odatahandler = new LMSDataHandler(scormManager, lmsDataBean, scormSettingsHandler);
    LMSResultsBean lmsBean = odatahandler.getResultsBean();
    return lmsBean.getIsItemCompleted().equals("true");
}
Also used : LMSResultsBean(org.olat.modules.scorm.server.beans.LMSResultsBean) LMSDataHandler(org.olat.modules.scorm.server.beans.LMSDataHandler) LMSDataFormBean(org.olat.modules.scorm.server.beans.LMSDataFormBean)

Example 12 with LMSResultsBean

use of org.olat.modules.scorm.server.beans.LMSResultsBean in project OpenOLAT by OpenOLAT.

the class OLATApiAdapter method getPreviousSco.

/**
 * @param recentId
 * @return the previos Sco itemId
 */
public Integer getPreviousSco(String recentId) {
    // TODO:gs make method faster by caching lmsBean, but when to set out of date?
    LMSDataFormBean lmsDataBean = new LMSDataFormBean();
    lmsDataBean.setItemID(recentId);
    lmsDataBean.setLmsAction("get");
    odatahandler = new LMSDataHandler(scormManager, lmsDataBean, scormSettingsHandler);
    LMSResultsBean lmsBean = odatahandler.getResultsBean();
    String[][] pretable = lmsBean.getPreReqTable();
    String previousNavScoId = "-1";
    for (int i = 0; i < pretable.length; i++) {
        if (pretable[i][0].equals(recentId) && (i != 0)) {
            previousNavScoId = pretable[--i][0];
            break;
        }
    }
    return new Integer(previousNavScoId);
}
Also used : LMSResultsBean(org.olat.modules.scorm.server.beans.LMSResultsBean) LMSDataHandler(org.olat.modules.scorm.server.beans.LMSDataHandler) LMSDataFormBean(org.olat.modules.scorm.server.beans.LMSDataFormBean)

Example 13 with LMSResultsBean

use of org.olat.modules.scorm.server.beans.LMSResultsBean in project openolat by klemens.

the class OLATApiAdapter method hasItemPrerequisites.

/**
 * @param itemId
 * @return true if item has any not fullfilled preconditions
 */
public boolean hasItemPrerequisites(String itemId) {
    // TODO:gs make method faster by caching lmsBean, but when to set out of date?
    LMSDataFormBean lmsDataBean = new LMSDataFormBean();
    lmsDataBean.setItemID(itemId);
    lmsDataBean.setLmsAction("get");
    odatahandler = new LMSDataHandler(scormManager, lmsDataBean, scormSettingsHandler);
    LMSResultsBean lmsBean = odatahandler.getResultsBean();
    return lmsBean.getHasPrerequisites().equals("true");
}
Also used : LMSResultsBean(org.olat.modules.scorm.server.beans.LMSResultsBean) LMSDataHandler(org.olat.modules.scorm.server.beans.LMSDataHandler) LMSDataFormBean(org.olat.modules.scorm.server.beans.LMSDataFormBean)

Example 14 with LMSResultsBean

use of org.olat.modules.scorm.server.beans.LMSResultsBean in project openolat by klemens.

the class OLATApiAdapter method isItemCompleted.

// </OLATCE-289>
/**
 * @param itemId
 * @return true if the item is completed
 */
public boolean isItemCompleted(String itemId) {
    // TODO:gs make method faster by caching lmsBean, but when to set out of date?
    LMSDataFormBean lmsDataBean = new LMSDataFormBean();
    lmsDataBean.setItemID(itemId);
    lmsDataBean.setLmsAction("get");
    odatahandler = new LMSDataHandler(scormManager, lmsDataBean, scormSettingsHandler);
    LMSResultsBean lmsBean = odatahandler.getResultsBean();
    return lmsBean.getIsItemCompleted().equals("true");
}
Also used : LMSResultsBean(org.olat.modules.scorm.server.beans.LMSResultsBean) LMSDataHandler(org.olat.modules.scorm.server.beans.LMSDataHandler) LMSDataFormBean(org.olat.modules.scorm.server.beans.LMSDataFormBean)

Aggregations

LMSDataFormBean (org.olat.modules.scorm.server.beans.LMSDataFormBean)14 LMSDataHandler (org.olat.modules.scorm.server.beans.LMSDataHandler)14 LMSResultsBean (org.olat.modules.scorm.server.beans.LMSResultsBean)14 HashMap (java.util.HashMap)2