Skip to content

Commit

Permalink
XAPI: Fix installation - refs BT#16742
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Nov 27, 2020
1 parent 33167e7 commit 6d00e92
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions plugin/xapi/src/XApiPlugin.php
Expand Up @@ -92,7 +92,10 @@ public function install()
$em = Database::getManager();

$tablesExists = $em->getConnection()->getSchemaManager()->tablesExist(
['xapi_shared_statement']
[
'xapi_shared_statement',
'xapi_tool_launch',
]
);

if ($tablesExists) {
Expand All @@ -101,7 +104,6 @@ public function install()

$this->installPluginDbTables();
$this->installUuid();
$this->deleteCourseTools();
$this->addCourseTools();
}

Expand Down Expand Up @@ -166,10 +168,10 @@ public function uninstallHook()
$quizQuestionAnsweredHook = XApiQuizQuestionAnsweredHookObserver::create();
$quizEndHook = XApiQuizEndHookObserver::create();

HookLearningPathItemViewed::create()->attach($learningPathItemViewedHook);
HookLearningPathItemViewed::create()->detach($learningPathItemViewedHook);
HookLearningPathEnd::create()->detach($learningPathEndHook);
HookQuizQuestionAnswered::create()->attach($quizQuestionAnsweredHook);
HookQuizEnd::create()->attach($quizEndHook);
HookQuizQuestionAnswered::create()->detach($quizQuestionAnsweredHook);
HookQuizEnd::create()->detach($quizEndHook);

return 1;
}
Expand Down Expand Up @@ -287,9 +289,6 @@ public function performActionsAfterConfigure()
$quizEndEvent->detach($quizEndHook);
}

$this->deleteCourseTools();
$this->addCourseTools();

return $this;
}

Expand Down

0 comments on commit 6d00e92

Please sign in to comment.