Fix error where teacher cannot correct exercise see BT#11759

1.10.x
jmontoyaa 9 years ago
parent 8f5d7dd75c
commit f2cdff586d
  1. 16
      main/exercice/exercise_show.php

@ -1,6 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
/**
* Shows the exercise results
*
@ -12,8 +14,6 @@
*
*/
use ChamiloSession as Session;
require_once '../inc/global.inc.php';
$debug = false;
if (empty($origin)) {
@ -208,7 +208,7 @@ if (!empty($track_exercise_info)) {
if ($result_disabled == RESULT_DISABLE_NO_SCORE_AND_EXPECTED_ANSWERS) {
$show_results = false;
if ($origin != 'learnpath') {
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
/*echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">';
Display::display_warning_message(
@ -217,7 +217,7 @@ if (!empty($track_exercise_info)) {
);
echo '</td>
</tr>
</table>';
</table>';*/
}
} elseif ($result_disabled == RESULT_DISABLE_SHOW_SCORE_ONLY) {
$show_results = false;
@ -262,6 +262,10 @@ if ($origin == 'learnpath' && !isset($_GET['fb_type'])) {
$show_results = false;
}
if ($is_allowedToEdit && in_array($action, ['qualify', 'edit'])) {
$show_results = true;
}
if ($show_results || $show_only_total_score || $showTotalScoreAndUserChoices) {
$user_info = api_get_user_info($student_id);
//Shows exercise header
@ -344,7 +348,6 @@ foreach ($questionList as $questionId) {
$counter = 1;
$exercise_content = null;
$category_list = array();
$useAdvancedEditor = true;
if (!empty($maxEditors) && count($questionList) > $maxEditors) {
@ -352,7 +355,7 @@ if (!empty($maxEditors) && count($questionList) > $maxEditors) {
}
foreach ($questionList as $questionId) {
$choice = $exerciseResult[$questionId];
$choice = isset($exerciseResult[$questionId]) ? $exerciseResult[$questionId] : '';
// destruction of the Question object
unset($objQuestionTmp);
@ -626,7 +629,6 @@ foreach ($questionList as $questionId) {
}
$comnt = null;
if ($show_results) {
if (
$is_allowedToEdit &&

Loading…
Cancel
Save