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");
}
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);
}
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");
}
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");
}
Aggregations