Open edX plugin that includes a custom teams API, which extends the functionality of the Open edX teams API. Compared to the existing teams API, this plugin includes new views to create and delete a topic and extends listing topics to include the list of teams within each topic. It also extends the functionality of adding a user to a team so multiple users can be added to a team by using a list of usernames.
This plugin has been created as an open source contribution to the Open edX platform and has been funded by the Unidigital project from the Spanish Government - 2023.
Open edX Release | Version |
---|---|
Palm | >= 0.2.0 |
Quince | >= 0.2.0 |
Redwood | >= 0.2.0 |
The settings can be changed in platform_plugin_teams/settings/common.py
or, for example, in tutor configurations.
NOTE: the current common.py
works with Open edX Palm, Quince and
Redwood version.
Clone the repository:
git clone git@github.com:eduNEXT/platform_plugin_teams.git
cd platform_plugin_teams
Set up a virtualenv with the same name as the repo and activate it. Here's how
you might do that if you have virtualenv
set up:
virtualenv -p python3.8 platform_plugin_teams
Activate the virtualenv. Here's how you might do that if you're using
virtualenv
:
source platform_plugin_teams/bin/activate
Grab the latest code:
git checkout main
git pull
Install/update the dev requirements:
make requirements
Run the tests and quality checks (to verify the status before you make any changes):
make validate
Make a new branch for your changes:
git checkout -b <your_github_username>/<short_description>
Using your favorite editor, edit the code to make your change:
vim ...
Run your new tests:
pytest ./path/to/new/tests
Run all the tests and quality checks:
make validate
Commit all your changes, push your branch to github, and open a PR:
git commit ...
git push
To use the API, you need to have a course with teams enabled. To enable you need to follow the next steps:
Activate teams in your Open edX instance
You must add the
ENABLE_TEAMS
in your LMS settings (development or production). For example, you can create a YAML plugin with the following content:name: teams-settings version: 0.1.0 patches: openedx-common-settings: | FEATURES["ENABLE_TEAMS"] = True
Activate teams app
You must create a waffle flag in the Django admin panel. You can access to Django Admin panel in the next URL:
<lms_host>/admin/waffle/flag/
. Then, you need to create a new flag with the following values:- Name:
teams.enable_teams_app
- Everyone:
Yes
- Superusers:
True
- Name:
Now, you can use the API. All the endpoints are protected with the same auth
method as the Open edX default teams API, and adds a new JwtAuthentication
auth method. For generate a token, you can use the next endpoint:
POST
/<lms_host>/oauth2/access_token/
: Generate a token for the user. The content type of the request must beapplication/x-www-form-urlencoded
.Body parameters
client_id
: Client ID of the OAuth2 application. You can find it in the Django admin panel. Normally, it islogin-service-client-id
.grant_type
: Grant type of the OAuth2 application. Normally, it ispassword
.username
: Username of the user.password
: Password of the user.token_type
: Type of the token. By default, it isbearer
by default but can beJWT
.
Response
access_token
: Access token of the user. You must use this token in theAuthorization
header of the requests to the API.
Finally, you are ready to use the API. The next endpoints are available:
GET
/<lms_host>/platform-plugin-teams/<course_id>/api/topics/
: List all the topics in the course.Path parameters
course_id
: ID of the course.
Query parameters
page
: Page number of the results.page_size
: Number of results per page.
POST
/<cms_host>/platform-plugin-teams/<course_id>/api/topics/
: Create a new topic in the course. The content type of the request must beapplication/json
.Path parameters
course_id
: ID of the course.
Body parameters
name
: Name of the topic.description
: Description of the topic.type
: Type of the topic. It can beopen
,public_managed
orprivate_managed
.max_team_size
: Maximum number of members in the teams of the topic.
DELETE
/<cms_host>/platform-plugin-teams/<course_id>/api/topics/<topic_id>/
: Delete a topic in the course.Path parameters
course_id
: ID of the course.topic_id
: ID of the topic.
POST
/<lms_host>/platform-plugin-teams/<course_id>/api/team-membership/
: Add a user to a team. The content type of the request must beapplication/json
.Path parameters
course_id
: ID of the course.
Body parameters
usernames
: List of usernames of the users to add to the team.team_id
: ID of the team.
If you're having trouble, we have discussion forums at discussions where you can connect with others in the community.
Our real-time conversations are on Slack. You can request a Slack invitation, then join our community Slack workspace.
For anything non-trivial, the best path is to open an issue in this repository with as many details about the issue you are facing as you can provide.
For more information about these options, see the Getting Help page.
The code in this repository is licensed under the AGPL 3.0 unless otherwise noted.
Please see LICENSE.txt for details.
Contributions are very welcome. Please read How To Contribute for details.
This project is currently accepting all types of contributions, bug fixes, security fixes, maintenance work, or new features. However, please make sure to have a discussion about your new feature idea with the maintainers prior to beginning development to maximize the chances of your change being accepted. You can start a conversation by creating a new issue on this repo summarizing your idea.
Please do not report security issues in public. Please email security@edunext.co.