This is the process for getting edX notes running today. There are a few gaps in automation that will require some manual steps. This guide assumes that you have a running LMS. This also assumes that you are running all your services on a single host. While this configuration is not recommended for production deployments, this should be enough to get you started.
Step-by-step guide
In order for the edx_notes_api application to authenticate against the LMS, an oauth client configuration will need to be created in your LMS. This can be done from the Django admin application as a superuser. The admin application is hosted at https://lms.example.com/admin. The client details need to be available to the notes application Note that in this document, the hostname lms.example.com will be used, but this value will need to be replaced with the appropriate value for your environment.
On the admin page, to go "Oath2" and click "Add" by "Clients". Fill out the following fields (after looking up your user ID). Note: leave the ID field blank.Key name edx-notes url https:/notes.example.com/ redirect url https://notes.example.com/complete/edx-oidc/ client id edx_notes_id client secret edx_notes_secret client type confidential (web application)
The values provided here correspond to the values in the playbooks/roles/edx_notes_api/defaults/main.yml. You can change these values to whatever you wish as long as the values in the role defaults are also overridden.
You will have to use master of the configuration repository to pull in some changes related to installing notes, so fetch the latest of https://github.com/edx/configuration and change to the master branch. Here is the command (details):
sudo /edx/bin/update edx-platform master
Install the database user for the edx_notes_api. Notes needs to connect to a mysql database and an elasticsearch instance. Review all the ALL CAPS variables defined in https://github.com/edx/configuration/blob/master/playbooks/roles/edx_notes_api/defaults/main.yml to understand what you need to override.
First, you will need to activate the venv (Python virtual environment) for ansible.
source /edx/app/edx_ansible/venvs/edx_ansible/bin/activate
Assuming that you have a local checkout of the edx configuration repository, you can create the required database users by runningansible-playbook -c local -i 'localhost,' ./run_role.yml -e 'role=edxlocal' -e@roles/edx_notes_api/defaults/main.yml
Create a file for your ansible overrides
~/ansible-overrides.yml
with at least the following valuesEDX_NOTES_API_ALLOWED_HOSTS: - localhost - lms.example.com
Enable this feature flag in
EDXAPP_FEATURES
:ENABLE_EDXNOTES: true
You will need to override the value of
EDXNOTES_INTERFACE
for your installation. This currently isn't handled by ansible, but will be. The recommendation is to add the following to yourlms/envs/aws.py
EDXNOTES_INTERFACE = { 'url': 'http://lms.example.com:18120/api/v1', }
Install the edx-notes-api using ansible
ansible-playbook -c local -i 'localhost,' ./notes.yml -e@/edx/app/edx_ansible/server-vars.yml
When the installation has completed verify that the notes api is healthy by running
sudo /edx/bin/supervisorctl status edx_notes_api edx_notes_api RUNNING pid 13630, uptime 11:42:01
In order to enable the notes application in the LMS and CMS you will have to set the
ENABLE_EDXNOTES
feature flag to true in both lms.env.json and cms.env.json and restart both the LMS and CMS.sudo /edx/bin/supervisorctl restart edxapp:*
- After the feature has been enabled, an advanced setting in Studio must also be enabled on a per course basis. From the advanced settings tab for your course, set Enable Student Notes to true. If you don't see that advanced setting, review the changes from step 7 and ensure you have restarted your LMS and CMS
- Navigate to the courseware for any course with edX Notes enabled. From the courseware you should be able to highlight text and add notes. If there are errors, check both the LMS logs,
/edx/var/log/lms/edx.log
, and the edx_notes_api logs,/edx/var/log/supervisor/edx_notes_apitderr.log
.
Related articles