DCAS Open EdX Documentation

DCAS Open EdX Documentation

  • Docs

›API

Creating a Course

  • Create a New Online Course
  • Set Course Schedule & Details
  • Add Sections, Subsections & Units
  • Managing Unit and Component
  • Adding Videos
  • Adding HTML
  • Adding Discussions
  • Adding Problems

    • Adding Problems
    • Problem Types
    • Drag and Drop
    • Pointing on a picture
  • Adding Images and Figures
  • Uploading Static Content
  • Course Visibility
  • Creating pages
  • Grading
  • Commonly Used Advanced Settings

Running a Course

  • Managing Certificates
  • Common Instructor Dashboard Tasks
  • Managing Course Discussions

Advanced Management

  • Importing / Exporting Courses
  • Change a user’s password
  • Inactivate / Activate a User
  • Understanding User Roles
  • Set a user to staff or superuser
  • Server Tasks

    • SSH into Server
    • Set or Change a Password

Migration

  • Migrate EdX (Single-Server)
  • Migrate the Theme

Migrate MySQL

  • Migrating MySQL Database off of Single-Server

Migrate Mongo

  • Migrating Mongo Database off of Single-Server

Configuration

  • Enable and Update Additional Languages
  • Enable Downloads from Instructor tab in LMS
  • Configure and Enable Certificate
  • Configure Open Response Assessment

Configure Ecommerce

  • Basic Ecommerce Setup
  • Setup JWT Keys
  • Getting Course Details on Checkout Page
  • Troubleshoot Ecommerce

Discovery Setup

  • Configure Discovery

Comprehensive theming

  • Setup Comprehensive Theming

Microsites

  • Setup Microsites
  • Common Microsite Configurations

API

  • Setup API
  • Common APIs Demonstration
  • Customizing an API
  • DCAS API Handoff for LMS

Xblock

  • Xblock introduction
  • Xblock installation and uninstallation
  • Xblock Development

Scaling the architecture

  • Scaling Mongo
  • Scaling MySQL
  • Dedicated Storage Configuration Outline
  • Azure Storage Configuration

    • Azure Storage Configuration
    • Basic Configuration
    • Private Blob Configuration

SCORM

  • SCORM Azure Storage

Trouble-Shooting

  • Forgot admin username or password
  • Server error
  • Can't reach your site
  • Problems with RabbitMQ
  • Can't login to LMS or CMS
  • Locate the error
  • Jobs are stucking
  • Mongodb not working
  • Forums Breaking Issue
  • Check open edx services status
  • Problem with mysql
  • Can't receive email
  • CSRF token error

Common APIs Demonstration

Enroll/Pre-enroll users via API

By default, Open Edx provides api/enrollment/v1/enrollment for a user to enroll. The API enrolls currently logged in users whose state has been saved in bearer token. If you don’t have a bearer token, see section Set up authentication for API to obtain one. For enrolling/pre-enrolling a specified user rather than the logged-in one, you need to modify the backend code of the API. After modification, you would be able to use a single API for the above scenario.

curl -X POST -H "Authorization: Bearer 59d340683440839845f1a2733ac98bec57aac69d" -H "Content-Type: application/json" -d '{"mode":"honor", "user":"user@mailinator.com", "course_details":{"course_id": "course-v1:E-LearnOrg+MOOC101+2014_H1"}}' "http://{LMS_URL}/api/enrollment/v1/enrollment"

After issuing this request, the user user@mailinator.com” will be enrolled in the course having title How to Build a Custom MOOC identified by course id as course-v1:E-LearnOrg+MOOC101+2014_H1. Also note that, if a user does not exist or have not yet registered in the platform, a pre-enrollment entry of the user with his email id has been created in Course enrollment alloweds. Once the user with this email id register and activate his account on the Open Edx platform, he/she will be automatically enrolled on this particular course.

Unenroll users via API

Similarly, the same API had to be modified for unenrolling a specified user from a course. The curl command is the same as above except the inclusion of “unenroll” parameter which needs to be “true” in string representation (i.e surrounded with double quotations).

curl -X POST -H "Authorization: Bearer 59d340683440839845f1a2733ac98bec57aac69d" -H "Content-Type: application/json" -d '{"mode":"honor", "user":"user@mailinator.com", "course_details":{"course_id": "course-v1:E-LearnOrg+MOOC101+2014_H1"},"unenroll":"true"}' "http://{LMS_URL}/api/enrollment/v1/enrollment"

If a pre-enrollment entry had been created against the user user@mailinator.com, it would be deleted.

Users final grade for a particular course

Open Edx provides api/grades/v1/courses API for fetching all the users grade for a particular course. The course id must be passed on the URL as a GET request. The output json will be a list of users containing their final grade.

curl --header "Authorization: Bearer 59d340683440839845f1a2733ac98bec57aac69d" -H "Content-Type: application/json" -X GET "http://{LMS_URL}/api/grades/v1/courses/course-v1:edX+DemoX+Demo_Course/"  | python -m json.tool

Users gradebook for a particular course

Open Edx provides api/grades/v1/gradebook API for fetching all the users gradebook for a particular course. The gradebook contains the final grade as well as the grades in each subsection a user gets.

curl --header "Authorization: Bearer 59d340683440839845f1a2733ac98bec57aac69d" -H "Content-Type: application/json" -X GET "http://{LMS_URL}/api/grades/v1/gradebook/course-v1:edX+DemoX+Demo_Course/" | python -m json.tool

Note that, you need to enable waffle switch for writable gradebook before you can use the gradebook API. Otherwise you will be met with the following response.

Error: {"developer_message":"The writable gradebook feature is not enabled for this course.","error_code":"feature_not_enabled"}

← Setup APICustomizing an API →
  • Enroll/Pre-enroll users via API
  • Unenroll users via API
  • Users final grade for a particular course
  • Users gradebook for a particular course
DCAS Open EdX Documentation
Docs
Create an Online Course
More
Curricu.me Website
Copyright © 2022 DCAS