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

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

@ -2771,10 +2771,12 @@ class learnpath {
$count = Database::num_rows($result); $count = Database::num_rows($result);
if ($item['type']=='quiz') { if ($item['type']=='quiz') {
if ($item['status']=='completed') { 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 { } else {
$html .= "<img id='toc_img_".$item['id']."' src='".$icon_name[$item['status']]."' alt='".substr($item['status'],0,1)."' />"; 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 = ''; $src = '';
if($debug>0){error_log('New lp - In lp_content.php - Looking for file url',0);} if($debug>0){error_log('New lp - In lp_content.php - Looking for file url',0);}
switch($lp_type){
case 1: $list = $_SESSION['oLP']->get_toc();
$_SESSION['oLP']->stop_previous_item();
$prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id); $dokeos_chapter = false;
if($prereq_check === true){
$src = $_SESSION['oLP']->get_link('http',$lp_item_id); foreach($list as $toc) {
$_SESSION['oLP']->start_current_item(); //starts time counter manually if asset if ($toc['id']==$lp_item_id && ($toc['type']=='dokeos_chapter' || $toc['type']=='dokeos_module' || $toc['type']=='dir')) {
}else{ $dokeos_chapter = true;
$src = 'blank.php?error=prerequisites'; }
} }
break;
case 2: if ($dokeos_chapter) {
case 3: $src='blank.php';
//save old if asset } else {
$_SESSION['oLP']->stop_previous_item(); //save status manually if asset switch($lp_type){
$prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id); case 1:
if($prereq_check === true){ $_SESSION['oLP']->stop_previous_item();
$src = $_SESSION['oLP']->get_link('http',$lp_item_id); $prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
$_SESSION['oLP']->start_current_item(); //starts time counter manually if asset if($prereq_check === true){
}else{ $src = $_SESSION['oLP']->get_link('http',$lp_item_id);
$src = 'blank.php'; $_SESSION['oLP']->start_current_item(); //starts time counter manually if asset
} }else{
break; $src = 'blank.php?error=prerequisites';
case 4: }
break; 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);} if($debug>0){error_log('New lp - In lp_content.php - File url is '.$src,0);}
$_SESSION['oLP']->set_previous_item($lp_item_id); $_SESSION['oLP']->set_previous_item($lp_item_id);

Loading…
Cancel
Save