Minor - remove unused code

pull/3023/head
Julio Montoya 6 years ago
parent bce51867dd
commit 1924436448
  1. 1
      main/inc/lib/banner.lib.php
  2. 40
      main/survey/preview.php
  3. 4
      main/survey/question.php

@ -810,7 +810,6 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools)
$i = 0;
$final_navigation_count = count($final_navigation);
if (!empty($final_navigation)) {
// $home_link.= '<span class="divider">/</span>';
if (!empty($home_link)) {
$lis .= Display::tag('li', $home_link);
}

@ -3,11 +3,11 @@
/**
* @package chamilo.survey
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @author Julio Montoya <gugli100@gmail.com>
*
**/
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @author Julio Montoya <gugli100@gmail.com>
*/
require_once __DIR__.'/../inc/global.inc.php';
api_protect_course_script(true);
@ -31,13 +31,8 @@ if (empty($survey_data)) {
$this_section = SECTION_COURSES;
// Database table definitions
$table_survey = Database::get_course_table(TABLE_SURVEY);
$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
$table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
$course_id = api_get_course_int_id();
$courseInfo = api_get_course_info();
@ -58,7 +53,6 @@ Display::display_header(get_lang('SurveyPreview'));
// We exit here is the first or last question is a pagebreak (which causes errors)
SurveyUtil::check_first_last_question($surveyId, false);
$counter_question = 0;
// Survey information
echo '<div class="page-header"><h2>'.$survey_data['survey_title'].'</h2></div>';
@ -134,7 +128,7 @@ if (isset($_GET['show'])) {
LEFT JOIN $table_survey_question_option survey_question_option
ON
survey_question.question_id = survey_question_option.question_id AND
survey_question_option.c_id = $course_id
survey_question_option.c_id = survey_question.c_id
WHERE
survey_question.survey_id = '".$surveyId."' AND
survey_question.question_id IN (".Database::escape_string(implode(',', $paged_questions[$_GET['show']]), null, false).") AND
@ -156,7 +150,6 @@ if (isset($_GET['show'])) {
$questions[$sort]['maximum_score'] = $row['max_value'];
$questions[$row['sort']]['is_required'] = $allowRequiredSurveyQuestions && $row['is_required'];
}
$counter_question++;
}
}
}
@ -227,19 +220,20 @@ if ($show < $numberOfPages) {
}
}
if ($show >= $numberOfPages && isset($_GET['show']) ||
(isset($_GET['show']) && count($questions) == 0)
) {
if ($questions_exists == false) {
echo '<p>'.get_lang('ThereAreNotQuestionsForthisSurvey').'</p>';
if (isset($_GET['show'])) {
if ($show >= $numberOfPages || count($questions) == 0) {
if ($questions_exists == false) {
echo '<p>'.get_lang('ThereAreNotQuestionsForthisSurvey').'</p>';
}
$form->addButton(
'finish_survey',
get_lang('FinishSurvey'),
'arrow-right',
'success'
);
}
$form->addButton(
'finish_survey',
get_lang('FinishSurvey'),
'arrow-right',
'success'
);
}
$form->addHtml('</div>');
$form->display();

@ -103,13 +103,11 @@ if (!in_array($_GET['type'], $possible_types)) {
Display::display_footer();
}
$error_message = '';
// Displaying the form for adding or editing the question
$ch_type = 'ch_'.$_GET['type'];
/** @var survey_question $surveyQuestion */
$surveyQuestion = new $ch_type();
//$surveyQuestion = survey_question::createQuestion($_GET['type'])
// The defaults values for the form
$formData = [];

Loading…
Cancel
Save