Inheritance diagram for ilHACPPresentationGUI:
Collaboration diagram for ilHACPPresentationGUI:Public Member Functions | |
| ilHACPPresentationGUI () | |
| explorer ($a_target="sahs_content") | |
| output table of content | |
| launchSahs () | |
Data Fields | |
| $ilias | |
| $slm | |
| $tpl | |
| $lng | |
Definition at line 39 of file class.ilHACPPresentationGUI.php.
| ilHACPPresentationGUI::explorer | ( | $ | a_target = "sahs_content" |
) |
output table of content
Reimplemented from ilAICCPresentationGUI.
Definition at line 65 of file class.ilHACPPresentationGUI.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/HACP/class.ilHACPExplorer.php");
$exp = new ilHACPExplorer("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:| ilHACPPresentationGUI::ilHACPPresentationGUI | ( | ) |
Definition at line 46 of file class.ilHACPPresentationGUI.php.
| ilHACPPresentationGUI::launchSahs | ( | ) |
Reimplemented from ilAICCPresentationGUI.
Definition at line 104 of file class.ilHACPPresentationGUI.php.
References $_GET, $_POST, $ilUser, $lng, $query, $ref_id, exit, ilUtil::getImagePath(), ilSCORMPresentationGUI::setArray(), and ilSCORMPresentationGUI::setSingleVariable().
{
echo "launchSahs";
exit;
global $ilUser, $ilDB;
$sahs_id = ($_GET["sahs_id"] == "")
? $_POST["sahs_id"]
: $_GET["sahs_id"];
$ref_id = ($_GET["ref_id"] == "")
? $_POST["ref_id"]
: $_GET["ref_id"];
$this->slm =& new ilObjAICCLearningModule($ref_id, true);
include_once("content/classes/AICC/class.ilAICCUnit.php");
$unit =& new ilAICCUnit($sahs_id);
//guess the url to be able to launch most contents
$url=$unit->getCommand_line();
if (strlen($url)==0)
$url=$unit->getFilename();
if (strcasecmp(substr($unit->getFilename(),0,4),"http")!=0)
$url=$unit->slm->getDataDirectory("output")."/".$url;
if (strlen($unit->getWebLaunch())>0)
$url.="?".$unit->getWebLaunch();
/*
if (strcasecmp(substr($unit->getFilename(),0,4),"http")==0)
$href=$unit->getFilename();
else
$href=$this->slm->getDataDirectory("output")."/".$unit->getFilename();
*/
$this->tpl = new ilTemplate("tpl.sahs_launch_cbt.html", true, true, true);
$this->tpl->setVariable("HREF", $url);
// $this->tpl->setVariable("LAUNCH_DATA", $unit->getDataFromLms());
$this->tpl->setVariable("MAST_SCORE", $unit->getMasteryScore());
$this->tpl->setVariable("MAX_TIME", $unit->getMaxTimeAllowed());
$this->tpl->setVariable("LIMIT_ACT", $unit->getTimeLimitAction());
if($ilUser->getFirstName() == "Joe") // for test purpose
{
$this->tpl->setCurrentBlock("credit");
$this->tpl->setVariable("CREDIT_MODE", "normal");
$this->tpl->parseCurrentBlock();
}
$query = "SELECT * FROM scorm_tracking WHERE".
" user_id = ".$ilDB->quote($ilUser->getId()).
" AND sco_id = ".$ilDB->quote($sahs_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"]))
{
$unit->insertTrackData("cmi.core.total_time", "0000:00:00", $_GET["ref_id"]);
}
if (!isset($re_value["cmi.core.lesson_status"]))
{
$unit->insertTrackData("cmi.core.lesson_status", "not attempted", $_GET["ref_id"]);
}
if (!isset($re_value["cmi.core.entry"]))
{
$unit->insertTrackData("cmi.core.entry", "", $_GET["ref_id"]);
}
$this->tpl->show();
}
Here is the call graph for this function:| ilHACPPresentationGUI::$ilias |
Reimplemented from ilAICCPresentationGUI.
Definition at line 41 of file class.ilHACPPresentationGUI.php.
Referenced by ilHACPPresentationGUI().
| ilHACPPresentationGUI::$lng |
Reimplemented from ilAICCPresentationGUI.
Definition at line 44 of file class.ilHACPPresentationGUI.php.
Referenced by ilHACPPresentationGUI(), and launchSahs().
| ilHACPPresentationGUI::$slm |
Reimplemented from ilAICCPresentationGUI.
Definition at line 42 of file class.ilHACPPresentationGUI.php.
| ilHACPPresentationGUI::$tpl |
Reimplemented from ilAICCPresentationGUI.
Definition at line 43 of file class.ilHACPPresentationGUI.php.
Referenced by ilHACPPresentationGUI().
1.7.1