MDL-68619 mod_h5pactivity: add activity check to get_attempt method
[moodle.git] / mod / h5pactivity / classes / local / manager.php
index 4c471bf..840de03 100644 (file)
@@ -417,7 +417,10 @@ class manager {
      */
     public function get_attempt(int $attemptid): ?attempt {
         global $DB;
-        $record = $DB->get_record('h5pactivity_attempts', ['id' => $attemptid]);
+        $record = $DB->get_record('h5pactivity_attempts', [
+            'id' => $attemptid,
+            'h5pactivityid' => $this->instance->id,
+        ]);
         if (!$record) {
             return null;
         }