ソースを参照

[svn r10119] Small coherence fixes

Yannick Warnier 18 年 前
コミット
cc312e3871
1 ファイル変更6 行追加3 行削除
  1. 6 3
      main/newscorm/learnpathItem.class.php

+ 6 - 3
main/newscorm/learnpathItem.class.php

@@ -319,7 +319,8 @@ class learnpathItem{
 	function get_lesson_mode(){
 	function get_lesson_mode(){
 		$mode = 'normal';
 		$mode = 'normal';
 		if($this->get_prevent_reinit() != 0){ //if prevent_reinit == 0
 		if($this->get_prevent_reinit() != 0){ //if prevent_reinit == 0
-			if($this->status != $this->possible_status[0] AND $this->status != $this->possible_status[1]){	
+			$my_status = $this->get_status();
+			if($my_status != $this->possible_status[0] AND $my_status != $this->possible_status[1]){	
 				$mode = 'review';
 				$mode = 'review';
 			}
 			}
 		}
 		}
@@ -418,12 +419,14 @@ class learnpathItem{
      */
      */
     function get_score(){
     function get_score(){
     	if($this->debug>0){error_log('New LP - In learnpathItem::get_score()',0);}
     	if($this->debug>0){error_log('New LP - In learnpathItem::get_score()',0);}
+    	$res = 0;
     	if(!empty($this->current_score))
     	if(!empty($this->current_score))
     	{
     	{
-    		return $this->current_score;
+    		$res = $this->current_score;
     	}
     	}
     	//TODO check this return value is valid for children classes (SCORM?)
     	//TODO check this return value is valid for children classes (SCORM?)
-    	return 0;
+    	if($this->debug>1){error_log('New LP - Out of learnpathItem::get_score() - returning '.$res,0);}
+    	return $res;
     }
     }
     /**
     /**
      * Gets the item status
      * Gets the item status