diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php index c331510c60..51a8f926f4 100644 --- a/main/exercice/exercise.class.php +++ b/main/exercice/exercise.class.php @@ -3278,44 +3278,22 @@ class Exercise { } function show_exercise_result_header($user_data, $date = null) { - $description = ''; + $array = array(); + + if (!empty($user_data)) { + $array[] = array('title' => get_lang("User"), 'content' => $user_data); + } + if (!empty($this->description)) { - $description = ' - -  '.get_lang("Description").' : - - - '.$this->description.' - - '; - } - $date_data = ''; - if (!empty($date)) { - $date_data = ' - -  '.get_lang("Date").' : - - - '.$date.' - - '; - } - $html = ' - - - - - - - - '.$date_data.' - '.$description.' -
-

'.Display::return_icon('quiz_big.png', get_lang('Result')).' '.$this->exercise.' : '.get_lang('Result').'

-
 '.get_lang('User').' : - '.$user_data.' -
-
'; + $array[] = array('title' => get_lang("Description"), 'content' => $this->description); + } + + if (!empty($date)) { + $array[] = array('title' => get_lang("Date"), 'content' => $date); + } + + $html = Display::page_header(Display::return_icon('quiz_big.png', get_lang('Result')).' '.$this->exercise.' : '.get_lang('Result')); + $html .= Display::description($array); return $html; } diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index 7302810570..cc91248da6 100644 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -1364,10 +1364,27 @@ class Display { return ''; } - public function page_subheader($title) { + public function page_subheader($title, $second_title = null) { + if (!empty($second_title)) { + $second_title = Security::remove_XSS($second_title); + $title .= " $second_title"; + } return ''; } + public function description($list) { + $html = null; + if (!empty($list)) { + $html = '
'; + foreach ($list as $item) { + $html .= '
'.$item['title'].''; + $html .= '
'.$item['content'].''; + } + $html .= '
'; + } + return $html; + } + function bar_progress($percentage, $show_percentage = true, $extra_info = null) { $percentage = intval($percentage); $div = '