/** * this function write a gui line for answer insertion,projected for modify * * @param int $i indicate the line number * @return nothing * * @access private * @author Fabio Pirovano (fabio@docebo.com) */ function _lineModAnswer($i) { $lang =& DoceboLanguage::createInstance('test'); $GLOBALS['page']->add('<tr class="line_answer">' . '<td rowspan="2" class=" valign_top align_center">' . '<label for="is_correct_' . $i . '">' . $lang->def('_TEST_CORRECT') . '</label><br /><br />', 'content'); if (isset($_POST['answer_id'][$i])) { $GLOBALS['page']->add('<input type="hidden" id="answer_id_' . $i . '" name="answer_id[' . $i . ']" value="' . $_POST['answer_id'][$i] . '" />', 'content'); } $GLOBALS['page']->add('<input type="checkbox" id="is_correct_' . $i . '" name="is_correct[' . $i . ']" value="1"' . (isset($_POST['is_correct'][$i]) ? ' checked="checked"' : '') . ' />' . '</td>' . '<td rowspan="2" class="image">' . '<label class="access-only" for="answer_' . $i . '">' . $lang->def('_TEST_TEXT_ANSWER') . '</label>' . loadHtmlEditor('', 'answer_' . $i, 'answer[' . $i . ']', isset($_POST['answer'][$i]) ? stripslashes($_POST['answer'][$i]) : '', false, '', true) . '</td>' . '<td rowspan="2" class="image">' . '<label class="access-only" for="comment_' . $i . '">' . $lang->def('_COMMENTS') . '</label>' . '<textarea class="test_comment" id="comment_' . $i . '" name="comment[' . $i . ']" rows="6">' . (isset($_POST['comment'][$i]) ? stripslashes($_POST['comment'][$i]) : '') . '</textarea>' . '</td>' . '<td class="test_ifcorrect">' . '<label for="score_correct_' . $i . '">' . $lang->def('_TEST_IFCORRECT') . '</label>' . '</td>' . '<td class="align_right">' . '<input type="text" class="test_point" id="score_correct_' . $i . '" name="score_correct[' . $i . ']" alt="' . $lang->def('_TEST_IFCORRECT') . '" size="5" value="' . (isset($_POST['score_correct'][$i]) ? $_POST['score_correct'][$i] : '0.0') . '" />' . '</td>' . '</tr>' . "\n" . '<tr class="line_answer">' . '<td class="test_ifcorrect">' . '<label for="score_incorrect_' . $i . '">' . $lang->def('_TEST_IFINCORRECT') . '</label>' . '</td>' . '<td class="align_right">' . '- <input type="text" class="test_point" id="score_incorrect_' . $i . '" name="score_incorrect[' . $i . ']" alt="' . $lang->def('_TEST_IFINCORRECT') . '" size="5" value="' . (isset($_POST['score_incorrect'][$i]) ? $_POST['score_incorrect'][$i] : '0.0') . '" />' . '</td>' . '</tr>' . "\n", 'content'); }
/** * public static function getTextarea( $label_name, $id, $name, $maxlenght, $value, $other_after ) * * this public static function is a temporary substitute for a more complete one */ public static function getTextarea($label_name, $id, $name, $value = '', $extra_param_for = false, $id_form = '', $css_line = 'form_line_l', $css_label = 'floating', $css_text = 'textarea', $simple = false) { $html_code = '<div class="' . $css_line . '">' . '<p><label class="' . $css_label . '" for="' . $id . '">' . $label_name . '</label></p><br />' . '<div class="nofloat"></div>' . loadHtmlEditor($id_form, $id, $name, $value, $css_text, $extra_param_for, $simple) . '</div>'; return $html_code; }
/** * this function write a gui line for answer insertion,projected for modify * * @param int $i indicate the line number * @return nothing * * @access private * @author Fabio Pirovano (fabio@docebo.com) */ function _lineModAnswer($i) { $lang =& DoceboLanguage::createInstance('test'); $GLOBALS['page']->add('<tr class="line_answer">' . '<td class="access-only valign_top align_center">' . '<input type="hidden" name="elem_a_id[' . $i . ']" value="' . (isset($_POST['elem_a_id'][$i]) ? $_POST['elem_a_id'][$i] : 0) . '">' . '<label for="elem_a_' . $i . '">' . $lang->def('_TEST_QUEST_ELEM') . ': ' . ($i + 1) . '</label>' . '</td>' . '<td class="image">' . loadHtmlEditor('', 'elem_a_' . $i, 'elem_a[' . $i . ']', isset($_POST['elem_a'][$i]) ? stripslashes($_POST['elem_a'][$i]) : '', false, '', true) . '</td>' . '<td class="access-only valign_top align_center">' . '<input type="hidden" name="elem_b_id[' . $i . ']" value="' . (isset($_POST['elem_b_id'][$i]) ? $_POST['elem_b_id'][$i] : 0) . '">' . '<label for="elem_b_' . $i . '">' . $lang->def('_TEST_QUEST_ELEM') . ': ' . ($i + 1) . '</label>' . '</td>' . '<td class="image">' . '<textarea class="test_area_answer" id="elem_b_' . $i . '" name="elem_b[' . $i . ']" cols="19" rows="3">' . (isset($_POST['elem_b'][$i]) ? stripslashes($_POST['elem_b'][$i]) : '') . '</textarea>' . '</td>' . '</tr>' . "\n", 'content'); }