Minor - format code

skala
Julio Montoya 12 years ago
parent 4aefb77f8c
commit 1c8d7c9707
  1. 5
      main/exercice/question.class.php
  2. 8
      main/exercice/testcategory.class.php

@ -2700,6 +2700,7 @@ abstract class Question
} }
return $result; return $result;
} }
/** /**
* Makes a question valid inside a global category in another course as well * Makes a question valid inside a global category in another course as well
* This might be used in combination with the ExerciseController::reuseQuestionAction() * This might be used in combination with the ExerciseController::reuseQuestionAction()
@ -2710,9 +2711,9 @@ abstract class Question
* *
* This might get deprecated if we start using c_id = 0 in the c_quiz_question_rel_category * This might get deprecated if we start using c_id = 0 in the c_quiz_question_rel_category
*/ */
function enableGlobalCategoryInNewCourse($questionId, $courseIdDest) { function enableGlobalCategoryInNewCourse($questionId, $courseIdDest)
{
$questionRelCategoryTable = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY); $questionRelCategoryTable = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
$categoryTable = Database::get_course_table(TABLE_QUIZ_CATEGORY);
$questionId = intval($questionId); $questionId = intval($questionId);
$courseIdDest = intval($courseIdDest); $courseIdDest = intval($courseIdDest);
// First check whether the category is global: if it's not, we don't need to do anything // First check whether the category is global: if it's not, we don't need to do anything

@ -1251,7 +1251,7 @@ class Testcategory
break; break;
} }
// settting the form elements // setting the form elements
$form->addElement('header', $header); $form->addElement('header', $header);
$form->addElement('hidden', 'category_id'); $form->addElement('hidden', 'category_id');
$form->addElement('text', 'category_name', get_lang('CategoryName'), array('class' => 'span6')); $form->addElement('text', 'category_name', get_lang('CategoryName'), array('class' => 'span6'));
@ -1288,13 +1288,15 @@ class Testcategory
// setting the rules // setting the rules
$form->addRule('category_name', get_lang('ThisFieldIsRequired'), 'required'); $form->addRule('category_name', get_lang('ThisFieldIsRequired'), 'required');
} }
/** /**
* Checks whether a category is global or not * Checks whether a category is global or not
* @param Category ID * @param int $categoryId
* @return bool True if it is global, false otherwise * @return bool True if it is global, false otherwise
* @assert (0) == false * @assert (0) == false
*/ */
function isGlobal($categoryId) { function isGlobal($categoryId)
{
$categoryTable = Database::get_course_table(TABLE_QUIZ_CATEGORY); $categoryTable = Database::get_course_table(TABLE_QUIZ_CATEGORY);
$sql = "SELECT parent_id, c_id FROM $categoryTable WHERE iid = $categoryId"; $sql = "SELECT parent_id, c_id FROM $categoryTable WHERE iid = $categoryId";
$res = Database::query($sql); $res = Database::query($sql);

Loading…
Cancel
Save