Human-Logic-Software-LLC / moodle-local_levitate

The Levitate plugin for Moodle enables LMS users to explore a wide range of interactive, immersive, microlearning courses and programs in both English and Arabic.
https://www.levitate.coach/
GNU General Public License v3.0
1 stars 0 forks source link

please use get_config() api instead of db calls to config_plugins table #13

Closed danmarsden closed 8 months ago

danmarsden commented 9 months ago

https://github.com/Human-Logic-Software-LLC/mdl_levitate/blob/main/explore.php#L29

Please use the get_config() api's instead as this is cached/better for general performance.

danmarsden commented 9 months ago

similar here: https://github.com/Human-Logic-Software-LLC/mdl_levitate/blob/main/classes/task/create_course.php#L52

sreenivasmalae commented 9 months ago

We've updated the code to utilize the get_config() APIs for improved performance and caching.

raortegar commented 9 months ago

Hi @sreenivasmalae , Just a suggestion, instead fetch the object you could use something like this: $tokenid = get_config('local_levitate', 'secret');

Also I don't see where it is used $tokenid in create_course.php file

sreenivasmalae commented 8 months ago

Hi @raortegar

We have updated the code as per your suggestion.