Minor - flint fixes

pull/2790/head
Julio Montoya 7 years ago
parent 1600d379e5
commit c9c2b87653
  1. 1
      main/exercise/exercise.class.php
  2. 43
      main/exercise/question.class.php
  3. 5
      main/exercise/question_list_admin.inc.php
  4. 2
      main/inc/lib/display.lib.php
  5. 4
      main/inc/lib/formvalidator/FormValidator.class.php
  6. 2
      main/wiki/wiki.inc.php
  7. 2
      plugin/keycloak/KeycloakPlugin.php
  8. 1
      plugin/keycloak/start.php
  9. 4
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRecycler.php

@ -8037,6 +8037,7 @@ class Exercise
while ($object = Database::fetch_object($result)) { while ($object = Database::fetch_object($result)) {
$questionList[$object->question_order] = $object->question_id; $questionList[$object->question_order] = $object->question_id;
} }
return $questionList; return $questionList;
} }

@ -240,7 +240,6 @@ abstract class Question
$title .= $itemNumber.'. '.$this->selectTitle(); $title .= $itemNumber.'. '.$this->selectTitle();
$title .= $showQuestionTitleHtml ? '' : '</strong>'; $title .= $showQuestionTitleHtml ? '' : '</strong>';
return Display::div( return Display::div(
$title, $title,
['class' => 'question_title'] ['class' => 'question_title']
@ -2370,6 +2369,26 @@ abstract class Question
return $count > 1; return $count > 1;
} }
/**
* @param string $code
*
* @return bool
*/
public function addCode($code)
{
if (api_get_configuration_value('allow_question_code') && !empty($this->id)) {
$code = Database::escape_string($code);
$table = Database::get_course_table(TABLE_QUIZ_QUESTION);
$sql = "UPDATE $table SET code = '$code'
WHERE iid = {$this->id} AND c_id = {$this->course['real_id']}";
Database::query($sql);
return true;
}
return false;
}
/** /**
* Resizes a picture || Warning!: can only be called after uploadPicture, * Resizes a picture || Warning!: can only be called after uploadPicture,
* or if picture is already available in object. * or if picture is already available in object.
@ -2434,26 +2453,4 @@ abstract class Question
return false; return false;
} }
/**
* @param string $code
*
* @return bool
*/
public function addCode($code)
{
if (api_get_configuration_value('allow_question_code') && !empty($this->id)) {
$code = Database::escape_string($code);
$table = Database::get_course_table(TABLE_QUIZ_QUESTION);
$sql = "UPDATE $table SET code = '$code'
WHERE iid = {$this->id} AND c_id = {$this->course['real_id']}";
Database::query($sql);
return true;
}
return false;
}
} }

@ -179,7 +179,7 @@ if (!$inATest) {
$pagination->setTotalItemCount($nbrQuestions); $pagination->setTotalItemCount($nbrQuestions);
$pagination->setItemNumberPerPage($lenght); $pagination->setItemNumberPerPage($lenght);
$pagination->setCurrentPageNumber($page); $pagination->setCurrentPageNumber($page);
$pagination->renderer = function($data) use ($url) { $pagination->renderer = function ($data) use ($url) {
$render = '<ul class="pagination">'; $render = '<ul class="pagination">';
for ($i = 1; $i <= $data['pageCount']; $i++) { for ($i = 1; $i <= $data['pageCount']; $i++) {
//foreach ($data['pagesInRange'] as $page) { //foreach ($data['pagesInRange'] as $page) {
@ -212,8 +212,7 @@ if (!$inATest) {
<div id="question_list"> <div id="question_list">
'; ';
$category_list = TestCategory::getListOfCategoriesNameForTest($objExercise->id, false);
$category_list = TestCategory::getListOfCategoriesNameForTest($objExercise->id,false);
if (is_array($questionList)) { if (is_array($questionList)) {
foreach ($questionList as $id) { foreach ($questionList as $id) {

@ -2794,7 +2794,5 @@ HTML;
});'; });';
return $frameReady; return $frameReady;
} }
} }

@ -914,9 +914,9 @@ EOT;
* @param string $label * @param string $label
* @param array $attributes * @param array $attributes
* *
* @return HTML_QuickForm_file
*
* @throws Exception if the file doesn't have an id * @throws Exception if the file doesn't have an id
*
* @return HTML_QuickForm_file
*/ */
public function addFile($name, $label, $attributes = []) public function addFile($name, $label, $attributes = [])
{ {

@ -6100,7 +6100,7 @@ class Wiki
get_lang('RecentChanges'), get_lang('RecentChanges'),
'', '',
ICON_SIZE_MEDIUM ICON_SIZE_MEDIUM
) .'</a>'; ).'</a>';
echo Display::toolbarAction('toolbar-wiki', [$actionsLeft]); echo Display::toolbarAction('toolbar-wiki', [$actionsLeft]);
} }

@ -49,7 +49,7 @@ class KeycloakPlugin extends Plugin
} }
/** /**
* Deletes all keycloak chamilo session data * Deletes all keycloak chamilo session data.
*/ */
public function logout() public function logout()
{ {

@ -25,7 +25,6 @@ if (file_exists('settings.php')) {
api_not_allowed(true, $message); api_not_allowed(true, $message);
} }
$content = ''; $content = '';
$auth = new Auth($settingsInfo); $auth = new Auth($settingsInfo);

@ -308,7 +308,7 @@ class CourseRecycler
/** /**
* Deletes all forum-categories without forum from the current course. * Deletes all forum-categories without forum from the current course.
* Categories with forums in it are dealt with by recycle_forums() * Categories with forums in it are dealt with by recycle_forums()
* This requires a check on the status of the forum item in c_item_property * This requires a check on the status of the forum item in c_item_property.
*/ */
public function recycle_forum_categories() public function recycle_forum_categories()
{ {
@ -356,7 +356,6 @@ class CourseRecycler
$sql = "DELETE FROM $linkCategoryTable $sql = "DELETE FROM $linkCategoryTable
WHERE c_id = $courseId AND id NOT IN ($subQuery)"; WHERE c_id = $courseId AND id NOT IN ($subQuery)";
Database::query($sql); Database::query($sql);
} }
/** /**
@ -628,7 +627,6 @@ class CourseRecycler
$sql = "DELETE FROM $learningPathCategoryTable WHERE iid = ".$categoryId; $sql = "DELETE FROM $learningPathCategoryTable WHERE iid = ".$categoryId;
Database::query($sql); Database::query($sql);
} }
} }
/** /**

Loading…
Cancel
Save