diff --git a/main/exercice/answer_admin.inc.php b/main/exercice/answer_admin.inc.php index 76c7003696..2bd2b4ca2d 100644 --- a/main/exercice/answer_admin.inc.php +++ b/main/exercice/answer_admin.inc.php @@ -1135,7 +1135,7 @@ if($modifyAnswers) -    +    diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 94a2a60895..94156646b2 100644 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -132,7 +132,7 @@ if ($show == 'result' && $_REQUEST['comments'] == 'update' && ($is_allowedToEdit $emailid = $_GET['emailid']; $test = $_GET['test']; $from = $_SESSION['_user']['mail']; - $from_name = $_SESSION['_user']['firstName'] . " " . $_SESSION['_user']['lastName']; + $from_name = api_get_person_name($_SESSION['_user']['firstName'], $_SESSION['_user']['lastName'], null, PERSON_NAME_EMAIL_ADDRESS); $url = api_get_path(WEB_CODE_PATH) . 'exercice/exercice.php?' . api_get_cidreq() . '&show=result'; $TBL_RECORDING = Database :: get_statistic_table('track_e_attempt_recording'); $total_weighting = $_REQUEST['totalWeighting']; @@ -781,9 +781,9 @@ if (($is_allowedToEdit) and ($origin != 'learnpath')) { $alt = get_lang('ExportWithoutUserFields'); $extra_user_fields = ''; } - //echo ''.Display::return_icon('excel.gif',get_lang('ExportAsCSV')).get_lang('ExportAsCSV').''; - echo '' . Display :: return_icon('excel.gif', get_lang('ExportAsXLS')) . get_lang('ExportAsXLS') . ''; - //echo ''.Display::return_icon('synthese_view.gif',$alt).$alt.''; + //echo ''.Display::return_icon('excel.gif',get_lang('ExportAsCSV')).get_lang('ExportAsCSV').''; + echo '' . Display :: return_icon('excel.gif', get_lang('ExportAsXLS')) . get_lang('ExportAsXLS') . ''; + //echo ''.Display::return_icon('synthese_view.gif',$alt).$alt.''; echo '' . Display :: return_icon('quiz.gif', get_lang('BackToExercisesList')) . get_lang('BackToExercisesList') . ''; echo '
'; echo ''; @@ -1139,14 +1139,14 @@ if ($_configuration['tracking_enabled'] && ($show == 'result')) { $exercise_where_query = 'te.exe_exo_id =ce.id AND '; } - $sql = "SELECT CONCAT(lastname,' ',firstname) as users, ce.title, te.exe_result , + $sql="SELECT ".(api_is_western_name_order() ? "CONCAT(firstname,' ',lastname)" : "CONCAT(lastname,' ',firstname)")." as users, ce.title, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date), te.exe_id, email, UNIX_TIMESTAMP(te.start_date), steps_counter,cuser.user_id,te.exe_duration FROM $TBL_EXERCICES AS ce , $TBL_TRACK_EXERCICES AS te, $TBL_USER AS user,$tbl_course_rel_user AS cuser WHERE user.user_id=cuser.user_id AND te.exe_exo_id = ce.id AND te.status != 'incomplete' AND cuser.user_id=te.exe_user_id AND te.exe_cours_id='" . Database :: escape_string($_cid) . "' AND cuser.status<>1 $user_id_and $session_id_and AND ce.active <>-1 AND orig_lp_id = 0 AND orig_lp_item_id = 0 AND cuser.course_code=te.exe_cours_id ORDER BY users, te.exe_cours_id ASC, ce.title ASC, te.exe_date DESC"; - $hpsql = "SELECT CONCAT(tu.lastname,' ',tu.firstname), tth.exe_name, + $hpsql="SELECT ".(api_is_western_name_order() ? "CONCAT(tu.firstname,' ',tu.lastname)" : "CONCAT(tu.lastname,' ',tu.firstname)").", tth.exe_name, tth.exe_result , tth.exe_weighting, UNIX_TIMESTAMP(tth.exe_date) FROM $TBL_TRACK_HOTPOTATOES tth, $TBL_USER tu WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = '" . Database :: escape_string($_cid) . " $user_id_and ' @@ -1156,7 +1156,7 @@ if ($_configuration['tracking_enabled'] && ($show == 'result')) { // get only this user's results $user_id_and = ' AND te.exe_user_id = ' . Database :: escape_string(api_get_user_id()) . ' '; - $sql = "SELECT CONCAT(lastname,' ',firstname) as users, ce.title, te.exe_result , + $sql="SELECT ".(api_is_western_name_order() ? "CONCAT(firstname,' ',lastname)" : "CONCAT(lastname,' ',firstname)")." as users,ce.title, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date), te.exe_id, email, UNIX_TIMESTAMP(te.start_date), steps_counter,cuser.user_id,te.exe_duration, ce.results_disabled FROM $TBL_EXERCICES AS ce , $TBL_TRACK_EXERCICES AS te, $TBL_USER AS user,$tbl_course_rel_user AS cuser WHERE user.user_id=cuser.user_id AND te.exe_exo_id = ce.id AND te.status != 'incomplete' AND cuser.user_id=te.exe_user_id AND te.exe_cours_id='" . Database :: escape_string($_cid) . "' diff --git a/main/exercice/exercice_history.php b/main/exercice/exercice_history.php index 859e608066..7693a72f72 100755 --- a/main/exercice/exercice_history.php +++ b/main/exercice/exercice_history.php @@ -109,7 +109,7 @@ Display::display_header($nameTools,"Exercise"); $sql = 'SELECT * FROM '.$TBL_EXERCICES; $query = api_sql_query($sql,__FILE__,__LINE__); */ -$sql = "SELECT *, quiz_question.question, CONCAT(firstname,' ',lastname) as full_name FROM $TBL_TRACK_ATTEMPT_RECORDING t,$TBL_USER,$TBL_EXERCICES_QUESTION quiz_question WHERE quiz_question.id = question_id AND user_id = author AND exe_id = '".(int)$_GET['exe_id']."' ORDER BY t.insert_date desc,question ASC"; +$sql = "SELECT *, quiz_question.question, firstname, lastname FROM $TBL_TRACK_ATTEMPT_RECORDING t,$TBL_USER,$TBL_EXERCICES_QUESTION quiz_question WHERE quiz_question.id = question_id AND user_id = author AND exe_id = '".(int)$_GET['exe_id']."' ORDER BY t.insert_date desc,question ASC"; $query = api_sql_query($sql,__FILE__,__LINE__); while($row = Database::fetch_array($query)){ echo ''.$row['insert_date'].''; - echo ''.(empty($row['full_name'])?''.get_lang('OriginalValue').'':$row['full_name']).''; + echo ''.(empty($row['firstname']) && empty($row['lastname']) ? ''.get_lang('OriginalValue').'' : api_get_person_name($row['firstname'], $row['lastname'])).''; echo ''; } diff --git a/main/exercice/exercice_submit.php b/main/exercice/exercice_submit.php index 2f0877245f..88090e808a 100644 --- a/main/exercice/exercice_submit.php +++ b/main/exercice/exercice_submit.php @@ -1100,4 +1100,6 @@ if ($_configuration['live_exercise_tracking'] == true && $exerciseFeedbackType ! if ($origin != 'learnpath') { //so we are not in learnpath tool Display :: display_footer(); +} else { + echo ''; } diff --git a/main/exercice/exercise_result.class.php b/main/exercice/exercise_result.class.php index 202e307559..476828c413 100644 --- a/main/exercice/exercise_result.class.php +++ b/main/exercice/exercise_result.class.php @@ -127,13 +127,13 @@ class ExerciseResult { //get all results (ourself and the others) as an admin should see them //AND exe_user_id <> $_user['user_id'] clause has been removed - $sql="SELECT CONCAT(lastname,' ',firstname),ce.title, te.exe_result , + $sql="SELECT ".(api_is_western_name_order() ? "CONCAT(firstname,' ',lastname)" : "CONCAT(lastname,' ',firstname)").", ce.title, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date),te.exe_id, user.email, user.user_id FROM $TBL_EXERCISES ce , $TBL_TRACK_EXERCISES te, $TBL_USER user WHERE te.exe_exo_id = ce.id AND user_id=te.exe_user_id AND te.exe_cours_id='$cid' ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date ASC"; - $hpsql="SELECT CONCAT(tu.lastname,' ',tu.firstname), tth.exe_name, + $hpsql="SELECT ".(api_is_western_name_order() ? "CONCAT(tu.firstname,' ',tu.lastname)" : "CONCAT(tu.lastname,' ',tu.firstname)").", tth.exe_name, tth.exe_result , tth.exe_weighting, UNIX_TIMESTAMP(tth.exe_date), tu.email, tu.user_id FROM $TBL_TRACK_HOTPOTATOES tth, $TBL_USER tu WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = '".$cid."' diff --git a/main/exercice/exercise_result.php b/main/exercice/exercise_result.php index a37802cb7d..ca335ea68b 100644 --- a/main/exercice/exercise_result.php +++ b/main/exercice/exercise_result.php @@ -135,7 +135,7 @@ $query = "SELECT user_id FROM $main_admin_table LIMIT 1"; //get all admins from $admin_id = Database::result(api_sql_query($query),0,"user_id"); $uinfo = api_get_user_info($admin_id); $from = $uinfo['mail']; -$from_name = $uinfo['firstname'].' '.$uinfo['lastname']; +$from_name = api_get_person_name($uinfo['firstname'], $uinfo['lastname'], null, PERSON_NAME_EMAIL_ADDRESS); $str = $_SERVER['REQUEST_URI']; $url = api_get_path(WEB_CODE_PATH).'exercice/exercice.php?'.api_get_cidreq().'&show=result'; @@ -1111,7 +1111,7 @@ if(count($arrques)>0) {   '.get_lang('StudentName').' - #firstName# #lastName# + '.(api_is_western_name_order() ? '#firstName# #lastName#' : '#lastName# #firstName#').'   '.get_lang('StudentEmail').' @@ -1145,7 +1145,7 @@ if(count($arrques)>0) { $msg1= str_replace("#url#",$url,$msg); $mail_content = $msg1; - $student_name = $_SESSION['_user']['firstName'].' '.$_SESSION['_user']['lastName']; + $student_name = api_get_person_name($_SESSION['_user']['firstName'], $_SESSION['_user']['lastName']); $subject = get_lang('OpenQuestionsAttempted'); $from = api_get_setting('noreply_email_address'); @@ -1157,7 +1157,7 @@ if(count($arrques)>0) { '; $result=api_sql_query($sql,__FILE__,__LINE__); $from = Database::result($result,0,'email'); - $from_name = Database::result($result,0,'firstname').' '.Database::result($result,0,'lastname'); + $from_name = api_get_person_name(Database::result($result,0,'firstname'), Database::result($result,0,'lastname'), null, PERSON_NAME_EMAIL_ADDRESS); } else { $array = explode(' ',$_SESSION['_course']['titular']); $firstname = $array[1]; @@ -1168,7 +1168,7 @@ if(count($arrques)>0) { '; $result=api_sql_query($sql,__FILE__,__LINE__); $from = Database::result($result,0,'email'); - $from_name = Database::result($result,0,'firstname').' '.Database::result($result,0,'lastname'); + $from_name = api_get_person_name(Database::result($result,0,'firstname'), Database::result($result,0,'lastname'), null, PERSON_NAME_EMAIL_ADDRESS); } } api_mail_html($student_name, $to, $subject, $mail_content, $from_name, $from, array('encoding'=>$mycharset,'charset'=>$mycharset)); diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php index e2682004aa..746ee45e8a 100644 --- a/main/exercice/exercise_show.php +++ b/main/exercice/exercise_show.php @@ -453,10 +453,10 @@ if ($show_results == true ) { $status_info=CourseManager::get_user_in_course_status($user_id,$course_code); if (STUDENT==$status_info) { $user_info=api_get_user_info($user_id); - echo $user_info['firstName'].' '.$user_info['lastName']; + echo api_get_person_name($user_info['firstName'], $user_info['lastName']); } elseif(COURSEMANAGER==$status_info && !isset($_GET['user'])) { $user_info=api_get_user_info($user_id); - echo $user_info['firstName'].' '.$user_info['lastName']; + echo api_get_person_name($user_info['firstName'], $user_info['lastName']); } else { echo $user_name; } diff --git a/main/exercice/feedback.php b/main/exercice/feedback.php index db61cad758..5d4e22df5b 100644 --- a/main/exercice/feedback.php +++ b/main/exercice/feedback.php @@ -91,6 +91,6 @@ Display::display_header($nameTools,"Exercise"); $form->display(); echo ""; }?> - + Click Ok to finish