From 1065948703ba68edbe7509eff7b5f84a9447ba28 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 2 Sep 2021 16:56:54 -0500 Subject: [PATCH] XAPI: Fix query to list in student view --- .../src/Entity/Repository/ToolLaunchRepository.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugin/xapi/src/Entity/Repository/ToolLaunchRepository.php b/plugin/xapi/src/Entity/Repository/ToolLaunchRepository.php index e74b5af868..0446c9fc09 100644 --- a/plugin/xapi/src/Entity/Repository/ToolLaunchRepository.php +++ b/plugin/xapi/src/Entity/Repository/ToolLaunchRepository.php @@ -53,9 +53,14 @@ class ToolLaunchRepository extends EntityRepository } if ($filteredForStudent) { - $qb->leftJoin(CLpItem::class, 'lpi', Join::WITH, 'tl.id = lpi.path AND tl.course = lpi.cId') - ->andWhere($qb->expr()->eq('lpi.itemType', ':item_type')) - ->setParameter('item_type', TOOL_XAPI); + $qb + ->leftJoin( + CLpItem::class, + 'lpi', + Join::WITH, + "tl.id = lpi.path AND tl.course = lpi.cId AND lpi.itemType = 'xapi'" + ) + ->andWhere($qb->expr()->isNull('lpi.path')); } $query = $qb->getQuery();