Skip to content

Commit

Permalink
Show user IP on exercise results - refs #7268
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Feb 23, 2015
1 parent 857fc4c commit fec32f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion main/exercice/exercise.class.php
Expand Up @@ -3875,9 +3875,10 @@ function send_notification_for_oral_questions($question_list_answers, $origin, $
* @param array $user_data result of api_get_user_info()
* @param null $start_date
* @param null $duration
* @param string The user IP
* @return string
*/
public function show_exercise_result_header($user_data, $start_date = null, $duration = null)
public function show_exercise_result_header($user_data, $start_date = null, $duration = null, $ip = null)
{
$array = array();

Expand Down Expand Up @@ -3907,6 +3908,10 @@ public function show_exercise_result_header($user_data, $start_date = null, $dur
$array[] = array('title' => get_lang("Duration"), 'content' => $duration);
}

if (!empty($ip)) {
$array[] = array("title" => get_lang("IP"), "content" => $ip);
}

$html = Display::page_header(
Display::return_icon('quiz_big.png', get_lang('Result')).' '.$this->exercise.' : '.get_lang('Result')
);
Expand Down
3 changes: 2 additions & 1 deletion main/exercice/exercise.lib.php
Expand Up @@ -2668,7 +2668,8 @@ function display_question_list_by_attempt($objExercise, $exe_id, $save_user_resu
echo $objExercise->show_exercise_result_header(
$user_info,
api_convert_and_format_date($exercise_stat_info['start_date'], DATE_TIME_FORMAT_LONG),
$exercise_stat_info['duration']
$exercise_stat_info['duration'],
$exercise_stat_info['user_ip']
);
}

Expand Down

0 comments on commit fec32f8

Please sign in to comment.