diff --git a/main/survey/addanother.php b/main/survey/addanother.php index 7f2fb0fcb7..c256623cfb 100644 --- a/main/survey/addanother.php +++ b/main/survey/addanother.php @@ -23,7 +23,7 @@ ============================================================================== * @package dokeos.survey * @author -* @version $Id: addanother.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: addanother.php 10680 2007-01-11 21:26:23Z pcool $ ============================================================================== */ @@ -70,8 +70,8 @@ if (!api_is_allowed_to_edit()) // Database table definitions /** @todo use database constants for the survey tables */ $table_user = Database :: get_main_table(TABLE_MAIN_USER); -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); // Language variables $tool_name = get_lang('CreateNewSurvey'); @@ -91,10 +91,6 @@ if(isset($_REQUEST['groupid'])) { $groupid=$_REQUEST['groupid']; } -if(isset($_GET['cidReq'])) -{ - $cidReq=$_GET['cidReq']; -} if(isset($_REQUEST['newgroupid'])) { $groupid=$_REQUEST['newgroupid']; @@ -106,7 +102,7 @@ if(isset($_REQUEST['newgroupid'])) if(isset($_POST['back'])) { - header("location:select_question_group.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']."&cidReq=$cidReq"); + header("location:select_question_group.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']); } if(isset($_POST['next'])) @@ -121,22 +117,22 @@ if(isset($_POST['next'])) switch ($_POST['add_question']) { case get_lang('YesNo'): - header("location:yesno.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']."&cidReq=$cidReq"); + header("location:yesno.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']); break; case get_lang('MultipleChoiceSingle'): - header("location:mcsa.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']."&cidReq=$cidReq"); + header("location:mcsa.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']); break; case get_lang('MultipleChoiceMulti'): - header("location:mcma.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']."&cidReq=$cidReq"); + header("location:mcma.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']); break; case get_lang('Open'): - header("location:open.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']."&cidReq=$cidReq"); + header("location:open.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']); break; case get_lang('Numbered'): - header("location:numbered.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']."&cidReq=$cidReq"); + header("location:numbered.php?add_question=$add_question&groupid=$groupid&surveyid=".$_GET['surveyid']); break; default : - header("location:select_question_type.php?cidReq=$cidReq"); + header("location:select_question_type.php"); break; } } @@ -170,7 +166,7 @@ if(isset($group_id)) } ?> -
+ diff --git a/main/survey/attach_existingsurvey.php b/main/survey/attach_existingsurvey.php index b81af0bfd9..183c480bf8 100644 --- a/main/survey/attach_existingsurvey.php +++ b/main/survey/attach_existingsurvey.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: attach_existingsurvey.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: attach_existingsurvey.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -66,9 +66,9 @@ if (!api_is_allowed_to_edit()) // Database table definitions /** @todo use database constants for the survey tables */ $table_user = Database :: get_main_table(TABLE_MAIN_USER); -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); $table_course_survey_rel = Database :: get_main_table(TABLE_MAIN_COURSE_SURVEY); @@ -90,7 +90,6 @@ $course_id = $_SESSION['_course']['id']; // $_GET and $_POST /** @todo replace $_REQUEST with $_GET or $_POST */ -$cidReq = $_REQUEST['cidReq']; $db_name = $_REQUEST['db_name']; $oldsurveyid=$_REQUEST['surveyid']; @@ -105,7 +104,6 @@ if ($_POST['action'] == 'add_survey') $surveycode=$_POST['survey_code']; $surveytitle = $_POST['survey_title']; $surveysubtitle = $_POST['survey_subtitle']; - //$cidReq = $_configuration['db_prefix'].$_POST['cidReq']; $author = $_POST['author']; $survey_language = $_POST['survey_language']; $availablefrom = $_POST['fyear']."-".$_POST['fmonth']."-".$_POST['fday']; @@ -116,15 +114,13 @@ if ($_POST['action'] == 'add_survey') $surveythanks = $_POST['thanks']; $savailablefrom=mktime(0,0,0,$_POST['fmonth'],$_POST['fday'], $_POST['fyear']); $savailabletill=mktime(0,0,0,$_POST['end_fmonth'],$_POST['end_fday'], $_POST['end_fyear']); - $cidReq=$_REQUEST['cidReq']; $db_name = $_REQUEST['db_name']; $surveyid = $_REQUEST['surveyid']; if(isset($_POST['back'])) { - $cidReq = $_REQUEST['cidReq']; $surveyid = $_REQUEST['surveyid']; $db_name = $_REQUEST['db_name']; - header("location:create_from_existing_survey.php?cidReq=$cidReq&surveyid=$surveyid&db_name=$db_name"); + header("location:create_from_existing_survey.php?surveyid=$surveyid&db_name=$db_name"); } $surveytitle=trim($surveytitle); $surveycode=trim($surveycode); @@ -149,21 +145,18 @@ if ($_POST['action'] == 'add_survey') else { $survey_id = SurveyManager::create_survey_attach($surveycode, $surveytitle, $surveysubtitle, $author, $survey_language, $availablefrom, $availabletill, $isshare, $surveytemplate, $surveyintroduction, $surveythanks, $table_survey, $table_group); - $cidReq=$_GET['cidReq']; $curr_dbname=SurveyManager::create_course_survey_rel($cidReq,$survey_id,$table_course,$table_course_survey_rel); $oldsurveyid=$_POST['surveyid']; $db_name = $_REQUEST['db_name']; SurveyManager::attach_survey($oldsurveyid,$survey_id,$db_name,$curr_dbname); if (isset($_POST['next'])) { - $cidReq=$_GET['cidReq']; - header("location:select_question_group.php?surveyid=$survey_id&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?surveyid=$survey_id"); exit; } else { - $cidReq=$_GET['cidReq']; - header("location:survey_list.php?&cidReq=$cidReq"); + header("location:survey_list.php"); exit; } } @@ -198,7 +191,7 @@ window.open(inf+".htm", 'popup', 'width=600,height=600,toolbar = no, status = no - + diff --git a/main/survey/attach_question.php b/main/survey/attach_question.php index 0acbd0d340..661d452f46 100644 --- a/main/survey/attach_question.php +++ b/main/survey/attach_question.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: attach_question.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: attach_question.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -66,9 +66,9 @@ if (!api_is_allowed_to_edit()) // Database table definitions /** @todo use database constants for the survey tables */ $table_user = Database :: get_main_table(TABLE_MAIN_USER); -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); $table_course_survey_rel = Database :: get_main_table(TABLE_MAIN_COURSE_SURVEY); @@ -90,8 +90,6 @@ $course_id = $_SESSION['_course']['id']; // $_GET and $_POST /** @todo replace $_REQUEST with $_GET or $_POST */ -$cidReq = $_REQUEST['cidReq']; -$db_name = $_REQUEST['db_name']; $oldsurveyid = $_REQUEST['surveyid']; $qids=$_REQUEST['qid']; $groupid=$_REQUEST['groupid']; @@ -104,7 +102,6 @@ if ($_POST['action'] == 'add_survey') $surveycode=$_POST['survey_code']; $surveytitle = $_POST['survey_title']; $surveysubtitle = $_POST['survey_subtitle']; - //$cidReq = $_configuration['db_prefix'].$_POST['cidReq']; $author = $_POST['author']; $survey_language = $_POST['survey_language']; $availablefrom = $_POST['fyear']."-".$_POST['fmonth']."-".$_POST['fday']; @@ -115,16 +112,12 @@ if ($_POST['action'] == 'add_survey') $surveythanks = $_POST['thanks']; $savailablefrom=mktime(0,0,0,$_POST['fmonth'],$_POST['fday'], $_POST['fyear']); $savailabletill=mktime(0,0,0,$_POST['end_fmonth'],$_POST['end_fday'], $_POST['end_fyear']); - $cidReq=$_REQUEST['cidReq']; $qids=$_REQUEST['qids']; - $db_name = $_REQUEST['db_name']; $surveyid = $_REQUEST['surveyid']; if(isset($_POST['back'])) { - $cidReq = $_REQUEST['cidReq']; $surveyid = $_REQUEST['surveyid']; - $db_name = $_REQUEST['db_name']; - header("location:create_from_existing_survey.php?cidReq=$cidReq&surveyid=$surveyid&db_name=$db_name"); + header("location:create_from_existing_survey.php?surveyid=$surveyid"); } $surveytitle=trim($surveytitle); @@ -150,29 +143,25 @@ if ($_POST['action'] == 'add_survey') else { $survey_id = SurveyManager::create_survey($surveycode, $surveytitle, $surveysubtitle, $author, $survey_language, $availablefrom, $availabletill, $isshare, $surveytemplate, $surveyintroduction, $surveythanks, $table_survey, $table_group); - $cidReq=$_GET['cidReq']; $curr_dbname=SurveyManager::create_course_survey_rel($cidReq,$survey_id,$table_course,$table_course_survey_rel); $qids=$_REQUEST['qids']; - //surveymanager::import_existing_question($survey_id,$qids,$table_group,$table_question,"no"); - $db_name = $_REQUEST['db_name']; $message_me=surveymanager::question_import($survey_id,$qids,$db_name,$curr_dbname); if (isset($_POST['next'])) { if(isset($message_me) && $message_me) { - header("location:select_question_group.php?surveyid=$survey_id&cidReq=$cidReq&curr_dbname=$curr_dbname&message=$message_me"); + header("location:select_question_group.php?surveyid=$survey_id&message=$message_me"); exit; } else { - header("location:select_question_group.php?surveyid=$survey_id&cidReq=$cidReq&curr_dbname=$curr_dbname&message=$message_me"); + header("location:select_question_group.php?surveyid=$survey_id&message=$message_me"); exit; } } else { - $cidReq=$_GET['cidReq']; - header("location:survey_list.php?&cidReq=$cidReq"); + header("location:survey_list.php"); exit; } } @@ -207,7 +196,7 @@ window.open(inf+".htm", 'popup', 'width=900,height=800,toolbar = no, status = no - + diff --git a/main/survey/attach_survey.php b/main/survey/attach_survey.php index 72a52c74f7..c68866e40f 100644 --- a/main/survey/attach_survey.php +++ b/main/survey/attach_survey.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: attach_survey.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: attach_survey.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -65,9 +65,9 @@ if (!api_is_allowed_to_edit()) // Database table definitions /** @todo use database constants for the survey tables */ -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $table_user = Database :: get_main_table(TABLE_MAIN_USER); $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); $table_course_survey_rel = Database :: get_main_table(TABLE_MAIN_COURSE_SURVEY); @@ -90,8 +90,6 @@ $course_id = $_SESSION['_course']['id']; // $_GET and $_POST /** @todo replace $_REQUEST with $_GET or $_POST */ -$cidReq = $_REQUEST['cidReq']; -$db_name = $_REQUEST['db_name']; $oldsurveyid=$_REQUEST['surveyid']; $gids = $_REQUEST['gids']; @@ -104,7 +102,6 @@ if ($_POST['action'] == 'add_survey') $surveycode=$_POST['survey_code']; $surveytitle = $_POST['survey_title']; $surveysubtitle = $_POST['survey_subtitle']; - //$cidReq = $_configuration['db_prefix'].$_POST['cidReq']; $author = $_POST['author']; $survey_language = $_POST['survey_language']; $availablefrom = $_POST['fyear']."-".$_POST['fmonth']."-".$_POST['fday']; @@ -115,16 +112,12 @@ if ($_POST['action'] == 'add_survey') $surveythanks = $_POST['thanks']; $savailablefrom=mktime(0,0,0,$_POST['fmonth'],$_POST['fday'], $_POST['fyear']); $savailabletill=mktime(0,0,0,$_POST['end_fmonth'],$_POST['end_fday'], $_POST['end_fyear']); - $cidReq=$_REQUEST['cidReq']; $gids = $_POST['gids']; - $db_name = $_REQUEST['db_name']; $surveyid = $_REQUEST['surveyid']; if(isset($_POST['back'])) { - $cidReq=$_REQUEST['cidReq']; $surveyid=$_REQUEST['surveyid']; - $db_name=$_REQUEST['db_name']; - header("location:create_from_existing_survey.php?cidReq=$cidReq&surveyid=$surveyid&db_name=$db_name"); + header("location:create_from_existing_survey.php?surveyid=$surveyid"); } $surveytitle=trim($surveytitle); $surveycode=trim($surveycode); @@ -149,28 +142,24 @@ if ($_POST['action'] == 'add_survey') else { $survey_id = SurveyManager::create_survey($surveycode, $surveytitle, $surveysubtitle, $author, $survey_language, $availablefrom, $availabletill, $isshare, $surveytemplate, $surveyintroduction, $surveythanks, $table_survey, $table_group); - $cidReq=$_GET['cidReq']; $curr_dbname=SurveyManager::create_course_survey_rel($cidReq,$survey_id,$table_course,$table_course_survey_rel); $oldsurveyid=$_POST['surveyid']; $gids = $_POST['gids']; $db_name = $_REQUEST['db_name']; - //surveymanager::insert_existing_groups($survey_id,$gids,$table_group,$table_question); surveymanager::import_group($survey_id,$gids,$db_name,$curr_dbname); /* $survey_id = SurveyManager::create_survey_attach($surveycode, $surveytitle, $surveysubtitle, $author, $survey_language, $availablefrom, $availabletill, $isshare, $surveytemplate, $surveyintroduction,$table_survey, $table_group); $oldsurveyid=$_POST['oldsurveyid']; - SurveyManager::attach_survey($oldsurveyid,$survey_id,$table_group,$table_question); + SurveyManager::attach_survey($oldsurveyid,$survey_id,$table_group,$table_survey_question); */ if (isset($_POST['next'])) { - $cidReq=$_GET['cidReq']; - header("location:select_question_group.php?surveyid=$survey_id&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?surveyid=$survey_id"); exit; } else { - $cidReq=$_GET['cidReq']; - header("location:survey_list.php?&cidReq=$cidReq"); + header("location:survey_list.php"); exit; } } @@ -205,10 +194,9 @@ window.open(inf+".htm", 'popup', 'width=900,height=800,toolbar = no, status = no - + - diff --git a/main/survey/blank.php b/main/survey/blank.php index 9e2f28a0b2..226fb4ab64 100644 --- a/main/survey/blank.php +++ b/main/survey/blank.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: blank.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: blank.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -55,7 +55,6 @@ if (!api_is_allowed_to_edit()) // $_GET and $_POST /** @todo replace $_REQUEST with $_GET or $_POST */ -$cidReq = $_REQUEST['cidReq']; $temp = $_REQUEST['temp']; $ques = $_REQUEST['ques']; $ans = $_REQUEST['ans']; diff --git a/main/survey/bluebreeze.php b/main/survey/bluebreeze.php index 884e8d96ee..3789e2aa22 100644 --- a/main/survey/bluebreeze.php +++ b/main/survey/bluebreeze.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: bluebreeze.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: bluebreeze.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -56,7 +56,6 @@ if (!api_is_allowed_to_edit()) // $_GET and $_POST /** @todo replace $_REQUEST with $_GET or $_POST */ $temp = $_REQUEST['temp']; -$cidReq = $_REQUEST['cidReq']; $ques = $_REQUEST['ques']; $ans = $_REQUEST['ans']; $qtype = $_REQUEST['qtype']; diff --git a/main/survey/complete_report.php b/main/survey/complete_report.php index aba611877b..d47c6011bd 100644 --- a/main/survey/complete_report.php +++ b/main/survey/complete_report.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: complete_report.php 10583 2007-01-02 14:47:19Z pcool $ +* @version $Id: complete_report.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -60,10 +60,10 @@ if (!api_is_allowed_to_edit()) // Database table definitions /** @todo use database constants for the survey tables */ -$tbl_user_survey = Database::get_main_table(TABLE_MAIN_SURVEY_USER); -$tbl_questions = Database::get_course_table('questions'); -$tbl_questions_groups = Database::get_course_table('survey_group'); -$tbl_answers = Database::get_course_table('survey_report'); +$tbl_user_survey = Database :: get_main_table(TABLE_MAIN_SURVEY_USER); +$tbl_questions = Database :: get_course_table(TABLE_SURVEY_QUESTION); +$tbl_questions_groups = Database :: get_course_table(TABLE_SURVEY_GROUP); +$tbl_answers = Database :: get_course_table(TABLE_SURVEY_REPORT); // Path variables /** @todo these variables are probably not used here */ @@ -75,9 +75,7 @@ $interbreadcrumb[] = array ("url" => "survey_list.php", "name" => get_lang('Surv // $_GET and $_POST /** @todo replace $_REQUEST with $_GET or $_POST */ -$cidReq = $_REQUEST['cidReq']; $surveyid = $_REQUEST['surveyid']; -$db_name = $_REQUEST['db_name']; $tool_name = get_lang('SurveyReporting'); diff --git a/main/survey/create_from_existing_survey.php b/main/survey/create_from_existing_survey.php index f615fd370f..08369fe977 100644 --- a/main/survey/create_from_existing_survey.php +++ b/main/survey/create_from_existing_survey.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: create_from_existing_survey.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: create_from_existing_survey.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -53,31 +53,24 @@ if (!api_is_allowed_to_edit()) } require_once (api_get_path(LIBRARY_PATH)."/course.lib.php"); -$cidReq = $_REQUEST['cidReq']; -$db_name = $_REQUEST['db_name']; -$table_survey = Database :: get_course_table('survey'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); $interbreadcrumb[] = array ("url" => "survey_list.php", "name" => get_lang('Survey')); $n='e'; $tool_name = get_lang('CreateFromExistingSurveys'); $surveyid=$_GET['surveyid']; if(isset($_POST['importexistingsurvey'])) { - $db_name = $_POST['db_name']; - $cidReq = $_REQUEST['cidReq']; $surveyid=$_REQUEST['surveyid']; - header("location:attach_existingsurvey.php?cidReq=$cidReq&surveyid=$surveyid&n=$n&db_name=$db_name"); + header("location:attach_existingsurvey.php?surveyid=$surveyid&n=$n"); exit; } if(isset($_POST['back'])) { - $db_name = $_POST['db_name']; - $cidReq = $_REQUEST['cidReq']; - header("location:survey_all_courses.php?cidReq=$cidReq&db_name=$db_name&n=$n"); + header("location:survey_all_courses.php?n=$n"); exit; } if(isset($_POST['import'])) { - $cidReq = $_REQUEST['cidReq']; $surveyid=$_REQUEST['surveyid']; $selectcount=count($_POST['course']); if($selectcount<=0) @@ -86,18 +79,14 @@ if(isset($_POST['import'])) } else { - $db_name = $_POST['db_name']; - $cidReq = $_REQUEST['cidReq']; $gid_arr = $_REQUEST['course']; $gids = implode(",",$gid_arr); - header("location:attach_survey.php?cidReq=$cidReq&surveyid=$surveyid&gids=$gids&db_name=$db_name"); + header("location:attach_survey.php?surveyid=$surveyid&gids=$gids"); exit; } } if(isset($_POST['view'])) { - $db_name = $_POST['db_name']; - $cidReq = $_REQUEST['cidReq']; $surveyid=$_REQUEST['surveyid']; $selectcount=count($_POST['course']); if($selectcount<=0) @@ -107,7 +96,7 @@ if(isset($_POST['view'])) else { $course=implode(",",$_REQUEST['course']); - header("location:question_list.php?cidReq=$cidReq&surveyid=$surveyid&course=$course&n=$n&db_name=$db_name"); + header("location:question_list.php?surveyid=$surveyid&course=$course&n=$n"); exit; } } @@ -119,25 +108,23 @@ if( isset($error_message) ) } ?> - + - + 0) { diff --git a/main/survey/create_new_group.php b/main/survey/create_new_group.php index 08fb9eacc7..485c06a530 100644 --- a/main/survey/create_new_group.php +++ b/main/survey/create_new_group.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: create_new_group.php 10603 2007-01-06 17:01:47Z pcool $ +* @version $Id: create_new_group.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -63,15 +63,14 @@ if (!api_is_allowed_to_edit()) // Database table definitions /** @todo use database constants for the survey tables */ -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); -$table_course = Database :: get_main_table(TABLE_MAIN_COURSE); -$table_survey_group = Database :: get_course_table('survey_group'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); +$table_course = Database :: get_main_table(TABLE_MAIN_COURSE); +$table_survey_group = Database :: get_course_table(TABLE_SURVEY_GROUP); -$cidReq=$_GET['cidReq']; $tool_name1 = get_lang('CreateNewGroup'); $tool_name = get_lang('CreateNewGroup'); $header1 = get_lang('GroupList'); @@ -106,7 +105,7 @@ if(isset($_REQUEST['delete'])) $group_id = $_REQUEST['group_delete']; $surveyid = $_REQUEST['surveyid']; SurveyManager::delete_group($group_id); - header("Location:create_new_group.php?surveyid=$surveyid&cidReq=$cidReq"); + header("Location:create_new_group.php?surveyid=$surveyid"); exit; } if ($_POST['action'] == 'new_group') @@ -116,7 +115,7 @@ if ($_POST['action'] == 'new_group') $surveyintroduction = $_POST['content']; if(isset($_POST['back'])) { - header("location:select_question_group.php?surveyid=$surveyid&cidReq=$cidReq"); + header("location:select_question_group.php?surveyid=$surveyid"); exit; } @@ -128,17 +127,16 @@ if ($_POST['action'] == 'new_group') else { $groupid = SurveyManager::create_group($surveyid,$groupname,$surveyintroduction,$table_group); - $cidReq = $_GET['cidReq']; if(isset($_POST['next']) && $groupid) { - header("location:addanother.php?surveyid=$surveyid&newgroupid=$groupid&cidReq=$cidReq"); + header("location:addanother.php?surveyid=$surveyid&newgroupid=$groupid"); exit; }elseif(isset($_POST['saveandexit']) && $groupid){ - header("location:survey_list.php?cidReq=$cidReq"); + header("location:survey_list.php"); exit; } @@ -168,7 +166,6 @@ if( isset($error_message) ) $parameters = array (); $parameters['surveyid']=$surveyid; $parameters['groupid']=$groupid; - $parameters['cidReq']=$cidReq; $res = api_sql_query($sql,__FILE__,__LINE__); $countGroups = mysql_num_rows($res); if ($countGroups > 0) @@ -189,21 +186,21 @@ if( isset($error_message) ) $survey[] = $author; $directions = '
'; if($i < $countGroups-1){ - $directions .= ''; + $directions .= ''; } else { $directions .= ''; } if($i > 0){ - $directions .= ''; + $directions .= ''; } else { $directions .= ''; } $directions .= '
'; $survey[] = $directions; - $survey[] = ''.get_lang('Edit').'' - .''.get_lang('Delete').'' + $survey[] = ''.get_lang('Edit').'' + .''.get_lang('Delete').'' ; $surveys[] = $survey; $i++; @@ -220,11 +217,11 @@ if( isset($error_message) ) { echo get_lang('NoSearchResults'); } - echo ''.get_lang('BackToQuestions').'

'; + echo ''.get_lang('BackToQuestions').'

'; api_display_tool_title($tool_name); ?> - + diff --git a/main/survey/create_new_survey.php b/main/survey/create_new_survey.php index 207d7df2fa..4b47d7a804 100644 --- a/main/survey/create_new_survey.php +++ b/main/survey/create_new_survey.php @@ -21,7 +21,7 @@ * @package dokeos.survey * @author unknown * @author Patrick Cool , Ghent University: cleanup, refactoring and rewriting large parts (if not all) of the code -* @version $Id: create_new_survey.php 10659 2007-01-10 22:41:53Z pcool $ +* @version $Id: create_new_survey.php 10680 2007-01-11 21:26:23Z pcool $ * * @todo rename this file to survey.php * @todo try to understand the template stuff and implement it (if needed) @@ -49,8 +49,8 @@ require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php' // Database table definitions /** @todo use database constants for the survey tables */ -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); $table_user = Database :: get_main_table(TABLE_MAIN_USER); $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); $table_course_survey_rel = Database :: get_main_table(TABLE_MAIN_COURSE_SURVEY); @@ -185,8 +185,8 @@ function store_survey($values) global $_user; // table defnitions - $table_survey = Database :: get_course_table('survey'); - $table_survey_group = Database :: get_course_table('survey_group'); + $table_survey = Database :: get_course_table(TABLE_SURVEY); + $table_survey_group = Database :: get_course_table(TABLE_SURVEY_GROUP); if (!$values['survey_id'] OR !is_numeric($values['survey_id'])) { @@ -253,7 +253,7 @@ function store_survey($values) */ function get_survey($survey_id) { - $tbl_survey = Database :: get_course_table('survey'); + $tbl_survey = Database :: get_course_table(TABLE_SURVEY); $sql = "SELECT * FROM $tbl_survey WHERE survey_id='".mysql_real_escape_string($survey_id)."'"; $result = api_sql_query($sql, __FILE__, __LINE__); diff --git a/main/survey/create_survey_in_another_language.php b/main/survey/create_survey_in_another_language.php index d5798ad8e1..9ddf4d9a24 100644 --- a/main/survey/create_survey_in_another_language.php +++ b/main/survey/create_survey_in_another_language.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: create_survey_in_another_language.php 10584 2007-01-02 15:09:21Z pcool $ +* @version $Id: create_survey_in_another_language.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -62,14 +62,13 @@ if (!api_is_allowed_to_edit()) exit; } -$cidReq = $_REQUEST['cidReq']; $id_survey = intval($_GET['id_survey']); if(isset($_POST['submit'])){ SurveyManager::create_survey_in_another_language($id_survey, addslashes($_POST['language_choosen'])); - header('Location:survey_list.php?cidReq='.$cidReq); + header('Location:survey_list.php'); exit; } @@ -83,7 +82,7 @@ $survey_language = SurveyManager::get_data($id_survey, 'lang'); $platform_languages = api_get_languages(); echo ' - +
'.get_lang('SelectWhichLanguage').'
- + 0) { @@ -127,7 +123,7 @@ function displayTemplate(url) { $survey[] = $object->lang; $survey[] = $object->avail_from ; $survey[] = $object->avail_till ; - $survey[] = "view"; + $survey[] = "view"; $surveys[] = $survey; } } @@ -155,7 +151,7 @@ function displayTemplate(url) { if($flag=='1') {echo get_lang('SurveyNotShared');} ?> - + -
+ diff --git a/main/survey/group_edit.php b/main/survey/group_edit.php index 616e9769eb..28576cb0ff 100644 --- a/main/survey/group_edit.php +++ b/main/survey/group_edit.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: group_edit.php 10603 2007-01-06 17:01:47Z pcool $ +* @version $Id: group_edit.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -61,9 +61,7 @@ if (!api_is_allowed_to_edit()) exit; } -$cidReq=$_GET['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; -$table_group = Database :: get_course_table('survey_group'); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); $table_user = Database :: get_main_table(TABLE_MAIN_USER); $tool_name1 = get_lang('CreateNewGroup'); $tool_name = get_lang('ModifyGroupInformation'); @@ -74,10 +72,8 @@ if($_POST['action'] == 'new_group') { if(isset($_POST['back'])) { - $cidReq = $_REQUEST['cidReq']; $surveyid = $_REQUEST['surveyid']; - $curr_dbname = $_REQUEST['curr_dbname']; - header("location:create_new_group.php?surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:create_new_group.php?surveyid=$surveyid"); exit; } } @@ -92,11 +88,8 @@ if ($_POST['action'] == 'new_group') $error_message = get_lang('PleaseEnterGroupName'); } $introduction = $_REQUEST['content']; - $curr_dbname = $_REQUEST['curr_dbname']; if(isset($_POST['next'])) { - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; $groupname=trim($groupname); if(empty ($groupname)) { @@ -105,13 +98,12 @@ if ($_POST['action'] == 'new_group') else { SurveyManager::update_group($groupid,$surveyid,$groupname,$introduction,$curr_dbname); - header("location:select_question_group.php?surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?surveyid=$surveyid"); exit; } } if(isset($_POST['saveandexit'])) { - $cidReq = $_GET['cidReq']; $groupname=trim($groupname); if(empty ($groupname)) { @@ -120,7 +112,7 @@ if ($_POST['action'] == 'new_group') else { SurveyManager::update_group($groupid,$surveyid,$groupname,$introduction,$curr_dbname); - header("location:survey_list.php?cidReq=$cidReq"); + header("location:survey_list.php"); exit; } } @@ -139,12 +131,10 @@ $obj = mysql_fetch_object($res); $groupname= $obj->groupname; $introduction = $obj->introduction; ?> - + - - diff --git a/main/survey/group_list.php b/main/survey/group_list.php index d6786b6846..587b3b07ef 100644 --- a/main/survey/group_list.php +++ b/main/survey/group_list.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: group_list.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: group_list.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -54,11 +54,9 @@ if (!api_is_allowed_to_edit()) exit; } -$cidReq = $_REQUEST['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $interbreadcrumb[] = array ("url" => "survey_list.php", "name" => get_lang('Survey')); $tool_name = get_lang('GroupList'); //Display :: display_header($tool_name); @@ -79,21 +77,19 @@ $surveyid=$_GET['surveyid']; $sid = $_REQUEST['sid']; $groupid = $_REQUEST['newgroupid']; $db_name = $_REQUEST['db_name']; -$table_group = Database :: get_course_table('survey_group'); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); - $sql = "SELECT * FROM $db_name.survey_group where survey_id='$sid'"; + $sql = "SELECT * FROM $table_group WHERE survey_id='$sid'"; $parameters = array (); $parameters['surveyid']=$surveyid; $parameters['sid']=$sid; $parameters['newgroupid']=$groupid; - $parameters['cidReq']=$cidReq; - $parameters['db_name']=$db_name; $res = api_sql_query($sql,__FILE__,__LINE__); if (mysql_num_rows($res) > 0) { $surveys = array (); ?> - + diff --git a/main/survey/import.php b/main/survey/import.php index 997f2b93db..0fbf16249f 100644 --- a/main/survey/import.php +++ b/main/survey/import.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: import.php 10549 2006-12-24 16:08:47Z pcool $ +* @version $Id: import.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -35,7 +35,6 @@ require ('../inc/global.inc.php'); api_protect_admin_script(); require_once (api_get_path(LIBRARY_PATH)."/course.lib.php"); require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php"); -$cidReq = $_REQUEST['cidReq']; $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('AdministrationTools')); $tool_name = get_lang('SelectQuestion'); $Sname = get_lang('SurveyName'); @@ -45,13 +44,12 @@ $surveyid=$_REQUEST['surveyid']; $newgroupid = $_REQUEST['newgroupid']; $groupid=$_REQUEST['groupid']; $surveyname =surveymanager::get_surveyname($surveyid); -$table_question = Database::get_course_table('questions'); -$table_group = Database :: get_course_table('survey_group'); +$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); if(isset($groupid)){ - surveymanager::insert_groups($surveyid,$newgroupid,$groupid,$table_group,$table_question); - //surveymanager::display_imported_group($surveyid,$table_group,$table_question,$groupid,$cidReq); - header("location:select_question_group.php?surveyid=$surveyid&cidReq=$cidReq"); + surveymanager::insert_groups($surveyid,$newgroupid,$groupid,$table_group,$table_survey_question); + header("location:select_question_group.php?surveyid=$surveyid"); exit; }else{ echo "Error : No Group"; diff --git a/main/survey/mcma.php b/main/survey/mcma.php index 0c6e2a928f..add234a0e1 100644 --- a/main/survey/mcma.php +++ b/main/survey/mcma.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: mcma.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: mcma.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -67,16 +67,14 @@ else { $add_question12=$_REQUEST['add_question']; } -$cidReq=$_GET['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; $add_question = $_REQUEST['add_question']; $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); -$interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey')); +$interbreadcrumb[] = array ("url" => "survey_list.php?n=$n", "name" => get_lang('Survey')); //$n=$_REQUEST['n']; if ($_POST['action'] == 'addquestion') @@ -135,10 +133,9 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_REQUEST['groupid']; $questtype = $_REQUEST['questtype']; - $curr_dbname = $_REQUEST['curr_dbname']; $surveyid = $_REQUEST['surveyid']; $enter_question = addslashes($enter_question); SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); - $cidReq = $_GET['cidReq']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } } @@ -146,9 +143,7 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; - header("location:addanother.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:addanother.php?groupid=$groupid&surveyid=$surveyid"); exit; } elseif(isset($_POST['saveandexit'])) @@ -197,11 +192,9 @@ if ($_POST['action'] == 'addquestion') else { $groupid = $_REQUEST['groupid']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; $surveyid = $_REQUEST['surveyid']; $enter_question = addslashes($enter_question); SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); - header("location:survey_list.php?cidReq=$cidReq&n=$n"); + header("location:survey_list.php?n=$n"); exit; } } @@ -247,12 +240,10 @@ function checkLength(form){ return true; } - + - -
@@ -582,7 +573,7 @@ function checkLength(form){ ?> template) diff --git a/main/survey/mcma_edit.php b/main/survey/mcma_edit.php index db2ae7100d..eedbe58ff1 100644 --- a/main/survey/mcma_edit.php +++ b/main/survey/mcma_edit.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: mcma_edit.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: mcma_edit.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -57,22 +57,23 @@ if (!api_is_allowed_to_edit()) exit; } + +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); + $n=$_REQUEST['n']; -$interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey')); -$cidReq = $_REQUEST['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; +$interbreadcrumb[] = array ("url" => "survey_list.php?n=$n", "name" => get_lang('Survey')); $groupid=$_REQUEST['groupid']; $surveyid=$_REQUEST['surveyid']; $qid=$_REQUEST['qid']; $qtype=$_REQUEST['qtype']; -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); + $Add = get_lang('UpdateQuestionType'); $Multi = get_lang('MultipleChoiceMulti'); $tool_name = $Add.$Multi; $rs=SurveyManager::get_question_data($qid,$curr_dbname); -$sql = "SELECT * FROM $curr_dbname.questions WHERE qid = '$qid'"; +$sql = "SELECT * FROM questions WHERE qid = '$qid'"; $res = api_sql_query($sql); $obj = mysql_fetch_object($res); for($i=0,$check=0;$i<10;$i++) @@ -121,21 +122,19 @@ if(isset($_POST['update'])) $surveyid = $_POST['surveyid']; $questtype = $_POST['questtype']; $qid=$_POST['qid']; - $curr_dbname = $_REQUEST['curr_dbname']; $enter_question = addslashes($enter_question); SurveyManager::update_question($qid,$questtype,$enter_question,$alignment,$answers,$open_ans,$curr_dbname); - $cidReq = $_GET['cidReq']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } } if(isset($_POST['back'])) { - $groupid = $_REQUEST['groupid']; - $surveyid = $_REQUEST['surveyid']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); - exit; + $groupid = $_REQUEST['groupid']; + $surveyid = $_REQUEST['surveyid']; + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); + exit; } Display::display_header($tool_name); @@ -147,13 +146,11 @@ if( isset($error_message) ) ?>
- + - -
@@ -434,7 +431,7 @@ if( isset($error_message) ) { echo ''; } - $sql = "SELECT * FROM $curr_dbname.survey WHERE survey_id='$surveyid'"; + $sql = "SELECT * FROM survey WHERE survey_id='$surveyid'"; $res=api_sql_query($sql); $obj=mysql_fetch_object($res); switch($obj->template) diff --git a/main/survey/mcma_view.php b/main/survey/mcma_view.php index 2cb8ebc16f..a5108eb02d 100644 --- a/main/survey/mcma_view.php +++ b/main/survey/mcma_view.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: mcma_view.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: mcma_view.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -48,14 +48,13 @@ if (!api_is_allowed_to_edit()) exit; } -$cidReq = $_REQUEST['cidReq']; $surveyid=$_REQUEST['surveyid']; $groupid=$_REQUEST['groupid']; $ques_type = $_GET['qtype']; $table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $db_name = $_REQUEST['db_name']; $gname=surveymanager::get_groupname($db_name,$groupid); $header2 = get_lang('GroupName'); diff --git a/main/survey/mcsa.php b/main/survey/mcsa.php index 5104425dc4..41893954be 100644 --- a/main/survey/mcsa.php +++ b/main/survey/mcsa.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: mcsa.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: mcsa.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -66,17 +66,15 @@ else { $add_question12=$_REQUEST['add_question']; } -$cidReq=$_GET['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; $add_question = $_REQUEST['add_question']; $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; -$table_question = Database :: get_course_table('questions'); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $Add = get_lang('AddNewQuestionType'); $Multi = get_lang('MultipleChoiceSingle'); $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; -$interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey')); +$interbreadcrumb[] = array ("url" => "survey_list.php?n=$n", "name" => get_lang('Survey')); //$n=$_REQUEST['n']; if ($_POST['action'] == 'addquestion') @@ -120,10 +118,9 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_POST['groupid']; $questtype = $_REQUEST['questtype']; - $curr_dbname = $_REQUEST['curr_dbname']; $surveyid = $_REQUEST['surveyid']; $enter_question = addslashes($enter_question); SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); - $cidReq = $_GET['cidReq']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } } @@ -131,9 +128,7 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; - header("location:addanother.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:addanother.php?groupid=$groupid&surveyid=$surveyid"); exit; } elseif(isset($_POST['saveandexit'])) @@ -177,10 +172,8 @@ if ($_POST['action'] == 'addquestion') $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; $questtype = $_REQUEST['questtype']; - $curr_dbname = $_REQUEST['curr_dbname']; $enter_question = addslashes($enter_question); SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); - $cidReq = $_GET['cidReq']; - header("location:survey_list.php?cidReq=$cidReq&n=$n"); + header("location:survey_list.php?n=$n"); exit; } } @@ -236,12 +229,10 @@ function checkLength(form){ return true; } - + - - @@ -527,7 +518,7 @@ $start=1;$end=5;$upx=2;$upy=1;$dwnx=0;$dwny=1;$jd=0;$sn=1; ?> template) diff --git a/main/survey/mcsa_edit.php b/main/survey/mcsa_edit.php index 6a240ee56a..3e2933f052 100644 --- a/main/survey/mcsa_edit.php +++ b/main/survey/mcsa_edit.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: mcsa_edit.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: mcsa_edit.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -58,19 +58,17 @@ if (!api_is_allowed_to_edit()) } $n=$_REQUEST['n']; -$interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey')); -$cidReq = $_REQUEST['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; +$interbreadcrumb[] = array ("url" => "survey_list.php?n=$n", "name" => get_lang('Survey')); $groupid=$_REQUEST['groupid']; $surveyid=$_REQUEST['surveyid']; $qid=$_REQUEST['qid']; $qtype=$_REQUEST['qtype']; -$table_question = Database :: get_course_table('questions'); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $Add = get_lang('UpdateQuestionType'); $Multi = get_lang('MultipleChoiceSingle'); $tool_name = $Add.$Multi; $rs=SurveyManager::get_question_data($qid,$curr_dbname); -$sql = "SELECT * FROM $curr_dbname.questions WHERE qid = '$qid'"; +$sql = "SELECT * FROM questions WHERE qid = '$qid'"; $res = api_sql_query($sql); $obj = mysql_fetch_object($res); for($i=0,$check=0;$i<10;$i++) @@ -126,11 +124,10 @@ if (isset($_POST['update'])) { $questtype=$rs->qtype; - $curr_dbname = $_REQUEST['curr_dbname']; $enter_question = addslashes($enter_question); SurveyManager::update_question($qid,$questtype,$enter_question,$alignment,$answers,$open_ans,$curr_dbname); - $cidReq = $_GET['cidReq']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } @@ -140,7 +137,7 @@ if(isset($_POST['back'])) { $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; - $curr_dbname = $_REQUEST['curr_dbname']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } Display::display_header($tool_name); @@ -152,13 +149,11 @@ if( isset($error_message) ) ?>
- + - -
@@ -402,7 +397,7 @@ $start=1;$end=$check;$upx=2;$upy=1;$dwnx=0;$dwny=1;$jd=0;$sn=1; { ?> template) diff --git a/main/survey/mcsa_view.php b/main/survey/mcsa_view.php index 1a43c77095..415fac9d9d 100644 --- a/main/survey/mcsa_view.php +++ b/main/survey/mcsa_view.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: mcsa_view.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: mcsa_view.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -48,11 +48,11 @@ if (!api_is_allowed_to_edit()) exit; } -$cidReq = $_REQUEST['cidReq']; -$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); + $tool_name = get_lang('ViewQuestions'); $header1 = get_lang('SurveyName'); $header2 = get_lang('GroupName'); @@ -60,8 +60,8 @@ $header3 = get_lang('Type'); $ques_id = $_GET['qid']; $ques_type = $_GET['qtype']; $db_name = $_REQUEST['db_name']; -$table_question = Database :: get_course_table('questions'); -$sql = "SELECT * FROM $db_name.questions where qid=$ques_id"; + +$sql = "SELECT * FROM $table_survey_question where qid=$ques_id"; $res = api_sql_query($sql); $obj = mysql_fetch_object($res); ?> diff --git a/main/survey/numbered.php b/main/survey/numbered.php index 08b5989999..1834273635 100644 --- a/main/survey/numbered.php +++ b/main/survey/numbered.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: numbered.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: numbered.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -66,19 +66,17 @@ else { $add_question12=$_REQUEST['add_question']; } -$cidReq=$_GET['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; $add_question = $_REQUEST['add_question']; $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $Add = get_lang('AddNewQuestionType'); $Multi = get_lang('Numbered'); $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; -$interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey')); +$interbreadcrumb[] = array ("url" => "survey_list.php?n=$n", "name" => get_lang('Survey')); //$n=$_REQUEST['n']; @@ -124,10 +122,8 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_POST['groupid']; $questtype = $_REQUEST['questtype']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; $surveyid = $_REQUEST['surveyid']; - $enter_question = addslashes($enter_question); SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + $enter_question = addslashes($enter_question); SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } } @@ -135,9 +131,7 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; - header("location:addanother.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:addanother.php?groupid=$groupid&surveyid=$surveyid"); exit; } elseif(isset($_POST['saveandexit'])) @@ -177,11 +171,9 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_REQUEST['groupid']; $questtype = $_REQUEST['questtype']; - $curr_dbname = $_REQUEST['curr_dbname']; $surveyid = $_REQUEST['surveyid']; $enter_question = addslashes($enter_question); SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); - $cidReq = $_GET['cidReq']; - header("location:survey_list.php?cidReq=$cidReq&n=$n"); + header("location:survey_list.php?n=$n"); exit; } } @@ -216,7 +208,7 @@ function checkLength(form){ return true; } - + @@ -548,7 +540,7 @@ function checkLength(form){ echo ''; } - $sql = "SELECT * FROM $curr_dbname.survey WHERE survey_id='$surveyid'"; + $sql = "SELECT * FROM survey WHERE survey_id='$surveyid'"; $res=api_sql_query($sql); $obj=mysql_fetch_object($res); switch($obj->template) diff --git a/main/survey/numbered_edit.php b/main/survey/numbered_edit.php index 9e41c2199e..eaa46e83c7 100644 --- a/main/survey/numbered_edit.php +++ b/main/survey/numbered_edit.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: numbered_edit.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: numbered_edit.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -38,19 +38,18 @@ require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php"); require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php"); require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php"); require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php"); -$interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey')); -$$cidReq = $_REQUEST['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; +$interbreadcrumb[] = array ("url" => "survey_list.php?n=$n", "name" => get_lang('Survey')); + $groupid=$_REQUEST['groupid']; $surveyid=$_REQUEST['surveyid']; $qid=$_REQUEST['qid']; $qtype=$_REQUEST['qtype']; -$table_question = Database :: get_course_table('questions'); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $Add = get_lang('UpdateQuestionType'); $Multi = get_lang('Numbered'); $tool_name = $Add.$Multi; $rs=SurveyManager::get_question_data($qid,$curr_dbname); -$sql = "SELECT * FROM $curr_dbname.questions WHERE qid = '$qid'"; +$sql = "SELECT * FROM questions WHERE qid = '$qid'"; $res = api_sql_query($sql); $obj = mysql_fetch_object($res); for($i=0,$check=0;$i<10;$i++) @@ -107,10 +106,9 @@ if (isset($_POST['update'])) { $questtype=$rs->qtype; - $curr_dbname = $_REQUEST['curr_dbname']; $enter_question = addslashes($enter_question); SurveyManager::update_question($qid,$questtype,$enter_question,$alignment,$answers,$open_ans,$curr_dbname); - $cidReq = $_GET['cidReq']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } @@ -119,8 +117,7 @@ if(isset($_POST['back'])) { $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; - $cidReq = $_REQUEST['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } @@ -133,13 +130,11 @@ if( isset($error_message) ) ?>
- + - -
@@ -361,7 +356,7 @@ $start=1;$end=$check;$upx=2;$upy=1;$dwnx=0;$dwny=1;$jd=0;$sn=1;
template) diff --git a/main/survey/numbered_view.php b/main/survey/numbered_view.php index f711b224c7..c05e5aafe4 100644 --- a/main/survey/numbered_view.php +++ b/main/survey/numbered_view.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: numbered_view.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: numbered_view.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -49,11 +49,11 @@ if (!api_is_allowed_to_edit()) exit; } -$cidReq = $_REQUEST['cidReq']; -$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); + $tool_name = get_lang('ViewQuestions'); $header2 = get_lang('GroupName'); $header3 = get_lang('Type'); diff --git a/main/survey/open.php b/main/survey/open.php index fd90616a36..bff8ea4ab3 100644 --- a/main/survey/open.php +++ b/main/survey/open.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: open.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: open.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -65,12 +65,10 @@ else $add_question12=$_REQUEST['add_question']; } $n=$_REQUEST['n']; -$interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey')); -$cidReq=$_GET['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$interbreadcrumb[] = array ("url" => "survey_list.php?n=$n", "name" => get_lang('Survey')); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $Add = get_lang('AddNewQuestionType'); $Multi = get_lang('Open'); $groupid = $_REQUEST['groupid']; @@ -99,9 +97,7 @@ if ($_POST['action'] == 'addquestion') else { $groupid = $_POST['groupid']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; - $surveyid = $_REQUEST['surveyid']; SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + $surveyid = $_REQUEST['surveyid']; SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } } @@ -109,8 +105,7 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; header("location:addanother.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:addanother.php?groupid=$groupid&surveyid=$surveyid"); exit; } elseif(isset($_POST['saveandexit'])) @@ -135,10 +130,9 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_REQUEST['groupid']; $questtype = $_REQUEST['questtype']; - $curr_dbname = $_REQUEST['curr_dbname']; - $surveyid = $_REQUEST['surveyid']; SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); - $cidReq = $_GET['cidReq']; - header("location:survey_list.php?cidReq=$cidReq&n=$n"); + $surveyid = $_REQUEST['surveyid']; + SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); + header("location:survey_list.php?n=$n"); exit; } } @@ -174,7 +168,7 @@ function checkLength(form){ }
- + @@ -234,7 +228,7 @@ border=0>

--> template) diff --git a/main/survey/open_edit.php b/main/survey/open_edit.php index 884c29f82f..6a3a25e876 100644 --- a/main/survey/open_edit.php +++ b/main/survey/open_edit.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: open_edit.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: open_edit.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -68,12 +68,10 @@ else } //if(!$add_question12) //$add_question12=$_REQUEST['questtype']; -$interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey')); -$cidReq=$_GET['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$interbreadcrumb[] = array ("url" => "survey_list.php?n=$n", "name" => get_lang('Survey')); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $Add = get_lang('UpdateQuestionType'); $Multi = get_lang('Open'); $tool_name = $Add.$Multi; @@ -106,13 +104,11 @@ if (isset($_POST['update'])) { $groupid = $_POST['groupid']; $qid = $_POST['qid']; - $cidReq = $_GET['cidReq']; $questtype=$_POST['questtype']; $answerD=$defaultext; - $curr_dbname = $_REQUEST['curr_dbname']; $enter_question = addslashes($enter_question); SurveyManager::update_question($qid,$questtype,$enter_question,$alignment,$answers,$open_ans,$curr_dbname); - $cidReq = $_GET['cidReq']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } } @@ -121,8 +117,7 @@ if(isset($_POST['back'])) { $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } Display::display_header($tool_name); @@ -136,7 +131,7 @@ if( isset($error_message) )
- + @@ -192,7 +187,7 @@ border=0> ?>
-->
template) diff --git a/main/survey/open_view.php b/main/survey/open_view.php index bb953db5a7..8cdc5d9683 100644 --- a/main/survey/open_view.php +++ b/main/survey/open_view.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: open_view.php 10583 2007-01-02 14:47:19Z pcool $ +* @version $Id: open_view.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -48,12 +48,12 @@ if (!api_is_allowed_to_edit()) exit; } -$cidReq = $_REQUEST['cidReq']; +$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); + -$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); $tool_name = get_lang('ViewQuestions'); $header2 = get_lang('GroupName'); $header3 = get_lang('Type'); diff --git a/main/survey/preview_mcma.php b/main/survey/preview_mcma.php index 496a6dc7ec..0696d1dbb3 100644 --- a/main/survey/preview_mcma.php +++ b/main/survey/preview_mcma.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: preview_mcma.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: preview_mcma.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -43,10 +43,10 @@ require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php"); require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php"); // Database table definitions -$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); -$table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY); -$table_group = Database :: get_main_table(TABLE_MAIN_GROUP); -$table_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION); +$table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); +$table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY); +$table_group = Database :: get_main_table(TABLE_MAIN_GROUP); +$table_survey_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION); $tool_name = get_lang('ViewQuestions'); $header1 = get_lang('SurveyName'); diff --git a/main/survey/preview_open.php b/main/survey/preview_open.php index 7cbd24ebb6..8095f60a2a 100644 --- a/main/survey/preview_open.php +++ b/main/survey/preview_open.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: preview_open.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: preview_open.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -46,7 +46,7 @@ require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php"); $table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); $table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY); $table_group = Database :: get_main_table(TABLE_MAIN_GROUP); -$table_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION); +$table_survey_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION); $tool_name = get_lang('ViewQuestions'); $header1 = get_lang('SurveyName'); $header2 = get_lang('GroupName'); diff --git a/main/survey/preview_yesno.php b/main/survey/preview_yesno.php index 3870d20134..9b363d9db9 100644 --- a/main/survey/preview_yesno.php +++ b/main/survey/preview_yesno.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: preview_yesno.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: preview_yesno.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -64,7 +64,7 @@ if (!api_is_allowed_to_edit()) $table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); $table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY); $table_group = Database :: get_main_table(TABLE_MAIN_GROUP); -$table_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION); +$table_survey_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION); $tool_name = get_lang('ViewQuestions'); diff --git a/main/survey/question.php b/main/survey/question.php index d5d2b6c864..4d6c4022d5 100644 --- a/main/survey/question.php +++ b/main/survey/question.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: question.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: question.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -48,16 +48,15 @@ if (!api_is_allowed_to_edit()) exit; } -$cidReq = $_REQUEST['cidReq']; - $surveyid=$_REQUEST['surveyid']; $groupid=$_REQUEST['groupid']; $ques_type = $_GET['qtype']; $table_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); -$db_name = $_REQUEST['db_name']; +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); + + $ques_id = $_GET['qid']; $gname=surveymanager::get_groupname($db_name,$groupid); $header2 = get_lang('GroupName'); diff --git a/main/survey/question_added.php b/main/survey/question_added.php index 4f9b55b15e..454a65cb35 100644 --- a/main/survey/question_added.php +++ b/main/survey/question_added.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: question_added.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: question_added.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -38,31 +38,26 @@ require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php"); require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php"); require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php"); require_once (api_get_path(LIBRARY_PATH)."/course.lib.php"); -$cidReq=$_GET['cidReq']; -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $interbreadcrumb[] = array ("url" => "survey.php", "name" => get_lang('CreateSurvey')); $groupid=$_REQUEST['groupid']; $surveyid=$_REQUEST['surveyid']; $qdeleted=0; -//$cidReqdb = $_configuration['db_prefix'].$_REQUEST['cidReq']; -//echo "dsfgdsgfsdgdsfg".$groupid; if (isset($_POST['addanother'])) { $groupid = $_POST['groupid']; $surveyid = $_POST['surveyid']; - $cidReq=$_REQUEST['cidReq']; - header("Location:addanother.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq"); - //header("Location:select_question_type.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq"); + header("Location:addanother.php?groupid=$groupid&surveyid=$surveyid"); + //header("Location:select_question_type.php?groupid=$groupid&surveyid=$surveyid"); exit; } if (isset($_POST['addanotherg'])) { $groupid = $_POST['groupid']; $surveyid = $_POST['surveyid']; - $cidReq=$_REQUEST['cidReq']; - header("Location:create_new_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq"); + header("Location:create_new_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } if(isset($_POST['delete'])) @@ -74,7 +69,7 @@ if(isset($_POST['delete'])) for($i=0;$i<$endloop;$i++) { $qid2=$qid1[$i]; - $query="DELETE FROM $table_question WHERE qid='$qid2'"; + $query="DELETE FROM $table_survey_question WHERE qid='$qid2'"; api_sql_query($query); } $qdeleted=1; @@ -83,8 +78,7 @@ if(isset($_POST['delete'])) } if (isset($_POST['finish'])) { - $cidReq=$_REQUEST['cidReq']; - header("Location:survey_list.php?cidReq=$cidReq"); + header("Location:survey_list.php"); exit; } $query="SELECT * FROM $table_survey WHERE survey_id='$surveyid'"; @@ -104,10 +98,9 @@ if($qdeleted) - + - "survey_list.php", "name" => get_lang('Survey')); -$cidReq = $_REQUEST['cidReq']; -$db_name = $_REQUEST['db_name']; $tool_name = get_lang('SelectQuestion'); $Sname = get_lang('SurveyName'); $GName = get_lang('GroupName'); @@ -66,7 +64,7 @@ $groupid=$_REQUEST['groupid']; //$sname =surveymanager::get_surveyname($surveyid); $gide=$_REQUEST['course']; $gid1=explode(",",$gide); -$table_question = Database :: get_course_table('questions'); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); if($gide) { $gid1=$gid1; @@ -85,14 +83,11 @@ for($r=0;$r - + @@ -129,14 +123,11 @@ function displayTemplate(url){ $gidi); $parameters['surveyid']=$surveyid; $parameters['groupid']=$groupid; - $parameters['cidReq']=$cidReq; $parameters['course']=$_REQUEST['course']; - $parameters['db_name']=$db_name; */ $res = api_sql_query($sql,__FILE__,__LINE__); while ($obj = mysql_fetch_object($res)) @@ -165,7 +154,7 @@ function displayTemplate(url){ $sname = surveymanager::get_surveyname($db_name,$sid); $question[] = $sname; /**********for displaying the 'edit' 'delete' etc. buttons***********/ - $url = "default.php?qid=".$obj->qid."&qtype=".$obj->qtype."&cidReq=".$cidReq."&surveyid=".$surveyid."&groupid=".$groupid."&db_name=".$db_name; + $url = "default.php?qid=".$obj->qid."&qtype=".$obj->qtype."&surveyid=".$surveyid."&groupid=".$groupid."&db_name=".$db_name; $question[] = "\"".get_lang('ViewQues')."\""; $questions[] = $question; $datacount++; diff --git a/main/survey/question_list_new.php b/main/survey/question_list_new.php index 1bff3380b2..62e59a0203 100644 --- a/main/survey/question_list_new.php +++ b/main/survey/question_list_new.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: question_list_new.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: question_list_new.php 10680 2007-01-11 21:26:23Z pcool $ */ @@ -56,9 +56,6 @@ if (!api_is_allowed_to_edit()) } $interbreadcrumb[] = array ("url" => "survey_list.php", "name" => get_lang('Survey')); -$cidReq = $_REQUEST['cidReq']; -$db_name = $_REQUEST['db_name']; -$curr_dbname = $_REQUEST['curr_dbname']; $tool_name = get_lang('SelectQuestion'); $Sname = get_lang('SurveyName'); $GName = get_lang('GroupName'); @@ -67,8 +64,8 @@ $surveyid=$_REQUEST['surveyid']; $groupid=$_REQUEST['groupid']; $sid = $_REQUEST['sid']; //$sname =surveymanager::get_surveyname($surveyid,$db_name); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $gide=$_POST['course']; $arraycount=0; $arraycount=count($_REQUEST['course']); @@ -91,8 +88,7 @@ $arraycount=0; $arraycount=count($_REQUEST['course']); if(isset($_POST['back1'])) { - $db_name = $_REQUEST['db_name']; - $curr_dbname = $_REQUEST['curr_dbname']; header("location:existing_surveys_new.php?cidReq=$cidReq&db_name=$db_name&surveyid=$surveyid&groupid=$groupid&curr_dbname=$curr_dbname"); + header("location:existing_surveys_new.php?surveyid=$surveyid&groupid=$groupid"); exit; } if(isset($_POST['view'])) @@ -100,8 +96,7 @@ if(isset($_POST['view'])) if($arraycount<=0) { $pls=1; - $db_name = $_REQUEST['db_name']; - $curr_dbname = $_REQUEST['curr_dbname']; header("location:group_list.php?cidReq=$cidReq&surveyid=$surveyid&groupid=$groupid&pls=$pls&db_name=$db_name&sid=$sid"); + header("location:group_list.php?surveyid=$surveyid&groupid=$groupid&pls=$pls&sid=$sid"); exit; } } @@ -109,9 +104,8 @@ if(isset($_POST['back'])) { $pls=0; $sid = $_REQUEST['sid']; - $db_name = $_REQUEST['db_name']; $surveyid=$_REQUEST['surveyid']; - $curr_dbname = $_REQUEST['curr_dbname']; header("location:group_list.php?cidReq=$cidReq&db_name=$db_name&curr_dbname=$curr_dbname&surveyid=$surveyid&sid=$sid&pls=$pls"); + header("location:group_list.php?surveyid=$surveyid&sid=$sid&pls=$pls"); exit; } if(isset($_POST['import'])) @@ -119,22 +113,17 @@ if(isset($_POST['import'])) if($arraycount<=0) { $pls=1; - $db_name = $_REQUEST['db_name']; - $curr_dbname = $_REQUEST['curr_dbname']; header("location:group_list.php?cidReq=$cidReq&surveyid=$surveyid&groupid=$groupid&pls=$pls&db_name=$db_name&sid=$sid&curr_dbname=$curr_dbname"); + header("location:group_list.php?surveyid=$surveyid&groupid=$groupid&pls=$pls&sid=$sid"); exit; } else { $gid_arr = $_REQUEST['course']; - $db_name = $_REQUEST['db_name']; - $curr_dbname = $_REQUEST['curr_dbname']; $gids = implode(",",$gid_arr); $surveyid = $_POST['surveyid']; $groupid = $_POST['groupid']; - //$flag = surveymanager::insert_old_groups($surveyid,$gids,$table_group,$table_question,$db_name,$cidReq); - //$message_me = surveymanager::import_group($surveyid,$gids,$db_name,$curr_dbname); $flag = surveymanager::import_group($surveyid,$gids,$db_name,$curr_dbname); - header("location:select_question_group.php?surveyid=$surveyid&cidReq=$cidReq&flag=$flag&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?surveyid=$surveyid&flag=$flag"); exit; } } @@ -143,8 +132,6 @@ if(isset($_POST['importquestion'])) $gidnext=$_POST['gid1']; $surveyid = $_POST['surveyid']; $groupid = $_POST['groupid']; - $db_name = $_REQUEST['db_name']; - $curr_dbname = $_REQUEST['curr_dbname']; $selectcount=count($_POST['question']); if($selectcount<=0) { @@ -157,12 +144,12 @@ if(isset($_POST['importquestion'])) $message_me=surveymanager::question_import($surveyid,$qids,$db_name,$curr_dbname); if(isset($message_me) && $message_me) { - header("location:select_question_group.php?surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname&messege=$message_me"); + header("location:select_question_group.php?surveyid=$surveyid&messege=$message_me"); exit; } else { - header("location:select_question_group.php?surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname&messege=$message_me"); + header("location:select_question_group.php?surveyid=$surveyid&messege=$message_me"); exit; } } @@ -190,7 +177,7 @@ function displayTemplate(url) { - + @@ -200,16 +187,12 @@ function displayTemplate(url) { qid."&qtype=".$obj->qtype."&cidReq=".$cidReq."&surveyid=".$surveyid."&groupid=".$groupid."&db_name=".$db_name; + $url = "default.php?qid=".$obj->qid."&qtype=".$obj->qtype."&surveyid=".$surveyid."&groupid=".$groupid."&db_name=".$db_name; $question[] = "\"".get_lang('Info')."\""; $questions[] = $question; $datacount++; diff --git a/main/survey/question_type.php b/main/survey/question_type.php index b5489dd9db..709f5023b9 100644 --- a/main/survey/question_type.php +++ b/main/survey/question_type.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: question_type.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: question_type.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -47,7 +47,8 @@ require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php"); // Database table definitions $table_survey = Database :: get_main_table(TABLE_MAIN_SURVEY); $table_group = Database :: get_main_table(TABLE_MAIN_GROUP); -$table_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION); +$table_survey_question = Database :: get_main_table(TABLE_MAIN_SURVEYQUESTION); + $tool_name = get_lang('SelectQuestionByType'); $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('Survey')); //$questtype=$_POST['add_question']; diff --git a/main/survey/reporting.php b/main/survey/reporting.php index aa4cb74b83..8795b76be0 100644 --- a/main/survey/reporting.php +++ b/main/survey/reporting.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: reporting.php 10584 2007-01-02 15:09:21Z pcool $ +* @version $Id: reporting.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -40,11 +40,10 @@ require_once ('../inc/global.inc.php'); require_once (api_get_path(LIBRARY_PATH)."/course.lib.php"); require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php"); -$table_survey = Database :: get_course_table('survey'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); $surveyid=intval($_REQUEST['surveyid']); - $cidReq=stripslashes($_REQUEST['cidReq']); - $db_name = stripslashes($_REQUEST['db_name']); + if($_SESSION['status']==5) { api_protect_admin_script(); @@ -56,12 +55,12 @@ Display::display_header($tool_name); echo ' - -
'.get_lang('CompleteReport').'
+
'.get_lang('CompleteReport').'
'.get_lang('CompleteReportDetails').'

'.get_lang('AdvancedReport').'
+
'.get_lang('AdvancedReport').'
'.get_lang('AdvancedReportDetails').'
'; diff --git a/main/survey/select_question.php b/main/survey/select_question.php index f3738e762a..7659956d27 100644 --- a/main/survey/select_question.php +++ b/main/survey/select_question.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: select_question.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: select_question.php 10680 2007-01-11 21:26:23Z pcool $ */ // including the global dokeos file require_once ('../inc/global.inc.php'); @@ -30,39 +30,36 @@ if(isset($_POST['add_question'])) $groupid=$_REQUEST['groupid']; $surveyid=$_REQUEST['surveyid']; - $cidReq=$_REQUEST['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; // name of the language file that needs to be included -$language_file = 'survey'; + $language_file = 'survey'; $add_question=$_REQUEST['add_question']; switch ($_POST['add_question']) { case get_lang('YesNo'): - header("location:yesno.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:yesno.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid"); break; case get_lang('MultipleChoiceSingle'): - header("location:mcsa.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:mcsa.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid"); break; case get_lang('MultipleChoiceMulti'): - header("location:mcma.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:mcma.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid"); break; case get_lang('Open'): - header("location:open.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:open.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid"); break; case get_lang('Numbered'): - header("location:numbered.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:numbered.php?add_question=$add_question&groupid=$groupid&surveyid=$surveyid"); break; default : - header("location:select_question_type.php?cidReq=$cidReq"); + header("location:select_question_type.php"); break; } exit; } function select_question_type($add_question12,$groupid,$surveyid,$cidReq,$curr_dbname) { - //$group_table = Database :: get_course_table('survey_group'); - $sql = "SELECT groupname FROM $curr_dbname.survey_group WHERE group_id='$groupid'"; + $sql = "SELECT groupname FROM survey_group WHERE group_id='$groupid'"; $sql_result = api_sql_query($sql,__FILE__,__LINE__); $group_name = @mysql_result($sql_result,0,'groupname'); ?> @@ -79,11 +76,10 @@ if( isset($error_message) ) Display::display_error_message($error_message); } ?> - + -
diff --git a/main/survey/select_question_group-uploaded.php b/main/survey/select_question_group-uploaded.php index bd1064ff78..e7cbc7099e 100644 --- a/main/survey/select_question_group-uploaded.php +++ b/main/survey/select_question_group-uploaded.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: select_question_group-uploaded.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: select_question_group-uploaded.php 10680 2007-01-11 21:26:23Z pcool $ */ @@ -61,25 +61,14 @@ if (!api_is_allowed_to_edit()) exit; } -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); -$table_course = Database::get_main_table(TABLE_MAIN_COURSE); -$cidReq = $_GET['cidReq']; -$db_name = $_REQUEST['db_name']; -$curr_dbname = $_REQUEST['curr_dbname']; -//$table_survey = Database :: get_course_table('survey'); -$tool_name1 = get_lang('AddQuestionGroup'); -$tool_name = get_lang('AddQuestionGroup'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); +$table_course = Database :: get_main_table(TABLE_MAIN_COURSE); + + $interbreadcrumb[] = array ("url" => "survey_list.php", "name" => get_lang('Survey')); -/*if($page = $_REQUEST['page']) -{ - $interbreadcrumb[] = array ("url" => "create_new_survey.php?surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname&page=$page", "name" => get_lang('CreateNewSurvey')); -} -else -{ - $interbreadcrumb[] = array ("url" => "create_new_survey.php?surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname&page=$page", "name" => get_lang('CreateFromExistingSurvey')); -}*/ + $default_group = '0'; $new_group = '1'; $existing_group = '2'; @@ -105,7 +94,7 @@ $column = $_REQUEST['column']; $per_page = $_REQUEST['per_page']; } /* -$sql="SELECT * FROM $curr_dbname.questions WHERE gid='$groupid' AND survey_id = '$surveyid'"; +$sql="SELECT * FROM questions WHERE gid='$groupid' AND survey_id = '$surveyid'"; $res=api_sql_query($sql,__FILE__,__LINE__); $obj=mysql_fetch_object($res); $number=mysql_num_rows($res); @@ -170,10 +159,8 @@ if ($_POST['action'] == 'selectquestion_group') $questiongroup = $_POST['question_group']; if (isset($questiongroup)) { - $cidReq=$_REQUEST['cidReq']; $exiztinggroup = $_POST['exiztinggroup']; - $curr_dbname = $_REQUEST['curr_dbname']; - header("Location:existing_surveys_new.php?cidReq=$cidReq&surveyid=$surveyid&curr_dbname=$curr_dbname"); + header("Location:existing_surveys_new.php?surveyid=$surveyid"); exit; } } @@ -182,35 +169,28 @@ if (isset($_POST['back'])) { $groupid = $_POST['groupid']; $surveyid = $_POST['surveyid']; - $cidReq=$_REQUEST['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; $page = $_REQUEST['page']; - header("Location:create_new_survey.php?surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname&page=$page"); - //header("Location:select_question_type.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq"); + header("Location:create_new_survey.php?surveyid=$surveyid&page=$page"); + //header("Location:select_question_type.php?groupid=$groupid&surveyid=$surveyid"); exit; } if (isset($_POST['addanother'])) { $groupid = $_POST['groupid']; $surveyid = $_POST['surveyid']; - $cidReq=$_REQUEST['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; - header("Location:addanother.php?surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); - //header("Location:select_question_type.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq"); + header("Location:addanother.php?surveyid=$surveyid"); + //header("Location:select_question_type.php?groupid=$groupid&surveyid=$surveyid"); exit; } if (isset($_POST['addanotherg'])) { //$groupid = $_POST['groupid']; $surveyid = $_POST['surveyid']; - $cidReq=$_REQUEST['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; - header("Location:create_new_group.php?surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("Location:create_new_group.php?surveyid=$surveyid"); exit; } if(isset($_REQUEST['delete'])) { - $curr_dbname = $_REQUEST['curr_dbname']; if(isset($_REQUEST['qid'])) { $endloop=count($_REQUEST['qid']); @@ -218,23 +198,21 @@ if(isset($_REQUEST['delete'])) for($i=0;$i<$endloop;$i++) { $qid2=$qid1[$i]; - $query="DELETE FROM $curr_dbname.questions WHERE qid='$qid2'"; + $query="DELETE FROM questions WHERE qid='$qid2'"; api_sql_query($query); - header("Location:select_question_group.php?surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("Location:select_question_group.php?surveyid=$surveyid"); exit; } } } if (isset($_POST['finish'])) { - $cidReq=$_REQUEST['cidReq']; - header("Location:survey_list.php?cidReq=$cidReq"); + header("Location:survey_list.php"); exit; } if(isset($action1)) { - $curr_dbname = $_REQUEST['curr_dbname']; $groupid = $_REQUEST['gid']; $surveyid = $_REQUEST['surveyid']; $qid = $_GET['qid']; @@ -246,25 +224,25 @@ if(isset($action1)) $post_sort = $_GET['post_sort']; if($direction=="up") { - $sql_update2="UPDATE $curr_dbname.questions SET sortby='".$sort."' WHERE qid='".$pre_qid."'"; + $sql_update2="UPDATE questions SET sortby='".$sort."' WHERE qid='".$pre_qid."'"; mysql_query($sql_update2); - $sql_update1="UPDATE $curr_dbname.questions SET sortby='".$pre_sort."' WHERE qid='".$qid."'"; + $sql_update1="UPDATE questions SET sortby='".$pre_sort."' WHERE qid='".$qid."'"; mysql_query($sql_update1); } else { -$sql_update2="UPDATE $curr_dbname.questions SET sortby='".$post_sort."' WHERE qid='".$qid."'"; +$sql_update2="UPDATE questions SET sortby='".$post_sort."' WHERE qid='".$qid."'"; mysql_query($sql_update2); -$sql_update1="UPDATE $curr_dbname.questions SET sortby='".$sort."' WHERE qid='".$post_qid."'"; +$sql_update1="UPDATE questions SET sortby='".$sort."' WHERE qid='".$post_qid."'"; mysql_query($sql_update1); } //surveymanager::move_question($direction,$qid,$pre_sort,$sort,$post_sort,$curr_dbname); } -Display::display_header($tool_name1); +Display::display_header(get_lang('AddQuestionGroup')); api_display_tool_title("Survey Name : ".$sname); -api_display_tool_title($tool_name); +api_display_tool_title(get_lang('AddQuestionGroup')); if($flag==1) { ?> @@ -278,7 +256,7 @@ if(isset($messege) && $messege ) - + @@ -304,14 +282,13 @@ if(isset($messege) && $messege )
sortby; $course = array (); $course[] = $question; - $course[] = ' '.$sort.'  '.''; + $course[] = ' '.$sort.'  '.''; $course[] = @mysql_result($res,$i,'groupname'); $course[] = mysql_result($res1,$k,'qtype');//$obj->qtype; - /*$course[]=''.get_lang('Edit').''.''.get_lang('Delete').''; + /*$course[]=''.get_lang('Edit').''.''.get_lang('Delete').''; */ $courses[] = $course; $x++; @@ -354,7 +331,7 @@ $result=api_sql_query($query);*/ } } ?> -
+ diff --git a/main/survey/select_question_group.php b/main/survey/select_question_group.php index f8127aec92..4c19fc3b22 100644 --- a/main/survey/select_question_group.php +++ b/main/survey/select_question_group.php @@ -21,7 +21,7 @@ * @package dokeos.survey * @author * @author Patrick Cool , Ghent University: cleanup, refactoring and rewriting large parts (if not all) of the code -* @version $Id: select_question_group.php 10663 2007-01-10 22:49:09Z pcool $ +* @version $Id: select_question_group.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -58,11 +58,11 @@ if (!api_is_allowed_to_edit()) // Database table definitions /** @todo use database constants for the survey tables */ -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); -$table_course = Database::get_main_table(TABLE_MAIN_COURSE); -$table_survey_group = Database :: get_course_table('survey_group'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); +$table_course = Database :: get_main_table(TABLE_MAIN_COURSE); +$table_survey_group = Database :: get_course_table(TABLE_SURVEY_GROUP); // breadcrumbs $interbreadcrumb[] = array ("url" => "survey_list.php", "name" => get_lang('Survey')); @@ -102,7 +102,7 @@ Display :: display_footer(); */ function get_survey($survey_id) { - $tbl_survey = Database :: get_course_table('survey'); + $tbl_survey = Database :: get_course_table(TABLE_SURVEY); $sql = "SELECT * FROM $tbl_survey WHERE survey_id='".mysql_real_escape_string($survey_id)."'"; $result = api_sql_query($sql, __FILE__, __LINE__); @@ -209,7 +209,7 @@ if(isset($_REQUEST['delete'])) for($i=0;$i<$endloop;$i++) { $qid2=$qid1[$i]; - $query="DELETE FROM $table_question WHERE qid='$qid2'"; + $query="DELETE FROM $table_survey_question WHERE qid='$qid2'"; api_sql_query($query); header("Location:select_question_group.php?surveyid=$surveyid"); exit; @@ -236,16 +236,16 @@ if(isset($action1)) $post_sort = $_GET['post_sort']; if($direction=="up") { - $sql_update2="UPDATE $table_question SET sortby='".$sort."' WHERE qid='".$pre_qid."'"; + $sql_update2="UPDATE $table_survey_question SET sortby='".$sort."' WHERE qid='".$pre_qid."'"; mysql_query($sql_update2); - $sql_update1="UPDATE $table_question SET sortby='".$pre_sort."' WHERE qid='".$qid."'"; + $sql_update1="UPDATE $table_survey_question SET sortby='".$pre_sort."' WHERE qid='".$qid."'"; mysql_query($sql_update1); } else { - $sql_update1="UPDATE $table_question SET sortby='".$sort."' WHERE qid='".$post_qid."'"; + $sql_update1="UPDATE $table_survey_question SET sortby='".$sort."' WHERE qid='".$post_qid."'"; mysql_query($sql_update1); - $sql_update2="UPDATE $table_question SET sortby='".$post_sort."' WHERE qid='".$qid."'"; + $sql_update2="UPDATE $table_survey_question SET sortby='".$post_sort."' WHERE qid='".$qid."'"; mysql_query($sql_update2); } //surveymanager::move_question($direction,$qid,$pre_sort,$sort,$post_sort,$curr_dbname); @@ -312,7 +312,7 @@ if(isset($messege) && $messege ) { $groupid=@mysql_result($res,$i,'group_id'); $gname=@mysql_result($res,$i,'groupname'); - $sql="SELECT * FROM $table_question WHERE gid='$groupid' AND survey_id = '$surveyid' order by `sortby` asc"; + $sql="SELECT * FROM $table_survey_question WHERE gid='$groupid' AND survey_id = '$surveyid' order by `sortby` asc"; $res1=api_sql_query($sql,__FILE__,__LINE__); $num1=mysql_num_rows($res1); diff --git a/main/survey/select_question_type.php b/main/survey/select_question_type.php index 5abd190f51..a9c9ec2cf3 100644 --- a/main/survey/select_question_type.php +++ b/main/survey/select_question_type.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: select_question_type.php 10584 2007-01-02 15:09:21Z pcool $ +* @version $Id: select_question_type.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -39,7 +39,6 @@ require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php"); require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php"); $add_question12=$_REQUEST['add_question']; -$cidReq=$_GET['cidReq']; $tool_name = get_lang('AddQuestion'); $interbreadcrumb[] = array ("url" => "survey.php", "name" => get_lang('CreateSurvey')); $group_name=$_GET['groupname']; diff --git a/main/survey/survey.php b/main/survey/survey.php index 4a581efad0..0241c31357 100644 --- a/main/survey/survey.php +++ b/main/survey/survey.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: survey.php 10662 2007-01-10 22:45:19Z pcool $ +* @version $Id: survey.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -41,7 +41,7 @@ require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php"); // Database table definitions /** @todo use database constants for the survey tables */ -$table_survey = Database :: get_course_table('survey'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); /** @todo replace this with the correct code */ /* diff --git a/main/survey/survey_all_courses.php b/main/survey/survey_all_courses.php index 4f9bf24d2a..dc8b44d2c3 100644 --- a/main/survey/survey_all_courses.php +++ b/main/survey/survey_all_courses.php @@ -21,7 +21,7 @@ * @package dokeos.survey * @author unknown * @author Patrick Cool , Ghent University: cleanup, refactoring and rewriting large parts (if not all) of the code -* @version $Id: survey_all_courses.php 10661 2007-01-10 22:44:31Z pcool $ +* @version $Id: survey_all_courses.php 10680 2007-01-11 21:26:23Z pcool $ * * @todo check if this page has to display all the shared surveys of the courses where the user is a teacher or only * the shared surveys of this course? @@ -41,9 +41,9 @@ require_once (api_get_path(LIBRARY_PATH)."/course.lib.php"); // Database table definitions /** @todo use database constants for the survey tables */ -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $table_course_survey_rel = Database :: get_main_table(TABLE_MAIN_COURSE_SURVEY); /** @todo replace this with the correct code */ @@ -86,7 +86,7 @@ Display::display_header(get_lang('CreateFromExistingSurveys')); $db_list[] = $db[0]; } $nameTools=get_lang('CreateFromExistingSurveys'); - $table_group = Database :: get_course_table('survey_group'); + $table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); $sql = "SELECT course_survey.*, visual_code FROM $table_course_survey_rel as course_survey INNER JOIN ".Database::get_main_table(TABLE_MAIN_COURSE)." as course diff --git a/main/survey/survey_blank.php b/main/survey/survey_blank.php index ff466cb078..3a6efb508f 100644 --- a/main/survey/survey_blank.php +++ b/main/survey/survey_blank.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: survey_blank.php 10605 2007-01-06 17:55:20Z pcool $ +* @version $Id: survey_blank.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -43,8 +43,7 @@ require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php"); $surveyid = $_REQUEST['surveyid']; $uid = $_REQUEST['uid']; $uid1 = $_REQUEST['uid1']; -$db_name = $_REQUEST['db_name']; -$cidReq = $_REQUEST['cidReq']; + $temp = $_REQUEST['temp']; $mail = $_REQUEST['mail']; $username = $_REQUEST['username']; @@ -81,8 +80,7 @@ $lower = $num*4-4; if(isset($_POST['Back'])){ //echo $sql ="Insert into"; $back=$num-2; - $cidReq = $_REQUEST['cidReq']; - header("location:".$_SERVER['PHP_SELF']."?num=$back&cidReq=$cidReq"); + header("location:".$_SERVER['PHP_SELF']."?num=$back"); exit; } @@ -771,11 +769,9 @@ if ($numb=mysql_num_rows($res) > 0)
  - + - - @@ -785,9 +781,9 @@ if ($numb=mysql_num_rows($res) > 0) "1"){ - echo ""; + echo ""; } else{ - echo ""; + echo ""; } if($num >= $page) {echo ""; ?> diff --git a/main/survey/survey_edit.php b/main/survey/survey_edit.php index 82aa74041b..bd1fa054d7 100644 --- a/main/survey/survey_edit.php +++ b/main/survey/survey_edit.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: survey_edit.php 10603 2007-01-06 17:01:47Z pcool $ +* @version $Id: survey_edit.php 10680 2007-01-11 21:26:23Z pcool $ */ /* ============================================================================== @@ -60,7 +60,7 @@ if (!api_is_allowed_to_edit()) /** @todo use database constants for the survey tables */ $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); $table_course_survey_rel = Database :: get_main_table(TABLE_MAIN_COURSE_SURVEY); -$table_survey = Database :: get_course_table('survey'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); $tbl_category = Database :: get_main_table(TABLE_MAIN_CATEGORY); // language variables @@ -118,7 +118,7 @@ if ($_POST['action'] == 'update_survey') $curr_dbname=SurveyManager::update_survey($_GET['survey_id'],$surveycode,$surveytitle,$surveysubtitle,$author,$survey_language,$availablefrom,$availabletill,$isshare,$surveytemplate,$surveyintroduction,$surveythanks,$cidReq,$table_course); if(isset($_POST['next'])) { - header("location:select_question_group.php?surveyid=".$_GET['survey_id']."&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?surveyid=".$_GET['survey_id']); exit; } else diff --git a/main/survey/survey_list.php b/main/survey/survey_list.php index b64647094b..2bb7cfd27b 100644 --- a/main/survey/survey_list.php +++ b/main/survey/survey_list.php @@ -21,7 +21,7 @@ * @package dokeos.survey * @author unknown * @author Patrick Cool , Ghent University: cleanup, refactoring and rewriting large parts of the code -* @version $Id: survey_list.php 10660 2007-01-10 22:43:25Z pcool $ +* @version $Id: survey_list.php 10680 2007-01-11 21:26:23Z pcool $ * * @todo The ansTarget column is not done * @todo try to understand the white, blue, ... template stuff. @@ -58,12 +58,12 @@ if (!api_is_allowed_to_edit()) // Database table definitions /** @todo use database constants for the survey tables */ -$table_survey = Database :: get_course_table('survey'); -$table_group = Database :: get_course_table('survey_group'); -$table_question = Database :: get_course_table('questions'); -$table_course = Database :: get_main_table(TABLE_MAIN_COURSE); -$table_user = Database :: get_main_table(TABLE_MAIN_USER); -$user_info = Database :: get_main_table(TABLE_MAIN_SURVEY_REMINDER); +$table_survey = Database :: get_course_table(TABLE_SURVEY); +$table_group = Database :: get_course_table(TABLE_SURVEY_GROUP); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); +$table_course = Database :: get_main_table(TABLE_MAIN_COURSE); +$table_user = Database :: get_main_table(TABLE_MAIN_USER); +$user_info = Database :: get_main_table(TABLE_MAIN_SURVEY_REMINDER); // language variables if (isset ($_GET['search']) && $_GET['search'] == 'advanced') @@ -396,7 +396,7 @@ function survey_search_restriction() $survey[] = $ratio; //$NoOfQuestion=surveymanager::no_of_question($gid); //$language=surveymanager::no_of_question($sid); - $survey[] = ''.get_lang('Edit').''.''.get_lang('Delete').''.''.get_lang('CreateInAnotherLanguage').''.' '.get_lang('ViewSurvey').''.' '.get_lang('Publish').''.' '.get_lang('Reporting').''; + $survey[] = ''.get_lang('Edit').''.''.get_lang('Delete').''.''.get_lang('CreateInAnotherLanguage').''.' '.get_lang('ViewSurvey').''.' '.get_lang('Publish').''.' '.get_lang('Reporting').''; $surveys[] = $survey; } $table_header[] = array (' ', false); @@ -413,7 +413,6 @@ function survey_search_restriction() echo ''; - echo ''; echo '  '; echo ''; diff --git a/main/survey/survey_report.php b/main/survey/survey_report.php index 50365e5fb9..090c1c9b7f 100644 --- a/main/survey/survey_report.php +++ b/main/survey/survey_report.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: survey_report.php 10584 2007-01-02 15:09:21Z pcool $ +* @version $Id: survey_report.php 10680 2007-01-11 21:26:23Z pcool $ */ /* @@ -41,11 +41,9 @@ require_once (api_get_path(LIBRARY_PATH)."/course.lib.php"); require_once (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php"); require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php"); -$table_survey = Database :: get_course_table('survey'); +$table_survey = Database :: get_course_table(TABLE_SURVEY); $surveyid=$_REQUEST['surveyid']; - $cidReq=$_REQUEST['cidReq']; - $db_name = $_REQUEST['db_name']; if($_SESSION['status']==5) { api_protect_admin_script(); @@ -256,9 +254,9 @@ switch($screen) { $params = array_merge($_POST['left'] , $_POST['right']); - $tbl_user_survey = Database::get_main_table(TABLE_MAIN_SURVEY_USER); - $tbl_questions = Database::get_course_table('questions'); - $tbl_answers = Database::get_course_table('survey_report'); + $tbl_user_survey = Database::get_main_table(TABLE_MAIN_SURVEY_USER); + $tbl_questions = Database::get_course_table(TABLE_SURVEY_QUESTION); + $tbl_answers = Database::get_course_table(TABLE_SURVEY_REPORT); //$which_answers = 'WHERE qid'; diff --git a/main/survey/survey_white.php b/main/survey/survey_white.php index acac8ebe8a..5e4bc5fe2a 100644 --- a/main/survey/survey_white.php +++ b/main/survey/survey_white.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: survey_white.php 10584 2007-01-02 15:09:21Z pcool $ +* @version $Id: survey_white.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -278,7 +278,7 @@ echo '
'; if($group_offset < $nbGroups) echo ' '; else - echo ' '; + echo ' '; ?> diff --git a/main/survey/surveytemp_white.php b/main/survey/surveytemp_white.php index 679380d563..cc91022ea5 100644 --- a/main/survey/surveytemp_white.php +++ b/main/survey/surveytemp_white.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: surveytemp_white.php 10584 2007-01-02 15:09:21Z pcool $ +* @version $Id: surveytemp_white.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -350,7 +350,7 @@ echo '

'; $content = ob_get_contents(); ob_end_clean(); -$content = '
'.$content; +$content = ''.$content; echo $content; ?> diff --git a/main/survey/white.php b/main/survey/white.php index 48a08cf192..de44d81fe2 100644 --- a/main/survey/white.php +++ b/main/survey/white.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: white.php 10584 2007-01-02 15:09:21Z pcool $ +* @version $Id: white.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -50,7 +50,6 @@ if (!api_is_allowed_to_edit()) exit; } -$cidReq = $_REQUEST['cidReq']; $ques = $_REQUEST['ques']; $ans = $_REQUEST['ans']; diff --git a/main/survey/yesno.php b/main/survey/yesno.php index 1e69f408c7..b9016af2cb 100644 --- a/main/survey/yesno.php +++ b/main/survey/yesno.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: yesno.php 10596 2007-01-05 14:09:55Z elixir_inter $ +* @version $Id: yesno.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -57,8 +57,6 @@ if (!api_is_allowed_to_edit()) exit; } -$cidReq=$_GET['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; $add_question = $_REQUEST['add_question']; $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; @@ -75,8 +73,8 @@ else -$interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey')); -$table_question = Database :: get_course_table('questions'); +$interbreadcrumb[] = array ("url" => "survey_list.php?n=$n", "name" => get_lang('Survey')); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $Add = get_lang('AddNewQuestionType'); $Multi = get_lang('YesNo'); $groupid = $_REQUEST['groupid']; @@ -117,9 +115,8 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_POST['groupid']; $questtype = $_REQUEST['questtype']; - $curr_dbname = $_REQUEST['curr_dbname']; $enter_question = addslashes($enter_question); SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); - $cidReq = $_GET['cidReq']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } } @@ -127,9 +124,7 @@ if ($_POST['action'] == 'addquestion') { $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; - header("location:addanother.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:addanother.php?groupid=$groupid&surveyid=$surveyid"); exit; } elseif(isset($_POST['saveandexit'])) @@ -167,10 +162,8 @@ if ($_POST['action'] == 'addquestion') $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; $questtype = $_REQUEST['questtype']; - $curr_dbname = $_REQUEST['curr_dbname']; $enter_question = addslashes($enter_question); SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); - $cidReq = $_GET['cidReq']; - header("location:survey_list.php?cidReq=$cidReq&n=$n"); + header("location:survey_list.php?n=$n"); exit; } } @@ -207,12 +200,10 @@ function checkLength(form){ return true; } - + - - @@ -453,7 +444,7 @@ function checkLength(form){ ?> template) diff --git a/main/survey/yesno_edit.php b/main/survey/yesno_edit.php index 3452481db2..e14edc6db5 100644 --- a/main/survey/yesno_edit.php +++ b/main/survey/yesno_edit.php @@ -20,7 +20,7 @@ /** * @package dokeos.survey * @author -* @version $Id: yesno_edit.php 10596 2007-01-05 14:09:55Z elixir_inter $ +* @version $Id: yesno_edit.php 10680 2007-01-11 21:26:23Z pcool $ */ // name of the language file that needs to be included @@ -59,14 +59,13 @@ if (!api_is_allowed_to_edit()) $n=$_REQUEST['n']; -$interbreadcrumb[] = array ("url" => "survey_list.php?cidReq=$cidReq&n=$n", "name" => get_lang('Survey')); -$cidReq = $_REQUEST['cidReq']; -$curr_dbname = $_REQUEST['curr_dbname']; +$interbreadcrumb[] = array ("url" => "survey_list.php?n=$n", "name" => get_lang('Survey')); + $groupid=$_REQUEST['groupid']; $surveyid=$_REQUEST['surveyid']; $qid=$_REQUEST['qid']; $qtype=$_REQUEST['qtype']; -$table_question = Database :: get_course_table('questions'); +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); $Add = get_lang('UpdateQuestionType'); $Multi = get_lang('YesNo'); $tool_name = $Add.$Multi; @@ -126,10 +125,9 @@ $add_question12=$rs->qtype; //$questtype = $_REQUEST['questtype']; //else $questtype=$rs->qtype; - $curr_dbname = $_REQUEST['curr_dbname']; $enter_question = addslashes($enter_question); SurveyManager::update_question($qid,$questtype,$enter_question,$alignment,$answers,$open_ans,$curr_dbname); - $cidReq = $_GET['cidReq']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } } @@ -137,8 +135,7 @@ $add_question12=$rs->qtype; { $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; - $cidReq = $_GET['cidReq']; - $curr_dbname = $_REQUEST['curr_dbname']; header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq&curr_dbname=$curr_dbname"); + header("location:select_question_group.php?groupid=$groupid&surveyid=$surveyid"); exit; } elseif(isset($_POST['saveandexit'])) @@ -146,10 +143,8 @@ $add_question12=$rs->qtype; $groupid = $_REQUEST['groupid']; $surveyid = $_REQUEST['surveyid']; $questtype = $_REQUEST['questtype']; - $curr_dbname = $_REQUEST['curr_dbname']; $enter_question = addslashes($enter_question); SurveyManager::create_question($groupid,$surveyid,$questtype,$enter_question,$alignment,$answers,$open_ans,$answerT,$answerD,$rating,$curr_dbname); - $cidReq = $_GET['cidReq']; - header("location:survey_list.php?cidReq=$cidReq"); + header("location:survey_list.php"); exit; } @@ -164,14 +159,12 @@ if( isset($error_message) ) ?>
- + - -
@@ -439,7 +432,7 @@ if( isset($error_message) ) { ?> template)