Fix and improve question result UI - refs BT#12615

pull/2487/head
Angel Fernando Quiroz Campos 8 years ago
parent 09f202ac3b
commit 7707ab76cf
  1. 18
      app/Resources/public/css/base.css
  2. 44
      main/exercise/exercise_show.php
  3. 6
      main/exercise/oral_expression.class.php
  4. 2
      main/exercise/question.class.php
  5. 2
      main/inc/lib/exercise.lib.php
  6. 8
      main/inc/lib/exercise_show_functions.lib.php

@ -1843,9 +1843,6 @@ div.admin_section h4 {
font-size:130%; font-size:130%;
} }
.question_row {
margin-bottom: 40px;
}
.question_row_score .title-score .total{ .question_row_score .title-score .total{
border: 1px solid #ddd; border: 1px solid #ddd;
border-radius: 5px; border-radius: 5px;
@ -1864,17 +1861,8 @@ div.admin_section h4 {
margin: 0px; margin: 0px;
font-size: 22px; font-size: 22px;
} }
.question_row_answer{
padding: 20px;
border: 1px solid #dddddd;
margin-top: 10px;
margin-bottom: 10px;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
.question_row_answer .page-header{ .question_row_answer .page-header{
margin: 20px 0px; margin: 10px 0;
} }
.question_row_answer h3.page-header{ .question_row_answer h3.page-header{
font-size: 22px; font-size: 22px;
@ -6344,7 +6332,7 @@ input[type=checkbox]{
padding: 10px; padding: 10px;
} }
.question_row_answer .page-header{ .question_row_answer .page-header{
margin: 10px 0px; margin: 10px 0;
} }
.question_row_answer h3.page-header{ .question_row_answer h3.page-header{
font-size: 16px; font-size: 16px;
@ -6400,7 +6388,7 @@ input[type=checkbox]{
display: block; display: block;
} }
.question_row_answer .page-header{ .question_row_answer .page-header{
margin: 10px 0px; margin: 10px 0;
} }
.question_row_answer h3.page-header{ .question_row_answer h3.page-header{
font-size: 16px; font-size: 16px;

@ -173,10 +173,9 @@ if ($origin != 'learnpath') {
<script> <script>
var maxEditors = <?php echo intval($maxEditors); ?>; var maxEditors = <?php echo intval($maxEditors); ?>;
function showfck(sid, marksid) { function showfck(sid, marksid) {
document.getElementById(sid).style.display = 'block'; $('#' + sid).toggleClass('hidden');
document.getElementById(marksid).style.display = 'block'; $('#' + marksid).toggleClass('hidden');
var comment = 'feedback_' + sid; $('#feedback_' + sid).toggleClass('hidden', !$('#' + sid).is('.hidden'));
document.getElementById(comment).style.display = 'none';
} }
function openEmailWrapper() { function openEmailWrapper() {
@ -698,33 +697,31 @@ foreach ($questionList as $questionId) {
$url_name = get_lang('AddComments'); $url_name = get_lang('AddComments');
} }
} }
echo '<br />'; echo '<p>';
echo Display::url( echo Display::button(
'show_ck',
$url_name, $url_name,
'javascript://', [
array( 'type' => 'button',
'class' => 'btn', 'class' => 'btn btn-default',
'onclick' => "showfck('".$name."', '".$marksname."');", 'onclick' => "showfck('".$name."', '".$marksname."');",
) ]
); );
echo '<br />'; echo '</p>';
echo '<div id="feedback_'.$name.'" style="width:100%">'; echo '<div id="feedback_'.$name.'" class="show">';
$comnt = trim(Event::get_comments($id, $questionId)); $comnt = trim(Event::get_comments($id, $questionId));
if (empty($comnt)) { if (!empty($comnt)) {
echo '<br />';
} else {
echo ExerciseLib::getFeedbackText($comnt); echo ExerciseLib::getFeedbackText($comnt);
} }
echo '</div>'; echo '</div>';
echo '<div id="'.$name.'" style="display:none">'; echo '<div id="'.$name.'" class="hidden">';
$arrid[] = $questionId; $arrid[] = $questionId;
$feedback_form = new FormValidator('frmcomments'.$questionId, 'post', ''); $feedback_form = new FormValidator('frmcomments'.$questionId);
$feedback_form->addElement('html', '<br>');
$renderer = &$feedback_form->defaultRenderer(); $renderer = &$feedback_form->defaultRenderer();
$renderer->setFormTemplate('<form{attributes}><div align="left">{content}</div></form>'); $renderer->setFormTemplate('<form{attributes}><div>{content}</div></form>');
$renderer->setCustomElementTemplate('<div align="left">{element}</div>'); $renderer->setCustomElementTemplate('<div>{element}</div>');
$comnt = Event::get_comments($id, $questionId); $comnt = Event::get_comments($id, $questionId);
$default = array('comments_'.$questionId => $comnt); $default = array('comments_'.$questionId => $comnt);
@ -743,7 +740,6 @@ foreach ($questionList as $questionId) {
} else { } else {
$feedback_form->addElement('textarea', 'comments_'.$questionId); $feedback_form->addElement('textarea', 'comments_'.$questionId);
} }
$feedback_form->addElement('html', '<br>');
$feedback_form->setDefaults($default); $feedback_form->setDefaults($default);
$feedback_form->display(); $feedback_form->display();
echo '</div>'; echo '</div>';
@ -760,7 +756,7 @@ foreach ($questionList as $questionId) {
if ($is_allowedToEdit && $isFeedbackAllowed) { if ($is_allowedToEdit && $isFeedbackAllowed) {
if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION, ANNOTATION))) { if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION, ANNOTATION))) {
$marksname = "marksName".$questionId; $marksname = "marksName".$questionId;
echo '<div id="'.$marksname.'" style="display:none">'; echo '<div id="'.$marksname.'" class="hidden">';
echo '<form name="marksform_'.$questionId.'" method="post" action="">'; echo '<form name="marksform_'.$questionId.'" method="post" action="">';
$arrmarks[] = $questionId; $arrmarks[] = $questionId;
echo get_lang("AssignMarks"); echo get_lang("AssignMarks");
@ -778,7 +774,7 @@ foreach ($questionList as $questionId) {
} else { } else {
$arrmarks[] = $questionId; $arrmarks[] = $questionId;
echo ' echo '
<div id="'.$marksname.'" style="display:none"> <div id="'.$marksname.'" class="hidden">
<form name="marksform_'.$questionId.'" method="post" action=""> <form name="marksform_'.$questionId.'" method="post" action="">
<select name="marks" id="marks" style="display:none;"> <select name="marks" id="marks" style="display:none;">
<option>'.$questionScore.'</option> <option>'.$questionScore.'</option>
@ -879,7 +875,7 @@ foreach ($questionList as $questionId) {
$counter++; $counter++;
$question_content .= $contents; $question_content .= $contents;
$question_content .= '</div>'; $question_content .= '</div>';
$exercise_content .= $question_content; $exercise_content .= Display::panel($question_content);
} // end of large foreach on questions } // end of large foreach on questions
$total_score_text = null; $total_score_text = null;

@ -71,14 +71,8 @@ class OralExpression extends Question
$score['revised'] = $this->isQuestionWaitingReview($score); $score['revised'] = $this->isQuestionWaitingReview($score);
$header = parent::return_header($exercise, $counter, $score); $header = parent::return_header($exercise, $counter, $score);
$header .= '<table class="'.$this->question_table_class.'"> $header .= '<table class="'.$this->question_table_class.'">
<tr>
<th>&nbsp;</th>
</tr>
<tr> <tr>
<th>'.get_lang("Answer").'</th> <th>'.get_lang("Answer").'</th>
</tr>
<tr>
<th>&nbsp;</th>
</tr>'; </tr>';
return $header; return $header;

@ -2250,6 +2250,6 @@ abstract class Question
*/ */
public function returnFormatFeedback() public function returnFormatFeedback()
{ {
return '<br /><br />'.Display::return_message($this->feedback, 'normal', false); return Display::return_message($this->feedback, 'normal', false);
} }
} }

@ -3906,7 +3906,7 @@ HOTSPOT;
$question_content .= '</div>'; $question_content .= '</div>';
} }
$exercise_content .= $question_content; $exercise_content .= Display::panel($question_content);
} // end foreach() block that loops over all questions } // end foreach() block that loops over all questions
} }

@ -51,7 +51,7 @@ class ExerciseShowFunctions
?> ?>
<tr> <tr>
<td> <td>
<?php echo nl2br(Security::remove_XSS($answerHTML, COURSEMANAGERLOWSECURITY)); ?> <?php echo Security::remove_XSS($answerHTML, COURSEMANAGERLOWSECURITY); ?>
</td> </td>
<?php <?php
@ -125,7 +125,7 @@ class ExerciseShowFunctions
if (!empty($answer)) { if (!empty($answer)) {
echo '<tr><td>'; echo '<tr><td>';
echo nl2br(Security::remove_XSS($answer)); echo Security::remove_XSS($answer);
echo '</td></tr>'; echo '</td></tr>';
} }
@ -159,7 +159,7 @@ class ExerciseShowFunctions
if (empty($id)) { if (empty($id)) {
echo '<tr>'; echo '<tr>';
echo Display::tag('td', nl2br(Security::remove_XSS($answer)), array('width'=>'55%')); echo Display::tag('td', Security::remove_XSS($answer), array('width'=>'55%'));
echo '</tr>'; echo '</tr>';
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
echo '<tr>'; echo '<tr>';
@ -172,7 +172,7 @@ class ExerciseShowFunctions
echo '<tr>'; echo '<tr>';
echo '<td>'; echo '<td>';
if (!empty($answer)) { if (!empty($answer)) {
echo nl2br(Security::remove_XSS($answer)); echo Security::remove_XSS($answer);
} }
echo '</td>'; echo '</td>';

Loading…
Cancel
Save