Quiz: User iid instead of id in queries with entities - refs BT#18452

pull/3824/head
Angel Fernando Quiroz Campos 5 years ago
parent bcc22fbfdb
commit b4ae2b57d0
  1. 8
      main/exercise/hotspot_answers.as.php
  2. 9
      main/inc/lib/search/tool_processors/quiz_processor.class.php

@ -182,14 +182,12 @@ if (!$hideExpectedAnswer) {
if ($objQuestion->selectType() == HOT_SPOT_DELINEATION) {
$qb
->where($qb->expr()->eq('a.cId', $courseId))
->andWhere($qb->expr()->eq('a.questionId', $questionId))
->where($qb->expr()->eq('a.questionId', $questionId))
->andWhere("a.hotspotType != 'noerror'")
->orderBy('a.id', 'ASC');
->orderBy('a.iid', 'ASC');
} else {
$qb
->where($qb->expr()->eq('a.cId', $courseId))
->andWhere($qb->expr()->eq('a.questionId', $questionId))
->where($qb->expr()->eq('a.questionId', $questionId))
->orderBy('a.position', 'ASC');
}

@ -1,6 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CQuiz;
/**
* Process exercises before pass it to search listing scripts.
*
@ -108,12 +110,7 @@ class quiz_processor extends search_processor
if (!empty($course_information)) {
$exercise_id = intval($exercise_id);
$dk_result = $em
->getRepository('ChamiloCourseBundle:CQuiz')
->findOneBy([
'id' => $exercise_id,
'cId' => $course_id,
]);
$dk_result = $em->find(CQuiz::class, $exercise_id);
$name = '';
if ($dk_result) {

Loading…
Cancel
Save