Inheritance diagram for ilSCORMPresentationGUI:Public Member Functions | |
| ilSCORMPresentationGUI () | |
| attrib2arr (&$a_attributes) | |
| frameset () | |
| output main menu | |
| explorer ($a_target="sahs_content") | |
| output table of content | |
| view () | |
| api () | |
| launchSahs () | |
| finishSahs () | |
| unloadSahs () | |
| launchAsset () | |
| setSingleVariable ($a_var, $a_value) | |
| set single value | |
| setArray ($a_left, $a_value, $a_name, &$v_array) | |
| set single value | |
Data Fields | |
| $ilias | |
| $slm | |
| $tpl | |
| $lng | |
Definition at line 39 of file class.ilSCORMPresentationGUI.php.
| ilSCORMPresentationGUI::api | ( | ) |
Definition at line 144 of file class.ilSCORMPresentationGUI.php.
References $_GET, $ilias, and exit.
{
global $ilias;
$slm_obj =& new ilObjSCORMLearningModule($_GET["ref_id"]);
$this->tpl = new ilTemplate("tpl.sahs_api.html", true, true, true);
$this->tpl->setVariable("USER_ID",$ilias->account->getId());
$this->tpl->setVariable("USER_FIRSTNAME",$ilias->account->getFirstname());
$this->tpl->setVariable("USER_LASTNAME",$ilias->account->getLastname());
$this->tpl->setVariable("REF_ID",$_GET["ref_id"]);
$this->tpl->setVariable("SESSION_ID",session_id());
$this->tpl->setVariable("CODE_BASE", "http://".$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, strpos ($_SERVER['PHP_SELF'], "/sahs_presentation.php")));
$this->tpl->parseCurrentBlock();
$this->tpl->show(false);
exit;
}
| ilSCORMPresentationGUI::attrib2arr | ( | &$ | a_attributes | ) |
Definition at line 62 of file class.ilSCORMPresentationGUI.php.
{
$attr = array();
if(!is_array($a_attributes))
{
return $attr;
}
foreach ($a_attributes as $attribute)
{
$attr[$attribute->name()] = $attribute->value();
}
return $attr;
}
| ilSCORMPresentationGUI::explorer | ( | $ | a_target = "sahs_content" |
) |
output table of content
Reimplemented in ilAICCPresentationGUI, and ilHACPPresentationGUI.
Definition at line 91 of file class.ilSCORMPresentationGUI.php.
References $_GET, $exp, $expanded, $output, and ilUtil::getStyleSheetLocation().
{
$this->tpl = new ilTemplate("tpl.sahs_exp_main.html", true, true, true);
//$this->tpl->setVariable("LOCATION_JAVASCRIPT", "./scorm_functions.js");
require_once("./content/classes/SCORM/class.ilSCORMExplorer.php");
$exp = new ilSCORMExplorer("sahs_presentation.php?cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
$exp->setTargetGet("obj_id");
$exp->setFrameTarget($a_target);
//$exp->setFiltered(true);
if ($_GET["scexpand"] == "")
{
$mtree = new ilSCORMTree($this->slm->getId());
$expanded = $mtree->readRootId();
}
else
{
$expanded = $_GET["scexpand"];
}
$exp->setExpand($expanded);
// build html-output
//666$exp->setOutput(0);
$exp->setOutput(0);
$output = $exp->getOutput();
$this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_content"));
$this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
$this->tpl->setVariable("EXPLORER",$output);
$this->tpl->setVariable("ACTION", "sahs_presentation.php?cmd=".$_GET["cmd"]."&frame=".$_GET["frame"].
"&ref_id=".$this->slm->getRefId()."&scexpand=".$_GET["scexpand"]);
$this->tpl->parseCurrentBlock();
$this->tpl->show();
}
Here is the call graph for this function:| ilSCORMPresentationGUI::finishSahs | ( | ) |
Definition at line 342 of file class.ilSCORMPresentationGUI.php.
References $_GET, $lng, ilUtil::getImagePath(), and ilUtil::getStyleSheetLocation().
{
global $lng;
$this->tpl = new ilTemplate("tpl.sahs_finish_cbt.html", true, true, true);
$this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$this->tpl->setCurrentBlock("switch_icon");
$this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
$this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath(
"scorm/".str_replace(" ", "_", $_GET["status"]).'.gif')
);
$this->tpl->setVariable("SCO_ALT",
$lng->txt("cont_status").": "
.$lng->txt("cont_sc_stat_".str_replace(" ", "_", $_GET["status"])).", "
.$lng->txt("cont_total_time"). ": "
.$_GET["totime"]
);
$this->tpl->setVariable("SCO_LAUNCH_ID", $_GET["launch"]);
$this->tpl->parseCurrentBlock();
$this->tpl->show();
}
Here is the call graph for this function:| ilSCORMPresentationGUI::frameset | ( | ) |
output main menu
Definition at line 80 of file class.ilSCORMPresentationGUI.php.
{
$this->tpl = new ilTemplate("tpl.sahs_pres_frameset.html", false, false, "content");
$this->tpl->setVariable("REF_ID",$this->slm->getRefId());
$this->tpl->show();
}
| ilSCORMPresentationGUI::ilSCORMPresentationGUI | ( | ) |
Definition at line 46 of file class.ilSCORMPresentationGUI.php.
| ilSCORMPresentationGUI::launchAsset | ( | ) |
Definition at line 373 of file class.ilSCORMPresentationGUI.php.
References $_GET, $_POST, $ilUser, and $ref_id.
{
global $ilUser, $ilDB;
$sco_id = ($_GET["asset_id"] == "")
? $_POST["asset_id"]
: $_GET["asset_id"];
$ref_id = ($_GET["ref_id"] == "")
? $_POST["ref_id"]
: $_GET["ref_id"];
$this->slm =& new ilObjSCORMLearningModule($ref_id, true);
include_once("content/classes/SCORM/class.ilSCORMItem.php");
include_once("content/classes/SCORM/class.ilSCORMResource.php");
$item =& new ilSCORMItem($sco_id);
$id_ref = $item->getIdentifierRef();
$resource =& new ilSCORMResource();
$resource->readByIdRef($id_ref, $item->getSLMId());
$href = $resource->getHref();
$this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
$this->tpl = new ilTemplate("tpl.scorm_launch_asset.html", true, true, true);
$this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
$this->tpl->show();
}
| ilSCORMPresentationGUI::launchSahs | ( | ) |
Reimplemented in ilAICCPresentationGUI, and ilHACPPresentationGUI.
Definition at line 164 of file class.ilSCORMPresentationGUI.php.
References $_GET, $_POST, $ilUser, $lng, $query, $ref_id, ilUtil::getImagePath(), setArray(), and setSingleVariable().
{
global $ilUser, $ilDB;
$sco_id = ($_GET["sahs_id"] == "")
? $_POST["sahs_id"]
: $_GET["sahs_id"];
$ref_id = ($_GET["ref_id"] == "")
? $_POST["ref_id"]
: $_GET["ref_id"];
$this->slm =& new ilObjSCORMLearningModule($ref_id, true);
include_once("content/classes/SCORM/class.ilSCORMItem.php");
include_once("content/classes/SCORM/class.ilSCORMResource.php");
$item =& new ilSCORMItem($sco_id);
$id_ref = $item->getIdentifierRef();
$resource =& new ilSCORMResource();
$resource->readByIdRef($id_ref, $item->getSLMId());
//$slm_obj =& new ilObjSCORMLearningModule($_GET["ref_id"]);
$href = $resource->getHref();
$this->tpl = new ilTemplate("tpl.sahs_launch_cbt.html", true, true, true);
$this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
// set item data
$this->tpl->setVariable("LAUNCH_DATA", $item->getDataFromLms());
$this->tpl->setVariable("MAST_SCORE", $item->getMasteryScore());
$this->tpl->setVariable("MAX_TIME", $item->getMaxTimeAllowed());
$this->tpl->setVariable("LIMIT_ACT", $item->getTimeLimitAction());
// set alternative API name
if ($this->slm->getAPIAdapterName() != "API")
{
$this->tpl->setCurrentBlock("alt_api_ref");
$this->tpl->setVariable("API_NAME", $this->slm->getAPIAdapterName());
$this->tpl->parseCurrentBlock();
}
$query = "SELECT * FROM scorm_tracking WHERE".
" user_id = ".$ilDB->quote($ilUser->getId()).
" AND sco_id = ".$ilDB->quote($sco_id);
$val_set = $ilDB->query($query);
$re_value = array();
while($val_rec = $val_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$val_rec["rvalue"] = str_replace("\r\n", "\n", $val_rec["rvalue"]);
$val_rec["rvalue"] = str_replace("\r", "\n", $val_rec["rvalue"]);
$val_rec["rvalue"] = str_replace("\n", "\\n", $val_rec["rvalue"]);
$re_value[$val_rec["lvalue"]] = $val_rec["rvalue"];
}
foreach($re_value as $var => $value)
{
switch ($var)
{
case "cmi.core.lesson_location":
case "cmi.core.lesson_status":
case "cmi.core.entry":
case "cmi.core.score.raw":
case "cmi.core.score.max":
case "cmi.core.score.min":
case "cmi.core.total_time":
case "cmi.core.exit":
case "cmi.suspend_data":
case "cmi.comments":
case "cmi.student_preference.audio":
case "cmi.student_preference.language":
case "cmi.student_preference.speed":
case "cmi.student_preference.text":
$this->setSingleVariable($var, $value);
break;
case "cmi.objectives._count":
$this->setSingleVariable($var, $value);
$this->setArray("cmi.objectives", $value, "id", $re_value);
$this->setArray("cmi.objectives", $value, "score.raw", $re_value);
$this->setArray("cmi.objectives", $value, "score.max", $re_value);
$this->setArray("cmi.objectives", $value, "score.min", $re_value);
$this->setArray("cmi.objectives", $value, "status", $re_value);
break;
case "cmi.interactions._count":
$this->setSingleVariable($var, $value);
$this->setArray("cmi.interactions", $value, "id", $re_value);
for($i=0; $i<$value; $i++)
{
$var2 = "cmi.interactions.".$i.".objectives._count";
if (isset($v_array[$var2]))
{
$cnt = $v_array[$var2];
$this->setArray("cmi.interactions.".$i.".objectives",
$cnt, "id", $re_value);
/*
$this->setArray("cmi.interactions.".$i.".objectives",
$cnt, "score.raw", $re_value);
$this->setArray("cmi.interactions.".$i.".objectives",
$cnt, "score.max", $re_value);
$this->setArray("cmi.interactions.".$i.".objectives",
$cnt, "score.min", $re_value);
$this->setArray("cmi.interactions.".$i.".objectives",
$cnt, "status", $re_value);*/
}
}
$this->setArray("cmi.interactions", $value, "time", $re_value);
$this->setArray("cmi.interactions", $value, "type", $re_value);
for($i=0; $i<$value; $i++)
{
$var2 = "cmi.interactions.".$i.".correct_responses._count";
if (isset($v_array[$var2]))
{
$cnt = $v_array[$var2];
$this->setArray("cmi.interactions.".$i.".correct_responses",
$cnt, "pattern", $re_value);
$this->setArray("cmi.interactions.".$i.".correct_responses",
$cnt, "weighting", $re_value);
}
}
$this->setArray("cmi.interactions", $value, "student_response", $re_value);
$this->setArray("cmi.interactions", $value, "result", $re_value);
$this->setArray("cmi.interactions", $value, "latency", $re_value);
break;
}
}
global $lng;
$this->tpl->setCurrentBlock("switch_icon");
$this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
$this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath("scorm/running.gif"));
$this->tpl->setVariable("SCO_ALT",
$lng->txt("cont_status").": "
.$lng->txt("cont_sc_stat_running")
);
$this->tpl->parseCurrentBlock();
// lesson mode
$lesson_mode = $this->slm->getDefaultLessonMode();
if ($this->slm->getAutoReview())
{
if ($re_value["cmi.core.lesson_status"] == "completed" ||
$re_value["cmi.core.lesson_status"] == "passed" ||
$re_value["cmi.core.lesson_status"] == "failed")
{
$lesson_mode = "review";
}
}
$this->tpl->setVariable("LESSON_MODE", $lesson_mode);
// credit mode
if ($lesson_mode == "normal")
{
$this->tpl->setVariable("CREDIT_MODE",
str_replace("_", "-", $this->slm->getCreditMode()));
}
else
{
$this->tpl->setVariable("CREDIT_MODE", "no-credit");
}
// init cmi.core.total_time, cmi.core.lesson_status and cmi.core.entry
if (!isset($re_value["cmi.core.total_time"]))
{
$item->insertTrackData("cmi.core.total_time", "0000:00:00", $_GET["ref_id"]);
}
if (!isset($re_value["cmi.core.lesson_status"]))
{
$item->insertTrackData("cmi.core.lesson_status", "not attempted", $_GET["ref_id"]);
}
if (!isset($re_value["cmi.core.entry"]))
{
$item->insertTrackData("cmi.core.entry", "", $_GET["ref_id"]);
}
$this->tpl->show();
}
Here is the call graph for this function:| ilSCORMPresentationGUI::setArray | ( | $ | a_left, | |
| $ | a_value, | |||
| $ | a_name, | |||
| &$ | v_array | |||
| ) |
set single value
Definition at line 415 of file class.ilSCORMPresentationGUI.php.
Referenced by launchSahs(), ilHACPPresentationGUI::launchSahs(), and ilAICCPresentationGUI::launchSahs().
{
for($i=0; $i<$a_value; $i++)
{
$var = $a_left.".".$i.".".$a_name;
if (isset($v_array[$var]))
{
$this->tpl->setCurrentBlock("set_value");
$this->tpl->setVariable("VAR", $var);
$this->tpl->setVariable("VALUE", $v_array[$var]);
$this->tpl->parseCurrentBlock();
}
}
}
Here is the caller graph for this function:| ilSCORMPresentationGUI::setSingleVariable | ( | $ | a_var, | |
| $ | a_value | |||
| ) |
set single value
Definition at line 404 of file class.ilSCORMPresentationGUI.php.
Referenced by launchSahs(), ilHACPPresentationGUI::launchSahs(), and ilAICCPresentationGUI::launchSahs().
{
$this->tpl->setCurrentBlock("set_value");
$this->tpl->setVariable("VAR", $a_var);
$this->tpl->setVariable("VALUE", $a_value);
$this->tpl->parseCurrentBlock();
}
Here is the caller graph for this function:| ilSCORMPresentationGUI::unloadSahs | ( | ) |
Definition at line 364 of file class.ilSCORMPresentationGUI.php.
References $_GET, and ilUtil::getStyleSheetLocation().
{
$this->tpl = new ilTemplate("tpl.sahs_unload_cbt.html", true, true, true);
$this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
$this->tpl->show();
}
Here is the call graph for this function:| ilSCORMPresentationGUI::view | ( | ) |
Reimplemented in ilAICCPresentationGUI.
Definition at line 131 of file class.ilSCORMPresentationGUI.php.
References $_GET, ilSCORMObjectGUI::getInstance(), and ilUtil::getStyleSheetLocation().
{
$sc_gui_object =& ilSCORMObjectGUI::getInstance($_GET["obj_id"]);
if(is_object($sc_gui_object))
{
$sc_gui_object->view();
}
$this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$this->tpl->show();
}
Here is the call graph for this function:| ilSCORMPresentationGUI::$ilias |
Reimplemented in ilAICCPresentationGUI, and ilHACPPresentationGUI.
Definition at line 41 of file class.ilSCORMPresentationGUI.php.
Referenced by api(), and ilSCORMPresentationGUI().
| ilSCORMPresentationGUI::$lng |
Reimplemented in ilAICCPresentationGUI, and ilHACPPresentationGUI.
Definition at line 44 of file class.ilSCORMPresentationGUI.php.
Referenced by finishSahs(), ilSCORMPresentationGUI(), and launchSahs().
| ilSCORMPresentationGUI::$slm |
Reimplemented in ilAICCPresentationGUI, and ilHACPPresentationGUI.
Definition at line 42 of file class.ilSCORMPresentationGUI.php.
| ilSCORMPresentationGUI::$tpl |
Reimplemented in ilAICCPresentationGUI, and ilHACPPresentationGUI.
Definition at line 43 of file class.ilSCORMPresentationGUI.php.
Referenced by ilSCORMPresentationGUI().
1.7.1