From f60a60f5c4bd6623860507995ed53311fdd761ac Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 24 Dec 2012 02:37:25 -0500 Subject: [PATCH] Added IP information to exercise tracking (as info icon) - refs #3987 --- main/exercice/exercise.lib.php | 2 ++ main/exercice/exercise_report.php | 6 +++--- main/inc/lib/tracking.lib.php | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/main/exercice/exercise.lib.php b/main/exercice/exercise.lib.php index 13928775d0..4060a16210 100644 --- a/main/exercice/exercise.lib.php +++ b/main/exercice/exercise.lib.php @@ -1189,6 +1189,8 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex //Admin can always delete the attempt if ($locked == false || api_is_platform_admin()) { + $ip = TrackingUserLog::get_ip_from_user_event($results[$i]['exe_user_id'], $results[$i]['exe_date'], false); + $actions .= ''; $actions .=' '.Display :: return_icon('delete.png', get_lang('Delete')).''; $actions .=' '; } diff --git a/main/exercice/exercise_report.php b/main/exercice/exercise_report.php index 9c8ad72f41..d562f22d43 100644 --- a/main/exercice/exercise_report.php +++ b/main/exercice/exercise_report.php @@ -351,8 +351,8 @@ if ($is_allowedToEdit || $is_tutor) { 'editoptions' => array('value' => $group_parameters)), array('name'=>'duration', 'index'=>'exe_duration', 'width'=>'30', 'align'=>'left', 'search' => 'true'), array('name'=>'start_date', 'index'=>'start_date', 'width'=>'60', 'align'=>'left', 'search' => 'true'), - array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'60', 'align'=>'left', 'search' => 'true'), - array('name'=>'score', 'index'=>'exe_result', 'width'=>'50', 'align'=>'left', 'search' => 'true'), + array('name'=>'exe_date', 'index'=>'exe_date', 'width'=>'60', 'align'=>'left', 'search' => 'true'), + array('name'=>'score', 'index'=>'exe_result', 'width'=>'50', 'align'=>'left', 'search' => 'true'), array('name'=>'status', 'index'=>'revised', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'stype'=>'select', //for the bottom bar 'searchoptions' => array( @@ -482,4 +482,4 @@ $(function() { 0) { $row_ip = Database::fetch_row($res_ip); if ($return_as_link) { - $ip = Display::url($row_ip[1], 'http://www.whatsmyip.org/ip-geo-location/?ip='.$row_ip[1], array('title'=>get_lang('TraceIP'), 'target'=>'_blank')); + $ip = Display::url((empty($body_replace)?$row_ip[1]:$body_replace), 'http://www.whatsmyip.org/ip-geo-location/?ip='.$row_ip[1], array('title'=>get_lang('TraceIP'), 'target'=>'_blank')); } else { $ip = $row_ip[1]; }