[svn r19655] Logic changes - fixed error message when a chapter is selected, it shows a blank page - partial FS#3909

skala
Cristian Fasanando 16 years ago
parent 28ada05106
commit 05ea78a71c
  1. 8
      main/newscorm/learnpath.class.php
  2. 65
      main/newscorm/lp_content.php

@ -2771,10 +2771,12 @@ class learnpath {
$count = Database::num_rows($result);
if ($item['type']=='quiz') {
if ($item['status']=='completed') {
$html .= "<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' />";
$html .= "&nbsp;<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' width='12' height='12' />";
}
} else {
$html .= "<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' />";
} else {
if ($item['type']!='dokeos_chapter' && $item['type']!='dokeos_module' && $item['type']!='dir') {
$html .= "&nbsp;<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' width='12' height='12' />";
}
}

@ -22,31 +22,46 @@ $lp_item_id = $_SESSION['oLP']->get_current_item_id();
*/
$src = '';
if($debug>0){error_log('New lp - In lp_content.php - Looking for file url',0);}
switch($lp_type){
case 1:
$_SESSION['oLP']->stop_previous_item();
$prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
if($prereq_check === true){
$src = $_SESSION['oLP']->get_link('http',$lp_item_id);
$_SESSION['oLP']->start_current_item(); //starts time counter manually if asset
}else{
$src = 'blank.php?error=prerequisites';
}
break;
case 2:
case 3:
//save old if asset
$_SESSION['oLP']->stop_previous_item(); //save status manually if asset
$prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
if($prereq_check === true){
$src = $_SESSION['oLP']->get_link('http',$lp_item_id);
$_SESSION['oLP']->start_current_item(); //starts time counter manually if asset
}else{
$src = 'blank.php';
}
break;
case 4:
break;
$list = $_SESSION['oLP']->get_toc();
$dokeos_chapter = false;
foreach($list as $toc) {
if ($toc['id']==$lp_item_id && ($toc['type']=='dokeos_chapter' || $toc['type']=='dokeos_module' || $toc['type']=='dir')) {
$dokeos_chapter = true;
}
}
if ($dokeos_chapter) {
$src='blank.php';
} else {
switch($lp_type){
case 1:
$_SESSION['oLP']->stop_previous_item();
$prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
if($prereq_check === true){
$src = $_SESSION['oLP']->get_link('http',$lp_item_id);
$_SESSION['oLP']->start_current_item(); //starts time counter manually if asset
}else{
$src = 'blank.php?error=prerequisites';
}
break;
case 2:
case 3:
//save old if asset
$_SESSION['oLP']->stop_previous_item(); //save status manually if asset
$prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
if($prereq_check === true){
$src = $_SESSION['oLP']->get_link('http',$lp_item_id);
$_SESSION['oLP']->start_current_item(); //starts time counter manually if asset
}else{
$src = 'blank.php';
}
break;
case 4:
break;
}
}
if($debug>0){error_log('New lp - In lp_content.php - File url is '.$src,0);}
$_SESSION['oLP']->set_previous_item($lp_item_id);

Loading…
Cancel
Save