Browse Source

[svn r13592] Added order_id

Yannick Warnier 17 years ago
parent
commit
f84049607c

+ 1 - 0
main/inc/lib/add_course.lib.inc.php

@@ -1020,6 +1020,7 @@ function update_Db_course($courseDbName)
 	$sql = "CREATE TABLE IF NOT EXISTS `$TABLELPIVOBJECTIVE`(" .
 		"id				bigint	unsigned 		primary key auto_increment," .
 		"lp_iv_id		bigint	unsigned not null," . //identifier of the related sco_view
+		"order_id		smallint	unsigned	not null default 0,". //internal order (0->...) given by Dokeos
 		"objective_id	varchar(255) not null default ''," . //sco-specific, given by the sco
 		"score_raw		float unsigned not null default 0," . //score
 		"score_max		float unsigned not null default 0," . //max score

+ 1 - 1
main/install/migrate-db-1.8.4-1.8.5-pre.sql

@@ -26,5 +26,5 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value,
 -- xxUSERxx
 
 -- xxCOURSExx
-CREATE TABLE lp_iv_interaction(id bigint unsigned primary key auto_increment, lp_iv_id bigint unsigned not null, objective_id	varchar(255) not null default '', score_raw		float unsigned not null default 0, score_max		float unsigned not null default 0, score_min		float unsigned not null default 0, status char(32) not null default 'not attempted');
+CREATE TABLE lp_iv_interaction(id bigint unsigned primary key auto_increment, lp_iv_id bigint unsigned not null, order_id smallint unsigned not null default 0, objective_id	varchar(255) not null default '', score_raw		float unsigned not null default 0, score_max		float unsigned not null default 0, score_min		float unsigned not null default 0, status char(32) not null default 'not attempted');
 ALTER TABLE lp_iv_interaction ADD INDEX (lp_iv_id);

+ 4 - 4
main/newscorm/learnpathItem.class.php

@@ -2090,16 +2090,16 @@ class learnpathItem{
 		     					"score_max = '".$objective[3]."' " .
 		     					"WHERE id = $iva_id";
 		     				$ivau_res = api_sql_query($ivau_sql,__FILE__,__LINE__);
-		     				error_log($ivau_sql,0);
+		     				//error_log($ivau_sql,0);
 		     			}else{
 		     				//insert new one
 		     				$ivai_sql = "INSERT INTO $iva_table " .
-		     						"(lp_iv_id, objective_id, status, score_raw, score_min, score_max )" .
+		     						"(lp_iv_id, order_id, objective_id, status, score_raw, score_min, score_max )" .
 		     						"VALUES" .
-		     						"(".$lp_iv_id.",'".$objective[0]."','".$objective[1]."'," .
+		     						"(".$lp_iv_id.", ".$index.",'".$objective[0]."','".$objective[1]."'," .
 		     						"'".$objective[2]."','".$objective[4]."','".$objective[3]."')";
 		     				$ivai_res = api_sql_query($ivai_sql,__FILE__,__LINE__);
-		     				error_log($ivai_sql);
+		     				//error_log($ivai_sql);
 		     			}
 		     		}
 	     		}