Minor - format code

1.9.x
Julio Montoya 12 years ago
parent f0504a01ad
commit 45c6d9e537
  1. 12
      main/newscorm/learnpathItem.class.php
  2. 9
      main/newscorm/lp_ajax_save_item.php

@ -11,7 +11,8 @@
* lp_item defines items belonging to a learnpath. Each item has a name, a score, a use time and additional
* information that enables tracking a user's progress in a learning path
*/
class learnpathItem {
class learnpathItem
{
public $attempt_id; // Also called "objectives" SCORM-wise.
public $audio; // The path to an audio file (stored in document/audio/).
public $children = array(); // Contains the ids of children items.
@ -1844,7 +1845,8 @@ class learnpathItem {
* @return void
* @todo //todo insert into lp_item_view if lp_view not exists
*/
public function set_lp_view($lp_view_id, $course_id = null) {
public function set_lp_view($lp_view_id, $course_id = null)
{
if (empty($course_id)) {
$course_id = api_get_course_int_id();
} else {
@ -1935,7 +1937,8 @@ class learnpathItem {
* @param float Score
* @return boolean True on success, false otherwise
*/
public function set_score($score) {
public function set_score($score)
{
//$possible_status = array('not attempted','incomplete','completed','passed','failed','browsed');
$debug = self::debug;
if ($debug > 0) { error_log('learnpathItem::set_score('.$score.')', 0); }
@ -1989,7 +1992,8 @@ class learnpathItem {
* @param string Status - must be one of the values defined in $this->possible_status
* @return boolean True on success, false on error
*/
public function set_status($status) {
public function set_status($status)
{
if (self::debug > 0) { error_log('learnpathItem::set_status('.$status.')', 0); }
$found = false;
foreach ($this->possible_status as $possible) {

@ -44,7 +44,8 @@ require_once 'aiccItem.class.php';
* @param array Interactions array
* @param string Core exit SCORM string
*/
function save_item($lp_id, $user_id, $view_id, $item_id, $score = -1, $max = -1, $min = -1, $status = '', $time = 0, $suspend = '', $location = '', $interactions = array(), $core_exit = 'none') {
function save_item($lp_id, $user_id, $view_id, $item_id, $score = -1, $max = -1, $min = -1, $status = '', $time = 0, $suspend = '', $location = '', $interactions = array(), $core_exit = 'none')
{
$return = null;
if ($debug > 0) {
@ -82,6 +83,8 @@ function save_item($lp_id, $user_id, $view_id, $item_id, $score = -1, $max = -1,
}
$prereq_check = $mylp->prerequisites_match($item_id);
/** @var learnpathItem $mylpi */
$mylpi = $mylp->items[$item_id];
if (empty($mylpi)) {
@ -266,6 +269,7 @@ function save_item($lp_id, $user_id, $view_id, $item_id, $score = -1, $max = -1,
Session::write('lpobject', serialize($mylp));
if ($debug > 0) { error_log('---------------- lp_ajax_save_item.php : save_item end ----- '); }
return $return;
}
@ -294,4 +298,5 @@ echo save_item(
(!empty($_REQUEST['suspend'])?$_REQUEST['suspend']:null),
(!empty($_REQUEST['loc'])?$_REQUEST['loc']:null),
$interactions,
(!empty($_REQUEST['core_exit'])?$_REQUEST['core_exit']:''));
(!empty($_REQUEST['core_exit'])?$_REQUEST['core_exit']:'')
);

Loading…
Cancel
Save