ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilHACPPresentationGUI Class Reference

Class ilHACPPresentationGUI. More...

+ Inheritance diagram for ilHACPPresentationGUI:
+ Collaboration diagram for ilHACPPresentationGUI:

Public Member Functions

 ilHACPPresentationGUI ()
executeCommand ()
 execute command
 explorer ($a_target="sahs_content")
 output table of content
 launchSahs ()
 This function is called by the API applet in the content frame when a SCO is started.
- Public Member Functions inherited from ilAICCPresentationGUI
 ilAICCPresentationGUI ()
 view ()
 SCORM content screen.
- Public Member Functions inherited from ilSCORMPresentationGUI
 ilSCORMPresentationGUI ()
 attrib2arr (&$a_attributes)
 frameset ()
 Output main frameset.
 get_max_attempts ()
 Get max.
 get_actual_attempts ()
 Get number of actual attempts for the user.
 increase_attemptAndsave_module_version ()
 Increases attempts by one for this package.
 contentSelect ()
 apiInitData ()
 SCORM Data for Javascript-API.
 api ()
 finishSahs ()
 unloadSahs ()
 launchAsset ()
 pingSession ()
 logMessage ()
 logWarning ()
 setSingleVariable ($a_var, $a_value)
 set single value
 setArray ($a_left, $a_value, $a_name, &$v_array)
 set single value
 downloadCertificate ()
 Download the certificate for the active user.

Data Fields

 $ilias
 $slm
 $tpl
 $lng
- Data Fields inherited from ilAICCPresentationGUI
 $ilias
 $slm
 $tpl
 $lng
- Data Fields inherited from ilSCORMPresentationGUI
 $ilias
 $slm
 $tpl
 $lng

Detailed Description

Class ilHACPPresentationGUI.

GUI class for hacp learning module presentation

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilHACPPresentationGUI.php 56825 2015-01-07 10:52:43Z akill

Definition at line 39 of file class.ilHACPPresentationGUI.php.

Member Function Documentation

& ilHACPPresentationGUI::executeCommand ( )

execute command

Reimplemented from ilAICCPresentationGUI.

Definition at line 64 of file class.ilHACPPresentationGUI.php.

References $_GET, $cmd, $ilias, $ilLog, and $lng.

{
global $ilAccess, $ilLog;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd("frameset");
if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]))
{
$ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->WARNING);
}
switch($next_class)
{
default:
$this->$cmd();
}
}
ilHACPPresentationGUI::explorer (   $a_target = "sahs_content")

output table of content

Reimplemented from ilAICCPresentationGUI.

Definition at line 86 of file class.ilHACPPresentationGUI.php.

References $_GET, $slm, ilUtil\getStyleSheetLocation(), ilTree\readRootId(), and ilExplorer\setTargetGet().

{
$this->tpl = new ilTemplate("tpl.sahs_exp_main.html", true, true, "Modules/ScormAicc");
require_once("./Modules/ScormAicc/classes/HACP/class.ilHACPExplorer.php");
$exp = new ilHACPExplorer($this->ctrl->getLinkTarget($this, "view"), $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);
$exp->forceExpandAll(true, false);
// 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", $this->ctrl->getLinkTarget($this, $_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.

References $_GET, $cmd, $ilCtrl, $ilias, $lng, and $tpl.

{
global $ilias, $tpl, $lng, $ilCtrl;;
$this->ilias =& $ilias;
$this->tpl =& $tpl;
$this->lng =& $lng;
$this->ctrl =& $ilCtrl;
$cmd = (!empty($_GET["cmd"])) ? $_GET["cmd"] : "frameset";
// Todo: check lm id
$this->slm =& new ilObjHACPLearningModule($_GET["ref_id"], true);
}
ilHACPPresentationGUI::launchSahs ( )

This function is called by the API applet in the content frame when a SCO is started.

Reimplemented from ilAICCPresentationGUI.

Definition at line 126 of file class.ilHACPPresentationGUI.php.

References $_GET, $_POST, $ilDB, $ilUser, $lng, $ref_id, ilObject\_lookupObjId(), exit, ilUtil\getImagePath(), ilSCORMPresentationGUI\setArray(), and ilSCORMPresentationGUI\setSingleVariable().

{
echo "launchSahs";
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("./Modules/ScormAicc/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, "Modules/ScormAicc");
$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();
}
$val_set = $ilDB->queryF('
SELECT * FROM scorm_tracking
WHERE user_id = %s
AND sco_id = %s
AND obj_id = %s',
array('integer','integer','integer'),
array($ilUser->getId(),$sahs_id,$this->slm->getId()));
$re_value = array();
while($val_rec = $ilDB->fetchAssoc($val_set))
{
$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.svg"));
$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
$sahs_obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
if (!isset($re_value["cmi.core.total_time"]))
{
$unit->insertTrackData("cmi.core.total_time", "0000:00:00", $sahs_obj_id);
}
if (!isset($re_value["cmi.core.lesson_status"]))
{
$unit->insertTrackData("cmi.core.lesson_status", "not attempted", $sahs_obj_id);
}
if (!isset($re_value["cmi.core.entry"]))
{
$unit->insertTrackData("cmi.core.entry", "", $sahs_obj_id);
}
$this->tpl->show();
}

+ Here is the call graph for this function:

Field Documentation

ilHACPPresentationGUI::$ilias

Definition at line 41 of file class.ilHACPPresentationGUI.php.

Referenced by executeCommand(), and ilHACPPresentationGUI().

ilHACPPresentationGUI::$lng
ilHACPPresentationGUI::$slm

Definition at line 42 of file class.ilHACPPresentationGUI.php.

Referenced by explorer().

ilHACPPresentationGUI::$tpl

Definition at line 43 of file class.ilHACPPresentationGUI.php.

Referenced by ilHACPPresentationGUI().


The documentation for this class was generated from the following file: