Giter Site home page Giter Site logo

mitodl / lmod_proxy Goto Github PK

View Code? Open in Web Editor NEW
1.0 27.0 1.0 152 KB

Flask application for proxying requests to the MIT Learning Modules API from edx-platform

License: GNU Affero General Public License v3.0

Python 85.44% HTML 6.01% JavaScript 7.68% Dockerfile 0.87%
edx-platform

lmod_proxy's Introduction

MIT is deprecating the Learning Modules application and we have stopped using this app. This repository is archived.

lmod_proxy

Flask application for proxying requests to the MIT Learning Modules API from edx-platform.

Quick Start

  • Download the latest tar ball or clone from github.
  • Run pip install -r requirements.txt
  • Make sure you have htpasswd available/installed
  • Run htpasswd -c ~/.htpasswd <your username>
  • Create environment variable with path to password file: export LMODP_HTPASSWD_PATH=~/.htpasswd
  • Run lmod_proxy
  • Go to https://localhost:5000/ and use the form there to try things out

You will also likely need to customize your settings to be able to do authentication to LMod via a proper certificate. To do that, determine the path to your certificate and export that path for the configuration with a configuration environment variable: export LMODP_CERT=/path/to/mycert.pem. The certificate needs to be a plain (no passphrase) base64 encoded file with both your certificate and private key from MIT.

macOS tip (likely relevant for other OSes, too): You can export your MIT certificate from Keychain Access to a PKCS file (with the .p12 extension). Then you can convert it to PEM with the following command: openssl pkcs12 -in your_certificate.p12 -out your_certificate.pem -nodes

Running on Heroku

There is an included Procfile to run the application in heroku, to do so just create a heroku app, configure the appropriate environment variables in heroku via heroku config:set LMODP_...=.... The one catch being that your certificate file and HTPASSWD files probably shouldn't be checked in with the repository on heroku, so you can actually copy your entire HTPASSWD file into the LMODP_HTPASSWD variable and your certificate into LMODP_CERT_STRING variable.

Configuring edX Platform

To configure your edX platform to use this as your remote gradebook endpoint, you need to configure a few things, first you need to enable the feature and point it at the URL of your lmod_proxy server. Adding something like: FEATURES['REMOTE_GRADEBOOK_URL'] = 'https://<htpasswd_user>:<htpasswd_password>@myapp.herokuapp.com/edx_grades' to your config will enable the feature, and then in your course, you will just need to specify the GradeBook UUID to point at in your advanced settings with something like:

"remote_gradebook": {
  "name": "STELLAR:/project/mitxdemosite",
  "section": "devops01"
}

Development Notes

See the Development Notes

lmod_proxy's People

Contributors

bdero avatar blarghmatey avatar carsongee avatar dependabot[bot] avatar itsbenweeks avatar markbreedlove avatar pdpinch avatar pwilkins avatar shaidar avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lmod_proxy's Issues

Normalize grades before submitting to Stellar

As an instructor, I would like to have grades submitted to the lmod gradebook be "out of" the max score for the assignment. Grades coming from edX are between 0 and 1.0 and it would be clearer for instructors and students to have them be between 0 and the max score.

  • add a configuration setting to control whether grades should be normalized at all. In our current use of lmod-proxy this would be an application setting, similar to LMODP_APPROVE_GRADES
  • fetch the max scores for all problems in the gradebook (possibly using get_assignments()
  • normalize the grades coming in from edX before submitting them in L32-L35

This may be very slow and we'll need to consider the possibility of timeouts.

Add nice index page

Add page that is descriptive of what the application does as well as offering a user interface to explore the features (i.e. calls to edx_grades "API")

Transmit raw score and max score to remote gradebook

Currently lmod_proxy sends calculated scores to the remote gradebook. The requested change is to send the raw score and the max score.

To send the max score, the assignment must be created by lmod_proxy. (In the existing implementation, assignments are created in the body of the PyLmod call that sends scores to the remote gradebook.)

Upgrade to Python 3

With the official end of life for Python 2 at the end of this year we should upgrade this app to run on Python 3

Flesh out README

Add quickstart, heroku setup, and configuration for edx-platform to README. Also badges.

conditionally set grades, to avoid overriding manually set grades

I'm not sure if this is an issue for lmod_proxy, or for pylmod.

I'd like to an option for setting grades to be conditional -- only set the grade if one hasn't been set already.

This would avoid overriding grades that have been set manually in the gradebook, and may obviate the immediate need for #5 (even though it's still a good idea).

Move deployment off of dot cloud

Dot cloud is going out of business. We need to find another host that won't timeout on a 60 second request.

Will require a deploy to staging and rp as well.

Basic Authentication

Support basic authentication (and the configuration of that), to allow for some security.

release 0.2.0

  • Use release script.
  • push to lmod_proxy_qa
  • integration testing
  • deploy to lmod_proxy

Add configuration style

Use a "first found" yaml configuration file loader from one of three locations: $(pwd)/lmod_proxy.yml, ~/.lmod_proxy.yml, and then /etc/lmod_proxy.yml. Also allow environment variable overrides prefixed with LMODP_.

Create Continuous Integration Deployment

It is convenient for integration and system testing to have an installation of the application that is always running the latest master version of the repo that works. We can add this easily with Travis as a step to do after a successful test has occurred. It does this by packaging our app up into a heroku deployable unit, and pushing it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.