Replace references to "exercice" by "exercise"

1.10.x
Yannick Warnier 10 years ago
parent e9f3d1ae28
commit d05b2c2785
  1. 10
      main/exercice/Hpdownload.php
  2. 10
      main/exercice/TestCategory.php
  3. 14
      main/exercice/addlimits.php
  4. 8
      main/exercice/admin.php
  5. 6
      main/exercice/adminhp.php
  6. 2
      main/exercice/aiken.php
  7. 4
      main/exercice/exercice.php
  8. 28
      main/exercice/exercise.class.php
  9. 4
      main/exercice/exercise_admin.php
  10. 79
      main/exercice/exercise_history.php
  11. 4
      main/exercice/exercise_reminder.php
  12. 14
      main/exercice/exercise_report.php
  13. 6
      main/exercice/exercise_result.php
  14. 16
      main/exercice/exercise_show.php
  15. 12
      main/exercice/exercise_submit.php
  16. 2
      main/exercice/export/aiken/aiken_import.inc.php
  17. 2
      main/exercice/export/exercise_import.php
  18. 4
      main/exercice/feedback.php
  19. 6
      main/exercice/hotpotatoes.php
  20. 12
      main/exercice/hotpotatoes_exercise_report.php
  21. 2
      main/exercice/index.html
  22. 2
      main/exercice/live_stats.php
  23. 8
      main/exercice/mark_free_answer.php
  24. 2
      main/exercice/overview.php
  25. 6
      main/exercice/qti2.php
  26. 43
      main/exercice/question.class.php
  27. 24
      main/exercice/question_create.php
  28. 56
      main/exercice/question_pool.php
  29. 2
      main/exercice/result.php
  30. 2
      main/exercice/savescores.php
  31. 2
      main/exercice/showinframes.php
  32. 2
      main/exercice/stats.php
  33. 2
      main/exercice/testheaderpage.php
  34. 4
      main/exercice/tests_category.php
  35. 6
      main/exercice/upload_exercise.php
  36. 2
      main/inc/lib/tracking.lib.php
  37. 4
      main/mySpace/myStudents.php

@ -97,11 +97,11 @@ if ($content_type == 'text/html') {
*/
$exercicePath = api_get_self();
$exfile = explode('/',$exercicePath);
$exercisePath = api_get_self();
$exfile = explode('/',$exercisePath);
$exfile = $exfile[sizeof($exfile)-1];
$exercicePath = substr($exercicePath,0,strpos($exercicePath,$exfile));
$exercicePath = $exercicePath;
$exercisePath = substr($exercisePath,0,strpos($exercisePath,$exfile));
$exercisePath = $exercisePath;
$content = $file_content;
$mit = "function Finish(){";
@ -114,7 +114,7 @@ if ($content_type == 'text/html') {
" SaveScoreVariable = 1;\n".
" if (C.ie)\n".
" {\n".
" document.location.href = \"".$exercicePath."savescores.php?origin=$origin&time=$time&test=".$doc_url."&uid=".$_user['user_id']."&cid=".$cid."&score=\"+Score;\n".
" document.location.href = \"".$exercisePath."savescores.php?origin=$origin&time=$time&test=".$doc_url."&uid=".$_user['user_id']."&cid=".$cid."&score=\"+Score;\n".
" //window.alert(Score);\n".
" }\n".
" else\n".

@ -404,15 +404,15 @@ class TestCategory
* tabres[24] = array of question id with category id = 24
* In this version, a question has 0 or 1 category
*/
public static function getQuestionsByCat($in_exerciceId)
public static function getQuestionsByCat($in_exerciseId)
{
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCISE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_QUESTION_REL_CATEGORY = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
$in_exerciceId = intval($in_exerciceId);
$in_exerciseId = intval($in_exerciseId);
$sql = "SELECT qrc.question_id, qrc.category_id
FROM $TBL_QUESTION_REL_CATEGORY qrc, $TBL_EXERCICE_QUESTION eq
FROM $TBL_QUESTION_REL_CATEGORY qrc, $TBL_EXERCISE_QUESTION eq
WHERE
exercice_id=$in_exerciceId AND
exercice_id=$in_exerciseId AND
eq.question_id=qrc.question_id AND
eq.c_id=".api_get_course_int_id()." AND
eq.c_id=qrc.c_id

@ -78,9 +78,9 @@ if (!empty($gradebook) && $gradebook=='view') {
'name' => get_lang('ToolGradebook')
);
}
$nameTools=get_lang('Exercice');
$interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
Display::display_header($nameTools,"Exercise");
$nameTools=get_lang('Exercises');
$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises'));
Display::display_header($nameTools,"Exercises");
if (isset($_POST['ok'])) {
$message = get_lang('TestLimitsAdded');
@ -156,19 +156,19 @@ if (isset($_POST['ok'])) {
$exercise_id = intval($_POST['exe_id']);
if ($_POST['limit']==1) {
$minutes = intval($_POST['minutes']);
$query = "UPDATE ".$TBL_EXERCICES." SET ques_time_limit= $minutes WHERE id= $exercise_id";
$query = "UPDATE ".$TBL_EXERCISES." SET ques_time_limit= $minutes WHERE id= $exercise_id";
Database::query($query);
} else {
$query = "UPDATE ".$TBL_EXERCICES." SET ques_time_limit= 0 WHERE id= $exercise_id";
$query = "UPDATE ".$TBL_EXERCISES." SET ques_time_limit= 0 WHERE id= $exercise_id";
Database::query($query);
}
if ($_POST['attempt']==1) {
$attempts = intval($_POST['attempts']);
$query = "UPDATE ".$TBL_EXERCICES." SET num_attempts = $attempts WHERE id= $exercise_id";
$query = "UPDATE ".$TBL_EXERCISES." SET num_attempts = $attempts WHERE id= $exercise_id";
Database::query($query);
} else {
$query = "UPDATE ".$TBL_EXERCICES." SET num_attempts = 0 WHERE id= $exercise_id";
$query = "UPDATE ".$TBL_EXERCISES." SET num_attempts = 0 WHERE id= $exercise_id";
Database::query($query);
}
}

@ -186,7 +186,7 @@ if (!is_object($objExercise)) {
// Exercise can be edited in their course.
if ($objExercise->sessionId != $sessionId) {
api_not_allowed(true);
/*header('Location: '.api_get_path(WEB_CODE_PATH).'exercice/exercice.php?'.api_get_cidreq());
/*header('Location: '.api_get_path(WEB_CODE_PATH).'exercice/exercise.php?'.api_get_cidreq());
exit;*/
}
@ -230,7 +230,7 @@ if ($cancelExercise) {
} else {
// new exercise
// goes back to the exercise list
header('Location: '.api_get_path(WEB_CODE_PATH).'exercice/exercice.php?'.api_get_cidreq());
header('Location: '.api_get_path(WEB_CODE_PATH).'exercice/exercise.php?'.api_get_cidreq());
exit();
}
}
@ -292,7 +292,7 @@ if (!empty($gradebook) && $gradebook=='view') {
);
}
$interbreadcrumb[] = array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
if (isset($_GET['newQuestion']) || isset($_GET['editQuestion']) ) {
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name);
} else {
@ -469,7 +469,7 @@ if ($inATest) {
Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) && !isset($_GET['editQuestion'])) {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/exercice.php?'.api_get_cidReq().'">'.
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/exercise.php?'.api_get_cidReq().'">'.
Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
}
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/overview.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&preview=1">'.

@ -12,7 +12,7 @@ $this_section=SECTION_COURSES;
if (isset($_REQUEST["cancel"])) {
if ($_REQUEST["cancel"]==get_lang('Cancel')) {
header("Location: exercice.php");
header("Location: exercise.php");
}
}
@ -47,7 +47,7 @@ if (!empty($gradebook) && $gradebook=='view') {
);
}
$interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises'));
$nameTools = get_lang('adminHP');
@ -67,7 +67,7 @@ if (isset($newName)) {
if ($newName!="") {
//alter database record for that test
SetComment($hotpotatoesName,$newName);
echo "<script language='Javascript' type='text/javascript'> window.location='exercice.php'; </script>";
echo "<script language='Javascript' type='text/javascript'> window.location='exercise.php'; </script>";
}
}

@ -27,7 +27,7 @@ if (!api_is_allowed_to_edit(null, true)) {
}
// the breadcrumbs
$interbreadcrumb[]= array ("url"=>"exercice.php", "name"=> get_lang('Exercices'));
$interbreadcrumb[]= array ("url"=>"exercise.php", "name"=> get_lang('Exercises'));
$is_allowedToEdit = api_is_allowed_to_edit(null, true);

@ -1,8 +1,8 @@
<?php
// This file serves the only purpose of maintaining backwards compatibility
// with previous content of Chamilo that might have pointed directly to
// exercice.php as it was called before.
// The *previous* exercice.php was renamed to exercise.php, which is the file
// exercise.php as it was called before.
// The *previous* exercise.php was renamed to exercise.php, which is the file
// included here. All new links to the main exercises page should point
// directly to exercise.php. This redirection is enabled for 1.10.x (2015-04-21)
// The final goal of this file is to be removed in a few years time, if

@ -95,14 +95,14 @@ class Exercise
public function read($id)
{
global $_configuration;
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
$table_lp_item = Database::get_course_table(TABLE_LP_ITEM);
$id = intval($id);
if (empty($this->course_id)) {
return false;
}
$sql = "SELECT * FROM $TBL_EXERCICES WHERE c_id = ".$this->course_id." AND id = ".$id;
$sql = "SELECT * FROM $TBL_EXERCISES WHERE c_id = ".$this->course_id." AND id = ".$id;
$result = Database::query($sql);
// if the exercise has been found
@ -428,11 +428,11 @@ class Exercise
public function selectQuestionList($from_db = false)
{
if ($from_db && !empty($this->id)) {
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCISE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$sql = "SELECT DISTINCT e.question_order
FROM $TBL_EXERCICE_QUESTION e
FROM $TBL_EXERCISE_QUESTION e
INNER JOIN $TBL_QUESTIONS q
ON (e.question_id = q.id AND e.c_id = ".$this->course_id." AND q.c_id = ".$this->course_id.")
WHERE e.exercice_id = ".intval($this->id)."";
@ -441,7 +441,7 @@ class Exercise
$count_question_orders = Database::num_rows($result);
$sql = "SELECT e.question_id, e.question_order
FROM $TBL_EXERCICE_QUESTION e
FROM $TBL_EXERCISE_QUESTION e
INNER JOIN $TBL_QUESTIONS q
ON (e.question_id= q.id AND e.c_id = ".$this->course_id." AND q.c_id = ".$this->course_id.")
WHERE e.exercice_id = ".intval($this->id)."
@ -758,7 +758,7 @@ class Exercise
public function save($type_e = '')
{
$_course = $this->course;
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
$id = $this->id;
$exercise = $this->exercise;
@ -802,7 +802,7 @@ class Exercise
$end_time = '0000-00-00 00:00:00';
}
$sql = "UPDATE $TBL_EXERCICES SET
$sql = "UPDATE $TBL_EXERCISES SET
title='".Database::escape_string($exercise)."',
description='".Database::escape_string($description)."'";
@ -883,11 +883,11 @@ class Exercise
'pass_percentage' => $pass_percentage
];
$this->id = Database::insert($TBL_EXERCICES, $params);
$this->id = Database::insert($TBL_EXERCISES, $params);
if ($this->id) {
$sql = "UPDATE $TBL_EXERCICES SET id = iid WHERE iid = {$this->id} ";
$sql = "UPDATE $TBL_EXERCISES SET id = iid WHERE iid = {$this->id} ";
Database::query($sql);
// insert into the item_property table
@ -1004,8 +1004,8 @@ class Exercise
*/
public function delete()
{
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$sql = "UPDATE $TBL_EXERCICES SET active='-1'
$TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
$sql = "UPDATE $TBL_EXERCISES SET active='-1'
WHERE c_id = ".$this->course_id." AND id = ".intval($this->id)."";
Database::query($sql);
api_item_property_update($this->course, TOOL_QUIZ, $this->id, 'QuizDeleted', api_get_user_id());
@ -1168,7 +1168,7 @@ class Exercise
$form->addElement('select', 'exerciseAttempts',get_lang('ExerciseAttempts'),$attempt_option, array('id'=>'exerciseAttempts','class'=>'chzn-select'));
// Exercice time limit
// Exercise time limit
$form->addElement('checkbox', 'activate_start_date_check',null, get_lang('EnableStartTime'), array('onclick' => 'activate_start_date()'));
$var = Exercise::selectTimeLimit();
@ -2952,7 +2952,7 @@ class Exercise
}
$user_array = substr($user_array,0,-1);
} else {
if ($studentChoice) {
if (!empty($studentChoice)) {
$newquestionList[]=$questionId;
}
@ -4588,7 +4588,7 @@ class Exercise
} else {
if ($this->isRandom()) {
// USE question categories
// get questions by category for this exercice
// get questions by category for this exercise
// we have to choice $objExercise->random question in each array values of $tabCategoryQuestions
// key of $tabCategoryQuestions are the categopy id (0 for not in a category)
// value is the array of question id of this category

@ -131,7 +131,7 @@ if ($form->validate()) {
$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'],'name' => get_lang('ToolGradebook'));
}
$nameTools = get_lang('ExerciseManagement');
$interbreadcrumb[] = array("url"=>'exercice.php', 'name'=> get_lang('Exercices'));
$interbreadcrumb[] = array("url"=>'exercise.php', 'name'=> get_lang('Exercises'));
$interbreadcrumb[] = array("url"=>"admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name);
Display::display_header($nameTools, get_lang('Exercise'));
@ -149,7 +149,7 @@ if ($form->validate()) {
}
echo "<a href=\"../newscorm/lp_controller.php?".api_get_cidreq()."&gradebook=&action=add_item&type=step&lp_id=".$lp_id."#resource_tab-2\">".Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"),'',ICON_SIZE_MEDIUM)."</a>";
} else {
echo '<a href="exercice.php">' . Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="exercise.php">' . Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
}
}
echo '</div>';

@ -1,12 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Exercise list: This script shows the list of exercises for administrators and students.
* @package chamilo.exercise
* @author Olivier Brouckaert, original author
* @author Denes Nagy, HotPotatoes integration
* @author Wolfgang Schneider, code/html cleanup
*/
* Exercise list: This script shows the list of exercises for administrators and students.
* @package chamilo.exercise
* @author Olivier Brouckaert, original author
* @author Denes Nagy, HotPotatoes integration
* @author Wolfgang Schneider, code/html cleanup
*/
/**
* Code
*/
@ -20,27 +20,26 @@ $show=(isset($_GET['show']) && $_GET['show'] == 'result')?'result':'test'; // mo
$is_allowedToEdit = api_is_allowed_to_edit(null,true);
$is_tutor = api_is_allowed_to_edit(true);
if(!$is_allowedToEdit){
header('Location: /main/exercice/exercice.php?cidReq='.Security::remove_XSS($_GET['cidReq']));
exit;
if (!$is_allowedToEdit){
header('Location: /main/exercice/exercise.php?cidReq='.Security::remove_XSS($_GET['cidReq']));
exit;
}
$interbreadcrumb[]= array ('url' => 'exercise_report.php','name' => get_lang('Exercices'));
$interbreadcrumb[]= array ('url' => 'exercise_report.php','name' => get_lang('Exercises'));
$interbreadcrumb[]= array ('url' => 'exercise_report.php'.'?filter=2','name' => get_lang('StudentScore'));
$interbreadcrumb[]= array ('url' => 'exercise_history.php'.'?exe_id='.intval($_GET['exe_id']), 'name' => get_lang('Details'));
$TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_EXERCICES_QUESTION = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_EXERCISES_QUESTION = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_ATTEMPT_RECORDING= Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
Display::display_header($nameTools,get_lang('Exercise'));
if (isset($_GET['message'])) {
if (in_array($_GET['message'], array('ExerciseEdited'))) {
$my_message_history=Security::remove_XSS($_GET['message']);
Display::display_confirmation_message(get_lang($my_message_history));
}
if (in_array($_GET['message'], array('ExerciseEdited'))) {
$my_message_history=Security::remove_XSS($_GET['message']);
Display::display_confirmation_message(get_lang($my_message_history));
}
}
echo '<div class="actions">';
@ -50,32 +49,36 @@ echo '</div>';
?>
<table class="data_table">
<tr class="row_odd">
<th><?php echo get_lang('Question'); ?></th>
<th width="50px"><?php echo get_lang('Value'); ?></th>
<th><?php echo get_lang('Feedback'); ?></th>
<th><?php echo get_lang('Author'); ?></th>
<th width="160px"><?php echo get_lang('Date'); ?></th>
</tr>
<tr class="row_odd">
<th><?php echo get_lang('Question'); ?></th>
<th width="50px"><?php echo get_lang('Value'); ?></th>
<th><?php echo get_lang('Feedback'); ?></th>
<th><?php echo get_lang('Author'); ?></th>
<th width="160px"><?php echo get_lang('Date'); ?></th>
</tr>
<?php
$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 position";
$sql = "SELECT *, quiz_question.question, firstname, lastname FROM $TBL_TRACK_ATTEMPT_RECORDING t, $TBL_USER,$TBL_EXERCISES_QUESTION quiz_question
WHERE quiz_question.id = question_id AND user_id = author AND exe_id = '".(int)$_GET['exe_id']."' ORDER BY position";
$query = Database::query($sql);
while($row = Database::fetch_array($query)){
echo '<tr';
if($i%2==0) echo 'class="row_odd"'; else echo 'class="row_even"';
echo '>';
echo '<td>'.$row['question'].'</td>';
echo '<td>'.$row['marks'].'</td>';
if(!empty($row['teacher_comment'])){
echo '<td>'.$row['teacher_comment'].'</td>';
} else {
echo '<td>'.get_lang('WithoutComment').'</td>';
}
echo '<tr';
if ($i%2==0) {
echo 'class="row_odd"';
} else {
echo 'class="row_even"';
}
echo '>';
echo '<td>'.$row['question'].'</td>';
echo '<td>'.$row['marks'].'</td>';
if (!empty($row['teacher_comment'])) {
echo '<td>'.$row['teacher_comment'].'</td>';
} else {
echo '<td>'.get_lang('WithoutComment').'</td>';
}
echo '<td>'.(empty($row['firstname']) && empty($row['lastname']) ? '<i>'.get_lang('OriginalValue').'</i>' : api_get_person_name($row['firstname'], $row['lastname'])).'</td>';
echo '<td>'.api_convert_and_format_date($row['insert_date'], DATE_TIME_FORMAT_LONG).'</td>';
echo '<td>'.api_convert_and_format_date($row['insert_date'], DATE_TIME_FORMAT_LONG).'</td>';
echo '</tr>';
}
}
echo '</table>';
Display::display_footer();

@ -102,8 +102,8 @@ if (empty($exercise_stat_info) || empty($question_list)) {
api_not_allowed();
}
$nameTools = get_lang('Exercice');
$interbreadcrumb[] = array("url" => "exercice.php?".api_get_cidreq(), "name" => get_lang('Exercices'));
$nameTools = get_lang('Exercises');
$interbreadcrumb[] = array("url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises'));
if ($origin != 'learnpath') {
//so we are not in learnpath tool

@ -36,7 +36,7 @@ $is_allowedToEdit = api_is_allowed_to_edit(null, true) || api_is_drh() || api_is
$is_tutor = api_is_allowed_to_edit(true);
$TBL_QUESTIONS = Database :: get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCICES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_EXERCISES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_ATTEMPT = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$TBL_TRACK_ATTEMPT_RECORDING = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
$TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
@ -199,7 +199,7 @@ if (isset($_REQUEST['comments']) &&
$tot += $row['marks'];
}
$sql = "UPDATE $TBL_TRACK_EXERCICES SET exe_result = '".floatval($tot)."'
$sql = "UPDATE $TBL_TRACK_EXERCISES SET exe_result = '".floatval($tot)."'
WHERE exe_id = ".$id;
Database::query($sql);
@ -235,7 +235,7 @@ if (isset($_REQUEST['comments']) &&
Database::query($sql);
if ($origin == 'tracking_course') {
//Redirect to the course detail in lp
header('location: exercice.php?course='.Security :: remove_XSS($_GET['course']));
header('location: exercise.php?course='.Security :: remove_XSS($_GET['course']));
exit;
} else {
//Redirect to the reporting
@ -274,7 +274,7 @@ if ($is_allowedToEdit && $origin != 'learnpath') {
);
}
} else {
$actions .= '<a href="exercice.php">'.Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
$actions .= '<a href="exercise.php">'.Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
}
//Deleting an attempt
@ -284,7 +284,7 @@ if (($is_allowedToEdit || $is_tutor || api_is_coach()) &&
) {
$exe_id = intval($_GET['did']);
if (!empty($exe_id)) {
$sql = 'DELETE FROM '.$TBL_TRACK_EXERCICES.' WHERE exe_id = '.$exe_id;
$sql = 'DELETE FROM '.$TBL_TRACK_EXERCISES.' WHERE exe_id = '.$exe_id;
Database::query($sql);
$sql = 'DELETE FROM '.$TBL_TRACK_ATTEMPT.' WHERE exe_id = '.$exe_id;
Database::query($sql);
@ -296,13 +296,13 @@ if (($is_allowedToEdit || $is_tutor || api_is_coach()) &&
if ($is_allowedToEdit || $is_tutor) {
$nameTools = get_lang('StudentScore');
$interbreadcrumb[] = array("url" => "exercice.php?gradebook=$gradebook", "name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercise.php?gradebook=$gradebook", "name" => get_lang('Exercises'));
$objExerciseTmp = new Exercise();
if ($objExerciseTmp->read($exercise_id)) {
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name);
}
} else {
$interbreadcrumb[] = array("url" => "exercice.php?gradebook=$gradebook", "name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercise.php?gradebook=$gradebook", "name" => get_lang('Exercises'));
$objExerciseTmp = new Exercise();
if ($objExerciseTmp->read($exercise_id)) {
$nameTools = get_lang('Results').': '.$objExerciseTmp->name;

@ -62,9 +62,9 @@ if (!empty($gradebook) && $gradebook=='view') {
$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook'));
}
$nameTools = get_lang('Exercice');
$nameTools = get_lang('Exercises');
$interbreadcrumb[]= array("url" => "exercice.php?gradebook=$gradebook","name" => get_lang('Exercices'));
$interbreadcrumb[]= array("url" => "exercise.php?gradebook=$gradebook","name" => get_lang('Exercises'));
if ($origin != 'learnpath') {
// So we are not in learnpath tool
@ -96,7 +96,7 @@ $learnpath_item_view_id = $exercise_stat_info['orig_lp_item_view_id'];
if ($origin == 'learnpath') {
?>
<form method="GET" action="exercice.php?<?php echo api_get_cidreq() ?>">
<form method="GET" action="exercise.php?<?php echo api_get_cidreq() ?>">
<input type="hidden" name="origin" value="<?php echo $origin; ?>" />
<input type="hidden" name="learnpath_id" value="<?php echo $learnpath_id; ?>" />
<input type="hidden" name="learnpath_item_id" value="<?php echo $learnpath_item_id; ?>" />

@ -29,9 +29,9 @@ if ($origin == 'learnpath') {
}
// Database table definitions
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCISE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
// General parameters passed via POST/GET
@ -112,7 +112,7 @@ if (!empty($gradebook) && $gradebook=='view') {
$fromlink = '';
$interbreadcrumb[]= array("url" => "exercice.php?".api_get_cidreq(),"name" => get_lang('Exercices'));
$interbreadcrumb[]= array("url" => "exercise.php?".api_get_cidreq(),"name" => get_lang('Exercises'));
$interbreadcrumb[]= array("url" => "overview.php?exerciseId=".$exercise_id.'&'.api_get_cidreq(),"name" => $objExercise->name);
$interbreadcrumb[]= array("url" => "#","name" => get_lang('Result'));
@ -178,7 +178,7 @@ if (!empty($track_exercise_info)) {
<tr>
<td colspan="2">';
Display::display_warning_message(
get_lang('ThankYouForPassingTheTest').'<br /><br /><a href="exercice.php">'.(get_lang('BackToExercisesList')).'</a>',
get_lang('ThankYouForPassingTheTest').'<br /><br /><a href="exercise.php">'.(get_lang('BackToExercisesList')).'</a>',
false
);
echo '</td>
@ -229,11 +229,11 @@ $arrans = array();
$user_restriction = $is_allowedToEdit ? '' : "AND user_id=".intval($student_id)." ";
$sql = "SELECT attempts.question_id, answer
FROM ".$TBL_TRACK_ATTEMPT." as attempts
INNER JOIN ".$TBL_TRACK_EXERCICES." AS stats_exercices
ON stats_exercices.exe_id=attempts.exe_id
INNER JOIN ".$TBL_EXERCICE_QUESTION." AS quizz_rel_questions
INNER JOIN ".$TBL_TRACK_EXERCISES." AS stats_exercises
ON stats_exercises.exe_id=attempts.exe_id
INNER JOIN ".$TBL_EXERCISE_QUESTION." AS quizz_rel_questions
ON
quizz_rel_questions.exercice_id=stats_exercices.exe_exo_id AND
quizz_rel_questions.exercice_id=stats_exercises.exe_exo_id AND
quizz_rel_questions.question_id = attempts.question_id AND
quizz_rel_questions.c_id=".api_get_course_int_id()."
INNER JOIN ".$TBL_QUESTIONS." AS questions

@ -89,7 +89,7 @@ $currentAnswer = isset($_REQUEST['num_answer']) ? intval($_REQUEST['num_answer']
$error = '';
//Table calls
$exercice_attemp_table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$exercise_attempt_table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
/* Teacher takes an exam and want to see a preview,
we delete the objExercise from the session in order to get the latest
@ -132,7 +132,7 @@ if (!isset($objExercise) && isset($_SESSION['objExercise'])) {
//3. $objExercise is not set, then return to the exercise list
if (!is_object($objExercise)) {
if ($debug) {error_log('3. $objExercise was not set, kill the script'); };
header('Location: exercice.php');
header('Location: exercise.php');
exit;
}
@ -158,7 +158,7 @@ $current_expired_time_key = ExerciseLib::get_time_control_key($objExercise->id,
$_SESSION['duration_time'][$current_expired_time_key] = $current_timestamp;
if ($time_control) {
// Get the expired time of the current exercice in track_e_exercises
// Get the expired time of the current exercise in track_e_exercises
$total_seconds = $objExercise->expired_time*60;
}
@ -369,7 +369,7 @@ if ($time_control) {
// First we update the attempt to today
/* How the expired time is changed into "track_e_exercises" table,
then the last attempt for this student should be changed too */
$sql = "UPDATE $exercice_attemp_table SET
$sql = "UPDATE $exercise_attempt_table SET
tms = '".api_get_utc_datetime()."'
WHERE
exe_id = '".$exercise_stat_info['exe_id']."' AND
@ -623,7 +623,7 @@ if (!empty ($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array ('url' => '../gradebook/' . Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('ToolGradebook'));
}
$interbreadcrumb[] = array ("url" => "exercice.php?".api_get_cidreq(), "name" => get_lang('Exercices'));
$interbreadcrumb[] = array ("url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises'));
$interbreadcrumb[] = array ("url" => "#", "name" => $objExercise->name);
if ($origin != 'learnpath') { //so we are not in learnpath tool
@ -719,7 +719,7 @@ if (isset($_custom['exercises_hidden_when_no_start_date']) &&
//Timer control
if ($time_control) {
echo $objExercise->return_time_left_div();
echo '<div style="display:none" class="warning-message" id="expired-message-id">'.get_lang('ExerciceExpiredTimeMessage').'</div>';
echo '<div style="display:none" class="warning-message" id="expired-message-id">'.get_lang('ExerciseExpiredTimeMessage').'</div>';
}
if (!empty($objExercise->description)) {

@ -38,7 +38,7 @@ function tempdir($dir, $prefix = 'tmp', $mode = 0777) {
function aiken_display_form($msg = '') {
$name_tools = get_lang('ImportAikenQuiz');
$form = '<div class="actions">';
$form .= '<a href="exercice.php?show=test">' . Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
$form .= '<a href="exercise.php?show=test">' . Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
$form .= '</div>';
$form .= $msg;
$form_validator = new FormValidator('aiken_upload', 'post',api_get_self()."?".api_get_cidreq(), null, array('enctype' => 'multipart/form-data') );

@ -33,7 +33,7 @@ $nameTools = get_lang('ImportExercise');
//bredcrump
$interbredcrump[] = array('url' => '../exercice.php', 'name' => get_lang('Exercises'));
$interbredcrump[] = array('url' => '../exercise.php', 'name' => get_lang('Exercises'));
//----------------------------------
// EXECUTE COMMAND

@ -23,8 +23,8 @@ if (!empty($gradebook) && $gradebook=='view') {
);
}
$interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
Display::display_header($nameTools,"Exercise");
$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises'));
Display::display_header($nameTools,"Exercises");
?>
<table border="0" align="center" cellpadding="2" cellspacing="2" width="100%">
<h4>

@ -31,7 +31,7 @@ if (!empty($gradebook) && $gradebook == 'view') {
);
}
// The breadcrumbs.
$interbreadcrumb[] = array('url' => './exercice.php', 'name' => get_lang('Exercices'));
$interbreadcrumb[] = array('url' => './exercise.php', 'name' => get_lang('Exercises'));
$is_allowedToEdit = api_is_allowed_to_edit(null, true);
@ -178,14 +178,14 @@ if ((api_is_allowed_to_edit(null, true)) && (($finish == 0) || ($finish == 2)))
}
}
if ($finish == 1) { /** ok -> send to main exercises page */
header('Location: exercice.php?'.api_get_cidreq());
header('Location: exercise.php?'.api_get_cidreq());
exit;
}
Display::display_header($nameTools, get_lang('Exercise'));
echo '<div class="actions">';
echo '<a href="exercice.php?show=test">'.
echo '<a href="exercise.php?show=test">'.
Display :: return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).
'</a>';
echo '</div>';

@ -32,8 +32,8 @@ $is_allowedToEdit = api_is_allowed_to_edit(null, true) || api_is_drh();
$is_tutor = api_is_allowed_to_edit(true);
$TBL_QUESTIONS = Database :: get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCICES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_HOTPOTATOES_EXERCICES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TBL_TRACK_EXERCISES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_HOTPOTATOES_EXERCISES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
$course_id = api_get_course_int_id();
@ -76,7 +76,7 @@ if ($is_allowedToEdit && $origin != 'learnpath') {
$actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&path='.Security::remove_XSS($hotpotatoes_path).' ">'.Display::return_icon('save.png', get_lang('Export'),'',ICON_SIZE_MEDIUM).'</a>';
}
} else {
$actions .= '<a href="exercice.php">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
$actions .= '<a href="exercise.php">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
}
if ($is_allowedToEdit) {
@ -98,13 +98,13 @@ $nameTools = get_lang('Results');
if ($is_allowedToEdit || $is_tutor) {
$nameTools = get_lang('StudentScore');
$interbreadcrumb[] = array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
$objExerciseTmp = new Exercise();
/*if ($objExerciseTmp->read($exercise_id)) {
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name);
}*/
} else {
$interbreadcrumb[] = array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
$objExerciseTmp = new Exercise();
/*if ($objExerciseTmp->read($exercise_id)) {
$nameTools = get_lang('Results').': '.$objExerciseTmp->name;
@ -139,7 +139,7 @@ $extra = '<script type="text/javascript">
var extra_data = $("input[name=load_extra_data]:checked").val();
location.href = targetUrl+"&export_format="+export_format+"&extra_data="+extra_data;
$( this ).dialog( "close" );
},
}
}
});
$( "#dialog-confirm" ).dialog("open");

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="refresh" content="0; url=exercice.php">
<meta http-equiv="refresh" content="0; url=exercise.php">
</head>
<body>
</body>

@ -20,7 +20,7 @@ if (!$result) {
api_not_allowed(true);
}
$interbreadcrumb[] = array ("url" => "exercice.php?gradebook=$gradebook", "name" => get_lang('Exercices'));
$interbreadcrumb[] = array ("url" => "exercise.php?gradebook=$gradebook", "name" => get_lang('Exercises'));
$interbreadcrumb[] = array ("url" => "admin.php?exerciseId=$exercise_id","name" => $objExercise->name);
//Add the JS needed to use the jqgrid

@ -46,7 +46,7 @@ if(!empty($_POST['action'])){
}
if (empty($my_qst) or empty($my_usr) or empty($my_cid) or empty($my_exe)){
header('Location: exercice.php');
header('Location: exercise.php');
exit();
}
@ -68,9 +68,9 @@ if (!empty($gradebook) && $gradebook=='view') {
);
}
$nameTools=get_lang('Exercice');
$nameTools=get_lang('Exercises');
$interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises'));
$my_msg = 'No change.';
@ -143,7 +143,7 @@ $objAnswerTmp->selectAnswer($answerId);
if($action == 'mark'){
echo $my_msg.'<br />
<a href="exercice.php?cidReq='.$cidReq.'">'.get_lang('Back').'</a>';
<a href="exercise.php?cidReq='.$cidReq.'">'.get_lang('Back').'</a>';
} else {
echo '<h2>'.$obj_question->question .':</h2>
'.$obj_question->selectTitle().'<br /><br />

@ -37,7 +37,7 @@ $learnpath_id = isset($_REQUEST['learnpath_id']) ? intval($_REQUEST['learnpath_i
$learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? intval($_REQUEST['learnpath_item_id']) : null;
$origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : null;
$interbreadcrumb[] = array("url" => "exercice.php?gradebook=$gradebook", "name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercise.php?gradebook=$gradebook", "name" => get_lang('Exercises'));
$interbreadcrumb[] = array("url" => "#", "name" => $objExercise->name);
$time_control = false;

@ -22,8 +22,8 @@ if (!api_is_allowed_to_edit(null, true)) {
// the breadcrumbs
$interbreadcrumb[]= array (
"url" => api_get_path(WEB_CODE_PATH)."exercice/exercice.php?".api_get_cidreq(),
"name" => get_lang('Exercices')
"url" => api_get_path(WEB_CODE_PATH)."exercice/exercise.php?".api_get_cidreq(),
"name" => get_lang('Exercises')
);
$is_allowedToEdit = api_is_allowed_to_edit(null, true);
@ -34,7 +34,7 @@ function ch_qti2_display_form()
{
$name_tools = get_lang('ImportQtiQuiz');
$form = '<div class="actions">';
$form .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/exercice.php?show=test&'.api_get_cidreq().'">'.
$form .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/exercise.php?show=test&'.api_get_cidreq().'">'.
Display :: return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>';
$form .= '</div>';
$formValidator = new FormValidator(

@ -118,7 +118,7 @@ abstract class Question
}
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCISE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$sql = "SELECT question, description, ponderation, position, type, picture, level, extra
FROM $TBL_QUESTIONS
@ -144,7 +144,7 @@ abstract class Question
$objQuestion->course = $course_info;
$objQuestion->category = TestCategory::getCategoryForQuestion($id);
$sql = "SELECT exercice_id FROM $TBL_EXERCICE_QUESTION
$sql = "SELECT exercice_id FROM $TBL_EXERCISE_QUESTION
WHERE c_id = $course_id AND question_id = $id";
$result_exercise_list = Database::query($sql);
@ -753,7 +753,7 @@ abstract class Question
*/
public function save($exerciseId = 0)
{
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCISE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$id = $this->id;
@ -807,7 +807,7 @@ abstract class Question
// creates a new question
$sql = "SELECT max(position)
FROM $TBL_QUESTIONS as question,
$TBL_EXERCICE_QUESTION as test_question
$TBL_EXERCISE_QUESTION as test_question
WHERE
question.id = test_question.question_id AND
test_question.exercice_id = " . intval($exerciseId) . " AND
@ -1102,7 +1102,7 @@ abstract class Question
*/
function removeFromList($exerciseId)
{
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCISE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$id = $this->id;
@ -1119,7 +1119,7 @@ abstract class Question
unset($this->exerciseList[$pos]);
//update order of other elements
$sql = "SELECT question_order
FROM $TBL_EXERCICE_QUESTION
FROM $TBL_EXERCISE_QUESTION
WHERE
c_id = $course_id
AND question_id = " . intval($id) . "
@ -1128,7 +1128,7 @@ abstract class Question
if (Database::num_rows($res)>0) {
$row = Database::fetch_array($res);
if (!empty($row['question_order'])) {
$sql = "UPDATE $TBL_EXERCICE_QUESTION
$sql = "UPDATE $TBL_EXERCISE_QUESTION
SET question_order = question_order-1
WHERE
c_id = $course_id
@ -1138,7 +1138,7 @@ abstract class Question
}
}
$sql = "DELETE FROM $TBL_EXERCICE_QUESTION
$sql = "DELETE FROM $TBL_EXERCISE_QUESTION
WHERE
c_id = $course_id
AND question_id = " . intval($id) . "
@ -1161,7 +1161,7 @@ abstract class Question
{
$course_id = api_get_course_int_id();
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCISE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_REPONSES = Database::get_course_table(TABLE_QUIZ_ANSWER);
$TBL_QUIZ_QUESTION_REL_CATEGORY = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
@ -1171,14 +1171,14 @@ abstract class Question
// if the question must be removed from all exercises
if (!$deleteFromEx) {
//update the question_order of each question to avoid inconsistencies
$sql = "SELECT exercice_id, question_order FROM $TBL_EXERCICE_QUESTION
$sql = "SELECT exercice_id, question_order FROM $TBL_EXERCISE_QUESTION
WHERE c_id = $course_id AND question_id = ".intval($id)."";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
while ($row = Database::fetch_array($res)) {
if (!empty($row['question_order'])) {
$sql = "UPDATE $TBL_EXERCICE_QUESTION
$sql = "UPDATE $TBL_EXERCISE_QUESTION
SET question_order = question_order-1
WHERE
c_id= $course_id
@ -1189,7 +1189,7 @@ abstract class Question
}
}
$sql = "DELETE FROM $TBL_EXERCICE_QUESTION WHERE c_id = $course_id AND question_id = " . intval($id) . "";
$sql = "DELETE FROM $TBL_EXERCISE_QUESTION WHERE c_id = $course_id AND question_id = " . intval($id) . "";
Database::query($sql);
$sql = "DELETE FROM $TBL_QUESTIONS WHERE c_id = $course_id AND id = " . intval($id) . "";
@ -1595,15 +1595,15 @@ abstract class Question
*/
static function saveQuestionOption($question_id, $name, $course_id, $position = 0)
{
$TBL_EXERCICE_QUESTION_OPTION = Database::get_course_table(TABLE_QUIZ_QUESTION_OPTION);
$TBL_EXERCISE_QUESTION_OPTION = Database::get_course_table(TABLE_QUIZ_QUESTION_OPTION);
$params['question_id'] = intval($question_id);
$params['name'] = $name;
$params['position'] = $position;
$params['c_id'] = $course_id;
$result = self::readQuestionOption($question_id, $course_id);
$last_id = Database::insert($TBL_EXERCICE_QUESTION_OPTION, $params);
$last_id = Database::insert($TBL_EXERCISE_QUESTION_OPTION, $params);
if ($last_id) {
$sql = "UPDATE $TBL_EXERCICE_QUESTION_OPTION SET id = iid WHERE iid = $last_id";
$sql = "UPDATE $TBL_EXERCISE_QUESTION_OPTION SET id = iid WHERE iid = $last_id";
Database::query($sql);
}
@ -1616,9 +1616,9 @@ abstract class Question
*/
static function deleteAllQuestionOptions($question_id, $course_id)
{
$TBL_EXERCICE_QUESTION_OPTION = Database::get_course_table(TABLE_QUIZ_QUESTION_OPTION);
$TBL_EXERCISE_QUESTION_OPTION = Database::get_course_table(TABLE_QUIZ_QUESTION_OPTION);
Database::delete(
$TBL_EXERCICE_QUESTION_OPTION,
$TBL_EXERCISE_QUESTION_OPTION,
array(
'c_id = ? AND question_id = ?' => array(
$course_id,
@ -1636,11 +1636,11 @@ abstract class Question
*/
static function updateQuestionOption($id, $params, $course_id)
{
$TBL_EXERCICE_QUESTION_OPTION = Database::get_course_table(
$TBL_EXERCISE_QUESTION_OPTION = Database::get_course_table(
TABLE_QUIZ_QUESTION_OPTION
);
$result = Database::update(
$TBL_EXERCICE_QUESTION_OPTION,
$TBL_EXERCISE_QUESTION_OPTION,
$params,
array('c_id = ? AND id = ?' => array($course_id, $id))
);
@ -1654,12 +1654,12 @@ abstract class Question
*/
static function readQuestionOption($question_id, $course_id)
{
$TBL_EXERCICE_QUESTION_OPTION = Database::get_course_table(
$TBL_EXERCISE_QUESTION_OPTION = Database::get_course_table(
TABLE_QUIZ_QUESTION_OPTION
);
$result = Database::select(
'*',
$TBL_EXERCICE_QUESTION_OPTION,
$TBL_EXERCISE_QUESTION_OPTION,
array(
'where' => array(
'c_id = ? AND question_id = ?' => array(
@ -1807,6 +1807,7 @@ abstract class Question
$tabQuestionList = Question::get_question_type_list(); // [0]=file to include [1]=type name
require_once $tabQuestionList[$type][0];
$img = $explanation = null;
eval('$img = ' . $tabQuestionList[$type][1] . '::$typePicture;');
eval('$explanation = get_lang(' . $tabQuestionList[$type][1] . '::$explanationLangVar);');
return array($img, $explanation);

@ -14,7 +14,7 @@ $this_section=SECTION_COURSES;
api_protect_course_script(true);
// breadcrumbs
$interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises'));
// Tool name
$nameTools=get_lang('AddQuestionToExercise');
@ -34,17 +34,17 @@ $form->addElement('select', 'question_type_hidden', get_lang('QuestionType'), $q
//session id
$session_id = api_get_session_id();
// the exercices
$tbl_exercices = Database :: get_course_table(TABLE_QUIZ_TEST);
// the exercises
$tbl_exercises = Database :: get_course_table(TABLE_QUIZ_TEST);
$course_id = api_get_course_int_id();
$sql = "SELECT id,title,type,description, results_disabled FROM $tbl_exercices WHERE c_id = $course_id AND active<>'-1' AND session_id=".$session_id." ORDER BY title ASC";
$sql = "SELECT id,title,type,description, results_disabled FROM $tbl_exercises WHERE c_id = $course_id AND active<>'-1' AND session_id=".$session_id." ORDER BY title ASC";
$result = Database::query($sql);
$exercises['-'] = '-'.get_lang('SelectExercice').'-';
$exercises['-'] = '-'.get_lang('SelectExercise').'-';
while ($row = Database :: fetch_array($result)) {
$exercises[$row['id']] = cut($row['title'], EXERCISE_MAX_NAME_SIZE);
}
$form->addElement('select', 'exercice', get_lang('Exercice'), $exercises);
$form->addElement('select', 'exercise', get_lang('Exercise'), $exercises);
// generate default content
$form->addElement('checkbox', 'is_content', null, get_lang('DefaultContent'), array('checked' => true));
@ -53,8 +53,8 @@ $form->addElement('checkbox', 'is_content', null, get_lang('DefaultContent'), ar
$form->addButtonCreate(get_lang('CreateQuestion'), 'SubmitCreateQuestion');
// setting the rules
$form->addRule('exercice', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('exercice', get_lang('YouHaveToSelectATest'), 'numeric');
$form->addRule('exercise', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('exercise', get_lang('YouHaveToSelectATest'), 'numeric');
$form->registerRule('validquestiontype', 'callback', 'check_question_type');
$form->addRule('question_type_hidden', get_lang('InvalidQuestionType'), 'validquestiontype');
@ -64,8 +64,8 @@ if ($form->validate()) {
$answer_type = $values['question_type_hidden'];
// check feedback_type from current exercise for type of question delineation
$exercise_id = intval($values['exercice']);
$sql = "SELECT feedback_type FROM $tbl_exercices WHERE c_id = $course_id AND id = '$exercise_id'";
$exercise_id = intval($values['exercise']);
$sql = "SELECT feedback_type FROM $tbl_exercises WHERE c_id = $course_id AND id = '$exercise_id'";
$rs_feedback_type = Database::query($sql);
$row_feedback_type = Database::fetch_row($rs_feedback_type);
$feedback_type = $row_feedback_type[0];
@ -76,14 +76,14 @@ if ($form->validate()) {
header('Location: question_create.php?'.api_get_cidreq().'&error=true');
exit;
}
header('Location: admin.php?exerciseId='.$values['exercice'].'&newQuestion=yes&isContent='.$values['is_content'].'&answerType='.$answer_type);
header('Location: admin.php?exerciseId='.$values['exercise'].'&newQuestion=yes&isContent='.$values['is_content'].'&answerType='.$answer_type);
exit;
} else {
// header
Display::display_header($nameTools);
echo '<div class="actions">';
echo '<a href="exercice.php?show=test">'.Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="exercise.php?show=test">'.Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
// displaying the form

@ -34,8 +34,8 @@ $session_id = isset($_REQUEST['session_id']) ? intval($_REQUEST['session_id']) :
$selected_course = isset($_GET['selected_course']) ? intval($_GET['selected_course']) : null;
// save the id of the previous course selected by user to reset menu if we detect that user change course hub 13-10-2011
$course_id_changed = isset($_GET['course_id_changed']) ? intval($_GET['course_id_changed']) : null;
// save the id of the previous exercice selected by user to reset menu if we detect that user change course hub 13-10-2011
$exercice_id_changed = isset($_GET['exercice_id_changed']) ? intval($_GET['exercice_id_changed']) : null;
// save the id of the previous exercise selected by user to reset menu if we detect that user change course hub 13-10-2011
$exercise_id_changed = isset($_GET['exercise_id_changed']) ? intval($_GET['exercise_id_changed']) : null;
// by default when we go to the page for the first time, we select the current course
if (!isset($_GET['selected_course']) && !isset($_GET['exerciseId'])) {
@ -50,7 +50,7 @@ if (empty($objExercise) && !empty($fromExercise)) {
}
$nameTools = get_lang('QuestionPool');
$interbreadcrumb[] = array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
if (!empty($objExercise)) {
$interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name);
@ -195,8 +195,8 @@ $htmlHeadXtra[] = "
$('#course_id_changed').val('1');
}
function mark_exercice_id_changed() {
$('#exercice_id_changed').val('1');
function mark_exercise_id_changed() {
$('#exercise_id_changed').val('1');
}
function confirm_your_choice() {
@ -218,7 +218,7 @@ if (isset($fromExercise) && $fromExercise > 0) {
Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
$titleAdd = get_lang('AddQuestionToTest');
} else {
echo '<a href="exercice.php?'.api_get_cidReq().'">'.
echo '<a href="exercise.php?'.api_get_cidReq().'">'.
Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
echo "<a href='admin.php?exerciseId=0'>".Display::return_icon('add_question.gif', get_lang('NewQu'), '', ICON_SIZE_MEDIUM)."</a>";
$titleAdd = get_lang('ManageAllQuestions');
@ -312,8 +312,8 @@ if ($course_id_changed) {
$course_id = $course_info['real_id'];
// Redefining table calls
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_EXERCISE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_REPONSES = Database::get_course_table(TABLE_QUIZ_ANSWER);
$TBL_CATEGORY = Database::get_course_table(TABLE_QUIZ_QUESTION_CATEGORY);
@ -354,14 +354,14 @@ if (is_array($exercise_list)) {
}
}
if ($exercice_id_changed == 1) {
if ($exercise_id_changed == 1) {
reset_menu_lvl_type();
}
$select_exercise_html = Display::select(
'exerciseId',
$my_exercise_list,
$exerciseId,
array('class'=>'chzn-select','onchange'=>'mark_exercice_id_changed(); submit_form(this);'),
array('class'=>'chzn-select','onchange'=>'mark_exercise_id_changed(); submit_form(this);'),
false
);
@ -421,7 +421,7 @@ echo Display::form_row(get_lang('AnswerType'), $select_answer_html);
$button = '<button class="save" type="submit" name="name" value="'.get_lang('Filter').'">'.get_lang('Filter').'</button>';
echo Display::form_row('', $button);
echo "<input type='hidden' id='course_id_changed' name='course_id_changed' value='0' />";
echo "<input type='hidden' id='exercice_id_changed' name='exercice_id_changed' value='0' />";
echo "<input type='hidden' id='exercise_id_changed' name='exercise_id_changed' value='0' />";
?>
</form>
<div class="clear"></div>
@ -451,7 +451,7 @@ if ($exerciseId > 0) {
type,
level
FROM
$TBL_EXERCICE_QUESTION qt,
$TBL_EXERCISE_QUESTION qt,
$TBL_QUESTIONS qu
$from
WHERE
@ -487,9 +487,9 @@ if ($exerciseId > 0) {
// @todo fix this query with the new id field
$sql = " (
SELECT q.* FROM $TBL_QUESTIONS q
INNER JOIN $TBL_EXERCICE_QUESTION r
INNER JOIN $TBL_EXERCISE_QUESTION r
ON (q.c_id = r.c_id AND q.id = r.question_id)
INNER JOIN $TBL_EXERCICES ex
INNER JOIN $TBL_EXERCISES ex
ON (ex.id = r.exercice_id AND ex.c_id = r.c_id )
$from
WHERE
@ -500,7 +500,7 @@ if ($exerciseId > 0) {
UNION
(
SELECT q.* FROM $TBL_QUESTIONS q
LEFT OUTER JOIN $TBL_EXERCICE_QUESTION r
LEFT OUTER JOIN $TBL_EXERCISE_QUESTION r
ON (q.c_id = r.c_id AND q.id = r.question_id)
$from
WHERE
@ -511,7 +511,7 @@ if ($exerciseId > 0) {
UNION
(
SELECT q.* FROM $TBL_QUESTIONS q
INNER JOIN $TBL_EXERCICE_QUESTION r
INNER JOIN $TBL_EXERCISE_QUESTION r
ON (q.c_id = r.c_id AND q.id = r.question_id)
$from
WHERE
@ -627,8 +627,8 @@ if ($exerciseId > 0) {
$sql = "SELECT DISTINCT qu.id, question, qu.type, level, q.session_id
FROM
$TBL_QUESTIONS as qu,
$TBL_EXERCICE_QUESTION as qt,
$TBL_EXERCICES as q
$TBL_EXERCISE_QUESTION as qt,
$TBL_EXERCISES as q
$from
WHERE
qu.c_id = $selected_course AND
@ -853,20 +853,20 @@ function get_a_tag_for_question(
/**
Return the <a> html code for delete, add, clone, edit a question
in_action = the code of the action triggered by the button
from_exercice = the id of the current exercice from which we click on question pool
from_exercise = the id of the current exercise from which we click on question pool
in_questionid = the id of the current question
in_questiontype = the code of the type of the current question
in_questionname = the name of the question
in_selected_course = the if of the course chosen in the FILTERING MENU
in_courseCategoryId = the id of the category chosen in the FILTERING MENU
in_exerciseLevel = the level of the exercice chosen in the FILTERING MENU
in_exerciseLevel = the level of the exercise chosen in the FILTERING MENU
in_answerType = the code of the type of the question chosen in the FILTERING MENU
in_session_id = the id of the session_id chosen in the FILTERING MENU
in_exercice_id = the id of the exercice chosen in the FILTERING MENU
in_exercise_id = the id of the exercise chosen in the FILTERING MENU
*/
function get_action_icon_for_question(
$in_action,
$from_exercice,
$from_exercise,
$in_questionid,
$in_questiontype,
$in_questionname,
@ -875,10 +875,10 @@ function get_action_icon_for_question(
$in_exerciseLevel,
$in_answerType,
$in_session_id,
$in_exercice_id
$in_exercise_id
) {
$res = "";
$getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercice_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";
$getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";
switch ($in_action) {
case "delete" :
$res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&delete=$in_questionid' onclick='return confirm_your_choice()'>";
@ -888,7 +888,7 @@ function get_action_icon_for_question(
case "edit" :
$res = get_a_tag_for_question(
1,
$from_exercice,
$from_exercise,
$in_questionid,
$in_questiontype,
Display::return_icon("edit.png", get_lang('Modify')),
@ -898,9 +898,9 @@ function get_action_icon_for_question(
case "add":
// add if question is not already in test
$myObjEx = new Exercise();
$myObjEx->read($from_exercice);
$myObjEx->read($from_exercise);
if (!$myObjEx->isInList($in_questionid)) {
$res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&recup=$in_questionid&fromExercise=$from_exercice'>";
$res = "<a href='".api_get_self()."?".api_get_cidreq().$getParams."&recup=$in_questionid&fromExercise=$from_exercise'>";
$res .= Display::return_icon("view_more_stats.gif", get_lang('InsertALinkToThisQuestionInTheExercise'));
$res .= "</a>";
} else {
@ -909,7 +909,7 @@ function get_action_icon_for_question(
unset($myObjEx);
break;
case "clone":
$url = api_get_self()."?".api_get_cidreq().$getParams."&amp;question_copy=$in_questionid&amp;course_id=$in_selected_course&amp;fromExercise=$from_exercice";
$url = api_get_self()."?".api_get_cidreq().$getParams."&amp;question_copy=$in_questionid&amp;course_id=$in_selected_course&amp;fromExercise=$from_exercise";
$res = Display::url(
Display::return_icon('cd.gif', get_lang('ReUseACopyInCurrentTest')),
$url

@ -54,7 +54,7 @@ if (!$is_allowedToEdit) {
}
if ($show_headers) {
$interbreadcrumb[] = array("url" => "exercice.php","name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
$interbreadcrumb[] = array("url" => "#","name" => get_lang('Result'));
$this_section = SECTION_COURSES;
Display::display_header();

@ -83,7 +83,7 @@ save_scores($test, $score);
// Back
if ($origin != 'learnpath') {
$url = "exercice.php"; // back to exercices
$url = "exercise.php"; // back to exercises
$jscript2run .= '<script>'."window.open('$url', '_top', '')".'</script>';
echo $jscript2run;
} else {

@ -82,7 +82,7 @@ $htmlHeadXtra[] = '
});
</script>';
$interbreadcrumb[]= array ("url"=>"./exercice.php", "name"=> get_lang('Exercices'));
$interbreadcrumb[]= array ("url"=>"./exercise.php", "name"=> get_lang('Exercises'));
if ($origin == 'learnpath') {
Display::display_reduced_header($nameTools,"Exercise");
} else {

@ -276,7 +276,7 @@ foreach ($data as $row_table) {
$content .= $table->toHtml();
$interbreadcrumb[] = array ("url" => "exercice.php?gradebook=$gradebook", "name" => get_lang('Exercices'));
$interbreadcrumb[] = array ("url" => "exercise.php?gradebook=$gradebook", "name" => get_lang('Exercises'));
$interbreadcrumb[] = array ("url" => "admin.php?exerciseId=$exercise_id","name" => $objExercise->name);
$tpl = new Template(get_lang('ReportByQuestion'));

@ -28,6 +28,6 @@ if (!empty($gradebook) && $gradebook=='view') {
'name' => get_lang('ToolGradebook')
);
}
$interbreadcrumb[]= array ("url"=>"./exercice.php", "name"=> get_lang('Exercices'));
$interbreadcrumb[]= array ("url"=>"./exercise.php", "name"=> get_lang('Exercises'));
Display::display_header($nameTools,"Exercise");
echo "<a name='TOP'></a>";

@ -33,7 +33,7 @@ $courseId = api_get_course_int_id();
$sessionId = api_get_session_id();
// breadcrumbs
$interbreadcrumb[] = array("url" => "exercice.php", "name" => get_lang('Exercices'));
$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
Display::display_header(get_lang('Category'));
// Action handling: add, edit and remove
@ -176,7 +176,7 @@ function add_category_form($in_action) {
function display_add_category() {
echo '<div class="actions">';
echo '<a href="exercice.php?' . api_get_cidreq() . '">' . Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<a href="exercise.php?' . api_get_cidreq() . '">' . Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<a href="' . api_get_self() . '?action=addcategory">' . Display::return_icon('question_category.gif', get_lang('AddACategory')) . '</a>';
echo '</div>';
echo "<br/>";

@ -35,7 +35,7 @@ $(document).ready( function(){
// Action handling
lp_upload_quiz_action_handling();
$interbreadcrumb[]= array ("url"=>"exercice.php", "name"=> get_lang('Exercices'));
$interbreadcrumb[]= array ("url"=>"exercise.php", "name"=> get_lang('Exercises'));
// Display the header
@ -56,7 +56,7 @@ echo '</div>';
lp_upload_quiz_main();
function lp_upload_quiz_actions() {
$return = '<a href="exercice.php?'.api_get_cidReq().'">'.
$return = '<a href="exercise.php?'.api_get_cidReq().'">'.
Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
return $return;
}
@ -436,7 +436,7 @@ function lp_upload_quiz_action_handling() {
header('location: ../newscorm/lp_controller.php?'.api_get_cidreq().'&action=add_item&type=step&lp_id='.Security::remove_XSS($_GET['lp_id']));
exit;
} else {
// header('location: exercice.php?' . api_get_cidreq());
// header('location: exercise.php?' . api_get_cidreq());
echo '<script>window.location.href = "'.api_get_path(WEB_CODE_PATH).'exercice/admin.php?'.api_get_cidReq().'&exerciseId='.$quiz_id.'&session_id='.api_get_session_id().'"</script>';
}
}

@ -4530,7 +4530,7 @@ class Tracking
//Course details
$html .= '
<tr>
<th class="head" style="color:#000">'.get_lang('Exercices').'</th>
<th class="head" style="color:#000">'.get_lang('Exercises').'</th>
<th class="head" style="color:#000">'.get_lang('Attempts').'</th>
<th class="head" style="color:#000">'.get_lang('BestAttempt').'</th>
<th class="head" style="color:#000">'.get_lang('Ranking').'</th>

@ -920,7 +920,7 @@ if (!empty($student_id)) {
<?php if ($user_info['status'] != INVITEE) { ?>
<table class="data_table">
<tr>
<th><?php echo get_lang('Exercices'); ?></th>
<th><?php echo get_lang('Exercises'); ?></th>
<th><?php echo get_lang('LearningPath');?></th>
<th><?php echo get_lang('AvgCourseScore').' '.Display :: return_icon('info3.gif', get_lang('AverageScore'), array('align' => 'absmiddle', 'hspace' => '3px')) ?></th>
<th><?php echo get_lang('Attempts'); ?></th>
@ -931,7 +931,7 @@ if (!empty($student_id)) {
$csv_content[] = array();
$csv_content[] = array(
get_lang('Exercices'),
get_lang('Exercises'),
get_lang('LearningPath'),
get_lang('AvgCourseScore'),
get_lang('Attempts')

Loading…
Cancel
Save