[svn r11703] fixes for survey

skala
Patrick Cool 19 years ago
parent 84670e7d0c
commit c4cfe67461
  1. 4
      main/inc/lib/add_course.lib.inc.php
  2. 7
      main/install/dokeos_main.sql
  3. 6
      main/survey/survey.lib.php

@ -1219,8 +1219,8 @@ function update_Db_course($courseDbName)
$sql = "CREATE TABLE `".$TABLESURVEY."` (
survey_id int unsigned NOT NULL auto_increment,
code varchar(20) default NULL,
title varchar(80) default NULL,
subtitle varchar(80) default NULL,
title text default NULL,
subtitle text default NULL,
author varchar(20) default NULL,
lang varchar(20) default NULL,
avail_from date default NULL,

@ -679,9 +679,9 @@ UNLOCK TABLES;
CREATE TABLE `shared_survey` (
`survey_id` int(10) unsigned NOT NULL auto_increment,
`code` varchar(20) default NULL,
`title` varchar(80) default NULL,
`subtitle` varchar(80) default NULL,
`author` varchar(20) default NULL,
`title` text default NULL,
`subtitle` text default NULL,
`author` varchar(250) default NULL,
`lang` varchar(20) default NULL,
`template` varchar(20) default NULL,
`intro` text,
@ -707,6 +707,7 @@ CREATE TABLE `shared_survey_question` (
`display` varchar(10) NOT NULL default '',
`sort` int(11) NOT NULL default '0',
`code` varchar(40) NOT NULL default '',
`max_value` int(11) NOT NULL default '',
PRIMARY KEY (`question_id`)
);

@ -670,6 +670,7 @@ class survey_manager
{
// table definitions
$table_survey_question = Database :: get_main_table(TABLE_MAIN_SHARED_SURVEY_QUESTION);
$table_survey_question_option = Database :: get_main_table(TABLE_MAIN_SHARED_SURVEY_QUESTION_OPTION);
// first we have to get the shared_question_id
$question_data = survey_manager::get_question($question_id);
@ -678,8 +679,9 @@ class survey_manager
$sql = "DELETE FROM $table_survey_question WHERE question_id='".Database::escape_string($question_data['shared_question_id'])."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
// deleting the options of the question of the survey
// survey_manager::delete_shared_survey_question_option($survey_id, $question_id, $shared);
// deleting the options of the question of the survey question
$sql = "DELETE FROM $table_survey_question_option WHERE question_id='".Database::escape_string($question_data['shared_question_id'])."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
}
/******************************************************************************************************

Loading…
Cancel
Save