Patrick Cool 18 years ago
parent 04a9938157
commit 4d1c0cdb76
  1. 16
      main/coursecopy/classes/CourseBuilder.class.php
  2. 9
      main/coursecopy/classes/CourseRecycler.class.php

@ -1,4 +1,4 @@
<?php // $Id: CourseBuilder.class.php 11785 2007-03-29 15:09:23Z yannoo $
<?php // $Id: CourseBuilder.class.php 12117 2007-04-24 22:06:36Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -298,9 +298,9 @@ class CourseBuilder
while ($obj = Database::fetch_object($db_result))
{
$survey = new Survey($obj->survey_id, $obj->code,$obj->title,
$obj->subtitle, $obj->author, $obj->lang,
$obj->subtitle, $obj->author, $obj->lang,
$obj->avail_from, $obj->avail_till, $obj->is_shared,
$obj->template, $obj->intro, $obj->surveythanks,
$obj->template, $obj->intro, $obj->surveythanks,
$obj->creation_date, $obj->invited, $obj->answered,
$obj->invite_mail, $obj->reminder_mail);
$sql = 'SELECT * FROM '.$table_question.' WHERE survey_id = '.$obj->survey_id;
@ -324,11 +324,11 @@ class CourseBuilder
$db_result = api_sql_query($sql, __FILE__, __LINE__);
while ($obj = Database::fetch_object($db_result))
{
$question = new SurveyQuestion($obj->question_id, $obj->survey_id,
$obj->survey_question, $obj->survey_question_comment,
$question = new SurveyQuestion($obj->question_id, $obj->survey_id,
$obj->survey_question, $obj->survey_question_comment,
$obj->type, $obj->display, $obj->sort,
$obj->shared_question_id, $obj->max_value);
$sql = 'SELECT * FROM '.$table_opt.' WHERE question_id = '.$obj->id;
$sql = 'SELECT * FROM '.$table_opt.' WHERE question_id = '.$obj->question_id;
$db_result2 = api_sql_query($sql, __FILE__, __LINE__);
while ($obj2 = Database::fetch_object($db_result2))
{
@ -393,7 +393,7 @@ class CourseBuilder
while ($obj = Database::fetch_object($db_result))
{
$items = array();
$sql_items = "SELECT * FROM ".$table_item." WHERE lp_id = ".$obj->id."";
$db_items = api_sql_query($sql_items);
@ -429,7 +429,7 @@ class CourseBuilder
{
$visibility='0';
}
$lp = new Learnpath($obj->id,
$obj->lp_type,
$obj->name,

@ -1,5 +1,5 @@
<?php
// $Id: CourseRecycler.class.php 11785 2007-03-29 15:09:23Z yannoo $
// $Id: CourseRecycler.class.php 12117 2007-04-24 22:06:36Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -72,6 +72,7 @@ class CourseRecycler
//$this->recycle_forums();
//$this->recycle_forum_categories();
$this->recycle_quizzes();
$this->recycle_surveys();
$this->recycle_learnpaths();
$this->recycle_cours_description();
}
@ -203,7 +204,7 @@ class CourseRecycler
/**
* Recycle surveys - removes everything
*/
function recycle_quizzes()
function recycle_surveys()
{
if ($this->course->has_resources(RESOURCE_SURVEY))
{
@ -242,7 +243,7 @@ class CourseRecycler
{
//remove links from course homepage
$sql = "DELETE FROM $table_tool WHERE link LIKE '%lp_controller.php%lp_id=$id%' AND image='scormbuilder.gif'";
api_sql_query($sql,__FILE__,__LINE__);
api_sql_query($sql,__FILE__,__LINE__);
//remove elements from lp_* tables (from bottom-up) by removing interactions, then item_view, then views and items, then paths
$sql_items = "SELECT id FROM $table_item WHERE lp_id=$id";
$res_items = api_sql_query($sql_items,__FILE__,__LINE__);
@ -267,7 +268,7 @@ class CourseRecycler
//delete views
$sql_views_del = "DELETE FROM $table_view WHERE lp_id=$id";
$res_views_del = api_sql_query($sql_views_del,__FILE__,__LINE__);
//delete lps
//delete lps
$sql_del = "DELETE FROM $table_main WHERE id = $id";
$res_del = api_sql_query($sql_del,__FILE__,__LINE__);
}

Loading…
Cancel
Save