From ecf24659ef6520da4d3f4cdba1c32a179990bbcf Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Thu, 23 Jun 2016 10:31:37 +0200 Subject: [PATCH] Allow add question if force_edit_exercise_in_lp = true see BT#11315 --- main/exercise/question.class.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/main/exercise/question.class.php b/main/exercise/question.class.php index 82c93746bc..486c7dd7eb 100755 --- a/main/exercise/question.class.php +++ b/main/exercise/question.class.php @@ -1362,7 +1362,7 @@ abstract class Question public function get_question_type_name() { $key = self::$questionTypes[$this->type]; - + return get_lang($key[1]); } @@ -1615,14 +1615,20 @@ abstract class Question eval('$explanation = get_lang(' . $a_type[1] . '::$explanationLangVar);'); echo '
  • '; echo '
    '; - if ($objExercise->exercise_was_added_in_lp == true) { - $img = pathinfo($img); - $img = $img['filename'] . '_na.' . $img['extension']; - echo Display::return_icon($img, $explanation, null, ICON_SIZE_BIG); - } else { - echo '' . + + + $icon = '' . Display::return_icon($img, $explanation, null, ICON_SIZE_BIG) . ''; + + if ($objExercise->force_edit_exercise_in_lp === false) { + if ($objExercise->exercise_was_added_in_lp == true) { + $img = pathinfo($img); + $img = $img['filename'].'_na.'.$img['extension']; + $icon = Display::return_icon($img, $explanation, null, ICON_SIZE_BIG); + } } + + echo $icon; echo '
    '; echo '
  • '; }