skala
Yannick Warnier 16 years ago
commit e70c6bb618
  1. 1
      dokeos_license.txt
  2. 96
      main/newscorm/learnpath.class.php
  3. 173
      main/newscorm/lp_ajax_initialize.php
  4. 2
      main/newscorm/lp_ajax_save_item.php
  5. 2
      main/newscorm/lp_ajax_start_timer.php
  6. 98
      main/newscorm/lp_ajax_switch_item.php
  7. 186
      main/newscorm/lp_ajax_switch_item_toc.php
  8. 155
      main/newscorm/lp_view.php
  9. 1286
      main/newscorm/scorm_api.php

@ -7,6 +7,7 @@
Copyright (c) 2001 Universite catholique de Louvain (UCL) Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) 2003-2008 Vrije Universiteit Brussel (VUB) Copyright (c) 2003-2008 Vrije Universiteit Brussel (VUB)
Copyright (c) 2004-2008 Hoogeschool Gent (HoGent) Copyright (c) 2004-2008 Hoogeschool Gent (HoGent)
Copyright (c) Denes Nagy (darkden@freemail.hu)
For a full list of contributors detaining copyrights over parts of For a full list of contributors detaining copyrights over parts of
the Dokeos software, see "documentation/credits.html". the Dokeos software, see "documentation/credits.html".
The full license can be read in "documentation/license.html". The full license can be read in "documentation/license.html".

@ -1786,9 +1786,9 @@ class learnpath {
' <a href="lp_controller.php?action=stats" onclick="window.parent.API.save_asset();return true;" target="content_name_blank" title="stats" id="stats_link"><img border="0" src="../img/lp_stats.gif" title="' . get_lang('Reporting') . '"></a>' . "\n" . ' <a href="lp_controller.php?action=stats" onclick="window.parent.API.save_asset();return true;" target="content_name_blank" title="stats" id="stats_link"><img border="0" src="../img/lp_stats.gif" title="' . get_lang('Reporting') . '"></a>' . "\n" .
' <a href="" onclick="dokeos_xajax_handler.switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"><img border="0" src="../img/lp_leftarrow.gif" title="' . get_lang('ScormPrevious') . '"></a>' . "\n" . ' <a href="" onclick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"><img border="0" src="../img/lp_leftarrow.gif" title="' . get_lang('ScormPrevious') . '"></a>' . "\n" .
' <a href="" onclick="dokeos_xajax_handler.switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next" ><img border="0" src="../img/lp_rightarrow.gif" title="' . get_lang('ScormNext') . '"></a>' . "\n" . ' <a href="" onclick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next" ><img border="0" src="../img/lp_rightarrow.gif" title="' . get_lang('ScormNext') . '"></a>' . "\n" .
//' <a href="lp_controller.php?action=mode&mode=embedded" target="_top" title="embedded mode"><img border="0" src="../img/view_choose.gif" title="'.get_lang('ScormExitFullScreen').'"></a>'."\n" . //' <a href="lp_controller.php?action=mode&mode=embedded" target="_top" title="embedded mode"><img border="0" src="../img/view_choose.gif" title="'.get_lang('ScormExitFullScreen').'"></a>'."\n" .
@ -1814,9 +1814,9 @@ class learnpath {
' <a href="lp_controller.php?action=stats" onclick="window.parent.API.save_asset();return true;" target="content_name" title="stats" id="stats_link"><img border="0" src="../img/lp_stats.gif" title="' . get_lang('Reporting') . '"></a>' . "\n" . ' <a href="lp_controller.php?action=stats" onclick="window.parent.API.save_asset();return true;" target="content_name" title="stats" id="stats_link"><img border="0" src="../img/lp_stats.gif" title="' . get_lang('Reporting') . '"></a>' . "\n" .
' <a href="" onclick="dokeos_xajax_handler.switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"><img border="0" src="../img/lp_leftarrow.gif" title="' . get_lang('ScormPrevious') . '"></a>' . "\n" . ' <a href="" onclick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"><img border="0" src="../img/lp_leftarrow.gif" title="' . get_lang('ScormPrevious') . '"></a>' . "\n" .
' <a href="" onclick="dokeos_xajax_handler.switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next" ><img border="0" src="../img/lp_rightarrow.gif" title="' . get_lang('ScormNext') . '"></a>' . "\n" . ' <a href="" onclick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next" ><img border="0" src="../img/lp_rightarrow.gif" title="' . get_lang('ScormNext') . '"></a>' . "\n" .
// ' <a href="lp_controller.php?action=mode&mode=fullscreen" target="_top" title="fullscreen"><img border="0" src="../img/view_fullscreen.gif" width="18" height="18" title="'.get_lang('ScormFullScreen').'"></a>'."\n" . // ' <a href="lp_controller.php?action=mode&mode=fullscreen" target="_top" title="fullscreen"><img border="0" src="../img/view_fullscreen.gif" width="18" height="18" title="'.get_lang('ScormFullScreen').'"></a>'."\n" .
@ -2648,6 +2648,28 @@ class learnpath {
} }
return $toc; return $toc;
} }
/**
* Generate and return the table of contents for this learnpath. The JS
* table returned is used inside of scorm_api.php
* @return string A JS array vairiable construction
*/
function get_items_details_as_js($varname='olms.lms_item_types') {
if ($this->debug > 0) {
error_log('New LP - In learnpath::get_items_details_as_js()', 0);
}
$toc = $varname.' = new Array();';
//echo "<pre>".print_r($this->items,true)."</pre>";
foreach ($this->ordered_items as $item_id) {
if ($this->debug > 2) {
error_log('New LP - learnpath::get_items_details_as_js(): getting info for item ' . $item_id, 0);
}
$toc.= $varname."['i$item_id'] = '".$this->items[$item_id]->get_type()."';";
}
if ($this->debug > 2) {
error_log('New LP - In learnpath::get_items_details_as_js() - TOC array: ' . print_r($toc, true), 0);
}
return $toc;
}
/** /**
* Gets the learning path type * Gets the learning path type
* @param boolean Return the name? If false, return the ID. Default is false. * @param boolean Return the name? If false, return the ID. Default is false.
@ -2714,70 +2736,6 @@ class learnpath {
} }
return $list; return $list;
} }
/**
* Uses the table generated by get_toc() and returns an HTML-formatted string ready to display
* @return string HTML TOC ready to display
*/
/*function get_html_toc()
{
if($this->debug>0){error_log('New LP - In learnpath::get_html_toc()',0);}
$list = $this->get_toc();
//echo $this->current;
//$parent = $this->items[$this->current]->get_parent();
//if(empty($parent)){$parent = $this->ordered_items[$this->items[$this->current]->get_previous_index()];}
$html = '<div class="inner_lp_toc">'."\n" ;
// " onchange=\"javascript:document.getElementById('toc_$parent').focus();\">\n";
require_once('resourcelinker.inc.php');
//temp variables
$mycurrentitemid = $this->get_current_item_id();
foreach($list as $item)
{
if($this->debug>2){error_log('New LP - learnpath::get_html_toc(): using item '.$item['id'],0);}
//TODO complete this
$icon_name = array('not attempted' => '../img/notattempted.gif',
'incomplete' => '../img/incomplete.gif',
'failed' => '../img/failed.gif',
'completed' => '../img/completed.gif',
'passed' => '../img/passed.gif',
'succeeded' => '../img/succeeded.gif',
'browsed' => '../img/completed.gif');
$style = 'scorm_item';
if($item['id'] == $this->current){
$style = 'scorm_item_highlight';
}
//the anchor will let us center the TOC on the currently viewed item &^D
$html .= '<a name="atoc_'.$item['id'].'" /><div class="'.$style.'" style="padding-left: '.($item['level']/2).'em; padding-right:'.($item['level']/2).'em" id="toc_'.$item['id'].'" >' .
'<img id="toc_img_'.$item['id'].'" class="scorm_status_img" src="'.$icon_name[$item['status']].'" alt="'.substr($item['status'],0,1).'" />';
//$title = htmlspecialchars($item['title'],ENT_QUOTES,$this->encoding);
$title = $item['title'];
if(empty($title)){
$title = rl_get_resource_name(api_get_course_id(),$this->get_id(),$item['id']);
$title = htmlspecialchars($title,ENT_QUOTES,$this->encoding);
}
if(empty($title))$title = '-';
if($item['type']!='dokeos_chapter' and $item['type']!='dir'){
//$html .= "<a href='lp_controller.php?".api_get_cidReq()."&action=content&lp_id=".$this->get_id()."&item_id=".$item['id']."' target='lp_content_frame_name'>".$title."</a>" ;
$url = $this->get_link('http',$item['id']);
//$html .= '<a href="'.$url.'" target="content_name" onclick="top.load_item('.$item['id'].',\''.$url.'\');">'.$title.'</a>' ;
//$html .= '<a href="" onclick="top.load_item('.$item['id'].',\''.$url.'\');return false;">'.$title.'</a>' ;
$html .= '<a href="" onclick="dokeos_xajax_handler.switch_item(' .
$mycurrentitemid.',' .
$item['id'].');' .
'return false;" >'.$title.'</a>' ;
}else{
$html .= $title;
}
$html .= "</div>\n";
}
$html .= "</div>\n";
return $html;
}*/
/** /**
* Uses the table generated by get_toc() and returns an HTML-formatted string ready to display * Uses the table generated by get_toc() and returns an HTML-formatted string ready to display
* @return string HTML TOC ready to display * @return string HTML TOC ready to display
@ -2880,7 +2838,7 @@ class learnpath {
//$html .= '<a href="" onclick="top.load_item('.$item['id'].',\''.$url.'\');return false;">'.$title.'</a>' ; //$html .= '<a href="" onclick="top.load_item('.$item['id'].',\''.$url.'\');return false;">'.$title.'</a>' ;
//<img align="absbottom" width="13" height="13" src="../img/lp_document.png">&nbsp;background:#aaa; //<img align="absbottom" width="13" height="13" src="../img/lp_document.png">&nbsp;background:#aaa;
$html .= '<a href="" onclick="dokeos_xajax_handler.switch_item(' . $html .= '<a href="" onclick="switch_item(' .
$mycurrentitemid . ',' . $mycurrentitemid . ',' .
$item['id'] . ');' . $item['id'] . ');' .
'return false;" >' . stripslashes($title) . '</a>'; 'return false;" >' . stripslashes($title) . '</a>';

@ -0,0 +1,173 @@
<?php //$id$
/**
* This script contains the server part of the xajax interaction process. The client part is located
* in lp_api.php or other api's.
* This script, in particular, enables the process of SCO's initialization. It
* resets the JavaScript values for each SCO to the current LMS status.
* @package dokeos.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Script
*/
//flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;
// name of the language file that needs to be included
$language_file[] = 'learnpath';
require_once('back_compat.inc.php');
/**
* Get one item's details
* @param integer LP ID
* @param integer user ID
* @param integer View ID
* @param integer Current item ID
* @param integer New item ID
*/
function initialize_item($lp_id,$user_id,$view_id,$next_item)
{
$debug=0;
$return = '';
if($debug>0){error_log('In initialize_item('.$lp_id.','.$user_id.','.$view_id.','.$next_item.')',0);}
//$objResponse = new xajaxResponse();
/*$item_id may be one of:
* -'next'
* -'previous'
* -'first'
* -'last'
* - a real item ID
*/
require_once('learnpath.class.php');
require_once('scorm.class.php');
require_once('aicc.class.php');
require_once('learnpathItem.class.php');
require_once('scormItem.class.php');
require_once('aiccItem.class.php');
$mylp = '';
if (isset($_SESSION['lpobject'])) {
if ($debug>1) {error_log('////$_SESSION[lpobject] is set',0);}
$oLP =& unserialize($_SESSION['lpobject']);
if (!is_object($oLP)) {
if($debug>1){error_log(print_r($oLP,true),0);}
if($debug>2){error_log('////Building new lp',0);}
unset($oLP);
$code = api_get_course_id();
$mylp = & new learnpath($code,$lp_id,$user_id);
} else {
if($debug>1){error_log('////Reusing session lp',0);}
$mylp = & $oLP;
}
}
$mylp->set_current_item($next_item);
if ($debug>1) {error_log('In {default} - item is '.$new_item_id,0);}
$mylp->start_current_item(true);
/*
if ($mylp->force_commit) {
$mylp->save_current();
}
*/
//$objResponse->addAlert(api_get_path(REL_CODE_PATH).'newscorm/learnpathItem.class.php');
if (is_object($mylp->items[$next_item])) {
$mylpi = & $mylp->items[$next_item];
} else {
if($debug>1){error_log('In switch_item_details - generating new item object',0);}
$mylpi =& new learnpathItem($next_item,$user_id);
$mylpi->set_lp_view($view_id);
}
/*
* now get what's needed by the SCORM API:
* -score
* -max
* -min
* -lesson_status
* -session_time
* -suspend_data
*/
$myscore = $mylpi->get_score();
$mymax = $mylpi->get_max();
if($mymax===''){$mymax="''";}
$mymin = $mylpi->get_min();
$mylesson_status = $mylpi->get_status();
$mylesson_location = $mylpi->get_lesson_location();
$mytotal_time = $mylpi->get_scorm_time('js');
$mymastery_score = $mylpi->get_mastery_score();
$mymax_time_allowed = $mylpi->get_max_time_allowed();
$mylaunch_data = $mylpi->get_launch_data();
$mysession_time = $mylpi->get_total_time();
$mysuspend_data = $mylpi->get_suspend_data();
$mylesson_location = $mylpi->get_lesson_location();
$myic = $mylpi->get_interactions_count();
$myistring = '';
for ($i=0;$i<$myic;$i++) {
$myistring .= ",[".$i.",'','','','','','','']";
}
if (!empty($myistring)) {
$myistring = substr($myistring,1);
}
$return .=
"olms.score=".$myscore.";" .
"olms.max=".$mymax.";" .
"olms.min=".$mymin.";" .
"olms.lesson_status='".$mylesson_status."';" .
"olms.lesson_location='".$mylesson_location."';" .
"olms.session_time='".$mysession_time."';" .
"olms.suspend_data='".$mysuspend_data."';" .
"olms.total_time = '".$mytotal_time."';" .
"olms.mastery_score = '".$mymastery_score."';" .
"olms.max_time_allowed = '".$mymax_time_allowed."';" .
"olms.launch_data = '".$mylaunch_data."';" .
"olms.interactions = new Array(".$myistring.");" .
"olms.item_objectives = new Array();" .
"olms.G_lastError = 0;" .
"olms.G_LastErrorMessage = 'No error';" ;
/*
* and re-initialise the rest (proper to the LMS)
* -lms_lp_id
* -lms_item_id
* -lms_old_item_id
* -lms_new_item_id
* -lms_initialized
* -lms_progress_bar_mode
* -lms_view_id
* -lms_user_id
*/
$mytotal = $mylp->get_total_items_count_without_chapters();
$mycomplete = $mylp->get_complete_items_count();
$myprogress_mode = $mylp->get_progress_bar_mode();
$myprogress_mode = ($myprogress_mode==''?'%':$myprogress_mode);
$mynext = $mylp->get_next_item_id();
$myprevious = $mylp->get_previous_item_id();
$myitemtype = $mylpi->get_type();
$mylesson_mode = $mylpi->get_lesson_mode();
$mycredit = $mylpi->get_credit();
$mylaunch_data = $mylpi->get_launch_data();
$myinteractions_count = $mylpi->get_interactions_count();
$myobjectives_count = $mylpi->get_objectives_count();
$mycore_exit = $mylpi->get_core_exit();
$return .=
"olms.lms_lp_id=".$lp_id.";" .
"olms.lms_item_id=".$next_item.";" .
"olms.lms_old_item_id=0;" .
"olms.lms_initialized=0;" .
"olms.lms_view_id=".$view_id.";" .
"olms.lms_user_id=".$user_id.";" .
"olms.next_item=".$next_item.";" . //this one is very important to replace possible literal strings
"olms.lms_next_item=".$mynext.";" .
"olms.lms_previous_item=".$myprevious.";" .
"olms.lms_item_type = '".$myitemtype."';" .
"olms.lms_item_credit = '".$mycredit."';" .
"olms.lms_item_lesson_mode = '".$mylesson_mode."';" .
"olms.lms_item_launch_data = '".$mylaunch_data."';" .
"olms.lms_item_interactions_count = '".$myinteractions_count."';" .
"olms.lms_item_objectives_count = '".$myinteractions_count."';" .
"olms.lms_item_core_exit = '".$mycore_exit."';" .
"olms.asset_timer = 0;";
$mylp->set_error_msg('');
$mylp->prerequisites_match(); //check the prerequisites are all complete
if($debug>1){error_log('Prereq_match() returned '.htmlentities($mylp->error),0);}
//$_SESSION['scorm_item_id'] = $new_item_id;//Save the new item ID for the exercise tool to use
//$_SESSION['lpobject'] = serialize($mylp);
return $return;
}
echo initialize_item($_POST['lid'],$_POST['uid'],$_POST['vid'],$_POST['iid']);

@ -141,7 +141,7 @@ function save_item($lp_id,$user_id,$view_id,$item_id,$score=-1,$max=-1,$min=-1,$
if($mylpi->get_type()!='sco') if($mylpi->get_type()!='sco')
{ //if this object's JS status has not been updated by the SCORM API, update now { //if this object's JS status has not been updated by the SCORM API, update now
//$objResponse->addScript("lesson_status='".$mystatus."';"); //$objResponse->addScript("lesson_status='".$mystatus."';");
$return .= "lesson_status='".$mystatus."';"; $return .= "olms.lesson_status='".$mystatus."';";
} }
//$objResponse->addScript("update_toc('".$mystatus."','".$item_id."');"); //$objResponse->addScript("update_toc('".$mystatus."','".$item_id."');");
$return .= "update_toc('".$mystatus."','".$item_id."');"; $return .= "update_toc('".$mystatus."','".$item_id."');";

@ -16,6 +16,6 @@ function start_timer()
$time = time(); $time = time();
//$objResponse->addScript("asset_timer='$time';asset_timer_total=0;"); //$objResponse->addScript("asset_timer='$time';asset_timer_total=0;");
//return $objResponse; //return $objResponse;
return "asset_timer='$time';asset_timer_total=0;"; return "olms.asset_timer='$time';olms.asset_timer_total=0;";
} }
echo start_timer(); echo start_timer();

@ -140,35 +140,38 @@ function switch_item_details($lp_id,$user_id,$view_id,$current_item,$next_item)
if (!empty($myistring)) { if (!empty($myistring)) {
$myistring = substr($myistring,1); $myistring = substr($myistring,1);
} }
//$objResponse->addScript( /*
* The following lines should reinitialize the values for the SCO
* However, due to many complications, we are now relying more on the
* LMSInitialize() call and its underlying lp_ajax_initialize.php call
* so this code is technically deprecated (but the change of item_id should
* remain). However, due to numerous technical issues with SCORM, we prefer
* leaving it as a double-lock security. If removing, please test carefully
* with both SCORM and dokeos learning path tracking.
*/
$return .= $return .=
"score=".$myscore.";" . "olms.score=".$myscore.";" .
"max=".$mymax.";" . "olms.max=".$mymax.";" .
"min=".$mymin.";" . "olms.min=".$mymin.";" .
"lesson_status='".$mylesson_status."';" . "olms.lesson_status='".$mylesson_status."';" .
"lesson_location='".$mylesson_location."';" . "olms.lesson_location='".$mylesson_location."';" .
"session_time='".$mysession_time."';" . "olms.session_time='".$mysession_time."';" .
"suspend_data='".$mysuspend_data."';" . "olms.suspend_data='".$mysuspend_data."';" .
"total_time = '".$mytotal_time."';" . "olms.total_time = '".$mytotal_time."';" .
"mastery_score = '".$mymastery_score."';" . "olms.mastery_score = '".$mymastery_score."';" .
"max_time_allowed = '".$mymax_time_allowed."';" . "olms.max_time_allowed = '".$mymax_time_allowed."';" .
"launch_data = '".$mylaunch_data."';" . "olms.launch_data = '".$mylaunch_data."';" .
"interactions = new Array(".$myistring.");" . "olms.interactions = new Array(".$myistring.");" .
"item_objectives = new Array();" . "olms.item_objectives = new Array();" .
"G_lastError = 0;" . "olms.G_lastError = 0;" .
"G_LastErrorMessage = 'No error';"; "olms.G_LastErrorMessage = 'No error';" ;
//);
/* /*
* and re-initialise the rest * and re-initialise the rest
* -saved_lesson_status = 'not attempted'
* -lms_lp_id * -lms_lp_id
* -lms_item_id * -lms_item_id
* -lms_old_item_id * -lms_old_item_id
* -lms_new_item_id * -lms_new_item_id
* -lms_been_synchronized
* -lms_initialized * -lms_initialized
* -lms_total_lessons
* -lms_complete_lessons
* -lms_progress_bar_mode * -lms_progress_bar_mode
* -lms_view_id * -lms_view_id
* -lms_user_id * -lms_user_id
@ -187,35 +190,30 @@ function switch_item_details($lp_id,$user_id,$view_id,$current_item,$next_item)
$myobjectives_count = $mylpi->get_objectives_count(); $myobjectives_count = $mylpi->get_objectives_count();
$mycore_exit = $mylpi->get_core_exit(); $mycore_exit = $mylpi->get_core_exit();
//$objResponse->addScript(
$return .= $return .=
"saved_lesson_status='not attempted';" . //"saved_lesson_status='not attempted';" .
"lms_lp_id=".$lp_id.";" . "olms.lms_lp_id=".$lp_id.";" .
"lms_item_id=".$new_item_id.";" . "olms.lms_item_id=".$new_item_id.";" .
"lms_old_item_id=0;" . "olms.lms_old_item_id=0;" .
"lms_been_synchronized=0;" . //"lms_been_synchronized=0;" .
"lms_initialized=0;" . "olms.lms_initialized=0;" .
"lms_total_lessons=".$mytotal.";" . //"lms_total_lessons=".$mytotal.";" .
"lms_complete_lessons=".$mycomplete.";" . //"lms_complete_lessons=".$mycomplete.";" .
"lms_progress_bar_mod='".$myprogress_mode."';" . //"lms_progress_bar_mode='".$myprogress_mode."';" .
"lms_view_id=".$view_id.";" . "olms.lms_view_id=".$view_id.";" .
"lms_user_id=".$user_id.";" . "olms.lms_user_id=".$user_id.";" .
"next_item=".$new_item_id.";" . //this one is very important to replace possible literal strings "olms.next_item=".$new_item_id.";" . //this one is very important to replace possible literal strings
"lms_next_item=".$mynext.";" . "olms.lms_next_item=".$mynext.";" .
"lms_previous_item=".$myprevious.";" . "olms.lms_previous_item=".$myprevious.";" .
"lms_item_type = '".$myitemtype."';" . "olms.lms_item_type = '".$myitemtype."';" .
"lms_item_credit = '".$mycredit."';" . "olms.lms_item_credit = '".$mycredit."';" .
"lms_item_lesson_mode = '".$mylesson_mode."';" . "olms.lms_item_lesson_mode = '".$mylesson_mode."';" .
"lms_item_launch_data = '".$mylaunch_data."';" . "olms.lms_item_launch_data = '".$mylaunch_data."';" .
"lms_item_interactions_count = '".$myinteractions_count."';" . "olms.lms_item_interactions_count = '".$myinteractions_count."';" .
"lms_item_objectives_count = '".$myinteractions_count."';" . "olms.lms_item_objectives_count = '".$myinteractions_count."';" .
"lms_item_core_exit = '".$mycore_exit."';" . "olms.lms_item_core_exit = '".$mycore_exit."';" .
"asset_timer = 0;"; "olms.asset_timer = 0;";
//); //);
//$objResponse->addScript("update_toc('unhighlight','".$current_item."');");
//$objResponse->addScript("update_toc('highlight','".$new_item_id."');");
//$objResponse->addScript("update_toc('$mylesson_status','".$new_item_id."');");
//$objResponse->addScript("update_progress_bar('$mycomplete','$mytotal','$myprogress_mode');");
$return .= "update_toc('unhighlight','".$current_item."');". $return .= "update_toc('unhighlight','".$current_item."');".
"update_toc('highlight','".$new_item_id."');". "update_toc('highlight','".$new_item_id."');".
"update_toc('$mylesson_status','".$new_item_id."');". "update_toc('$mylesson_status','".$new_item_id."');".
@ -224,11 +222,9 @@ function switch_item_details($lp_id,$user_id,$view_id,$current_item,$next_item)
$mylp->set_error_msg(''); $mylp->set_error_msg('');
$mylp->prerequisites_match(); //check the prerequisites are all complete $mylp->prerequisites_match(); //check the prerequisites are all complete
if($debug>1){error_log('Prereq_match() returned '.htmlentities($mylp->error),0);} if($debug>1){error_log('Prereq_match() returned '.htmlentities($mylp->error),0);}
//$objResponse->addScript("update_message_frame('".str_replace("'","\'",htmlentities($mylp->error))."');");
$return .= "update_message_frame('".str_replace("'","\'",api_htmlentities($mylp->error, ENT_QUOTES, api_get_system_encoding()))."');";
$_SESSION['scorm_item_id'] = $new_item_id;//Save the new item ID for the exercise tool to use $_SESSION['scorm_item_id'] = $new_item_id;//Save the new item ID for the exercise tool to use
$_SESSION['lpobject'] = serialize($mylp); $_SESSION['lpobject'] = serialize($mylp);
return $return; return $return;
//return $objResponse; //return $objResponse;
} }
echo switch_item_details($_GET['lid'],$_GET['uid'],$_GET['vid'],$_GET['iid'],$_GET['next']); echo switch_item_details($_POST['lid'],$_POST['uid'],$_POST['vid'],$_POST['iid'],$_POST['next']);

@ -0,0 +1,186 @@
<?php //$id$
/**
* This script contains the server part of the xajax interaction process. The client part is located
* in lp_api.php or other api's.
* This script updated the TOC of the SCORM without updating the SCO's attributes
* @package dokeos.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Script
*/
//flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;
// name of the language file that needs to be included
$language_file[] = 'learnpath';
require_once('back_compat.inc.php');
/**
* Get one item's details
* @param integer LP ID
* @param integer user ID
* @param integer View ID
* @param integer Current item ID
* @param integer New item ID
*/
function switch_item_toc($lp_id,$user_id,$view_id,$current_item,$next_item)
{
$debug=0;
$return = '';
if($debug>0){error_log('In xajax_switch_item_toc('.$lp_id.','.$user_id.','.$view_id.','.$current_item.','.$next_item.')',0);}
require_once('learnpath.class.php');
require_once('scorm.class.php');
require_once('aicc.class.php');
require_once('learnpathItem.class.php');
require_once('scormItem.class.php');
require_once('aiccItem.class.php');
$mylp = '';
if(isset($_SESSION['lpobject']))
{
if($debug>1){error_log('////$_SESSION[lpobject] is set',0);}
$oLP =& unserialize($_SESSION['lpobject']);
if(!is_object($oLP)){
if($debug>1){error_log(print_r($oLP,true),0);}
if($debug>2){error_log('////Building new lp',0);}
unset($oLP);
$code = api_get_course_id();
$mylp = & new learnpath($code,$lp_id,$user_id);
}else{
if($debug>1){error_log('////Reusing session lp',0);}
$mylp = & $oLP;
}
}
$new_item_id = 0;
switch($next_item){
case 'next':
$mylp->set_current_item($current_item);
$mylp->next();
$new_item_id = $mylp->get_current_item_id();
if($debug>1){error_log('In {next} - next item is '.$new_item_id.'(current: '.$current_item.')',0);}
break;
case 'previous':
$mylp->set_current_item($current_item);
$mylp->previous();
$new_item_id = $mylp->get_current_item_id();
if($debug>1){error_log('In {previous} - next item is '.$new_item_id.'(current: '.$current_item.')',0);}
break;
case 'first':
$mylp->set_current_item($current_item);
$mylp->first();
$new_item_id = $mylp->get_current_item_id();
if($debug>1){error_log('In {first} - next item is '.$new_item_id.'(current: '.$current_item.')',0);}
break;
case 'last':
break;
default:
//should be filtered to check it's not hacked
if($next_item == $current_item){
//if we're opening the same item again
$mylp->items[$current_item]->restart();
}
$new_item_id = $next_item;
$mylp->set_current_item($new_item_id);
if($debug>1){error_log('In {default} - next item is '.$new_item_id.'(current: '.$current_item.')',0);}
break;
}
$mylp->start_current_item(true);
if($mylp->force_commit){
$mylp->save_current();
}
//$objResponse->addAlert(api_get_path(REL_CODE_PATH).'newscorm/learnpathItem.class.php');
if(is_object($mylp->items[$new_item_id])){
$mylpi = & $mylp->items[$new_item_id];
}else{
if($debug>1){error_log('In switch_item_details - generating new item object',0);}
$mylpi =& new learnpathItem($new_item_id,$user_id);
$mylpi->set_lp_view($view_id);
}
/*
* now get what's needed by the SCORM API:
* -score
* -max
* -min
* -lesson_status
* -session_time
* -suspend_data
*/
$myscore = $mylpi->get_score();
$mymax = $mylpi->get_max();
if($mymax===''){$mymax="''";}
$mymin = $mylpi->get_min();
$mylesson_status = $mylpi->get_status();
$mylesson_location = $mylpi->get_lesson_location();
$mytotal_time = $mylpi->get_scorm_time('js');
$mymastery_score = $mylpi->get_mastery_score();
$mymax_time_allowed = $mylpi->get_max_time_allowed();
$mylaunch_data = $mylpi->get_launch_data();
/*
if($mylpi->get_type() == 'asset'){
//temporary measure to save completion of an asset. Later on, Dokeos should trigger something on unload, maybe... (even though that would mean the last item cannot be completed)
$mylesson_status = 'completed';
$mylpi->set_status('completed');
$mylpi->save();
}
*/
$mysession_time = $mylpi->get_total_time();
$mysuspend_data = $mylpi->get_suspend_data();
$mylesson_location = $mylpi->get_lesson_location();
$myic = $mylpi->get_interactions_count();
$myistring = '';
for ($i=0;$i<$myic;$i++) {
$myistring .= ",[".$i.",'','','','','','','']";
}
if (!empty($myistring)) {
$myistring = substr($myistring,1);
}
$mytotal = $mylp->get_total_items_count_without_chapters();
$mycomplete = $mylp->get_complete_items_count();
$myprogress_mode = $mylp->get_progress_bar_mode();
$myprogress_mode = ($myprogress_mode==''?'%':$myprogress_mode);
$mynext = $mylp->get_next_item_id();
$myprevious = $mylp->get_previous_item_id();
$myitemtype = $mylpi->get_type();
$mylesson_mode = $mylpi->get_lesson_mode();
$mycredit = $mylpi->get_credit();
$mylaunch_data = $mylpi->get_launch_data();
$myinteractions_count = $mylpi->get_interactions_count();
$myobjectives_count = $mylpi->get_objectives_count();
$mycore_exit = $mylpi->get_core_exit();
$return .=
//"saved_lesson_status='not attempted';" .
"olms.lms_lp_id=".$lp_id.";" .
"olms.lms_item_id=".$new_item_id.";" .
"olms.lms_old_item_id=0;" .
//"lms_been_synchronized=0;" .
"olms.lms_initialized=0;" .
//"lms_total_lessons=".$mytotal.";" .
//"lms_complete_lessons=".$mycomplete.";" .
//"lms_progress_bar_mode='".$myprogress_mode."';" .
"olms.lms_view_id=".$view_id.";" .
"olms.lms_user_id=".$user_id.";" .
"olms.next_item=".$new_item_id.";" . //this one is very important to replace possible literal strings
"olms.lms_next_item=".$mynext.";" .
"olms.lms_previous_item=".$myprevious.";" .
"olms.lms_item_type = '".$myitemtype."';" .
"olms.lms_item_credit = '".$mycredit."';" .
"olms.lms_item_lesson_mode = '".$mylesson_mode."';" .
"olms.lms_item_launch_data = '".$mylaunch_data."';" .
"olms.lms_item_interactions_count = '".$myinteractions_count."';" .
"olms.lms_item_objectives_count = '".$myinteractions_count."';" .
"olms.lms_item_core_exit = '".$mycore_exit."';" .
"olms.asset_timer = 0;";
//);
$return .= "update_toc('unhighlight','".$current_item."');".
"update_toc('highlight','".$new_item_id."');".
"update_toc('$mylesson_status','".$new_item_id."');".
"update_progress_bar('$mycomplete','$mytotal','$myprogress_mode');";
$mylp->set_error_msg('');
$mylp->prerequisites_match(); //check the prerequisites are all complete
if($debug>1){error_log('Prereq_match() returned '.htmlentities($mylp->error),0);}
$_SESSION['scorm_item_id'] = $new_item_id;//Save the new item ID for the exercise tool to use
$_SESSION['lpobject'] = serialize($mylp);
return $return;
//return $objResponse;
}
echo switch_item_toc($_POST['lid'],$_POST['uid'],$_POST['vid'],$_POST['iid'],$_POST['next']);

@ -71,16 +71,14 @@ $my_style=$platform_theme;
Header Header
----------------------------------------------------------- -----------------------------------------------------------
*/ */
//$htmlHeadXtra[] = '<script type="text/javascript" src="lp_view.lib.js"></script>';
//$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/')."\n";
$htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery $htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
$htmlHeadXtra[] = '<script language="javascript"> $htmlHeadXtra[] = '<script language="javascript" type="text/javascript">
function cleanlog(){ $(document).ready(function (){
if(document.getElementById){ $("div#log_content_cleaner").bind("click", function(){
document.getElementById("log_content").innerHTML = ""; $("div#log_content").empty();
} });
} });
</script>'; </script>';
$htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript"> $htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
@ -230,14 +228,12 @@ if($_SESSION['oLP']->mode == 'fullscreen') {
//set flag to ensure lp_header.php is loaded by this script (flag is unset in lp_header.php) //set flag to ensure lp_header.php is loaded by this script (flag is unset in lp_header.php)
$_SESSION['loaded_lp_view'] = true; $_SESSION['loaded_lp_view'] = true;
?> ?>
<input type="hidden" id="old_item" name ="old_item" value="0"/> <body>
<input type="hidden" id="current_item_id" name ="current_item_id" value="0" /> <div id="learning_path_main" style="width:100%;height:100%;" >
<div id="learning_path_left_zone" style="float:left;width:280px;height:100%">
<div id="learningPathMain" style="width:100%;height:100%;" >
<div id="learningPathLeftZone" style="float:left;width:280px;height:100%">
<!-- header --> <!-- header -->
<div id="header"> <div id="header">
<div id="learningPathHeader" style="font-size:14px;"> <div id="learning_path_header" style="font-size:14px;">
<table> <table>
<tr> <tr>
<td> <td>
@ -261,13 +257,12 @@ if($_SESSION['oLP']->mode == 'fullscreen') {
<div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px"> <div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px">
<div style="width:100; float:left;height:105;margin:5px"> <div style="width:100; float:left;height:105;margin:5px">
<span> <span>
<?php if ($_SESSION['oLP']->get_preview_image()!=''): ?>
<img width="115" height="100" src="<?php echo api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image(); ?>">
<?php <?php
else if ($_SESSION['oLP']->get_preview_image()!='') {
: echo Display :: display_icon('unknown_250_100.jpg', ' '); echo '<img width="115px" height="100px" src="'.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image().'">';
endif; } else {
?> echo Display :: display_icon('unknown_250_100.jpg', ' ');
}; ?>
</span> </span>
</div> </div>
@ -324,35 +319,28 @@ if($_SESSION['oLP']->mode == 'fullscreen') {
<!-- toc layout --> <!-- toc layout -->
<div id="toc_id" name="toc_name" style="padding:0;margin-top:20px;height:60%;width:100%"> <div id="toc_id" name="toc_name" style="padding:0;margin-top:20px;height:60%;width:100%">
<div id="learningPathToc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?> <div id="learning_path_toc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?>
<!-- log message layout --> <!-- log message layout -->
<div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:50px;overflow:auto;margin:15px"> <div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:50px;overflow:auto;margin:15px">
<div id="log_content"></div> <div id="log_content"></div>
<div style="color: white;" onClick="cleanlog();">.</div> <div id="log_content_cleaner" style="color: white;">.</div>
</div> </div>
<!-- end log message layout --> <!-- end log message layout -->
</div> </div>
</div> </div>
<!-- end toc layout --> <!-- end toc layout -->
</div> </div>
<!-- end left Zone --> <!-- end left Zone -->
<!-- right Zone --> <!-- right Zone -->
<div id="learningPathRightZone" style="margin-left:282px;border : 0pt solid blue;height:100%"> <div id="learning_path_right_zone" style="margin-left:282px;border : 0pt solid blue;height:100%">
<iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" style="width:100%;height:600px" ></iframe> <iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" style="width:100%;height:600px" ></iframe>
</div> </div>
<!-- end right Zone --> <!-- end right Zone -->
</div> </div>
<script language="JavaScript" type="text/javascript">
// Need to be called after the <head> to be sure window.oxajax is defined
var dokeos_xajax_handler = window.oxajax;
</script>
<script language="JavaScript" type="text/javascript"> <script language="JavaScript" type="text/javascript">
<!-- <!--
var leftZoneHeightOccupied = 0; var leftZoneHeightOccupied = 0;
@ -372,8 +360,8 @@ if($_SESSION['oLP']->mode == 'fullscreen') {
newRightZoneHeight = initialRightZoneHeight; newRightZoneHeight = initialRightZoneHeight;
newLeftZoneHeight = newRightZoneHeight + rightZoneHeightOccupied - leftZoneHeightOccupied; newLeftZoneHeight = newRightZoneHeight + rightZoneHeightOccupied - leftZoneHeightOccupied;
} }
document.getElementById('learningPathToc').style.height = newLeftZoneHeight + 'px'; document.getElementById('learning_path_toc').style.height = newLeftZoneHeight + 'px';
document.getElementById('learningPathRightZone').style.height = newRightZoneHeight + 'px'; document.getElementById('learning_path_right_zone').style.height = newRightZoneHeight + 'px';
document.getElementById('content_id_blank').style.height = newRightZoneHeight + 'px'; document.getElementById('content_id_blank').style.height = newRightZoneHeight + 'px';
if (document.body.clientHeight > winHeight) { if (document.body.clientHeight > winHeight) {
document.body.style.overflow = 'auto'; document.body.style.overflow = 'auto';
@ -387,19 +375,19 @@ if($_SESSION['oLP']->mode == 'fullscreen') {
screen_height = screen.height; screen_height = screen.height;
screen_width = screen.height; screen_width = screen.height;
document.getElementById('learningPathLeftZone').style.height = "100%"; document.getElementById('learning_path_left_zone').style.height = "100%";
document.getElementById('learningPathToc').style.height = "60%"; document.getElementById('learning_path_toc').style.height = "60%";
document.getElementById('learningPathToc').style.width = "100%"; document.getElementById('learning_path_toc').style.width = "100%";
document.getElementById('learningPathRightZone').style.height = "100%" document.getElementById('learning_path_right_zone').style.height = "100%"
document.getElementById('content_id').style.height = "100%" ; document.getElementById('content_id').style.height = "100%" ;
if (screen_height <= 600) { if (screen_height <= 600) {
document.getElementById('inner_lp_toc').style.height = "100px" ; document.getElementById('inner_lp_toc').style.height = "100px" ;
document.getElementById('learningPathLeftZone').style.height = "415px"; document.getElementById('learning_path_left_zone').style.height = "415px";
} }
initialLeftZoneHeight = document.getElementById('learningPathToc').offsetHeight; initialLeftZoneHeight = document.getElementById('learning_path_toc').offsetHeight;
initialRightZoneHeight = document.getElementById('learningPathRightZone').offsetHeight; initialRightZoneHeight = document.getElementById('learning_path_right_zone').offsetHeight;
docHeight = document.body.clientHeight; docHeight = document.body.clientHeight;
leftZoneHeightOccupied = docHeight - initialLeftZoneHeight; leftZoneHeightOccupied = docHeight - initialLeftZoneHeight;
rightZoneHeightOccupied = docHeight - initialRightZoneHeight; rightZoneHeightOccupied = docHeight - initialRightZoneHeight;
@ -410,37 +398,29 @@ if($_SESSION['oLP']->mode == 'fullscreen') {
window.onresize = updateContentHeight; window.onresize = updateContentHeight;
--> -->
</script> </script>
</body>
<?php <?php
} } else {
else //not fullscreen mode
{
include_once('../inc/reduced_header.inc.php'); include_once('../inc/reduced_header.inc.php');
//$displayAudioRecorder = (api_get_setting('service_visio','active')=='true') ? true : false; //$displayAudioRecorder = (api_get_setting('service_visio','active')=='true') ? true : false;
//check if audio recorder needs to be in studentview //check if audio recorder needs to be in studentview
$course_id=$_SESSION["_course"]["id"]; $course_id=$_SESSION["_course"]["id"];
if($_SESSION["status"][$course_id]==5) if ($_SESSION["status"][$course_id]==5) {
{
$audio_recorder_studentview = true; $audio_recorder_studentview = true;
} } else {
else
{
$audio_recorder_studentview = false; $audio_recorder_studentview = false;
} }
//set flag to ensure lp_header.php is loaded by this script (flag is unset in lp_header.php) //set flag to ensure lp_header.php is loaded by this script (flag is unset in lp_header.php)
$_SESSION['loaded_lp_view'] = true; $_SESSION['loaded_lp_view'] = true;
?> ?>
<body>
<input type="hidden" id="old_item" name ="old_item" value="0"/> <div id="learning_path_main" style="width:100%;height:100%;" >
<input type="hidden" id="current_item_id" name ="current_item_id" value="0" /> <div id="learning_path_left_zone" style="float:left;width:280px;height:100%">
<div id="learningPathMain" style="width:100%;height:100%;" >
<div id="learningPathLeftZone" style="float:left;width:280px;height:100%">
<!-- header --> <!-- header -->
<div id="header"> <div id="header">
<div id="learningPathHeader" style="font-size:14px;"> <div id="learning_path_header" style="font-size:14px;">
<table> <table>
<tr> <tr>
<td> <td>
@ -459,24 +439,22 @@ else
<!-- Image preview Layout --> <!-- Image preview Layout -->
<div id="author_image" name="author_image" class="lp_author_image" style="height:23%; width:100%;margin-left:5px;"> <div id="author_image" name="author_image" class="lp_author_image" style="height:23%; width:100%;margin-left:5px;">
<?php $image = '../img/lp_author_background.gif'; ?> <?php $image = '../img/lp_author_background.gif'; ?>
<div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px"> <div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px">
<div style="width:100; float:left;height:105;margin:5px"> <div style="width:100; float:left;height:105;margin:5px">
<span style="width:104px; height:96px; float:left; vertical-align:bottom;"> <span style="width:104px; height:96px; float:left; vertical-align:bottom;">
<center><?php if ($_SESSION['oLP']->get_preview_image()!=''): ?> <center>
<?php <?php
if ($_SESSION['oLP']->get_preview_image()!='') {
$picture = getimagesize(api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image()); $picture = getimagesize(api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image());
if($picture['1'] < 96) $style = ' style="padding-top:'.((94 -$picture['1'])/2).'px;" '; if($picture['1'] < 96) { $style = ' style="padding-top:'.((94 -$picture['1'])/2).'px;" '; }
$size = ($picture['0'] > 104 && $picture['1'] > 96 )? ' width="104" height="96" ': $style; $size = ($picture['0'] > 104 && $picture['1'] > 96 )? ' width="104" height="96" ': $style;
$flie = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image(); $my_path = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image();
echo '<img '.$size.' src="'.$flie.'">'; echo '<img '.$size.' src="'.$my_path.'">';
} else {
echo Display :: display_icon('unknown_250_100.jpg', ' ');
}
?> ?>
<?php </center>
else
: echo Display :: display_icon('unknown_250_100.jpg', ' ');
endif;
?></center>
</span> </span>
</div> </div>
@ -516,7 +494,6 @@ else
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- end image preview Layout --> <!-- end image preview Layout -->
<div id="author_name" style="position:relative;top:2px;left:0px;margin:0;padding:0;text-align:center;width:100%"> <div id="author_name" style="position:relative;top:2px;left:0px;margin:0;padding:0;text-align:center;width:100%">
@ -532,35 +509,28 @@ else
<!-- toc layout --> <!-- toc layout -->
<div id="toc_id" name="toc_name" style="padding:0;margin-top:20px;height:60%;width:100%"> <div id="toc_id" name="toc_name" style="padding:0;margin-top:20px;height:60%;width:100%">
<div id="learningPathToc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?> <div id="learning_path_toc" style="font-size:9pt;margin:0;"><?php echo $_SESSION['oLP']->get_html_toc(); ?>
<!-- log message layout -->
<div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:50px;overflow:auto;margin:15px"> <?php if (!empty($_SESSION['oLP']->scorm_debug)) { //only show log ?>
<!-- log message layout -->
<div id="lp_log_name" name="lp_log_name" class="lp_log" style="height:150px;overflow:auto;margin:4px">
<div id="log_content"></div> <div id="log_content"></div>
<div style="color: white;" onClick="cleanlog();">.</div> <div id="log_content_cleaner" style="color: white;">.</div>
</div> </div>
<!-- end log message layout --> <!-- end log message layout -->
<?php } ?>
</div> </div>
</div> </div>
<!-- end toc layout --> <!-- end toc layout -->
</div> </div>
<!-- end left Zone --> <!-- end left Zone -->
<!-- right Zone --> <!-- right Zone -->
<div id="learningPathRightZone" style="margin-left:282px;height:100%"> <div id="learning_path_right_zone" style="margin-left:282px;height:100%">
<iframe id="content_id" name="content_name" src="<?php echo $src; ?>" border="0" frameborder="0" style="width:100%;height:600px" ></iframe> <iframe id="content_id" name="content_name" src="<?php echo $src; ?>" border="0" frameborder="0" style="width:100%;height:600px" ></iframe>
</div> </div>
<!-- end right Zone --> <!-- end right Zone -->
</div> </div>
<script language="JavaScript" type="text/javascript">
// Need to be called after the <head> to be sure window.oxajax is defined
var dokeos_xajax_handler = window.oxajax;
</script>
<script language="JavaScript" type="text/javascript"> <script language="JavaScript" type="text/javascript">
<!-- <!--
var leftZoneHeightOccupied = 0; var leftZoneHeightOccupied = 0;
@ -580,8 +550,8 @@ else
newRightZoneHeight = initialRightZoneHeight; newRightZoneHeight = initialRightZoneHeight;
newLeftZoneHeight = newRightZoneHeight + rightZoneHeightOccupied - leftZoneHeightOccupied; newLeftZoneHeight = newRightZoneHeight + rightZoneHeightOccupied - leftZoneHeightOccupied;
} }
document.getElementById('learningPathToc').style.height = newLeftZoneHeight + 'px'; document.getElementById('learning_path_toc').style.height = newLeftZoneHeight + 'px';
document.getElementById('learningPathRightZone').style.height = newRightZoneHeight + 'px'; document.getElementById('learning_path_right_zone').style.height = newRightZoneHeight + 'px';
document.getElementById('content_id').style.height = newRightZoneHeight + 'px'; document.getElementById('content_id').style.height = newRightZoneHeight + 'px';
if (document.body.clientHeight > winHeight) { if (document.body.clientHeight > winHeight) {
document.body.style.overflow = 'auto'; document.body.style.overflow = 'auto';
@ -595,19 +565,19 @@ else
screen_height = screen.height; screen_height = screen.height;
screen_width = screen.height; screen_width = screen.height;
document.getElementById('learningPathLeftZone').style.height = "100%"; document.getElementById('learning_path_left_zone').style.height = "100%";
document.getElementById('learningPathToc').style.height = "60%"; document.getElementById('learning_path_toc').style.height = "60%";
document.getElementById('learningPathToc').style.width = "100%"; document.getElementById('learning_path_toc').style.width = "100%";
document.getElementById('learningPathRightZone').style.height = "100%" document.getElementById('learning_path_right_zone').style.height = "100%"
document.getElementById('content_id').style.height = "100%" ; document.getElementById('content_id').style.height = "100%" ;
if (screen_height <= 600) { if (screen_height <= 600) {
document.getElementById('inner_lp_toc').style.height = "100px" ; document.getElementById('inner_lp_toc').style.height = "100px" ;
document.getElementById('learningPathLeftZone').style.height = "415px"; document.getElementById('learning_path_left_zone').style.height = "415px";
} }
initialLeftZoneHeight = document.getElementById('learningPathToc').offsetHeight; initialLeftZoneHeight = document.getElementById('learning_path_toc').offsetHeight;
initialRightZoneHeight = document.getElementById('learningPathRightZone').offsetHeight; initialRightZoneHeight = document.getElementById('learning_path_right_zone').offsetHeight;
docHeight = document.body.clientHeight; docHeight = document.body.clientHeight;
leftZoneHeightOccupied = docHeight - initialLeftZoneHeight; leftZoneHeightOccupied = docHeight - initialLeftZoneHeight;
rightZoneHeightOccupied = docHeight - initialRightZoneHeight; rightZoneHeightOccupied = docHeight - initialRightZoneHeight;
@ -618,7 +588,7 @@ else
window.onresize = updateContentHeight; window.onresize = updateContentHeight;
--> -->
</script> </script>
</body>
<?php <?php
/* /*
============================================================================== ==============================================================================
@ -629,4 +599,3 @@ else
} }
//restore global setting //restore global setting
$_setting['show_navigation_menu'] = $save_setting; $_setting['show_navigation_menu'] = $save_setting;
?>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save