Minor - fix php code

pull/3064/head
Julio 5 years ago
parent 4ff1aed266
commit aa807dd19d
  1. 1
      public/main/exercise/exercise.php
  2. 12
      public/main/exercise/exercise_history.php
  3. 4
      public/main/exercise/exercise_report.php
  4. 15
      public/main/inc/lib/api.lib.php
  5. 24
      public/main/inc/lib/search/IndexableChunk.class.php

@ -103,6 +103,7 @@ if ($is_allowedToEdit && !empty($action)) {
case 'remove_shortcut':
$repo = Container::getShortcutRepository();
$shortCut = $repo->getShortcutFromResource($exerciseEntity);
$courseEntity = api_get_course_entity(api_get_course_int_id());
if (null !== $shortCut) {
$repo->addResourceNode($shortCut, api_get_user_entity(api_get_user_id()), $courseEntity);
$repo->getEntityManager()->remove($shortCut);

@ -40,7 +40,7 @@ $TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
$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('Test'));
Display::display_header(get_lang('Test'));
if (isset($_GET['message'])) {
if (in_array($_GET['message'], ['ExerciseEdited'])) {
@ -66,13 +66,13 @@ echo '</div>';
</tr>
<?php
$sql = "SELECT *, quiz_question.question, firstname, lastname
$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']."'
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)) {

@ -119,7 +119,7 @@ if (!empty($_REQUEST['export_report']) && $_REQUEST['export_report'] == '1') {
switch ($_GET['export_format']) {
case 'xls':
$export->exportCompleteReportXLS(
$documentPath,
'',
null,
$loadExtraData,
null,
@ -130,7 +130,7 @@ if (!empty($_REQUEST['export_report']) && $_REQUEST['export_report'] == '1') {
case 'csv':
default:
$export->exportCompleteReportCSV(
$documentPath,
'',
null,
$loadExtraData,
null,

@ -680,6 +680,21 @@ define('TOOL_DRH', 'tool_drh');
define('TOOL_STUDENT_VIEW', 'toolstudentview');
define('TOOL_ADMIN_VISIBLE', 'tooladminvisible');
// Search settings
// some constants to avoid serialize string keys on serialized data array
define('SE_COURSE_ID', 0);
define('SE_TOOL_ID', 1);
define('SE_DATA', 2);
define('SE_USER', 3);
// in some cases we need top differenciate xapian documents of the same tool
define('SE_DOCTYPE_EXERCISE_EXERCISE', 0);
define('SE_DOCTYPE_EXERCISE_QUESTION', 1);
// xapian prefixes
define('XAPIAN_PREFIX_COURSEID', 'C');
define('XAPIAN_PREFIX_TOOLID', 'O');
/**
* Returns a path to a certain resource within the Chamilo area, specifyed through a parameter.
* Also, this function provides conversion between path types, in this case the input path points inside the Chamilo area too.

@ -1,28 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.include.search
*/
// some constants to avoid serialize string keys on serialized data array
define('SE_COURSE_ID', 0);
define('SE_TOOL_ID', 1);
define('SE_DATA', 2);
define('SE_USER', 3);
// in some cases we need top differenciate xapian documents of the same tool
define('SE_DOCTYPE_EXERCISE_EXERCISE', 0);
define('SE_DOCTYPE_EXERCISE_QUESTION', 1);
// xapian prefixes
define('XAPIAN_PREFIX_COURSEID', 'C');
define('XAPIAN_PREFIX_TOOLID', 'O');
/* For licensing terms, see /license.txt */
/**
* Class.
*
* @package chamilo.include.search
* Class _IndexableChunk.
*/
abstract class _IndexableChunk
{
@ -33,7 +14,6 @@ abstract class _IndexableChunk
* string ids; <- los flags a guardar "cidReq:lp_id:path"
* }
*/
public $data;
/**

Loading…
Cancel
Save