Hi @BrianMesick Thank you again for your time, I do really appreciate it,
Now I have better understanding of the things that I should do in order to listen to an event thanks to you.
1- First I use the appPluginExample or I use cookieCutter to start an app
2- I modify the setup.py especially the entryPoints object so it will have lms.djangoapp as the key (i’m not sure about this point ).
example:
setup(
name="tutor-contrib-demo",
packages=find_packages(exclude=["tests*"]),
include_package_data=True,
python_requires=">=3.8",
install_requires=["tutor>=17.0.0,<18.0.0"],
entry_points={
"lms.djangoapp": [
"demo = tutordemo.apps:MyAppConfig",
],
},
)
2- I modify the apps.py to map between the events and the functions that will handle each event.
example:
class MyAppConfig(AppConfig):
name = 'tutordemo'
verbose_name = "Tutor Demo Plugin"
plugin_app = {
'signals_config': {
'lms.djangoapp': {
'relative_path': 'plugin', # this is the file that holds the logic of the functions
'receivers': [{
'receiver_func_name': 'on_login_receiver',
'signal_path': 'openedx_events.learning.signal.SESSION_LOGIN_COMPLETED',
}],
}
}
}
3- I create a file with the logic of the functions mentioned in the apps.py
example
def on_login_receiver(user, **kwargs):
print("It is finally working :D")
print("=================================================")
So, If I have everything correct, I should mount the app into openEdx
after, I’ve read the link you sent me and I was doing it this way
tutor mounts add /home/ubuntu/tutor-contrib-demo
I rebuild the images using this command
tutor images build openedx
Unfortunately, it did not work, I think I’m pretty close to make it work.
If you have any extra notes I will be glad to take it.
Thank you.