ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAICCPresentationGUI Class Reference

Class ilAICCPresentationGUI. More...

+ Inheritance diagram for ilAICCPresentationGUI:
+ Collaboration diagram for ilAICCPresentationGUI:

Public Member Functions

 ilAICCPresentationGUI ()
executeCommand ()
 execute command
 view ()
 SCORM content screen.
 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 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_attempt ()
 Increases attempts by one for this package.
 save_module_version ()
 save the active module version to scorm_tracking
 api ()
 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
- Data Fields inherited from ilSCORMPresentationGUI
 $ilias
 $slm
 $tpl
 $lng

Detailed Description

Class ilAICCPresentationGUI.

GUI class for aicc learning module presentation

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilAICCPresentationGUI.php 15697 2008-01-08 20:04:33Z hschottm

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

Member Function Documentation

& ilAICCPresentationGUI::executeCommand ( )

execute command

Reimplemented from ilSCORMPresentationGUI.

Reimplemented in ilHACPPresentationGUI.

Definition at line 64 of file class.ilAICCPresentationGUI.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();
}
}
ilAICCPresentationGUI::explorer (   $a_target = "sahs_content")

output table of content

Reimplemented from ilSCORMPresentationGUI.

Reimplemented in ilHACPPresentationGUI.

Definition at line 99 of file class.ilAICCPresentationGUI.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/AICC/class.ilAICCExplorer.php");
$exp = new ilAICCExplorer(
$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:

ilAICCPresentationGUI::ilAICCPresentationGUI ( )

Definition at line 46 of file class.ilAICCPresentationGUI.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 ilObjAICCLearningModule($_GET["ref_id"], true);
}
ilAICCPresentationGUI::launchSahs ( )

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

Reimplemented from ilSCORMPresentationGUI.

Reimplemented in ilHACPPresentationGUI.

Definition at line 140 of file class.ilAICCPresentationGUI.php.

References $_GET, $lng, $ref_id, ilObject\_lookupObjId(), DB_FETCHMODE_ASSOC, ilUtil\getImagePath(), ilSCORMPresentationGUI\setArray(), and ilSCORMPresentationGUI\setSingleVariable().

{
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
$url=$unit->getCommand_line();
if (strlen($url)==0)
$url=$unit->getFilename();
if (strcasecmp(substr($unit->getFilename(),0,4),"http")!=0)
$url=$this->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();
}
$query = "SELECT * FROM scorm_tracking WHERE".
" user_id = ".$ilDB->quote($ilUser->getId()).
" AND sco_id = ".$ilDB->quote($sahs_id).
" AND obj_id = ".$ilDB->quote($this->slm->getId());
$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
$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:

ilAICCPresentationGUI::view ( )

SCORM content screen.

Reimplemented from ilSCORMPresentationGUI.

Definition at line 83 of file class.ilAICCPresentationGUI.php.

References $_GET, ilAICCObjectGUI\getInstance(), and ilUtil\getStyleSheetLocation().

{
$sc_gui_object =& ilAICCObjectGUI::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:

Field Documentation

ilAICCPresentationGUI::$ilias

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

Referenced by executeCommand(), and ilAICCPresentationGUI().

ilAICCPresentationGUI::$lng
ilAICCPresentationGUI::$slm

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

Referenced by explorer().

ilAICCPresentationGUI::$tpl

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

Referenced by ilAICCPresentationGUI().


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