diff --git a/main/coursecopy/classes/CourseRestorer.class.php b/main/coursecopy/classes/CourseRestorer.class.php index e40c219441..21fd09339f 100644 --- a/main/coursecopy/classes/CourseRestorer.class.php +++ b/main/coursecopy/classes/CourseRestorer.class.php @@ -715,7 +715,7 @@ class CourseRestorer $cat_id = $this->course->resources[RESOURCE_FORUMCATEGORY][$params['forum_category']]->destination_id; } - self::DBUTF8_array($params); + $params = self::DBUTF8_array($params); $params['c_id'] = $this->destination_course_id; $params['forum_category'] = $cat_id; unset($params['forum_id']); @@ -779,7 +779,7 @@ class CourseRestorer $params['c_id'] = $this->destination_course_id; $params['cat_comment'] = DocumentManager::replace_urls_inside_content_html_from_copy_course($params['cat_comment'], $this->course->code, $this->course->destination_path); unset($params['cat_id']); - self::DBUTF8_array($params); + $params = self::DBUTF8_array($params); $new_id = Database::insert($forum_cat_table, $params); $this->course->resources[RESOURCE_FORUMCATEGORY][$id]->destination_id = $new_id; if (!empty($my_id)) { @@ -798,7 +798,7 @@ class CourseRestorer $topic = $this->course->resources[RESOURCE_FORUMTOPIC][$thread_id]; $params = (array)$topic->obj; - self::DBUTF8_array($params); + $params = self::DBUTF8_array($params); $params['c_id'] = $this->destination_course_id; $params['forum_id'] = $forum_id; $params['thread_poster_id'] = $this->first_teacher_id; @@ -1098,7 +1098,6 @@ class CourseRestorer $quiz = $quiz->obj; } else { //For backward compatibility - //$quiz = $quiz->obj; $quiz->obj = $quiz; } @@ -1112,8 +1111,6 @@ class CourseRestorer } } if ($id != -1) { - - // check resources inside html from fckeditor tool and copy correct urls into recipient course $quiz->description = DocumentManager::replace_urls_inside_content_html_from_copy_course($quiz->description, $this->course->code, $this->course->destination_path); @@ -1125,12 +1122,12 @@ class CourseRestorer $params = array( 'c_id' => $this->destination_course_id, - 'title' => self::DBUTF8escapestring($quiz->title), - 'description' => self::DBUTF8escapestring($quiz->description), + 'title' => self::DBUTF8($quiz->title), + 'description' => self::DBUTF8($quiz->description), 'type' => $quiz->type, 'random' => $quiz->random, 'active' => $quiz->active, - 'sound' => self::DBUTF8escapestring($doc), + 'sound' => self::DBUTF8($doc), 'max_attempt' => (int)$quiz->max_attempt, 'results_disabled' => (int)$quiz->results_disabled, 'access_condition' => $quiz->access_condition, @@ -1967,7 +1964,6 @@ class CourseRestorer // check resources inside html from fckeditor tool and copy correct urls into recipient course $thematic->content = DocumentManager::replace_urls_inside_content_html_from_copy_course($thematic->content, $this->course->code, $this->course->destination_path); $thematic->params['c_id'] = $this->destination_course_id; - $doc = ''; $thematic->params['id'] = null; $last_id = Database::insert($table_thematic, $thematic->params, false); @@ -2015,7 +2011,6 @@ class CourseRestorer // check resources inside html from fckeditor tool and copy correct urls into recipient course $obj->params['description'] = DocumentManager::replace_urls_inside_content_html_from_copy_course($obj->params['description'], $this->course->code, $this->course->destination_path); - $doc = ''; $obj->params['id'] = null; $obj->params['c_id'] = $this->destination_course_id; @@ -2029,16 +2024,19 @@ class CourseRestorer $attendance_calendar['attendance_id'] = $last_id; $attendance_calendar['c_id'] = $this->destination_course_id; $my_id = Database::insert($table_attendance_calendar, $attendance_calendar); - /* - if (is_numeric($my_id)) { - api_item_property_update($this->destination_course_info, 'thematic_advance', $my_id,"ThematicAdvanceAdded", api_get_user_id()); - }*/ } } } } } + function DBUTF8($str) { + if (UTF8_CONVERT) { + $str = utf8_encode($str); + } + return $str; + } + function DBUTF8escapestring($str) { if (UTF8_CONVERT) $str = utf8_encode($str); return Database::escape_string($str); diff --git a/main/exercice/exercise_submit.php b/main/exercice/exercise_submit.php index 6831068fc1..966b656189 100644 --- a/main/exercice/exercise_submit.php +++ b/main/exercice/exercise_submit.php @@ -816,8 +816,7 @@ if (!empty($error)) { //1. Normal choice inputs var my_choice = $(\'*[name*="choice[\'+question_id+\']"]\').serialize(); - console.log(my_choice); - + //2. Reminder checkbox var remind_list = $(\'*[name*="remind_list"]\').serialize(); diff --git a/main/exercice/savescores.php b/main/exercice/savescores.php index 2f31337216..390e6008b3 100644 --- a/main/exercice/savescores.php +++ b/main/exercice/savescores.php @@ -83,7 +83,6 @@ function save_scores($file, $score) { $(document).ready(function() { //API_obj = window.frames.window.content.API; //API_obj = $('content_id').context.defaultView.content.API; //works only in FF - //console.log(window.parent.frames.window.top.API); //API_obj = window.parent.frames.window.top.API; API_obj = window.top.API; API_obj.void_save_asset('$score', '$weighting', 0, 'completed'); diff --git a/main/inc/lib/usermanager.lib.php b/main/inc/lib/usermanager.lib.php index af7fbd5351..3e482f2429 100644 --- a/main/inc/lib/usermanager.lib.php +++ b/main/inc/lib/usermanager.lib.php @@ -351,7 +351,6 @@ class UserManager { } else { $return = false; - //echo $sql; return api_set_failure('error inserting in Database'); }