From 042189bf6ad62a351b85eec79e2337c9a8682650 Mon Sep 17 00:00:00 2001 From: aragonc Date: Thu, 29 Jan 2015 16:56:03 -0500 Subject: [PATCH] presentation question survey user student --- main/css/base.css | 107 +++++++++++++++++++++++++++++++++++ main/css/base_chamilo.css | 36 +----------- main/css/chamilo/default.css | 4 +- main/survey/fillsurvey.php | 22 +++++-- main/survey/survey.lib.php | 48 +++++++++++----- 5 files changed, 159 insertions(+), 58 deletions(-) diff --git a/main/css/base.css b/main/css/base.css index 4065870f87..2787825934 100755 --- a/main/css/base.css +++ b/main/css/base.css @@ -5304,3 +5304,110 @@ i.size-32.icon-new-work{ { height: 52px; } +/***** Survey ****/ +#list-survey p{ + display: inline-block; + margin-left: 10px; +} +.survey-block{ + width: 100%; + margin: auto; + padding: 10px; + box-sizing:border-box; + -moz-box-sizing:border-box; + -webkit-box-sizing:border-box; +} +.survey-block .table tbody tr:hover td{ + background-color: #fff6d5 ; +} +.survey-block .table tbody tr:hover th,.survey-block .table tbody tr th { + background-color: #ececec ; + text-align: center; +} +.survey-block .table .center{ + text-align: center; +} +.survey-block .title-survey-block{ + padding-top: 10px; + padding-bottom: 10px; +} +.survey-block .title-survey-block h3{ + display: inline-block; + margin-left: 10px; +} +#survey_title { + font-size: 24px; + font-weight: 500; + color:#666; + padding-top:10px; + padding-bottom: 10px; + padding-left: 15px; + padding-right: 15px; + background-color: #ececec; +} +#survey_subtitle { + background-color:#F7F7E3; + color:#666; + padding:10px; + font-size:14px ; +} +.survey_content { + color:#666; + padding:5px; + font-size: 13px; + margin-top: 4px; + margin-bottom: 10px; +} +.survey-block #question{ + background-color: #ececec; + text-align: center; +} +.survey_question_wrapper { + border-top: 1px solid #DADADA; + background-color: #ffffff; + padding-top: 1em; + padding-bottom: 2em; + padding-left: 1em; + padding-right: 1em; + text-align: left; +} +.survey_question { + /* 264269 4271b5 E5EDF9 */ + color:#666; + padding:5px; + font-size: 16px; + font-weight: bold; +} +.survey_question_options { + /* 264269 4271b5 E5EDF9 */ + background-color:#FFF; + color:#000; + padding:5px;/*border: 1px solid #264269;*/ +} +.survey-next.btn{ + border:1px solid #319265; -webkit-border-radius: 3px; -moz-border-radius: 3px;border-radius: 3px;font-size:18px;font-family:arial, helvetica, sans-serif; padding: 10px 20px 10px 20px; text-decoration:none; display:inline-block;font-weight:bold; color: #FFFFFF; + background-color: #3FBC82; background-image: -webkit-gradient(linear, left top, left bottom, from(#3FBC82), to(#308E60)); + background-image: -webkit-linear-gradient(top, #3FBC82, #308E60); + background-image: -moz-linear-gradient(top, #3FBC82, #308E60); + background-image: -ms-linear-gradient(top, #3FBC82, #308E60); + background-image: -o-linear-gradient(top, #3FBC82, #308E60); + background-image: linear-gradient(to bottom, #3FBC82, #308E60);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#3FBC82, endColorstr=#308E60); + text-shadow:none; + margin-top: 1em; + margin-bottom: 1em; +} + +.survey-next.btn:hover{ + border:1px solid #25704d; + background-color: #329668; background-image: -webkit-gradient(linear, left top, left bottom, from(#329668), to(#236846)); + background-image: -webkit-linear-gradient(top, #329668, #236846); + background-image: -moz-linear-gradient(top, #329668, #236846); + background-image: -ms-linear-gradient(top, #329668, #236846); + background-image: -o-linear-gradient(top, #329668, #236846); + background-image: linear-gradient(to bottom, #329668, #236846);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#329668, endColorstr=#236846); + background-position: 0 0; +} +.survey-block .confirmation-message, .survey-block .error-message{ + font-size: 16px; + text-align: center; +} \ No newline at end of file diff --git a/main/css/base_chamilo.css b/main/css/base_chamilo.css index 58c37ac75f..1b85239d14 100755 --- a/main/css/base_chamilo.css +++ b/main/css/base_chamilo.css @@ -1003,41 +1003,7 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0p .skip { display: none; } -/* Survey */ -#survey_title { - background-color:#dcdcdc; - color:#000; - padding:2px; -} -#survey_subtitle { - background-color:#dcdcdc; - color:#000; - padding:2px; -} -.survey_content { - background-color:#a0e5fc; - color:#264269; - padding:5px; - border: 1px solid #999; - margin-top: 4px; -} -.survey_question_wrapper { - border: 1px solid #999; - margin-top:4px; -} -.survey_question { - /* 264269 4271b5 E5EDF9 */ - background-color:#E5EDF9; - color:#999; - padding:5px;/*border: 1px solid #264269;*/ -} -.survey_question_options { - /* 264269 4271b5 E5EDF9 */ - background-color:#FFF; - color:#000; - padding:5px;/*border: 1px solid #264269;*/ -} -/* + Added: to fit img and blocks in home page */ #hellomindfactory { diff --git a/main/css/chamilo/default.css b/main/css/chamilo/default.css index ad8969c46a..8d0aaa3488 100755 --- a/main/css/chamilo/default.css +++ b/main/css/chamilo/default.css @@ -7,7 +7,7 @@ /* the following for regular elements */ body { - + line-height: 25px; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } @@ -625,7 +625,7 @@ a.thumbnail:hover{ * FOOTER STYLES * *****************************************************/ footer { - height: 7em; + height: auto; background: #00a9e0; /* Old browsers */ color:#ffffff; border-top: none; diff --git a/main/survey/fillsurvey.php b/main/survey/fillsurvey.php index 10ca6b92e4..85d078290e 100755 --- a/main/survey/fillsurvey.php +++ b/main/survey/fillsurvey.php @@ -81,7 +81,9 @@ Display :: display_header(get_lang('ToolSurvey')); // First we check if the needed parameters are present if ((!isset($_GET['course']) || !isset($_GET['invitationcode'])) && !isset($_GET['user_id'])) { + echo '
'; Display :: display_error_message(get_lang('YouAlreadyFilledThisSurvey'), false); + echo '
'; Display :: display_footer(); exit; } @@ -311,13 +315,17 @@ if (count($_POST) > 0) { } } else { // In case it's another type than 0 or 1 + die(get_lang('ErrorSurveyTypeUnknown')); } } // Displaying the survey title and subtitle (appears on every page) -echo '
'.$survey_data['survey_title'].'
'; -echo '
'.$survey_data['survey_subtitle'].'
'; +echo '
'; +echo '
'; +echo Display::return_icon('statistics.png', get_lang('CreateNewSurvey'),array('style'=>'display:inline-block; margin-right:5px;'),ICON_SIZE_SMALL); +echo strip_tags($survey_data['survey_title']).'
'; +echo '
'.strip_tags($survey_data['survey_subtitle']).'
'; // Checking time availability check_time_availability($survey_data); @@ -330,7 +338,7 @@ if (!isset($_GET['show'])) { $paged_questions_sec = array(); if (!empty($survey_data['survey_introduction'])) { - echo '
'.$survey_data['survey_introduction'].'
'; + echo '
'.strip_tags($survey_data['survey_introduction']).'
'; } $limit = 0; } @@ -1128,13 +1136,13 @@ if ($survey_data['survey_type'] === '0') { // The normal survey as always if (($show < $numberofpages) || !$_GET['show']) { //$show = $_GET['show'] + 1 if ($show == 0) { - echo ''; + echo ''; } else { - echo ''; + echo ''; } } if ($show >= $numberofpages && $_GET['show']) { - echo ''; + echo ''; } } else { // The normal survey as always but with the form profile @@ -1212,7 +1220,9 @@ if ($survey_data['survey_type'] === '0') { echo ''; } } + echo ''; +echo '
'; // Footer Display :: display_footer(); diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index ebb0c793ff..c1ba67289f 100755 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -2507,6 +2507,7 @@ class SurveyUtil $error = false; while ($row = Database::fetch_array($result, 'ASSOC')) { if ($counter == 1 && $row['type'] == 'pagebreak') { + Display::display_error_message(get_lang('PagebreakNotFirst'), false); $error = true; } @@ -2916,17 +2917,27 @@ class SurveyUtil echo ''; if ($survey_data['number_of_questions'] > 0) { - echo '
'.get_lang('Question').' '; - for ($i = 1; $i <= $survey_data['number_of_questions']; $i++) { - if ($offset != $i - 1) { - echo ''.$i.''; - } else { - echo $i; - } - if ($i < $survey_data['number_of_questions']) { - echo ' | '; + echo ''; // Getting the question information @@ -2941,7 +2952,7 @@ class SurveyUtil $question = Database::fetch_array($result); // Navigate through the questions (next and previous) - if ($currentQuestion != 0 ) { + /*if ($currentQuestion != 0 ) { echo ''. Display::return_icon('action_prev.png', get_lang('PreviousQuestion'), array('align' => 'middle')).' '.get_lang('PreviousQuestion').' '; } else { @@ -2952,7 +2963,7 @@ class SurveyUtil echo ''.get_lang('NextQuestion').' '.Display::return_icon('action_next.png', get_lang('NextQuestion'), array('align' => 'middle')).''; } else { echo get_lang('NextQuestion').' '.Display::return_icon('action_next.png', get_lang('NextQuestion'), array('align' => 'middle')); - } + }*/ } echo isset($question['survey_question']) ? $question['survey_question'] : null; @@ -5036,7 +5047,11 @@ class SurveyUtil break; } } - echo ''; + echo '
'; + echo '
'; + echo Display::return_icon('survey.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_SMALL); + echo '

'.get_lang('SurveyList').'

'; + echo '
'; echo ''; echo ' '; echo ' '; @@ -5066,13 +5081,15 @@ class SurveyUtil echo ''; if ($row['answered'] == 0) { echo ''; } else { //echo ''; - echo ''; + echo ''; } - echo ''; echo ''; @@ -5088,6 +5105,7 @@ class SurveyUtil } } echo '
'.get_lang('SurveyName').''.get_lang('Anonymous').'
'; - echo Display::return_icon('survey.gif', get_lang('CreateNewSurvey'),'',ICON_SIZE_MEDIUM).' '; + echo Display::return_icon('statistics.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY); echo ''.$row['title'].''.$row['title'].''.$row['title'].''; + echo Display::return_icon('statistics_na.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY); + echo ''.$row['title'].''; + echo ''; echo ($row['anonymous'] == 1) ? get_lang('Yes') : get_lang('No'); echo '
'; + echo '
'; } /**