Minor - Apply Flint fixes

pull/2798/head
Angel Fernando Quiroz Campos 7 years ago
parent 77b9c084d8
commit a36ae1563c
  1. 1
      main/course_description/index.php
  2. 26
      main/exercise/ReadingComprehension.php
  3. 44
      main/exercise/question.class.php
  4. 1
      main/gradebook/gradebook_edit_cat.php
  5. 3
      main/inc/lib/CoursesAndSessionsCatalog.class.php
  6. 8
      main/inc/lib/tracking.lib.php

@ -101,7 +101,6 @@ switch ($action) {
$descriptionController->destroy($id);
break;
case 'listing':
//no break
default:
$descriptionController->listing();
}

@ -53,7 +53,7 @@ class ReadingComprehension extends UniqueAnswer
/**
* Indicates how show the question list.
* 1 = all in one page; 2 = one per page (default)
* 1 = all in one page; 2 = one per page (default).
*
* @var int
*/
@ -197,6 +197,18 @@ class ReadingComprehension extends UniqueAnswer
return $select_level;
}
/**
* @param int $type
*
* @return ReadingComprehension
*/
public function setExerciseType($type)
{
$this->exerciseType = (int) $type;
return $this;
}
/**
* @param $wordsCount
* @param $turns
@ -216,16 +228,4 @@ class ReadingComprehension extends UniqueAnswer
$view->assign('exercise_type', $this->exerciseType);
$view->display($template);
}
/**
* @param int $type
*
* @return ReadingComprehension
*/
public function setExerciseType($type)
{
$this->exerciseType = (int) $type;
return $this;
}
}

@ -2324,6 +2324,28 @@ abstract class Question
return '<br />'.Display::return_message($this->feedback, 'normal', false);
}
/**
* Check if this question exists in another exercise.
*
* @throws \Doctrine\ORM\Query\QueryException
*
* @return mixed
*/
public function existsInAnotherExercises()
{
$em = Database::getManager();
$count = $em
->createQuery('
SELECT COUNT(qq.iid) FROM ChamiloCourseBundle:CQuizRelQuestion qq
WHERE qq.questionId = :id
')
->setParameters(['id' => (int) $this->id])
->getSingleScalarResult();
return $count > 1;
}
/**
* Resizes a picture || Warning!: can only be called after uploadPicture,
* or if picture is already available in object.
@ -2388,26 +2410,4 @@ abstract class Question
return false;
}
/**
* Check if this question exists in another exercise.
*
* @throws \Doctrine\ORM\Query\QueryException
*
* @return mixed
*/
public function existsInAnotherExercises()
{
$em = Database::getManager();
$count = $em
->createQuery('
SELECT COUNT(qq.iid) FROM ChamiloCourseBundle:CQuizRelQuestion qq
WHERE qq.questionId = :id
')
->setParameters(['id' => (int) $this->id])
->getSingleScalarResult();
return $count > 1;
}
}

@ -85,7 +85,6 @@ if ($form->validate()) {
}
$selectcat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
$action_details = '';
$current_id = 0;
if (isset($_GET['editcat'])) {

@ -469,8 +469,9 @@ class CoursesAndSessionsCatalog
* @param string $date (optional) The date of sessions
* @param array $limit
*
* @return array The session list
* @throws Exception
*
* @return array The session list
*/
public static function browseSessions($date = null, $limit = [])
{

@ -6793,10 +6793,10 @@ class Tracking
}
/**
* @param int $userId
* @param int $courseId
* @param int $sessionId
* @param int $toolId
* @param int $userId
* @param int $courseId
* @param int $sessionId
* @param int $toolId
*
* @return array
*/

Loading…
Cancel
Save