123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <?php
- class aiccItem extends learnpathItem
- {
- public $identifier = '';
- public $identifierref = '';
- public $parameters = '';
- public $title = '';
- public $sub_items = array();
-
-
-
- public $maxtimeallowed = '00:00:00';
- public $timelimitaction = '';
- public $masteryscore = '';
- public $core_vendor = '';
- public $system_vendor = '';
- public $au_type = '';
- public $command_line = '';
- public $debug = 0;
-
- public function aiccItem($type = 'config', $params = array(), $course_id = null)
- {
- if (isset($params)) {
- switch ($type) {
- case 'db':
- parent::__construct($params, api_get_user_id(), $course_id);
- $this->aicc_contact = false;
-
- return false;
- case 'config':
- default:
-
- foreach ($params as $a => $value) {
- switch ($a) {
- case 'system_id':
- $this->identifier = Database::escape_string(strtolower($value));
- break;
- case 'type':
- $this->au_type = Database::escape_string($value);
- break;
- case 'command_line':
- $this->command_line = Database::escape_string($value);
- break;
- case 'max_time_allowed':
- $this->maxtimeallowed = Database::escape_string($value);
- break;
- case 'time_limit_action':
- $this->timelimitaction = Database::escape_string($value);
- break;
- case 'max_score':
- $this->max_score = Database::escape_string($value);
- break;
- case 'core_vendor':
- $this->core_vendor = Database::escape_string($value);
- break;
- case 'system_vendor':
- $this->system_vendor = Database::escape_string($value);
- break;
- case 'file_name':
- $this->path = Database::escape_string($value);
- break;
- case 'mastery_score':
- $this->masteryscore = Database::escape_string($value);
- break;
- case 'web_launch':
- $this->parameters = Database::escape_string($value);
- break;
- }
- }
- return true;
- }
- }
- return false;
- }
-
- function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
- {
- $list[] = array(
- 'au_type' => $this->au_type,
- 'command_line' => $this->command_line,
- 'core_vendor' => $this->core_vendor,
- 'identifier' => $this->identifier,
- 'identifierref' => $this->identifierref,
- 'masteryscore' => $this->masteryscore,
- 'maxtimeallowed' => $this->maxtimeallowed,
- 'level' => $level,
- 'parameters' => $this->parameters,
- 'prerequisites' => (!empty($this->prereq_string) ? $this->prereq_string : ''),
- 'timelimitaction' => $this->timelimitaction,
- );
- $abs_order++;
- $i = 1;
- foreach ($this->sub_items as $id => $dummy) {
- $oSubitem =& $this->sub_items[$id];
- $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1);
- $i++;
- }
- }
-
- function save($from_outside = true, $prereqs_complete = false)
- {
- parent::save($from_outside, $prereqs_complete = false);
-
- $this->aicc_contact = true;
- if (!$this->aicc_contact) {
-
- }
- }
- }
|