Pārlūkot izejas kodu

Try find items using iid see BT#15894

Julio Montoya 5 gadi atpakaļ
vecāks
revīzija
af8cb8d2d6

+ 12 - 3
main/exercise/exercise.class.php

@@ -8170,12 +8170,21 @@ class Exercise
         $em = Database::getManager();
 
         $links = AbstractLink::getGradebookLinksFromItem(
-            $this->selectId(),
+            $this->id,
             LINK_EXERCISE,
-            api_get_course_id(),
-            api_get_session_id()
+            $courseInfo['code'],
+            $sessionId
         );
 
+        if (empty($links)) {
+            $links = AbstractLink::getGradebookLinksFromItem(
+                $this->iId,
+                LINK_EXERCISE,
+                $courseInfo['code'],
+                $sessionId
+            );
+        }
+
         if (!empty($links)) {
             $repo = $em->getRepository('ChamiloCoreBundle:GradebookLink');
 

+ 1 - 1
main/gradebook/lib/be/exerciselink.class.php

@@ -579,7 +579,7 @@ class ExerciseLink extends AbstractLink
         if ($this->is_hp == 1) {
             $table = Database::get_course_table(TABLE_DOCUMENT);
         } else {
-            $table = $this->get_exercise_table();
+            $table = Database::get_course_table(TABLE_QUIZ_TEST);
         }
 
         $exerciseId = $this->get_ref_id();