//make sure there is a way of retrieving which links were updated (to revert)
fwrite($fh,$sql_tool_upd." AND link ='$link'");
fwrite($fh_revert,"UPDATE $tbl_tool SET link='$link' WHERE id=".$row_tool['id']." AND link ='newscorm/lp_controller.php?action=view&lp_id=$new_lp_id';\n");
//echo "<pre>Replacing ".$row_i['intro_text']."\n by \n ".$intro."</pre><br/>\n";
$sql_upd = "update $tbl_intro set intro_text = '".mysql_real_escape_string($intro)."' WHERE id = 'course_homepage' AND intro_text = '".mysql_real_escape_string($row_i['intro_text'])."'";
//echo $sql_upd."<br/>\n";
fwrite($fh,"$sql_upd\n");
fwrite($fh_revert,"UPDATE $tbl_intro set intro_text = '".$row_i['intro_text']."' WHERE id = 'course_homepage' AND intro_text = '$intro';\n");
fwrite($fh_res,"$intro\n");
api_sql_query($sql_upd,__FILE__,__LINE__);
}
}
echo "Done!".$msg."<br/>\n";
@ -458,6 +498,10 @@ unset($lp_items);
unset($lp_ordered_items);
unset($parent_lps);
fwrite($fh,"-- Recording course homepages links changes for SCORM to enable reverting\n");
fwrite($fh_revert,"-- Recording reverted course homepages links changes for SCORM to enable reverting\n");
fwrite($fh_res,"-- Recording resulting course homepages links changes for SCORM\n");
/**
* SCORM
* The migration needs to take all data from the scorm.scorm_main and scorm.scorm_sco_data tables
@ -661,20 +705,11 @@ foreach($scorms as $my_course_code => $paths_list )
//TODO add code to update the path in that new lp created, as it probably uses / where
//$sco_path_temp should be used...
$lp_ids[$my_content_id] = $oScorm->lp_id; //contains the old LP ID => the new LP ID
echo " @@@ Created scorm lp ".$oScorm->lp_id." from imsmanifest [".$ims."] in course $my_course_code<br/>\n";
$lp_course[$my_content_id] = $courses_id_list[$my_course_code]; //contains the old learnpath ID => the course DB name
//echo "<pre>Replacing ".$row_i['intro_text']."\n by \n ".$intro."</pre><br/>\n";
$sql_upd = "update $tbl_intro set intro_text = '".mysql_real_escape_string($intro)."' WHERE id = 'course_homepage' AND intro_text = '".mysql_real_escape_string($row_i['intro_text'])."'";
//echo $sql_upd."<br/>\n";
fwrite($fh,$sql_upd."\n");
fwrite($fh_revert,"UPDATE $tbl_intro set intro_text = '".$row_i['intro_text']."' WHERE id = 'course_homepage' AND intro_text = '$intro';\n");