presentation question survey user student

1.10.x
aragonc 11 years ago
parent 87a32fb3f4
commit 042189bf6a
  1. 107
      main/css/base.css
  2. 36
      main/css/base_chamilo.css
  3. 4
      main/css/chamilo/default.css
  4. 22
      main/survey/fillsurvey.php
  5. 48
      main/survey/survey.lib.php

@ -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;
}

@ -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 {

@ -7,7 +7,7 @@
/* the following for regular <a> 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;

@ -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 '<div class="survey-block';
Display :: display_error_message(get_lang('SurveyParametersMissingUseCopyPaste'), false);
echo '</div>';
Display :: display_footer();
exit;
}
@ -145,7 +147,9 @@ if ( !isset($_POST['finish_survey']) &&
($isAnonymous && isset($_SESSION['surveyuser'])) ||
($survey_invitation['answered'] == 1 && !isset($_GET['user_id']))
) {
echo '<div class="survey-block">';
Display :: display_error_message(get_lang('YouAlreadyFilledThisSurvey'), false);
echo '</div>';
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 '<div id="survey_title">'.$survey_data['survey_title'].'</div>';
echo '<div id="survey_subtitle">'.$survey_data['survey_subtitle'].'</div>';
echo '<div class="survey-block">';
echo '<div id="survey_title">';
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']).'</div>';
echo '<div id="survey_subtitle">'.strip_tags($survey_data['survey_subtitle']).'</div>';
// 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 '<div id="survey_content" class="survey_content">'.$survey_data['survey_introduction'].'</div>';
echo '<div id="survey_content" class="survey_content">'.strip_tags($survey_data['survey_introduction']).'</div>';
}
$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 '<button type="submit" name="next_survey_page" class="next">'.get_lang('StartSurvey').'</button>';
echo '<button type="submit" name="next_survey_page" class="survey-next">'.get_lang('StartSurvey').'</button>';
} else {
echo '<button type="submit" name="next_survey_page" class="next">'.get_lang('Next').'</button>';
echo '<button type="submit" name="next_survey_page" class="survey-next">'.get_lang('Next').'</button>';
}
}
if ($show >= $numberofpages && $_GET['show']) {
echo '<button type="submit" name="finish_survey" class="next">'.get_lang('FinishSurvey').'</button>';
echo '<button type="submit" name="finish_survey" class="survey-next">'.get_lang('FinishSurvey').'</button>';
}
} else {
// The normal survey as always but with the form profile
@ -1212,7 +1220,9 @@ if ($survey_data['survey_type'] === '0') {
echo '<button type="submit" name="next_survey_page" class="next">'.get_lang('Next').'</button>';
}
}
echo '</form>';
echo '</div>';
// Footer
Display :: display_footer();

@ -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 '</div>';
if ($survey_data['number_of_questions'] > 0) {
echo '<div id="question_report_questionnumbers">'.get_lang('Question').' ';
for ($i = 1; $i <= $survey_data['number_of_questions']; $i++) {
if ($offset != $i - 1) {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.Security::remove_XSS($_GET['action']).'&amp;'.api_get_cidreq().'&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;question='.($i-1).'">'.$i.'</a>';
} else {
echo $i;
}
if ($i < $survey_data['number_of_questions']) {
echo ' | ';
echo '<div id="question_report_questionnumbers" class="pagination">';
/* echo '<ul><li class="disabled"><a href="#">'.get_lang('Question').'</a></li>'; */
if ($currentQuestion != 0 ) {
echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.Security::remove_XSS($_GET['action']).'&amp;'.api_get_cidreq().'&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;question='.Security::remove_XSS($offset-1).'">'.get_lang('PreviousQuestion').'</a></li>';
}
for ($i = 1; $i <= $survey_data['number_of_questions']; $i++) {
if ($offset != $i - 1) {
echo '<li><a href="' . api_get_path(WEB_CODE_PATH) . 'survey/reporting.php?action=' . Security::remove_XSS($_GET['action']) . '&amp;' . api_get_cidreq() . '&amp;survey_id=' . Security::remove_XSS($_GET['survey_id']) . '&amp;question=' . ($i - 1) . '">' . $i . '</a></li>';
} else {
echo '<li class="disabled"s><a href="#">' . $i . '</a></li>';
}
/*if ($i < $survey_data['number_of_questions']) {
echo ' | ';
}*/
}
if ($currentQuestion < ($survey_data['number_of_questions'] - 1)) {
echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.Security::remove_XSS($_GET['action']).'&amp;'.api_get_cidreq().'&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;question='.Security::remove_XSS($offset+1).'">'.get_lang('NextQuestion').'</li></a>';
}
echo '</ul>';
echo '</div>';
// 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 '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.Security::remove_XSS($_GET['action']).'&amp;'.api_get_cidreq().'&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;question='.Security::remove_XSS($offset-1).'">'.
Display::return_icon('action_prev.png', get_lang('PreviousQuestion'), array('align' => 'middle')).' '.get_lang('PreviousQuestion').'</a> ';
} else {
@ -2952,7 +2963,7 @@ class SurveyUtil
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.Security::remove_XSS($_GET['action']).'&amp;'.api_get_cidreq().'&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;question='.Security::remove_XSS($offset+1).'">'.get_lang('NextQuestion').' '.Display::return_icon('action_next.png', get_lang('NextQuestion'), array('align' => 'middle')).'</a>';
} 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 '<table class="data_table cosa">';
echo '<div class="survey-block">';
echo '<div class="title-survey-block">';
echo Display::return_icon('survey.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_SMALL);
echo '<h3>'.get_lang('SurveyList').'</h3></div>';
echo '<table id="list-survey" class="table ">';
echo '<tr>';
echo ' <th>'.get_lang('SurveyName').'</th>';
echo ' <th>'.get_lang('Anonymous').'</th>';
@ -5066,13 +5081,15 @@ class SurveyUtil
echo '<tr>';
if ($row['answered'] == 0) {
echo '<td>';
echo Display::return_icon('survey.gif', get_lang('CreateNewSurvey'),'',ICON_SIZE_MEDIUM).'</a> ';
echo Display::return_icon('statistics.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY);
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/fillsurvey.php?course='.$_course['sysCode'].'&amp;invitationcode='.$row['invitation_code'].'&amp;cidReq='.$_course['sysCode'].'">'.$row['title'].'</a></td>';
} else {
//echo '<td>'.$row['title'].'</td>';
echo '<td><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&amp;cidReq='.$_course['sysCode'].'&amp;id_session='.$row['session_id'].'&amp;gidReq='.'0'.'&amp;origin='.''.'&amp;survey_id='.$row['survey_id'].'">'.$row['title'].'</a></td>';
echo '<td>';
echo Display::return_icon('statistics_na.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY);
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&amp;cidReq='.$_course['sysCode'].'&amp;id_session='.$row['session_id'].'&amp;gidReq='.'0'.'&amp;origin='.''.'&amp;survey_id='.$row['survey_id'].'">'.$row['title'].'</a></td>';
}
echo '<td>';
echo '<td class="center">';
echo ($row['anonymous'] == 1) ? get_lang('Yes') : get_lang('No');
echo '</td>';
echo '</tr>';
@ -5088,6 +5105,7 @@ class SurveyUtil
}
}
echo '</table>';
echo '</div>';
}
/**

Loading…
Cancel
Save