Bug #3646 and Issue #306 - Tests tool: Fixing person name order to be dependable on the internationalization settings, other minor corrections.

skala
Ivan Tcholakov 17 years ago
parent d7ac1ce93b
commit bc7b463083
  1. 2
      main/exercice/answer_admin.inc.php
  2. 14
      main/exercice/exercice.php
  3. 4
      main/exercice/exercice_history.php
  4. 2
      main/exercice/exercice_submit.php
  5. 4
      main/exercice/exercise_result.class.php
  6. 10
      main/exercice/exercise_result.php
  7. 4
      main/exercice/exercise_show.php
  8. 2
      main/exercice/feedback.php

@ -1135,7 +1135,7 @@ if($modifyAnswers)
<tr>
<td colspan="2">
<input type="submit" name="buttonBack" value="&lt; <?php echo get_lang('Back'); ?>">
&nbsp;&nbsp;<input type="submit" name="submitAnswers" value="<?php echo get_lang('Ok'); ?>">
&nbsp;&nbsp;<input type="submit" name="submitAnswers" value="<?php echo ' '.get_lang('Ok').' '; ?>">
<!-- &nbsp;&nbsp;<input type="submit" name="cancelAnswers" value="<?php echo get_lang('Cancel'); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)); ?>')) return false;"> //-->
</td>
</tr>

@ -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 = '<input type="hidden" name="export_user_fields" value="do_not_export_user_fields">';
}
//echo '<a href="#" onclick="document.form1a.submit();">'.Display::return_icon('excel.gif',get_lang('ExportAsCSV')).get_lang('ExportAsCSV').'</a>';
echo '<a href="#" onclick="document.form1b.submit();">' . Display :: return_icon('excel.gif', get_lang('ExportAsXLS')) . get_lang('ExportAsXLS') . '</a>';
//echo '<a href="#" onclick="document.form1c.submit();">'.Display::return_icon('synthese_view.gif',$alt).$alt.'</a>';
//echo '<a href="javascript: void(0);" onclick="javascript: document.form1a.submit();">'.Display::return_icon('excel.gif',get_lang('ExportAsCSV')).get_lang('ExportAsCSV').'</a>';
echo '<a href="javascript: void(0);" onclick="javascript: document.form1b.submit();">' . Display :: return_icon('excel.gif', get_lang('ExportAsXLS')) . get_lang('ExportAsXLS') . '</a>';
//echo '<a href="javascript: void(0);" onclick="javascript: document.form1c.submit();">'.Display::return_icon('synthese_view.gif',$alt).$alt.'</a>';
echo '<a href="' . api_add_url_param($_SERVER['REQUEST_URI'], 'show=test') . '">' . Display :: return_icon('quiz.gif', get_lang('BackToExercisesList')) . get_lang('BackToExercisesList') . '</a>';
echo '<form id="form1a" name="form1a" method="post" action="' . api_get_self() . '?show=' . Security :: remove_XSS($_GET['show']) . '">';
echo '<input type="hidden" name="export_report" value="export_report">';
@ -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) . "'

@ -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 '<tr';
@ -125,7 +125,7 @@ while($row = Database::fetch_array($query)){
}
echo '<td>'.$row['insert_date'].'</td>';
echo '<td>'.(empty($row['full_name'])?'<i>'.get_lang('OriginalValue').'</i>':$row['full_name']).'</td>';
echo '<td>'.(empty($row['firstname']) && empty($row['lastname']) ? '<i>'.get_lang('OriginalValue').'</i>' : api_get_person_name($row['firstname'], $row['lastname'])).'</td>';
echo '</tr>';
}

@ -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 '</body></html>';
}

@ -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."'

@ -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) {
</tr>
<tr>
<td valign="top">&nbsp;&nbsp;<span class="style10">'.get_lang('StudentName').'</span></td>
<td valign="top" >#firstName# #lastName#</td>
'.(api_is_western_name_order() ? '<td valign="top" >#firstName# #lastName#</td>' : '<td valign="top" >#lastName# #firstName#</td>').'
</tr>
<tr>
<td valign="top" >&nbsp;&nbsp;'.get_lang('StudentEmail').' </td>
@ -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));

@ -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;
}

@ -91,6 +91,6 @@ Display::display_header($nameTools,"Exercise");
$form->display();
echo "</td>";
}?>
<form name="frm" action="#" method="post">
<form name="frm" action="javascript: void(0);" method="post">
Click Ok to finish <input type="submit" value="Ok" />
</form>

Loading…
Cancel
Save