orden question new fix css

1.10.x
aragonc 11 years ago
parent ddae944ba5
commit 4ae63d2672
  1. 5
      main/exercice/exercice.php
  2. 20
      main/exercice/question_list_admin.inc.php
  3. 56
      main/exercice/unique_answer.class.php
  4. 2
      main/inc/lib/display.lib.php

@ -491,7 +491,7 @@ if (isset($list_ordered) && !empty($list_ordered)) {
} }
$exercise_list = $new_question_list; $exercise_list = $new_question_list;
} }
echo '<div class="table-responsive">';
echo '<table class="'.Display::return_default_table_class().'">'; echo '<table class="'.Display::return_default_table_class().'">';
/* Listing exercises */ /* Listing exercises */
@ -509,7 +509,7 @@ if (!empty($exercise_list)) {
if ($is_allowedToEdit) { if ($is_allowedToEdit) {
$headers = array( $headers = array(
array('name' => get_lang('ExerciseName')), array('name' => get_lang('ExerciseName')),
array('name' => get_lang('QuantityQuestions'), 'params' => array('width' => '100px')), array('name' => get_lang('QuantityQuestions'), 'params' => array('width' => '170px')),
array('name' => get_lang('Actions'), 'params' => array('width' => '180px'))); array('name' => get_lang('Actions'), 'params' => array('width' => '180px')));
} else { } else {
$headers = array( $headers = array(
@ -1031,6 +1031,7 @@ if (isset($attribute['path']) && is_array($attribute['path'])) {
} }
} }
echo '</table>'; echo '</table>';
echo '</div>';
if (empty($exercise_list) && $hotpotatoes_exist == false) { if (empty($exercise_list) && $hotpotatoes_exist == false) {
if ($is_allowedToEdit && $origin != 'learnpath') { if ($is_allowedToEdit && $origin != 'learnpath') {

@ -135,17 +135,21 @@ unset($_SESSION['less_answer']);
// If we are in a test // If we are in a test
$inATest = isset($exerciseId) && $exerciseId > 0; $inATest = isset($exerciseId) && $exerciseId > 0;
if (!$inATest) { if (!$inATest) {
echo "<p class='warning-message'>".get_lang("ChoiceQuestionType")."</p>"; echo "<div class='alert alert-warning'>".get_lang("ChoiceQuestionType")."</div>";
} else { } else {
// Title line // Title line
echo "<div>"; echo "<div class='table-responsive'>";
echo "<div style='font-weight:bold; width:50%; float:left; padding:10px 0px; text-align:center;'><span style='padding-left:50px;'>&nbsp;</span>".get_lang('Questions')."</div>"; echo "<table class='table table-condensed'>";
echo "<div style='font-weight:bold; width:4%; float:left; padding:10px 0px; text-align:center;'>".get_lang('Type')."</div>"; echo "<tr>";
echo "<div style='font-weight:bold; width:22%; float:left; padding:10px 0px; text-align:center;'>".get_lang('Category')."</div>"; echo "<th>" .get_lang('Questions'). "</th>";
echo "<div style='font-weight:bold; width:6%; float:left; padding:10px 0px; text-align:center;'>".get_lang('Difficulty')."</div>"; echo "<th>" .get_lang('Type'). "</th>";
echo "<div style='font-weight:bold; width:4%; float:left; padding:10px 0px; text-align:center;'>".get_lang('Score')."</div>"; echo "<th>" .get_lang('Category'). "</th>";
echo "<th>" .get_lang('Difficulty'). "</th>";
echo "<th>" .get_lang('Score'). "</th>";
echo "</tr>";
echo "</table>";
echo "</div>"; echo "</div>";
echo "<div style='clear:both'>&nbsp;</div>";
echo '<div id="question_list">'; echo '<div id="question_list">';
if ($nbrQuestions) { if ($nbrQuestions) {

@ -215,22 +215,20 @@ class UniqueAnswer extends Question
' value = "' . $i . '"' ' value = "' . $i . '"'
); );
$answer_number->freeze(); $answer_number->freeze();
$form->addHtml('<div class="row">');
$form->addHtml('<div class="col-md-1">');
$form->addElement( $form->addElement(
'radio', 'radio',
'correct', 'correct',
null, null,
null, null,
$i, $i,
'class="checkbox" style="margin-left: 0em;"' 'class="checkbox"'
);
$form->addElement(
'html_editor',
'answer[' . $i . ']',
null,
'style="vertical-align:middle"',
$editor_config
); );
$form->addHtml('</div>');
$form->addHtml('<div class="col-md-5">');
$form->addHtmlEditor('answer[' . $i . ']',null,null,true, $editor_config);
$form->addHtml('</div>');
$form->addRule( $form->addRule(
'answer[' . $i . ']', 'answer[' . $i . ']',
@ -239,13 +237,9 @@ class UniqueAnswer extends Question
); );
if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {
$form->addElement( $form->addHtml('<div class="col-md-5">');
'html_editor', $form->addHtmlEditor('comment[' . $i . ']',null,null,false,$editor_config);
'comment[' . $i . ']', $form->addHtml('</div>');
null,
'style="vertical-align:middle"',
$editor_config
);
// Direct feedback // Direct feedback
//Adding extra feedback fields //Adding extra feedback fields
@ -273,7 +267,7 @@ class UniqueAnswer extends Question
'url' . $i, 'url' . $i,
get_lang('Other') . ': ', get_lang('Other') . ': ',
array( array(
'class' => 'span2', 'class' => 'col-md-2',
'placeholder' => get_lang('Other') 'placeholder' => get_lang('Other')
) )
); );
@ -285,20 +279,12 @@ class UniqueAnswer extends Question
); );
} else { } else {
$form->addElement( $form->addHtml('<div class="col-md-5">');
'html_editor', $form->addHtmlEditor('comment[' . $i . ']',null,null,false,$editor_config);
'comment[' . $i . ']', $form->addHtml('</div>');
null,
'style="vertical-align:middle"',
$editor_config
);
} }
$form->addElement( $form->addHtml('</div>');
'text', $form->addText('weighting[' . $i . ']', null,null, array('class' => "col-md-1", 'value' => '0'));
'weighting[' . $i . ']',
null,
array('class' => "span1", 'value' => '0')
);
$form->addElement('html', '</tr>'); $form->addElement('html', '</tr>');
} }
@ -316,13 +302,13 @@ class UniqueAnswer extends Question
'submit', 'submit',
'lessAnswers', 'lessAnswers',
get_lang('LessAnswer'), get_lang('LessAnswer'),
'class="btn minus"' 'class="btn btn-primary"'
); );
$form->addElement( $form->addElement(
'submit', 'submit',
'moreAnswers', 'moreAnswers',
get_lang('PlusAnswer'), get_lang('PlusAnswer'),
'class="btn plus"' 'class="btn btn-primary"'
); );
$form->addElement( $form->addElement(
'submit', 'submit',
@ -336,13 +322,13 @@ class UniqueAnswer extends Question
'style_submit_button', 'style_submit_button',
'lessAnswers', 'lessAnswers',
get_lang('LessAnswer'), get_lang('LessAnswer'),
'class="btn minus"' 'class="btn btn-primary"'
); );
$form->addElement( $form->addElement(
'style_submit_button', 'style_submit_button',
'moreAnswers', 'moreAnswers',
get_lang('PlusAnswer'), get_lang('PlusAnswer'),
'class="btn plus"' 'class="btn btn-primary"'
); );
$form->addElement( $form->addElement(
'style_submit_button', 'style_submit_button',
@ -356,7 +342,7 @@ class UniqueAnswer extends Question
$renderer->setElementTemplate('{element}&nbsp;', 'lessAnswers'); $renderer->setElementTemplate('{element}&nbsp;', 'lessAnswers');
$renderer->setElementTemplate('{element}&nbsp;', 'moreAnswers'); $renderer->setElementTemplate('{element}&nbsp;', 'moreAnswers');
$form->addElement('html', '</div></div>'); $form->addHtml('</div></div>');
// We check the first radio button to be sure a radio button will be check // We check the first radio button to be sure a radio button will be check
if ($correct == 0) { if ($correct == 0) {

@ -1654,7 +1654,7 @@ class Display
public static function return_default_table_class() public static function return_default_table_class()
{ {
return 'data_table'; return 'table table-bordered';
} }
/** /**

Loading…
Cancel
Save