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%;
}
.question_row {
margin-bottom: 40px;
}
.question_row_score .title-score .total{
border: 1px solid #ddd;
border-radius: 5px;
@ -1864,17 +1861,8 @@ div.admin_section h4 {
margin: 0px;
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{
margin: 20px 0px;
margin: 10px 0;
}
.question_row_answer h3.page-header{
font-size: 22px;
@ -6344,7 +6332,7 @@ input[type=checkbox]{
padding: 10px;
}
.question_row_answer .page-header{
margin: 10px 0px;
margin: 10px 0;
}
.question_row_answer h3.page-header{
font-size: 16px;
@ -6400,7 +6388,7 @@ input[type=checkbox]{
display: block;
}
.question_row_answer .page-header{
margin: 10px 0px;
margin: 10px 0;
}
.question_row_answer h3.page-header{
font-size: 16px;

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

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

@ -2250,6 +2250,6 @@ abstract class Question
*/
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>';
}
$exercise_content .= $question_content;
$exercise_content .= Display::panel($question_content);
} // end foreach() block that loops over all questions
}

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

Loading…
Cancel
Save