Refactoring: move main/exercice/ to main/exercise/ and related folders (except code for migration from 1.9 and 1.10)

ofaj
Yannick Warnier 10 years ago
parent 0d77174c6f
commit ba818ee23e
  1. 3
      .htaccess
  2. 2
      composer.json
  3. 2
      documentation/installation_guide.html
  4. 2
      documentation/installation_guide_es_ES.html
  5. 2
      documentation/installation_guide_fr_FR.html
  6. 0
      main/exercise/Draggable.php
  7. 2
      main/exercise/Hpdownload.php
  8. 0
      main/exercise/MatchingDraggable.php
  9. 0
      main/exercise/TestCategory.php
  10. 0
      main/exercise/UniqueAnswerImage.php
  11. 20
      main/exercise/admin.php
  12. 2
      main/exercise/adminhp.php
  13. 4
      main/exercise/aiken.php
  14. 0
      main/exercise/answer.class.php
  15. 2
      main/exercise/calculated_answer.class.php
  16. 0
      main/exercise/evalmathnotation.php
  17. 0
      main/exercise/exercice.php
  18. 6
      main/exercise/exercise.class.php
  19. 20
      main/exercise/exercise.php
  20. 0
      main/exercise/exercise_admin.php
  21. 2
      main/exercise/exercise_history.php
  22. 0
      main/exercise/exercise_reminder.php
  23. 4
      main/exercise/exercise_report.php
  24. 0
      main/exercise/exercise_result.class.php
  25. 2
      main/exercise/exercise_result.php
  26. 4
      main/exercise/exercise_show.php
  27. 0
      main/exercise/exercise_submit.php
  28. 0
      main/exercise/exercise_submit_modal.php
  29. 0
      main/exercise/export/aiken/aiken_classes.php
  30. 0
      main/exercise/export/aiken/aiken_import.inc.php
  31. 0
      main/exercise/export/exercise_import.inc.php
  32. 0
      main/exercise/export/exercise_import.php
  33. 0
      main/exercise/export/index.php
  34. 0
      main/exercise/export/qti2/qti2_classes.php
  35. 0
      main/exercise/export/qti2/qti2_export.php
  36. 0
      main/exercise/export/scorm/scorm_classes.php
  37. 0
      main/exercise/feedback.php
  38. 2
      main/exercise/fill_blanks.class.php
  39. 0
      main/exercise/freeanswer.class.php
  40. 486
      main/exercise/global_multiple_answer.class.php
  41. 0
      main/exercise/hotpotatoes.lib.php
  42. 2
      main/exercise/hotpotatoes.php
  43. 0
      main/exercise/hotpotatoes_exercise_report.php
  44. 0
      main/exercise/hotpotatoes_exercise_result.class.php
  45. 0
      main/exercise/hotspot.class.php
  46. 0
      main/exercise/hotspot.inc.php
  47. 0
      main/exercise/hotspot_actionscript.as.php
  48. 0
      main/exercise/hotspot_actionscript_admin.as.php
  49. 4
      main/exercise/hotspot_admin.inc.php
  50. 0
      main/exercise/hotspot_answers.as.php
  51. 0
      main/exercise/hotspot_lang_conversion.php
  52. 0
      main/exercise/hotspot_save.inc.php
  53. 0
      main/exercise/hotspot_savescore.inc.php
  54. 0
      main/exercise/hotspot_updatescore.inc.php
  55. 0
      main/exercise/index.html
  56. 0
      main/exercise/live_stats.php
  57. 0
      main/exercise/matching.class.php
  58. 0
      main/exercise/multiple_answer.class.php
  59. 0
      main/exercise/multiple_answer_combination.class.php
  60. 0
      main/exercise/multiple_answer_combination_true_false.class.php
  61. 0
      main/exercise/multiple_answer_true_false.class.php
  62. 0
      main/exercise/oral_expression.class.php
  63. 6
      main/exercise/overview.php
  64. 10
      main/exercise/qti2.php
  65. 0
      main/exercise/question.class.php
  66. 0
      main/exercise/question_admin.inc.php
  67. 0
      main/exercise/question_create.php
  68. 0
      main/exercise/question_list_admin.inc.php
  69. 0
      main/exercise/question_pool.php
  70. 0
      main/exercise/quiz_template.xls
  71. 0
      main/exercise/result.php
  72. 0
      main/exercise/savescores.php
  73. 6
      main/exercise/showinframes.php
  74. 0
      main/exercise/stats.php
  75. 0
      main/exercise/tests_category.php
  76. 0
      main/exercise/unique_answer.class.php
  77. 0
      main/exercise/unique_answer_no_option.class.php
  78. 6
      main/exercise/upload_exercise.php
  79. 6
      main/gradebook/exercise_jump.php
  80. 6
      main/gradebook/lib/be/exerciselink.class.php
  81. 2
      main/inc/lib/add_course.lib.inc.php
  82. 2
      main/inc/lib/course.lib.php
  83. 2
      main/inc/lib/events.lib.php
  84. 8
      main/inc/lib/exercise.lib.php
  85. 12
      main/inc/lib/javascript/hotspot/js/hotspot.js
  86. 2
      main/inc/lib/search/tool_processors/quiz_processor.class.php
  87. 10
      main/inc/lib/tracking.lib.php
  88. 2
      main/inc/lib/userportal.lib.php
  89. 4
      main/mySpace/myStudents.php
  90. 4
      main/newscorm/learnpath.class.php
  91. 2
      main/newscorm/lp_view.php
  92. 26
      main/newscorm/resourcelinker.inc.php
  93. 2
      main/newscorm/resourcelinker.php
  94. 16
      main/resourcelinker/resourcelinker.inc.php
  95. 2
      main/resourcelinker/resourcelinker.php
  96. 4
      main/session/index.php
  97. 2
      main/tracking/course_log_tools.php
  98. 2
      main/tracking/userLog.php
  99. 2
      main/tracking/userlogCSV.php
  100. 2
      src/Chamilo/CourseBundle/Entity/CQuizRelQuestion.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -45,3 +45,6 @@ RewriteRule ^badge/(\d{1,}) main/badge/issued.php?issue=$1 [L]
RewriteRule ^skill/(\d{1,})/user/(\d{1,}) main/badge/issued_all.php?skill=$1&user=$2 [L]
# Support deprecated URL (avoid 404)
RewriteRule ^badge/(\d{1,})/user/(\d{1,}) main/badge/issued_all.php?skill=$1&user=$2 [L]
# Support old URLs using the exercice (with a c) folder rather than exercise
RewriteRule ^main/exercice/(.*)$ main/exercise/$1 [QSA,L]

@ -22,7 +22,7 @@
"main/cron/lang",
"main/course_description",
"main/dropbox",
"main/exercice",
"main/exercise",
"main/gradebook/lib",
"main/newscorm",
"main/inc/lib",

@ -680,6 +680,7 @@ If you have issues with files taking a long time to download, make sure you reco
RewriteRule ^courses/([^/]+)/course-pic.png$ app/courses/$1/course-pic.png [QSA,L]
RewriteRule ^session/(\d{1,})/about/?$ main/session/about.php?session_id=$1 [L]
RewriteRule ^badge/(\d{1,})/user/(\d{1,}) main/badge/issued.php?skill=$1&user=$2 [L]
RewriteRule ^main/exercice/(.+)$ main/exercise/$1 [QSA,L]
</Directory>
</pre>
<h3>Nginx</h3>
@ -718,6 +719,7 @@ If you have issues with files taking a long time to download, make sure you reco
rewrite ^/courses/([^/]+)/$ /main/course_home/course_home.php?cDir=$1 last;
rewrite ^/courses/([^/]+)/index.php$ /main/course_home/course_home.php?cDir=$1 last;
rewrite ^/session/([^/]+)/about/?$ /main/session/about.php?session_id=$1 last;
rewrite ^/main/exercice/(.+)$ /main/exercise/$1 last;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;

@ -711,6 +711,7 @@ por ejemplo. El efecto debería ser inmediato.
rewrite ^/courses/([^/]+)/$ /main/course_home/course_home.php?cDir=$1 last;
rewrite ^/courses/([^/]+)/index.php$ /main/course_home/course_home.php?cDir=$1 last;
rewrite ^/session/([^/]+)/about/?$ /main/session/about.php?session_id=$1 last;
rewrite ^/main/exercice/(.+)$ /main/exercise/$1 last;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
@ -777,6 +778,7 @@ Apache2: La configuración para nuestro sitio de ejemplo my.chamilo10.net sería
RewriteRule ^courses/([^/]+)/course-pic.png$ app/courses/$1/course-pic.png [QSA,L]
RewriteRule ^session/(\d{1,})/about/?$ main/session/about.php?session_id=$1 [L]
RewriteRule ^badge/(\d{1,})/user/(\d{1,}) main/badge/issued.php?skill=$1&user=$2 [L]
RewriteRule ^main/exercice/(.+)$ main/exercise/$1 [QSA,L]
&lt;/Directory&gt;
php_value display_errors Off

@ -739,6 +739,7 @@ ou, si vous travaillez avec Apache 2.4, la syntaxe est légèrement différente
RewriteRule ^courses/([^/]+)/course-pic.png$ app/courses/$1/course-pic.png [QSA,L]
RewriteRule ^session/(\d{1,})/about/?$ main/session/about.php?session_id=$1 [L]
RewriteRule "^badge/(\d{1,})/user/(\d{1,})$" main/badge/issued.php?skill=$1&user=$2 [L]
RewriteRule ^main/exercice/(.+)$ main/exercise/$1 [QSA,L]
&lt;/Directory&gt;
</pre>
<h3>Nginx</h3>
@ -777,6 +778,7 @@ Ce sont uniquement les redirections à placer dans un bloc server{}, comme les a
rewrite ^/courses/([^/]+)/$ /main/course_home/course_home.php?cDir=$1 last;
rewrite ^/courses/([^/]+)/index.php$ /main/course_home/course_home.php?cDir=$1 last;
rewrite ^/session/([^/]+)/about/?$ /main/session/about.php?session_id=$1 last;
rewrite ^/main/exercice/(.+)$ /main/exercise/$1 last;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;

@ -128,7 +128,7 @@ if ($content_type == 'text/html') {
$newcontent = str_replace($mit,$js_content,$content);
$prehref="javascript:void(0);";
$posthref=$_configuration['root_web']."main/exercice/Hpdownload.php?doc_url=".$doc_url."&cid=".$cid."&uid=".$uid;
$posthref = api_get_path(WEB_CODE_PATH) . "main/exercise/Hpdownload.php?doc_url=".$doc_url."&cid=".$cid."&uid=".$uid;
$newcontent = str_replace($prehref,$posthref,$newcontent);

@ -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/exercise.php?'.api_get_cidreq());
/*header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/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/exercise.php?'.api_get_cidreq());
header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq());
exit();
}
}
@ -302,7 +302,7 @@ if (isset($_GET['newQuestion']) || isset($_GET['editQuestion']) ) {
// shows a link to go back to the question pool
if (!$exerciseId && $nameTools != get_lang('ExerciseManagement')){
$interbreadcrumb[]=array(
"url" => api_get_path(WEB_CODE_PATH)."exercice/question_pool.php?fromExercise=$fromExercise&".api_get_cidreq(),
"url" => api_get_path(WEB_CODE_PATH)."exercise/question_pool.php?fromExercise=$fromExercise&".api_get_cidreq(),
"name" => get_lang('QuestionPool')
);
}
@ -363,22 +363,22 @@ $inATest = isset($exerciseId) && $exerciseId > 0;
if ($inATest) {
echo '<div class="actions">';
if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid']))
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'">'.
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'">'.
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/exercise.php?'.api_get_cidreq().'">'.
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/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">'.
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&preview=1">'.
Display::return_icon('preview_view.png', get_lang('Preview'),'',ICON_SIZE_MEDIUM).'</a>';
echo Display::url(
Display::return_icon('test_results.png', get_lang('Results'),'',ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'exercice/exercise_report.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id
api_get_path(WEB_CODE_PATH).'exercise/exercise_report.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id
);
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'.
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'.
Display::return_icon('settings.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).'</a>';
$maxScoreAllQuestions = 0;
@ -396,13 +396,13 @@ if ($inATest) {
} else if (isset($_GET['newQuestion'])) {
// we are in create a new question from question pool not in a test
echo '<div class="actions">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/admin.php?'.api_get_cidreq().'">'.
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
} else {
// If we are in question_pool but not in an test, go back to question create in pool
echo '<div class="actions">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/question_pool.php?'.api_get_cidreq().'">'.
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/question_pool.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).
'</a>';
echo '</div>';

@ -54,7 +54,7 @@ $nameTools = get_lang('adminHP');
Display::display_header($nameTools,"Exercise");
/** @todo probably wrong !!!! */
require_once(api_get_path(SYS_CODE_PATH).'/exercice/hotpotatoes.lib.php');
require_once(api_get_path(SYS_CODE_PATH).'/exercise/hotpotatoes.lib.php');
?>

@ -15,8 +15,8 @@ $lib_path = api_get_path(LIBRARY_PATH);
$main_path = api_get_path(SYS_CODE_PATH);
// including additional libraries
require_once $main_path.'exercice/export/aiken/aiken_import.inc.php';
require_once $main_path.'exercice/export/aiken/aiken_classes.php';
require_once $main_path.'exercise/export/aiken/aiken_import.inc.php';
require_once $main_path.'exercise/export/aiken/aiken_classes.php';
// section (for the tabs)
$this_section = SECTION_COURSES;

@ -138,7 +138,7 @@ class CalculatedAnswer extends Question
$notationListButton = Display::url(
get_lang('NotationList'),
api_get_path(WEB_PATH).'main/exercice/evalmathnotation.php',
api_get_path(WEB_CODE_PATH).'exercise/evalmathnotation.php',
array(
'class' => 'btn btn-info ajax',
'data-title' => get_lang('NotationList'),

@ -5165,7 +5165,7 @@ class Exercise
}
$url_email = api_get_path(WEB_CODE_PATH)
. 'exercice/exercise_show.php?'
. 'exercise/exercise_show.php?'
. api_get_cidreq()
. '&id_session='
. $sessionId
@ -5241,7 +5241,7 @@ class Exercise
$course_info = api_get_course_info($courseCode);
$url_email = api_get_path(WEB_CODE_PATH)
. 'exercice/exercise_show.php?'
. 'exercise/exercise_show.php?'
. api_get_cidreq()
. '&id_session='
. api_get_session_id()
@ -5337,7 +5337,7 @@ class Exercise
$course_info = api_get_course_info($courseCode);
$url_email = api_get_path(WEB_CODE_PATH)
. 'exercice/exercise_show.php?'
. 'exercise/exercise_show.php?'
. api_get_cidreq()
. '&id_session='
. api_get_session_id()

@ -116,7 +116,7 @@ if (!empty($gradebook) && $gradebook == 'view') {
$nameTools = get_lang('Exercises');
$errorXmlExport = null;
if ($is_allowedToEdit && !empty($choice) && $choice == 'exportqti2') {
require_once api_get_path(SYS_CODE_PATH).'exercice/export/qti2/qti2_export.php';
require_once api_get_path(SYS_CODE_PATH).'exercise/export/qti2/qti2_export.php';
$export = export_exercise_to_qti($exerciseId, true);
$archive_path = api_get_path(SYS_ARCHIVE_PATH);
@ -443,25 +443,25 @@ $total = $total_exercises + $hp_count;
$token = Security::get_token();
if ($is_allowedToEdit && $origin != 'learnpath') {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/exercise_admin.php?'.api_get_cidreq().'">'.
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise_admin.php?'.api_get_cidreq().'">'.
Display :: return_icon('new_exercice.png', get_lang('NewEx'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/question_create.php?'.api_get_cidreq().'">'.
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/question_create.php?'.api_get_cidreq().'">'.
Display :: return_icon('new_question.png', get_lang('AddQ'), '', ICON_SIZE_MEDIUM).'</a>';
// Question category
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/tests_category.php?'.api_get_cidreq().'">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/tests_category.php?'.api_get_cidreq().'">';
echo Display::return_icon('green_open.png', get_lang('QuestionCategory'), '', ICON_SIZE_MEDIUM);
echo '</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/question_pool.php?'.api_get_cidreq().'">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/question_pool.php?'.api_get_cidreq().'">';
echo Display::return_icon('database.png', get_lang('QuestionPool'), '', ICON_SIZE_MEDIUM);
echo '</a>';
//echo Display::url(Display::return_icon('looknfeel.png', get_lang('Media')), 'media.php?' . api_get_cidreq());
// end question category
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/hotpotatoes.php?'.api_get_cidreq().'">'.Display :: return_icon('import_hotpotatoes.png', get_lang('ImportHotPotatoesQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/hotpotatoes.php?'.api_get_cidreq().'">'.Display :: return_icon('import_hotpotatoes.png', get_lang('ImportHotPotatoesQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
// link to import qti2 ...
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/qti2.php?'.api_get_cidreq().'">'.Display :: return_icon('import_qti2.png', get_lang('ImportQtiQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/aiken.php?'.api_get_cidreq().'">'.Display :: return_icon('import_aiken.png', get_lang('ImportAikenQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/upload_exercise.php?'.api_get_cidreq().'">'.Display :: return_icon('import_excel.png', get_lang('ImportExcelQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/qti2.php?'.api_get_cidreq().'">'.Display :: return_icon('import_qti2.png', get_lang('ImportQtiQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/aiken.php?'.api_get_cidreq().'">'.Display :: return_icon('import_aiken.png', get_lang('ImportAikenQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/upload_exercise.php?'.api_get_cidreq().'">'.Display :: return_icon('import_excel.png', get_lang('ImportExcelQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
echo Display::url(
Display::return_icon(
'clean_all.png',
@ -472,7 +472,7 @@ if ($is_allowedToEdit && $origin != 'learnpath') {
'',
array(
'onclick' => "javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToEmptyAllTestResults'), ENT_QUOTES, $charset))."')) return false;",
'href' => api_get_path(WEB_CODE_PATH).'exercice/exercise.php?'.api_get_cidreq().'&choice=clean_all_test&sec_token='.$token
'href' => api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq().'&choice=clean_all_test&sec_token='.$token
)
);
}

@ -22,7 +22,7 @@ $is_allowedToEdit = api_is_allowed_to_edit(null,true);
$is_tutor = api_is_allowed_to_edit(true);
if (!$is_allowedToEdit){
header('Location: /main/exercice/exercise.php?'.api_get_cidreq());
header('Location: ' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise.php?' . api_get_cidreq());
exit;
}

@ -151,7 +151,7 @@ if (isset($_REQUEST['comments']) &&
null,
PERSON_NAME_EMAIL_ADDRESS
);
$url = api_get_path(WEB_CODE_PATH).'exercice/result.php?id='.$track_exercise_info['exe_id'].'&'.api_get_cidreq().'&show_headers=1&id_session='.$session_id;
$url = api_get_path(WEB_CODE_PATH).'exercise/result.php?id='.$track_exercise_info['exe_id'].'&'.api_get_cidreq().'&show_headers=1&id_session='.$session_id;
$my_post_info = array();
$post_content_id = array();
@ -261,7 +261,7 @@ if (isset($_REQUEST['comments']) &&
Database::query($sql);
if ($origin == 'tracking_course') {
//Redirect to the course detail in lp
header('location: '.api_get_path(WEB_CODE_PATH).'exercice/exercise.php?course='.Security :: remove_XSS($_GET['course']));
header('location: '.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?course='.Security :: remove_XSS($_GET['course']));
exit;
} else {
// Redirect to the reporting

@ -151,7 +151,7 @@ if ($objExercise->selectAttempts() > 0) {
if ($remainingAttempts) {
$attemptButton = Display::toolbarButton(
get_lang('AnotherAttempt'),
api_get_path(WEB_CODE_PATH) . 'exercice/overview.php?' . api_get_cidreq() . '&' . http_build_query([
api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?' . api_get_cidreq() . '&' . http_build_query([
'exerciseId' => $objExercise->id
]),
'pencil-square-o',

@ -855,7 +855,7 @@ if ($isFeedbackAllowed) {
if ($isFeedbackAllowed) {
if (in_array($origin, array('tracking_course', 'user_course', 'correct_exercise_in_lp'))) {
$formUrl = api_get_path(WEB_CODE_PATH) . 'exercice/exercise_report.php?' . api_get_cidreq() . '&';
$formUrl = api_get_path(WEB_CODE_PATH) . 'exercise/exercise_report.php?' . api_get_cidreq() . '&';
$formUrl .= http_build_query([
'exerciseId' => $exercise_id,
'filter' => 2,
@ -874,7 +874,7 @@ if ($isFeedbackAllowed) {
echo '<input type = "hidden" name="total_score" value="' . $totalScore . '"> ';
echo '<input type = "hidden" name="my_exe_exo_id" value="' . $exercise_id . '"> ';
} else {
$formUrl = api_get_path(WEB_CODE_PATH) . 'exercice/exercise_report.php?' . api_get_cidreq() . '&';
$formUrl = api_get_path(WEB_CODE_PATH) . 'exercise/exercise_report.php?' . api_get_cidreq() . '&';
$formUrl .= http_build_query([
'exerciseId' => $exercise_id,
'filter' => 1,

@ -757,7 +757,7 @@ class FillBlanks extends Question
$tblTrackEExercise = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$courseId = api_get_course_int_id();
require_once api_get_path(SYS_PATH).'main/exercice/fill_blanks.class.php';
require_once api_get_path(SYS_PATH).'main/exercise/fill_blanks.class.php';
// request to have all the answers of student for this question
// student may have doing it several time

@ -1,243 +1,243 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Class GlobalMultipleAnswer
*/
class GlobalMultipleAnswer extends Question
{
static $typePicture = 'mcmagl.png';
static $explanationLangVar = 'GlobalMultipleAnswer';
/**
*
*/
public function __construct()
{
parent::__construct();
$this->type = GLOBAL_MULTIPLE_ANSWER;
$this->isContent = $this->getIsContent();
}
/**
* function which redefines Question::createAnswersForm
* @param FormValidator $form
*/
public function createAnswersForm($form)
{
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
$obj_ex = $_SESSION['objExercise'];
/* Mise en variable de Affichage "Reponses" et son icone, "N<EFBFBD>", "Vrai", "Reponse" */
$html = '<table class="data_table">
<tr>
<th width="10px">
' . get_lang('Number') . '
</th>
<th width="10px">
' . get_lang('True') . '
</th>
<th width="50%">
' . get_lang('Answer') . '
</th>';
$html .='<th>' . get_lang('Comment') . '</th>';
$html .='</tr>';
$form->addElement(
'label',
get_lang('Answers') .
'<br /> '.Display::return_icon('fill_field.png'),
$html
);
$defaults = array();
$correct = 0;
$answer = false;
if (!empty($this->id)) {
$answer = new Answer($this->id);
$answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers;
}
}
#le nombre de r<EFBFBD>ponses est bien enregistr<EFBFBD> sous la forme int(nb)
/* Ajout mise en forme nb reponse */
$form->addElement('hidden', 'nb_answers');
$boxes_names = array();
/* V<EFBFBD>rification : Cr<EFBFBD>action d'au moins une r<EFBFBD>ponse */
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
//D<EFBFBD>but affichage score global dans la modification d'une question
$scoreA = "0"; //par reponse
$scoreG = "0"; //Global
/* boucle pour sauvegarder les donn<EFBFBD>es dans le tableau defaults */
for ($i = 1; $i <= $nb_answers; ++$i) {
/* si la reponse est de type objet */
if (is_object($answer)) {
$defaults['answer[' . $i . ']'] = $answer->answer[$i];
$defaults['comment[' . $i . ']'] = $answer->comment[$i];
$defaults['correct[' . $i . ']'] = $answer->correct[$i];
// start
$scoreA = $answer->weighting[$i];
}
if ($scoreA > 0) {
$scoreG = $scoreG + $scoreA;
}
//------------- Fin
//------------- Debut si un des scores par reponse est egal <EFBFBD> 0 : la coche vaut 1 (coch<EFBFBD>)
if ($scoreA == 0) {
$defaults['pts'] = 1;
}
$renderer = & $form->defaultRenderer();
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
//$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
$answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"');
$answer_number->freeze();
$form->addElement('checkbox', 'correct[' . $i . ']', null, null, 'class="checkbox"');
$boxes_names[] = 'correct[' . $i . ']';
$form->addElement('html_editor', 'answer[' . $i . ']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
$form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('html_editor', 'comment[' . $i . ']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
$form->addElement('html', '</tr>');
}
//--------- Mise en variable du score global lors d'une modification de la question/r<EFBFBD>ponse
$defaults['weighting[1]'] = (round($scoreG));
$form->addElement('html', '</div></div></table>');
//$form -> addElement ('html', '<br />');
$form->add_multiple_required_rule($boxes_names, get_lang('ChooseAtLeastOneCheckbox'), 'multiple_required');
//only 1 answer the all deal ...
$form->addElement('text', 'weighting[1]', get_lang('Score'));
global $pts;
//--------- Creation coche pour ne pas prendre en compte les n<EFBFBD>gatifs
$form->addElement('checkbox', 'pts', '', get_lang('NoNegativeScore'));
$form->addElement('html', '<br />');
// Affiche un message si le score n'est pas renseign<EFBFBD>
$form->addRule('weighting[1]', get_lang('ThisFieldIsRequired'), 'required');
global $text, $class;
if ($obj_ex->edit_exercise_in_lp == true) {
$form->addButtonDelete(get_lang('LessAnswer'), 'lessAnswers');
$form->addButtonCreate(get_lang('PlusAnswer'), 'moreAnswers');
$form->addButtonSave($text, 'submitQuestion');
// setting the save button here and not in the question class.php
}
$renderer->setElementTemplate('{element}&nbsp;', 'lessAnswers');
$renderer->setElementTemplate('{element}&nbsp;', 'submitQuestion');
$renderer->setElementTemplate('{element}', 'moreAnswers');
$form->addElement('html', '</div></div>');
$defaults['correct'] = $correct;
if (!empty($this->id)) {
$form->setDefaults($defaults);
} else {
if ($this->isContent == 1) {
$form->setDefaults($defaults);
}
}
$form->setConstants(array('nb_answers' => $nb_answers));
}
/**
* abstract function which creates the form to create / edit the answers of the question
* @param FormValidator $form
*/
function processAnswersCreation($form)
{
$questionWeighting = $nbrGoodAnswers = 0;
$objAnswer = new Answer($this->id);
$nb_answers = $form->getSubmitValue('nb_answers');
// Score total
$answer_score = trim($form->getSubmitValue('weighting[1]'));
// Reponses correctes
$nbr_corrects = 0;
for ($i = 1; $i <= $nb_answers; $i++) {
$goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
if ($goodAnswer) {
$nbr_corrects++;
}
}
// Set question weighting (score total)
$questionWeighting = $answer_score;
// Set score per answer
$nbr_corrects = $nbr_corrects == 0 ? 1 : $nbr_corrects;
$answer_score = $nbr_corrects == 0 ? 0 : $answer_score;
$answer_score = ($answer_score / $nbr_corrects);
//$answer_score <EFBFBD>quivaut <EFBFBD> la valeur d'une bonne r<EFBFBD>ponse
// cr<EFBFBD>ation variable pour r<EFBFBD>cuperer la valeur de la coche pour la prise en compte des n<EFBFBD>gatifs
$test = $form->getSubmitValue('pts');
for ($i = 1; $i <= $nb_answers; $i++) {
$answer = trim($form->getSubmitValue('answer[' . $i . ']'));
$comment = trim($form->getSubmitValue('comment[' . $i . ']'));
$goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
if ($goodAnswer) {
$weighting = abs($answer_score);
} else {
if ($test == 1) {
$weighting = 0;
} else {
$weighting = -abs($answer_score);
}
}
$objAnswer->createAnswer($answer, $goodAnswer, $comment, $weighting, $i);
}
// saves the answers into the data base
$objAnswer->save();
// sets the total weighting of the question --> sert <EFBFBD> donner le score total pendant l'examen
$this->updateWeighting($questionWeighting);
$this->save();
}
public function return_header(
$feedback_type = null,
$counter = null,
$score = null
) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<th>' . get_lang("Choice") . '</th>
<th>' . get_lang("ExpectedChoice") . '</th>
<th>' . get_lang("Answer") . '</th>';
$header .= '<th>' . get_lang("Comment") . '</th>';
$header .= '</tr>';
return $header;
}
}
<?php
/* For licensing terms, see /license.txt */
/**
* Class GlobalMultipleAnswer
*/
class GlobalMultipleAnswer extends Question
{
static $typePicture = 'mcmagl.png';
static $explanationLangVar = 'GlobalMultipleAnswer';
/**
*
*/
public function __construct()
{
parent::__construct();
$this->type = GLOBAL_MULTIPLE_ANSWER;
$this->isContent = $this->getIsContent();
}
/**
* function which redefines Question::createAnswersForm
* @param FormValidator $form
*/
public function createAnswersForm($form)
{
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
$obj_ex = $_SESSION['objExercise'];
/* Mise en variable de Affichage "Reponses" et son icone, "N<EFBFBD>", "Vrai", "Reponse" */
$html = '<table class="data_table">
<tr>
<th width="10px">
' . get_lang('Number') . '
</th>
<th width="10px">
' . get_lang('True') . '
</th>
<th width="50%">
' . get_lang('Answer') . '
</th>';
$html .='<th>' . get_lang('Comment') . '</th>';
$html .='</tr>';
$form->addElement(
'label',
get_lang('Answers') .
'<br /> '.Display::return_icon('fill_field.png'),
$html
);
$defaults = array();
$correct = 0;
$answer = false;
if (!empty($this->id)) {
$answer = new Answer($this->id);
$answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers;
}
}
#le nombre de r<EFBFBD>ponses est bien enregistr<EFBFBD> sous la forme int(nb)
/* Ajout mise en forme nb reponse */
$form->addElement('hidden', 'nb_answers');
$boxes_names = array();
/* V<EFBFBD>rification : Cr<EFBFBD>action d'au moins une r<EFBFBD>ponse */
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
//D<EFBFBD>but affichage score global dans la modification d'une question
$scoreA = "0"; //par reponse
$scoreG = "0"; //Global
/* boucle pour sauvegarder les donn<EFBFBD>es dans le tableau defaults */
for ($i = 1; $i <= $nb_answers; ++$i) {
/* si la reponse est de type objet */
if (is_object($answer)) {
$defaults['answer[' . $i . ']'] = $answer->answer[$i];
$defaults['comment[' . $i . ']'] = $answer->comment[$i];
$defaults['correct[' . $i . ']'] = $answer->correct[$i];
// start
$scoreA = $answer->weighting[$i];
}
if ($scoreA > 0) {
$scoreG = $scoreG + $scoreA;
}
//------------- Fin
//------------- Debut si un des scores par reponse est egal <EFBFBD> 0 : la coche vaut 1 (coch<EFBFBD>)
if ($scoreA == 0) {
$defaults['pts'] = 1;
}
$renderer = & $form->defaultRenderer();
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
//$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
$answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"');
$answer_number->freeze();
$form->addElement('checkbox', 'correct[' . $i . ']', null, null, 'class="checkbox"');
$boxes_names[] = 'correct[' . $i . ']';
$form->addElement('html_editor', 'answer[' . $i . ']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
$form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('html_editor', 'comment[' . $i . ']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
$form->addElement('html', '</tr>');
}
//--------- Mise en variable du score global lors d'une modification de la question/r<EFBFBD>ponse
$defaults['weighting[1]'] = (round($scoreG));
$form->addElement('html', '</div></div></table>');
//$form -> addElement ('html', '<br />');
$form->add_multiple_required_rule($boxes_names, get_lang('ChooseAtLeastOneCheckbox'), 'multiple_required');
//only 1 answer the all deal ...
$form->addElement('text', 'weighting[1]', get_lang('Score'));
global $pts;
//--------- Creation coche pour ne pas prendre en compte les n<EFBFBD>gatifs
$form->addElement('checkbox', 'pts', '', get_lang('NoNegativeScore'));
$form->addElement('html', '<br />');
// Affiche un message si le score n'est pas renseign<EFBFBD>
$form->addRule('weighting[1]', get_lang('ThisFieldIsRequired'), 'required');
global $text, $class;
if ($obj_ex->edit_exercise_in_lp == true) {
$form->addButtonDelete(get_lang('LessAnswer'), 'lessAnswers');
$form->addButtonCreate(get_lang('PlusAnswer'), 'moreAnswers');
$form->addButtonSave($text, 'submitQuestion');
// setting the save button here and not in the question class.php
}
$renderer->setElementTemplate('{element}&nbsp;', 'lessAnswers');
$renderer->setElementTemplate('{element}&nbsp;', 'submitQuestion');
$renderer->setElementTemplate('{element}', 'moreAnswers');
$form->addElement('html', '</div></div>');
$defaults['correct'] = $correct;
if (!empty($this->id)) {
$form->setDefaults($defaults);
} else {
if ($this->isContent == 1) {
$form->setDefaults($defaults);
}
}
$form->setConstants(array('nb_answers' => $nb_answers));
}
/**
* abstract function which creates the form to create / edit the answers of the question
* @param FormValidator $form
*/
function processAnswersCreation($form)
{
$questionWeighting = $nbrGoodAnswers = 0;
$objAnswer = new Answer($this->id);
$nb_answers = $form->getSubmitValue('nb_answers');
// Score total
$answer_score = trim($form->getSubmitValue('weighting[1]'));
// Reponses correctes
$nbr_corrects = 0;
for ($i = 1; $i <= $nb_answers; $i++) {
$goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
if ($goodAnswer) {
$nbr_corrects++;
}
}
// Set question weighting (score total)
$questionWeighting = $answer_score;
// Set score per answer
$nbr_corrects = $nbr_corrects == 0 ? 1 : $nbr_corrects;
$answer_score = $nbr_corrects == 0 ? 0 : $answer_score;
$answer_score = ($answer_score / $nbr_corrects);
//$answer_score <EFBFBD>quivaut <EFBFBD> la valeur d'une bonne r<EFBFBD>ponse
// cr<EFBFBD>ation variable pour r<EFBFBD>cuperer la valeur de la coche pour la prise en compte des n<EFBFBD>gatifs
$test = $form->getSubmitValue('pts');
for ($i = 1; $i <= $nb_answers; $i++) {
$answer = trim($form->getSubmitValue('answer[' . $i . ']'));
$comment = trim($form->getSubmitValue('comment[' . $i . ']'));
$goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
if ($goodAnswer) {
$weighting = abs($answer_score);
} else {
if ($test == 1) {
$weighting = 0;
} else {
$weighting = -abs($answer_score);
}
}
$objAnswer->createAnswer($answer, $goodAnswer, $comment, $weighting, $i);
}
// saves the answers into the data base
$objAnswer->save();
// sets the total weighting of the question --> sert <EFBFBD> donner le score total pendant l'examen
$this->updateWeighting($questionWeighting);
$this->save();
}
public function return_header(
$feedback_type = null,
$counter = null,
$score = null
) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<th>' . get_lang("Choice") . '</th>
<th>' . get_lang("ExpectedChoice") . '</th>
<th>' . get_lang("Answer") . '</th>';
$header .= '<th>' . get_lang("Comment") . '</th>';
$header .= '</tr>';
return $header;
}
}

@ -31,7 +31,7 @@ if (!empty($gradebook) && $gradebook == 'view') {
}
// The breadcrumbs.
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH) . '.exercice/exercise.php?' . api_get_cidreq(),
'url' => api_get_path(WEB_CODE_PATH) . '.exercise/exercise.php?' . api_get_cidreq(),
'name' => get_lang('Exercises')
);

@ -64,7 +64,7 @@ if ($modifyIn) {
unset($buttonBack);
}
$hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercice/admin.php?' . api_get_cidreq() . '&exerciseId=' . $exerciseId;
$hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercise/admin.php?' . api_get_cidreq() . '&exerciseId=' . $exerciseId;
// the answer form has been submitted
$submitAnswers = isset($_POST['submitAnswers']) ? true : false;
@ -572,7 +572,7 @@ if ($modifyAnswers) {
Display::display_normal_message($msgErr); //main API
}
$hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercice/admin.php?' . api_get_cidreq() . '&hotspotadmin=' . $modifyAnswers . '&exerciseId=' . $exerciseId . '&' . api_get_cidreq();
$hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercise/admin.php?' . api_get_cidreq() . '&hotspotadmin=' . $modifyAnswers . '&exerciseId=' . $exerciseId . '&' . api_get_cidreq();
?>
<form method="post" action="<?php echo $hotspot_admin_url; ?>" class="form-horizontal" id="frm_exercise" name="frm_exercise">
<div class="form-group">

@ -78,7 +78,7 @@ $edit_link = '';
if ($is_allowed_to_edit && $objExercise->sessionId == $sessionId) {
$edit_link = Display::url(
Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL),
api_get_path(WEB_CODE_PATH).'exercice/admin.php?'.api_get_cidreq().'&id_session='.api_get_session_id().'&exerciseId='.$objExercise->id
api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&id_session='.api_get_session_id().'&exerciseId='.$objExercise->id
);
}
$iconExercise = Display::return_icon('test-quiz.png', null, array(), ICON_SIZE_MEDIUM);
@ -118,7 +118,7 @@ if (!empty($attempt_list)) {
// 2. Exercise button
// Notice we not add there the lp_item_view_id because is not already generated
$exercise_url = api_get_path(WEB_CODE_PATH).'exercice/exercise_submit.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.$extra_params;
$exercise_url = api_get_path(WEB_CODE_PATH) . 'exercise/exercise_submit.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.$extra_params;
$exercise_url_button = Display::url(
$label,
$exercise_url,
@ -184,7 +184,7 @@ if (!empty($attempts)) {
$attempt_result['exe_result'],
$attempt_result['exe_weighting']
);
$attempt_url = api_get_path(WEB_CODE_PATH) . 'exercice/result.php?';
$attempt_url = api_get_path(WEB_CODE_PATH) . 'exercise/result.php?';
$attempt_url .= api_get_cidreq() . '&show_headers=1&';
$attempt_url .= http_build_query([
'id' => $attempt_result['exe_id']

@ -22,7 +22,7 @@ if (!api_is_allowed_to_edit(null, true)) {
// the breadcrumbs
$interbreadcrumb[]= array (
"url" => api_get_path(WEB_CODE_PATH)."exercice/exercise.php?".api_get_cidreq(),
"url" => api_get_path(WEB_CODE_PATH) . "exercise/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/exercise.php?show=test&'.api_get_cidreq().'">'.
$form .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise.php?show=test&'.api_get_cidreq().'">'.
Display :: return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>';
$form .= '</div>';
$formValidator = new FormValidator(
@ -67,8 +67,8 @@ function ch_qti2_import_file($array_file)
if ($process && $unzip == 1) {
$main_path = api_get_path(SYS_CODE_PATH);
require_once $main_path.'exercice/export/exercise_import.inc.php';
require_once $main_path.'exercice/export/qti2/qti2_classes.php';
require_once $main_path.'exercise/export/exercise_import.inc.php';
require_once $main_path.'exercise/export/qti2/qti2_classes.php';
return import_exercise($array_file['name']);
}
@ -84,7 +84,7 @@ if ((api_is_allowed_to_edit(null, true))) {
$imported = ch_qti2_import_file($_FILES['userFile']);
if (is_numeric($imported) && !empty($imported)) {
header('Location: '.api_get_path(WEB_CODE_PATH).'exercice/admin.php?'.api_get_cidreq().'&exerciseId='.$imported);
header('Location: '.api_get_path(WEB_CODE_PATH) . 'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$imported);
exit;
} else {
$message = Display::return_message(get_lang($imported));

@ -8,7 +8,7 @@
*/
require_once '../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/hotpotatoes.lib.php';
require_once api_get_path(SYS_CODE_PATH).'exercise/hotpotatoes.lib.php';
$_course = api_get_course_info();
$time = time();
@ -38,9 +38,9 @@ if ($content == '') {
if (SaveScoreVariable==0) {
SaveScoreVariable = 1;
if (C.ie) {
document.location.href = '".api_get_path(WEB_PATH)."main/exercice/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score;
document.location.href = '" . api_get_path(WEB_CODE_PATH) . "exercise/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score;
} else {
window.location.href = '".api_get_path(WEB_PATH)."main/exercice/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score;
window.location.href = '" . api_get_path(WEB_CODE_PATH) . "exercise/savescores.php?lp_view_id=$lpViewId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&time=".Security::remove_XSS($time)."&test=".$doc_url."&uid=".$user_id."&cid=".$cid."&score='+Score;
}
}
}

@ -85,7 +85,7 @@ function lp_upload_quiz_main() {
$form->addElement('header', get_lang('ImportExcelQuiz'));
$form->addElement('file', 'user_upload_quiz', get_lang('FileUpload'));
$link = '<a href="../exercice/quiz_template.xls">'.
$link = '<a href="../exercise/quiz_template.xls">'.
Display::return_icon('export_excel.png', get_lang('DownloadExcelTemplate')).get_lang('DownloadExcelTemplate').'</a>';
$form->addElement('label', '', $link);
@ -621,8 +621,8 @@ 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());
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>';
// header('location: exercise.php?' . api_get_cidreq());
echo '<script>window.location.href = "'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$quiz_id.'&session_id='.api_get_session_id().'"</script>';
}
}
}

@ -22,7 +22,7 @@ $type = Security::remove_XSS($_GET['type']);
$doExerciseUrl = '';
if (isset($_GET['doexercise'])) {
$doExerciseUrl = api_get_path(WEB_CODE_PATH) . 'exercice/overview.php?' . http_build_query([
$doExerciseUrl = api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?' . http_build_query([
'session_id' => $session_id,
'cidReq' => $cidReq,
'gradebook' => $gradebook,
@ -35,14 +35,14 @@ if (isset($_GET['doexercise'])) {
// no support for hot potatoes
if ($type == LINK_HOTPOTATOES) {
$doExerciseUrl = api_get_path(WEB_CODE_PATH).'exercice/exercice.php?session_id='.$session_id.'&cidReq='.Security::remove_XSS($cidReq);
$doExerciseUrl = api_get_path(WEB_CODE_PATH) . 'exercise/exercice.php?session_id='.$session_id.'&cidReq='.Security::remove_XSS($cidReq);
}
if (isset($_GET['doexercise'])) {
header('Location: '.$doExerciseUrl);
exit;
} else {
$url = api_get_path(WEB_CODE_PATH).'exercice/overview.php?session_id='.$session_id.'&cidReq='.Security::remove_XSS($cidReq);
$url = api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?session_id='.$session_id.'&cidReq='.Security::remove_XSS($cidReq);
if (isset($_GET['gradebook'])) {
$url .= '&gradebook=view&exerciseId='.intval($_GET['exerciseId']);

@ -103,7 +103,7 @@ class ExerciseLink extends AbstractLink
ip.visibility='1'
";
require_once api_get_path(SYS_CODE_PATH).'exercice/hotpotatoes.lib.php';
require_once api_get_path(SYS_CODE_PATH).'exercise/hotpotatoes.lib.php';
$exerciseInLP = array();
if (!$this->is_hp) {
$result = Database::query($sql);
@ -191,7 +191,7 @@ class ExerciseLink extends AbstractLink
$tblDoc = Database::get_course_table(TABLE_DOCUMENT);
/* the following query should be similar (in conditions) to the one used
in exercice/exercice.php, look for note-query-exe-results marker*/
in exercise/exercise.php, look for note-query-exe-results marker*/
$session_id = $this->get_session_id();
$courseId = $this->getCourseId();
$exercise = new Exercise($courseId);
@ -332,7 +332,7 @@ class ExerciseLink extends AbstractLink
public function get_name()
{
$documentPath = api_get_path(SYS_COURSE_PATH).$this->course_code."/document";
require_once api_get_path(SYS_CODE_PATH).'exercice/hotpotatoes.lib.php';
require_once api_get_path(SYS_CODE_PATH).'exercise/hotpotatoes.lib.php';
$data = $this->get_exercise_data();
if ($this->is_hp == 1) {
if (isset($data['path'])) {

@ -519,7 +519,7 @@ class AddCourse
);
Database::query(
"INSERT INTO $tbl_course_homepage (c_id, id, name, link, image, visibility, admin, address, added_tool, target, category, session_id)
VALUES ($course_id, 6, '" . TOOL_QUIZ . "','exercice/exercice.php','quiz.gif','" . self::string2binary(
VALUES ($course_id, 6, '" . TOOL_QUIZ . "','exercise/exercise.php','quiz.gif','" . self::string2binary(
api_get_setting('course_create_active_tools', 'quiz')
) . "','0','squaregrey.gif',0,'_self','authoring','0')"
);

@ -5737,7 +5737,7 @@ class CourseManager
$result = $objExercise->read($exercise_redirect);
if (!empty($exercise_redirect) && !empty($result)) {
$form_data['action'] = api_get_path(WEB_CODE_PATH).'exercice/overview.php?exerciseId='.$exercise_redirect.'&cidReq='.$course_info['code'];
$form_data['action'] = api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?exerciseId='.$exercise_redirect.'&cidReq='.$course_info['code'];
$form_data['message'] .= '<br />'.get_lang('YouCanAccessTheExercise');
$form_data['button'] = Display::button(
'next',

@ -316,7 +316,7 @@ class Event
*
* @author Sebastien Piraux <piraux_seb@hotmail.com>
* @author Julio Montoya Armas <gugli100@gmail.com> Reworked 2010
* @desc Record result of user when an exercice was done
* @desc Record result of user when an exercise was done
*/
public static function update_event_exercice(
$exeid,

@ -556,7 +556,7 @@ class ExerciseLib
break;
case FILL_IN_BLANKS:
// display the question, with field empty, for student to fill it,
// or filled to display the answer in the Question preview of the exercice/admin.php page
// or filled to display the answer in the Question preview of the exercise/admin.php page
$displayForStudent = true;
$listAnswerInformations = FillBlanks::getAnswerInfo($answer);
$separatorStartRegexp = FillBlanks::escapeForRegexp($listAnswerInformations['blankseparatorstart']);
@ -574,7 +574,7 @@ class ExerciseLib
$studentAnswerList = $arrayStudentAnswer['studentanswer'];
}
// If the question must be shown with the answer (in page exercice/admin.php) for teacher preview
// If the question must be shown with the answer (in page exercise/admin.php) for teacher preview
// set the student-answer to the correct answer
if ($debug_mark_answer) {
$studentAnswerList = $correctAnswerList;
@ -1461,7 +1461,7 @@ HOTSPOT;
$result = array();
$apiIsAllowedToEdit = api_is_allowed_to_edit();
$urlBase = api_get_path(WEB_CODE_PATH) .
'exercice/hotpotatoes_exercise_report.php?action=delete&' .
'exercise/hotpotatoes_exercise_report.php?action=delete&' .
api_get_cidreq() . '&id=';
while ($data = Database::fetch_array($res)) {
$actions = null;
@ -1987,7 +1987,7 @@ HOTSPOT;
} else {
$attempt_url = api_get_path(
WEB_CODE_PATH
) . 'exercice/result.php?' . api_get_cidreq() . '&id=' . $results[$i]['exe_id'] . '&id_session=' . $sessionId;
) . 'exercise/result.php?' . api_get_cidreq() . '&id=' . $results[$i]['exe_id'] . '&id_session=' . $sessionId;
$attempt_link = Display::url(
get_lang('Show'),
$attempt_url,

@ -1139,13 +1139,13 @@ window.HotspotQuestion = (function () {
switch (config.for) {
case 'admin':
xhrQuestion = $.getJSON(config.relPath+'main/exercice/hotspot_actionscript_admin.as.php', {
xhrQuestion = $.getJSON(config.relPath+'main/exercise/hotspot_actionscript_admin.as.php', {
modifyAnswers: parseInt(config.questionId)
});
break;
case 'user':
xhrQuestion = $.getJSON(config.relPath+'main/exercice/hotspot_actionscript.as.php', {
xhrQuestion = $.getJSON(config.relPath+'main/exercise/hotspot_actionscript.as.php', {
modifyAnswers: parseInt(config.questionId),
exe_id: parseInt(config.exerciseId)
});
@ -1154,7 +1154,7 @@ window.HotspotQuestion = (function () {
case 'solution':
//no break
case 'preview':
xhrQuestion = $.getJSON(config.relPath+'main/exercice/hotspot_answers.as.php', {
xhrQuestion = $.getJSON(config.relPath+'main/exercise/hotspot_answers.as.php', {
modifyAnswers: parseInt(config.questionId),
exe_id: parseInt(config.exerciseId)
});
@ -1763,13 +1763,13 @@ window.DelineationQuestion = (function () {
switch (config.for) {
case 'admin':
xhrQuestion = $.getJSON(config.relPath+'main/exercice/hotspot_actionscript_admin.as.php', {
xhrQuestion = $.getJSON(config.relPath+'main/exercise/hotspot_actionscript_admin.as.php', {
modifyAnswers: parseInt(config.questionId)
});
break;
case 'user':
xhrQuestion = $.getJSON(config.relPath+'main/exercice/hotspot_actionscript.as.php', {
xhrQuestion = $.getJSON(config.relPath+'main/exercise/hotspot_actionscript.as.php', {
modifyAnswers: parseInt(config.questionId)
});
break;
@ -1777,7 +1777,7 @@ window.DelineationQuestion = (function () {
case 'solution':
//no break
case 'preview':
xhrQuestion = $.getJSON(config.relPath+'main/exercice/hotspot_answers.as.php', {
xhrQuestion = $.getJSON(config.relPath+'main/exercise/hotspot_answers.as.php', {
modifyAnswers: parseInt(config.questionId),
exe_id: parseInt(config.exerciseId)
});

@ -70,7 +70,7 @@ class quiz_processor extends search_processor {
$visibility = api_get_item_visibility(api_get_course_info($courseid), TOOL_QUIZ, $exercise_id);
if ($visibility) {
list($thumbnail, $image, $name, $author) = $this->get_information($courseid, $exercise_id);
$url = api_get_path(WEB_PATH) . 'main/exercice/exercise_submit.php?cidReq=%s&exerciseId=%s';
$url = api_get_path(WEB_CODE_PATH) . 'exercise/exercise_submit.php?cidReq=%s&exerciseId=%s';
$url = sprintf($url, $courseid, $exercise_id);
$result = array(
'toolid' => TOOL_QUIZ,

@ -959,7 +959,7 @@ class Tracking
</td>';
} else {
$output .= '<td>
<a href="../exercice/exercise_show.php?origin=' . $origin . '&id=' . $my_exe_id . '&cidReq=' . $courseCode . '" target="_parent">
<a href="../exercise/exercise_show.php?origin=' . $origin . '&id=' . $my_exe_id . '&cidReq=' . $courseCode . '" target="_parent">
<img src="' . Display::returnIconPath('quiz.gif').'" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '">
</a></td>';
}
@ -969,7 +969,7 @@ class Tracking
<img src="' . Display::returnIconPath('quiz_na.gif').'" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></td>';
} else {
$output .= '<td>
<a href="../exercice/exercise_show.php?cidReq=' . $courseCode . '&origin=correct_exercise_in_lp&id=' . $my_exe_id . '" target="_parent">
<a href="../exercise/exercise_show.php?cidReq=' . $courseCode . '&origin=correct_exercise_in_lp&id=' . $my_exe_id . '" target="_parent">
<img src="' . Display::returnIconPath('quiz.gif').'" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></a></td>';
}
}
@ -4799,7 +4799,7 @@ class Tracking
);
$html .= '<tr class="row_even">';
$url = api_get_path(WEB_CODE_PATH)."exercice/overview.php?cidReq={$course_info['code']}&id_session=$session_id&exerciseId={$exercices['id']}";
$url = api_get_path(WEB_CODE_PATH) . "exercise/overview.php?cidReq={$course_info['code']}&id_session=$session_id&exerciseId={$exercices['id']}";
if ($visible_return['value'] == true) {
$exercices['title'] = Display::url(
@ -4858,7 +4858,7 @@ class Tracking
$weighting = $exercise_stat['exe_weighting'];
$exe_id = $exercise_stat['exe_id'];
$latest_attempt_url .= api_get_path(WEB_CODE_PATH).'exercice/result.php?id='.$exe_id.'&cidReq='.$course_info['code'].'&show_headers=1&id_session='.$session_id;
$latest_attempt_url .= api_get_path(WEB_CODE_PATH) . 'exercise/result.php?id='.$exe_id.'&cidReq='.$course_info['code'].'&show_headers=1&id_session='.$session_id;
$percentage_score_result = Display::url(ExerciseLib::show_score($score, $weighting), $latest_attempt_url);
$my_score = 0;
if (!empty($weighting) && intval($weighting) != 0) {
@ -6092,7 +6092,7 @@ class TrackingCourseLog
break;
case 'quiz':
$table_name = TABLE_QUIZ_TEST;
$link_tool = 'exercice/exercice.php';
$link_tool = 'exercise/exercise.php';
$id_tool = 'id';
break;
case 'glossary':

@ -79,7 +79,7 @@ class IndexManager
if (!empty($exercise_list)) {
$exercise_list = msort($exercise_list, 'tms');
$my_exercise = $exercise_list[0];
$url = Display::url($my_exercise['title'], api_get_path(WEB_CODE_PATH).'exercice/overview.php?exerciseId='.$my_exercise['id'].'&cidReq='.$my_exercise['course_code'].'&id_session='.$my_exercise['session_id']);
$url = Display::url($my_exercise['title'], api_get_path(WEB_CODE_PATH).'exercise/overview.php?exerciseId='.$my_exercise['id'].'&cidReq='.$my_exercise['course_code'].'&id_session='.$my_exercise['session_id']);
$this->tpl->assign('exercise_url', $url);
$this->tpl->assign('exercise_end_date', api_convert_and_format_date($my_exercise['end_time'], DATE_FORMAT_SHORT));
}

@ -1144,14 +1144,14 @@ if (!empty($student_id)) {
if (Database :: num_rows($result_last_attempt) > 0) {
$id_last_attempt = Database :: result($result_last_attempt, 0, 0);
if ($count_attempts > 0)
echo '<a href="../exercice/exercise_show.php?id=' . $id_last_attempt . '&cidReq='.$course_code.'&session_id='.$sessionId.'&student='.$student_id.'&origin='.(empty($origin)?'tracking':$origin).'">
echo '<a href="../exercise/exercise_show.php?id=' . $id_last_attempt . '&cidReq='.$course_code.'&session_id='.$sessionId.'&student='.$student_id.'&origin='.(empty($origin)?'tracking':$origin).'">
'.Display::return_icon('quiz.gif').'
</a>';
}
echo '</td>';
echo '<td>';
$all_attempt_url = "../exercice/exercise_report.php?exerciseId=$exercise_id&cidReq=$course_code&filter_by_user=$student_id&id_session=$sessionId";
$all_attempt_url = "../exercise/exercise_report.php?exerciseId=$exercise_id&cidReq=$course_code&filter_by_user=$student_id&id_session=$sessionId";
echo Display::url(Display::return_icon('test_results.png', get_lang('AllAttempts'), array(), ICON_SIZE_SMALL), $all_attempt_url );
echo '</td></tr>';

@ -6304,7 +6304,7 @@ class learnpath
$return .= $exercise->description.'<br />';
$return .= Display::url(
get_lang('GoToExercise'),
api_get_path(WEB_CODE_PATH).'exercice/overview.php?'.api_get_cidreq().'&exerciseId='.$exercise->id,
api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?' . api_get_cidreq() . '&exerciseId=' . $exercise->id,
['class' => 'btn btn-primary']
);
}
@ -8895,7 +8895,7 @@ class learnpath
$return .= '<li class="lp_resource_element">';
$return .= Display::return_icon('new_test_small.gif');
$return .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'exercice/exercise_admin.php?'.api_get_cidreq().'&lp_id=' . $this->lp_id . '">' .
$return .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise_admin.php?'.api_get_cidreq().'&lp_id=' . $this->lp_id . '">' .
get_lang('NewExercise') . '</a>';
$return .= '</li>';

@ -331,7 +331,7 @@ if (
if (intval($_GET['fb_type']) > 0) {
$src = 'blank.php?msg=exerciseFinished';
} else {
$src = api_get_path(WEB_CODE_PATH) . 'exercice/result.php?origin=learnpath&id=' . $safe_exe_id.'&'.api_get_cidreq();
$src = api_get_path(WEB_CODE_PATH) . 'exercise/result.php?origin=learnpath&id=' . $safe_exe_id.'&'.api_get_cidreq();
if ($debug) {
error_log('Calling URL: ' . $src);

@ -23,7 +23,7 @@ if (!empty($_course['language'])){
require_once $resource_linker_file;
}
}
require_once '../exercice/hotpotatoes.lib.php';
require_once '../exercise/hotpotatoes.lib.php';
/* FUNCTIONS */
@ -244,13 +244,13 @@ function display_addedresource_link($type, $id, $style = '')
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$result = Database::query("SELECT * FROM $TBL_EXERCICES WHERE c_id = $course_id AND id=$id");
$myrow = Database::fetch_array($result);
echo '<img src="../img/quiz.gif" align="middle" /> <a href="../exercice/exercise_submit.php?exerciseId='.$myrow['id'].'"'.$styling.'>'.$myrow['title']."</a><br />\n";
echo '<img src="../img/quiz.gif" align="middle" /> <a href="../exercise/exercise_submit.php?exerciseId='.$myrow['id'].'"'.$styling.'>'.$myrow['title']."</a><br />\n";
break;
case 'Forum':
$TBL_FORUMS = Database::get_course_table(TABLE_FORUM);
$result = Database::query("SELECT * FROM $TBL_FORUMS WHERE c_id = $course_id AND forum_id=$id");
$myrow = Database::fetch_array($result);
echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewforum.php?forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow['forum_name']."</a><br />\n";
echo '<img src="../img/forum.gif" align="middle" /> <a href="../forum/viewforum.php?forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow['forum_name']."</a><br />\n";
break;
case 'Thread': //=topics
//@deprecated bb_posts, bb_posts_text, bb_forums
@ -532,7 +532,7 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
}
}
} else {
echo "<a href=\"../exercice/exercise_submit.php?origin=$origin&exerciseId=".$myrow['id']."\" class='$completed' target='_blank'>".shorten($myrow['title'], ($length-3*$level))."</a>";
echo "<a href=\"../exercise/exercise_submit.php?origin=$origin&exerciseId=".$myrow['id']."\" class='$completed' target='_blank'>".shorten($myrow['title'], ($length-3*$level))."</a>";
}
break;
@ -583,7 +583,7 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
}
}
} else {
echo "&nbsp;<a href=\"../exercice/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
echo "&nbsp;<a href=\"../exercise/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
}
break;
@ -1115,7 +1115,7 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
if ($builder != 'builder') {
$link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path";
} else {
$link .= "../exercice/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"];
$link .= "../exercise/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"];
}
break;
case 'HotPotatoes':
@ -1132,7 +1132,7 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
if ($builder != 'builder') {
$link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path";
} else {
$link .= "../exercice/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id'];
$link .= "../exercise/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id'];
}
break;
case 'Forum':
@ -1548,13 +1548,13 @@ function rl_get_html_resource_link($course_code, $type, $id, $style='', $new_win
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$result = Database::query("SELECT * FROM $TBL_EXERCICES WHERE c_id = $course_id AND id=$id");
$myrow = Database::fetch_array($result);
$output = '<img src="../img/quiz.gif" align="middle" /> <a href="../exercice/exercise_submit.php?exerciseId='.$myrow['id'].'"'.$styling.' '.$target.'>'.$myrow['title']."</a><br />\n";
$output = '<img src="../img/quiz.gif" align="middle" /> <a href="../exercise/exercise_submit.php?exerciseId='.$myrow['id'].'"'.$styling.' '.$target.'>'.$myrow['title']."</a><br />\n";
break;
case TOOL_FORUM:
$TBL_FORUMS = Database::get_course_table(TABLE_FORUM);
$result = Database::query("SELECT * FROM $TBL_FORUMS WHERE c_id = $course_id AND forum_id=$id");
$myrow = Database::fetch_array($result);
$output = '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewforum.php?forum='.$myrow['forum_id'].'&md5='.$myrow['md5'].'"'.$styling.' '.$target.'>'.$myrow['forum_name']."</a><br />\n";
$output = '<img src="../img/forum.gif" align="middle" /> <a href="../forum/viewforum.php?forum='.$myrow['forum_id'].'&md5='.$myrow['md5'].'"'.$styling.' '.$target.'>'.$myrow['forum_name']."</a><br />\n";
break;
case TOOL_THREAD: //=topics
//$tbl_forum = Database::get_course_table(TABLE_FORUM);
@ -1564,7 +1564,7 @@ function rl_get_html_resource_link($course_code, $type, $id, $style='', $new_win
$sql_title = "SELECT * FROM $tbl_post WHERE c_id = $course_id AND post_id=".$id;
$result_title = Database::query($sql_title);
$myrow_title = Database::fetch_array($result_title);
$output = '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$myrow_title['thread_id'].'&forum='.$myrow_title['forum_id'].'" '.$styling.' '.$target.'>'.$myrow_title['post_title']."</a><br />\n";
$output = '<img src="../img/forum.gif" align="middle" /> <a href="../forum/viewtopic.php?topic='.$myrow_title['thread_id'].'&forum='.$myrow_title['forum_id'].'" '.$styling.' '.$target.'>'.$myrow_title['post_title']."</a><br />\n";
break;
case TOOL_POST:
$tbl_post = Database::get_course_table(TABLE_FORUM_POST);
@ -1572,7 +1572,7 @@ function rl_get_html_resource_link($course_code, $type, $id, $style='', $new_win
$sql = "SELECT * FROM $tbl_post p WHERE c_id = $course_id AND p.post_id = $id";
$result = Database::query($sql);
$post = Database::fetch_array($result);
$output = '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$post['thread_id'].'&forum='.$post['forum_id'].'"'.$styling.' '.$target.'>'.$post['post_title']."</a><br />\n";
$output = '<img src="../img/forum.gif" align="middle" /> <a href="../forum/viewtopic.php?topic='.$post['thread_id'].'&forum='.$post['forum_id'].'"'.$styling.' '.$target.'>'.$post['post_title']."</a><br />\n";
break;
case TOOL_DOCUMENT:
$tbl_doc = Database::get_course_table(TABLE_DOCUMENT);
@ -1661,7 +1661,7 @@ function rl_get_resource_link_for_learnpath($course_id, $learnpath_id, $id_in_pa
if ($row_item['title'] != '') {
$myrow['title'] = $row_item['title'];
}
$link .= $main_dir_path.'exercice/overview.php?cidReq='.$course_code.'&session_id='.$session_id.'&lp_init=1&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$id_in_path.'&exerciseId='.$id;
$link .= $main_dir_path . 'exercise/overview.php?cidReq='.$course_code.'&session_id='.$session_id.'&lp_init=1&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$id_in_path.'&exerciseId='.$id;
}
break;
case 'hotpotatoes': //lowercase because of strtolower above
@ -1669,7 +1669,7 @@ function rl_get_resource_link_for_learnpath($course_id, $learnpath_id, $id_in_pa
$result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE c_id = $course_id AND id=$id");
$myrow = Database::fetch_array($result);
$path = $myrow['path'];
$link .= $main_dir_path.'exercice/showinframes.php?file='.$path.'' .
$link .= $main_dir_path . 'exercise/showinframes.php?file='.$path.'' .
'&origin='.$origin.'&cid='.$course_code.'&uid='.api_get_user_id().'' .
'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$id_in_path.'&lp_view_id='.$lpViewId;
break;

@ -367,7 +367,7 @@ if ($_GET['source_id']) {
unset ($from_learnpath);
break;
case '4': // coming from exercises: edit topic
$url = "../exercice/admin.php?modifyAnswers=$modifyAnswers";
$url = "../exercise/admin.php?modifyAnswers=$modifyAnswers";
$originaltoolname = get_lang('ExerciseAnswers');
$breadcrumbelement = array ('url' => $url, 'name' => $originaltoolname);
session_unregister('from_learnpath');

@ -17,7 +17,7 @@ use ChamiloSession as Session;
* INIT SECTION
*/
include(api_get_path(SYS_CODE_PATH).'exercice/hotpotatoes.lib.php');
include(api_get_path(SYS_CODE_PATH).'exercise/hotpotatoes.lib.php');
/**
* FUNCTIONS
@ -273,13 +273,13 @@ function display_addedresource_link($type, $id, $style='')
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$result = Database::query("SELECT * FROM $TBL_EXERCICES WHERE c_id = $course_id AND id=$id");
$myrow = Database::fetch_array($result);
echo '<img src="../img/quiz.gif" align="middle" /> <a href="../exercice/exercise_submit.php?exerciseId='.$myrow['id'].'"'.$styling.'>'.$myrow['title']."</a><br />\n";
echo '<img src="../img/quiz.gif" align="middle" /> <a href="../exercise/exercise_submit.php?exerciseId='.$myrow['id'].'"'.$styling.'>'.$myrow['title']."</a><br />\n";
break;
case 'Forum':
$TBL_FORUMS = Database::get_course_table(TABLE_FORUM);
$result = Database::query("SELECT * FROM $TBL_FORUMS WHERE c_id = $course_id AND forum_id=$id");
$myrow = Database::fetch_array($result);
echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewforum.php?forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow['forum_name']."</a><br />\n";
echo '<img src="../img/forum.gif" align="middle" /> <a href="../forum/viewforum.php?forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow['forum_name']."</a><br />\n";
break;
case 'Thread': //=topics
//deprecated
@ -292,7 +292,7 @@ function display_addedresource_link($type, $id, $style='')
$sql_title = "SELECT * FROM $tbl_posts_text WHERE post_id=".$myrow["post_id"];
$result_title = Database::query($sql_title);
$myrow_title = Database::fetch_array($result_title);
echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$myrow['topic_id'].'&amp;forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n";
echo '<img src="../img/forum.gif" align="middle" /> <a href="../forum/viewtopic.php?topic='.$myrow['topic_id'].'&amp;forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n";
break;
case 'Post':
//deprecated
@ -572,7 +572,7 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
}
else
{
echo "<a href=\"../exercice/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"]."\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>";
echo "<a href=\"../exercise/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"]."\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>";
}
break;
@ -630,7 +630,7 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
}
else
{
echo "&nbsp;<a href=\"../exercice/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
echo "&nbsp;<a href=\"../exercise/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>";
}
break;
@ -1203,7 +1203,7 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
}
else
{
$link .= "../exercice/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"];
$link .= "../exercise/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"];
}
break;
@ -1225,7 +1225,7 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
}
else
{
$link .= "../exercice/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."";
$link .= "../exercise/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."";
}
break;

@ -313,7 +313,7 @@ if ($_GET["source_id"])
unset ($from_learnpath);
break;
case "4" : // coming from exercises: edit topic
$url = "../exercice/admin.php?modifyAnswers=$modifyAnswers";
$url = "../exercise/admin.php?modifyAnswers=$modifyAnswers";
$originaltoolname = get_lang("ExerciseAnswers");
$breadcrumbelement = array ("url" => $url, "name" => $originaltoolname);
session_unregister('from_learnpath');

@ -332,7 +332,7 @@ foreach ($final_array as $session_data) {
$exercise_info->exercise = Display::url(
$exercise_info->exercise,
api_get_path(WEB_CODE_PATH)."exercice/result.php?cidReq=$my_course_code&id={$exercise_result['exe_id']}&id_session=$session_id&show_headers=1",
api_get_path(WEB_CODE_PATH) . "exercise/result.php?cidReq=$my_course_code&id={$exercise_result['exe_id']}&id_session=$session_id&show_headers=1",
array('target'=>SESSION_LINK_TARGET,'class'=>'exercise-result-link')
);
@ -358,7 +358,7 @@ foreach ($final_array as $session_data) {
}
$exercise_info->exercise = Display::url(
$exercise_info->exercise,
api_get_path(WEB_CODE_PATH)."exercice/overview.php?cidReq=$my_course_code&exerciseId={$exercise_info->id}&id_session=$session_id",
api_get_path(WEB_CODE_PATH) . "exercise/overview.php?cidReq=$my_course_code&exerciseId={$exercise_info->id}&id_session=$session_id",
array('target'=>SESSION_LINK_TARGET)
);

@ -250,7 +250,7 @@ if ($exerciseReporting) {
$quiz_avg_score = round(($quiz_avg_score / $studentCount), 2).'%';
$url = api_get_path(
WEB_CODE_PATH
).'exercice/overview.php?exerciseId='.$quiz['id'].$course_path_params;
) . 'exercise/overview.php?exerciseId='.$quiz['id'].$course_path_params;
echo '<tr><td>'.Display::url(
$quiz['title'],

@ -26,7 +26,7 @@ $is_allowed = true;
/* Libraries */
require_once api_get_path(SYS_CODE_PATH).'resourcelinker/resourcelinker.inc.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/hotpotatoes.lib.php';
require_once api_get_path(SYS_CODE_PATH).'exercise/hotpotatoes.lib.php';
/* Header */

@ -27,7 +27,7 @@ $is_allowed = true;
/* Libraries */
require_once api_get_path(SYS_CODE_PATH) . 'resourcelinker/resourcelinker.inc.php';
require_once api_get_path(SYS_CODE_PATH) . 'exercice/hotpotatoes.lib.php';
require_once api_get_path(SYS_CODE_PATH) . 'exercise/hotpotatoes.lib.php';
/* Header */

@ -13,7 +13,7 @@ use Doctrine\ORM\Mapping as ORM;
* indexes={
* @ORM\Index(name="course", columns={"c_id"}),
* @ORM\Index(name="question", columns={"question_id"}),
* @ORM\Index(name="exercice", columns={"exercice_id"})
* @ORM\Index(name="exercise", columns={"exercice_id"})
* }
* )
* @ORM\Entity

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save