|
|
|
|
@ -24,7 +24,7 @@ |
|
|
|
|
* @package dokeos.survey |
|
|
|
|
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts (if not all) of the code |
|
|
|
|
@author Julio Montoya Armas <gugli100@gmail.com>, Dokeos: Personality Test modification and rewriting large parts of the code |
|
|
|
|
* @version $Id: survey.lib.php 16697 2008-11-07 21:47:40Z yannoo $ |
|
|
|
|
* @version $Id: survey.lib.php 17323 2008-12-16 16:14:27Z cfasanando $ |
|
|
|
|
* |
|
|
|
|
* @todo move this file to inc/lib |
|
|
|
|
* @todo use consistent naming for the functions (save vs store for instance) |
|
|
|
|
@ -1331,7 +1331,7 @@ class question |
|
|
|
|
$fck_attribute['Height'] = '100'; |
|
|
|
|
$fck_attribute['ToolbarSet'] = 'Survey'; |
|
|
|
|
//$this->html .= ' <td><input type="text" name="question" id="question" value="'.$form_content['question'].'"/></td>'; |
|
|
|
|
$this->html .= ' <td colspan="3" width="500">'.api_return_html_area('question', html_entity_decode(stripslashes($form_content['question']))).'</td>'; |
|
|
|
|
$this->html .= ' <td colspan="3" width="550">'.api_return_html_area('question', html_entity_decode(stripslashes($form_content['question']))).'</td>'; |
|
|
|
|
$this->html .= ' </tr>'; |
|
|
|
|
/* |
|
|
|
|
$this->html .= ' <tr>'; |
|
|
|
|
@ -1595,18 +1595,18 @@ class yesno extends question |
|
|
|
|
|
|
|
|
|
// The options |
|
|
|
|
$this->html .= ' <tr>'; |
|
|
|
|
$this->html .= ' <td colspan="3"><strong>'.get_lang('AnswerOptions').'</strong></td>'; |
|
|
|
|
$this->html .= ' <td colspan="3"><strong>'.get_lang('AnswerOptions').'</strong></td>'; |
|
|
|
|
$this->html .= ' </tr>'; |
|
|
|
|
$this->html .= ' <tr>'; |
|
|
|
|
$this->html .= ' <td align="right"><label for="answers[0]">1</label></td>'; |
|
|
|
|
//$this->html .= ' <td><input type="text" name="answers[0]" id="answers[0]" value="'.$form_content['answers'][0].'" /></td>'; |
|
|
|
|
$this->html .= ' <td>'.api_return_html_area('answers[0]', stripslashes($form_content['answers'][0])).'</td>'; |
|
|
|
|
$this->html .= ' <td width="550">'.api_return_html_area('answers[0]', stripslashes($form_content['answers'][0])).'</td>'; |
|
|
|
|
$this->html .= ' <td><input type="image" src="../img/down.gif" value="move_down[0]" name="move_down[0]"/></td>'; |
|
|
|
|
$this->html .= ' </tr>'; |
|
|
|
|
$this->html .= ' <tr>'; |
|
|
|
|
$this->html .= ' <td align="right"><label for="answers[1]">2</label></td>'; |
|
|
|
|
//$this->html .= ' <td><input type="text" name="answers[1]" id="answers[1]" value="'.$form_content['answers'][1].'" /></td>'; |
|
|
|
|
$this->html .= ' <td>'.api_return_html_area('answers[1]', stripslashes($form_content['answers'][1])).'</td>'; |
|
|
|
|
$this->html .= ' <td width="550">'.api_return_html_area('answers[1]', stripslashes($form_content['answers'][1])).'</td>'; |
|
|
|
|
$this->html .= ' <td><input type="image" src="../img/up.gif" value="move_up[1]" name="move_up[1]" /></td>'; |
|
|
|
|
$this->html .= ' </tr>'; |
|
|
|
|
} |
|
|
|
|
@ -1695,24 +1695,16 @@ class multiplechoice extends question |
|
|
|
|
$this->html .= ' <tr>'; |
|
|
|
|
$this->html .= ' <td align="right"><label for="answers['.$key.']">'.($key+1).'</label></td>'; |
|
|
|
|
//$this->html .= ' <td><input type="text" name="answers['.$key.']" id="answers['.$key.']" value="'.$form_content['answers'][$key].'" /></td>'; |
|
|
|
|
$this->html .= ' <td width="500">'.api_return_html_area('answers['.$key.']', html_entity_decode(stripslashes($form_content['answers'][$key]))).'</td>'; |
|
|
|
|
$this->html .= ' <td width="550">'.api_return_html_area('answers['.$key.']', html_entity_decode(stripslashes($form_content['answers'][$key]))).'</td>'; |
|
|
|
|
$this->html .= ' <td>'; |
|
|
|
|
if ($key<$total_number_of_answers-1) |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <input type="image" src="../img/down.gif" value="move_down['.$key.']" name="move_down['.$key.']"/>'; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <img src="../img/spacer.gif" alt="'.get_lang('Empty').'" title="'.get_lang('Empty').'" />'; |
|
|
|
|
} |
|
|
|
|
if ($key>0) |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <input type="image" src="../img/up.gif" value="move_up['.$key.']" name="move_up['.$key.']"/>'; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <img src="../img/spacer.gif" alt="'.get_lang('Empty').'" title="'.get_lang('Empty').'" />'; |
|
|
|
|
} |
|
|
|
|
if ($total_number_of_answers> 2) |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <input type="image" src="../img/delete.gif" value="delete_answer['.$key.']" name="delete_answer['.$key.']"/>'; |
|
|
|
|
@ -1804,7 +1796,7 @@ class personality extends question |
|
|
|
|
$this->html .= ' <tr>'; |
|
|
|
|
$this->html .= ' <td align="right"><label for="answers['.$key.']">'.($key+1).'</label></td>'; |
|
|
|
|
//$this->html .= ' <td><input type="text" name="answers['.$key.']" id="answers['.$key.']" value="'.$form_content['answers'][$key].'" /></td>'; |
|
|
|
|
$this->html .= ' <td width="500">'.api_return_html_area('answers['.$key.']', html_entity_decode(stripslashes($form_content['answers'][$key]))).'</td>'; |
|
|
|
|
$this->html .= ' <td width="550">'.api_return_html_area('answers['.$key.']', html_entity_decode(stripslashes($form_content['answers'][$key]))).'</td>'; |
|
|
|
|
$this->html .= ' <td>'; |
|
|
|
|
|
|
|
|
|
if ($total_number_of_answers> 2) |
|
|
|
|
@ -1814,25 +1806,15 @@ class personality extends question |
|
|
|
|
|
|
|
|
|
if ($key<$total_number_of_answers-1) |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <input type="image" src="../img/down.gif" value="move_down['.$key.']" name="move_down['.$key.']"/>'; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <img src="../img/spacer.gif" alt="'.get_lang('Empty').'" title="'.get_lang('Empty').'" />'; |
|
|
|
|
$this->html .= ' <input type="image" src="../img/down.gif" value="move_down['.$key.']" name="move_down['.$key.']"/>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($key>0) |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <input type="image" src="../img/up.gif" value="move_up['.$key.']" name="move_up['.$key.']"/>'; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <img src="../img/spacer.gif" alt="'.get_lang('Empty').'" title="'.get_lang('Empty').'" />'; |
|
|
|
|
$this->html .= ' <input type="image" src="../img/up.gif" value="move_up['.$key.']" name="move_up['.$key.']"/>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($total_number_of_answers> 2) |
|
|
|
|
{ |
|
|
|
|
//$this->html .= '<input type="image" src="../img/delete.gif" value="delete_answer['.$key.']" name="delete_answer['.$key.']"/>'; |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <input type="image" src="../img/delete.gif" value="delete_answer['.$key.']" name="delete_answer['.$key.']"/>'; |
|
|
|
|
} |
|
|
|
|
$this->html .= ' </td>'; |
|
|
|
|
$this->html .= ' </tr>'; |
|
|
|
|
@ -1910,24 +1892,16 @@ class multipleresponse extends question |
|
|
|
|
$this->html .= ' <tr>'; |
|
|
|
|
$this->html .= ' <td align="right"><label for="answers['.$key.']">'.($key+1).'</label></td>'; |
|
|
|
|
//$this->html .= ' <td><input type="text" name="answers['.$key.']" id="answers['.$key.']" value="'.$form_content['answers'][$key].'" /></td>'; |
|
|
|
|
$this->html .= ' <td width="500">'.api_return_html_area('answers['.$key.']', html_entity_decode(stripslashes($form_content['answers'][$key]))).'</td>'; |
|
|
|
|
$this->html .= ' <td width="550">'.api_return_html_area('answers['.$key.']', html_entity_decode(stripslashes($form_content['answers'][$key]))).'</td>'; |
|
|
|
|
$this->html .= ' <td>'; |
|
|
|
|
if ($key<$total_number_of_answers-1) |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <input type="image" src="../img/down.gif" value="move_down['.$key.']" name="move_down['.$key.']"/>'; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <img src="../img/spacer.gif" alt="'.get_lang('Empty').'" title="'.get_lang('Empty').'" />'; |
|
|
|
|
} |
|
|
|
|
if ($key>0) |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <input type="image" src="../img/up.gif" value="move_up['.$key.']" name="move_up['.$key.']"/>'; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <img src="../img/spacer.gif" alt="'.get_lang('Empty').'" title="'.get_lang('Empty').'" />'; |
|
|
|
|
} |
|
|
|
|
if ($total_number_of_answers> 2) |
|
|
|
|
{ |
|
|
|
|
$this->html .= ' <input type="image" src="../img/delete.gif" value="delete_answer['.$key.']" name="delete_answer['.$key.']"/>'; |
|
|
|
|
@ -2200,7 +2174,7 @@ class score extends question |
|
|
|
|
$this->html .= ' <tr>'; |
|
|
|
|
$this->html .= ' <td align="right"><label for="answers['.$key.']">'.($key+1).'</label></td>'; |
|
|
|
|
//$this->html .= ' <td><input type="text" name="answers['.$key.']" id="answers['.$key.']" value="'.$form_content['answers'][$key].'" /></td>'; |
|
|
|
|
$this->html .= ' <td width="500">'.api_return_html_area('answers['.$key.']', stripslashes($form_content['answers'][$key])).'</td>'; |
|
|
|
|
$this->html .= ' <td width="550">'.api_return_html_area('answers['.$key.']', stripslashes($form_content['answers'][$key])).'</td>'; |
|
|
|
|
$this->html .= ' <td>'; |
|
|
|
|
if ($key<$total_number_of_answers-1) |
|
|
|
|
{ |
|
|
|
|
@ -2587,7 +2561,7 @@ class SurveyUtil { |
|
|
|
|
if (isset($_GET['user'])) |
|
|
|
|
{ |
|
|
|
|
Display::display_normal_message(get_lang('AllQuestionsOnOnePage'), false); |
|
|
|
|
echo '<a href="reporting.php?action=deleteuserreport&survey_id='.Security::remove_XSS($_GET['survey_id']).'&user='.Security::remove_XSS($_GET['user']).'" >'.get_lang('DeleteSurveyByUser').'</a>'; |
|
|
|
|
echo '<a href="reporting.php?action=deleteuserreport&survey_id='.Security::remove_XSS($_GET['survey_id']).'&user='.Security::remove_XSS($_GET['user']).'" ><img src="../img/delete.gif" border="0" title="'.get_lang('Delete').'" alt="" /> '.get_lang('DeleteSurveyByUser').'</a>'; |
|
|
|
|
// getting all the questions and options |
|
|
|
|
$sql = "SELECT survey_question.question_id, survey_question.survey_id, survey_question.survey_question, survey_question.display, survey_question.max_value, survey_question.sort, survey_question.type, |
|
|
|
|
survey_question_option.question_option_id, survey_question_option.option_text, survey_question_option.sort as option_sort |
|
|
|
|
|