GithubHelp home page GithubHelp logo

koljanos / sga-lti Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mitodl/sga-lti

0.0 2.0 0.0 452 KB

an LTI implementation of Staff Graded Assignments, for use with edX

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.15% Shell 0.46% Python 75.30% JavaScript 3.90% HTML 20.11% CSS 0.08%

sga-lti's Introduction

sga-lti

sga-lti:LTI implementation of Staff Graded Assignments
Version:0.4.1
Author:MIT Office of Digital Learning
Homepage:http://odl.mit.edu
License:BSD

an LTI implementation of Staff Graded Assignments, for use with edX

Getting Started

You can either run this locally with a default sqlite database after installing the requirements.txt file, or if you have Docker and prefer a cleaner environment, install docker-compose with pip install docker-compose and run docker-compose up. This will set up a near production-ready containerized development environment that runs migrations, with the django development server running on port 8071.

To run one-off commands, like shell, you can run docker-compose run web python manage.py shell or to create root user, etc.

Environment/Local Variables

The following variables need to be created in environment or in local settings ("sga-lti.yml"):

# Media files (for uploaded files)
AWS_STORAGE_BUCKET_NAME  # S3 bucket name
AWS_ACCESS_KEY_ID  # S3 access key id credential
AWS_SECRET_ACCESS_KEY  # S3 secret access key credential
MEDIAFILES_LOCATION  # Optional S3 subfolder within AWS_STORAGE_BUCKET_NAME
LTI_OAUTH_CREDENTIALS  # A dictionary of lti oauth key/secret pairs

Servers additionally need the parameters:

SECRET_KEY  # The Django secret key
ALLOWED_HOSTS  # A list containing the name of the server
DATABASE_URL  # The url to connect to the database

Sample sga-lti.yml for local development:

DEBUG: True
SGA_LTI_SECURE_SSL_REDIRECT: False
SGA_LTI_DB_DISABLE_SSL: True
SGA_LTI_LOG_LEVEL: INFO
DJANGO_LOG_LEVEL: INFO
LTI_OAUTH_CREDENTIALS:
    client-key: client-secret
AWS_STORAGE_BUCKET_NAME: XXXXXXXXXX
AWS_ACCESS_KEY_ID: AKXXXXXXXXXXXX
AWS_SECRET_ACCESS_KEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
MEDIAFILES_LOCATION: /testing

Sample server configuration:

ALLOWED_HOSTS             ["example.com"]
DATABASE_URL              postgres://xxx:yyy@hostname:port/zzz
LTI_OAUTH_CREDENTIALS     {"client-key": "client-secret"}
AWS_STORAGE_BUCKET_NAME   s3_bucket
AWS_ACCESS_KEY_ID         AKXXXXXXXXXXXX
AWS_SECRET_ACCESS_KEY     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
MEDIAFILES_LOCATION       /sga_files
SECRET_KEY                super_secret_key

Installing as an LTI tool

To add this to a course, first follow the edX instructions for adding LTI passport configuration: http://edx.readthedocs.io/projects/edx-partner-course-staff/en/latest/exercises_tools/lti_component.html.

You can add this tool to a graded unit by going to edX studio for that unit. Under "Add New Component", click "Advanced", and pick "LTI Consumer". Edit the newly created LTI consumer. Fill in the following settings:

  • Display Name: the name of the assignment that will be passed to SGA-LTI
  • LTI ID: [your LTI passport id that you configured in course settings]
  • LTI URL: [the root url of the tool] (so if the tool is deployed at example.com, the launch URL is https://example.com)
  • LTI Launch Target: Inline
  • Scored: True
  • Request user's username: True
  • Request user's email: True

NOTE: This tool is only designed to be installed in graded units of an edX course.

Adding an application

To add an application to this, add it to the requirements file, add its needed settings, include its URLs, and provide any needed template overrides.

Testing

The project is set up with `tox<https://tox.readthedocs.org/en/latest/>`_ and `py.test<http://pytest.org/latest/>`_. It will run pylint, pep8, and py.test tests with coverage. It will also generate an HTML coverage report. To run them all inside the docker image, run docker-compose run web tox, or if you are running locally, after installing the requirements file, just run tox.

Continuous Testing

If you want test to run on file changes, the test_requirements.txt adds pytest-watcher, which can be started with ptw. This unfortunately will not work well in the Docker container because the file events it uses are fired on the host OS, and not the docker OS. I have corrected it upstream with `issue<https://github.com/joeyespo/pytest-watch/issues/9>`_ to the `pytest-watch repo<https://github.com/joeyespo/pytest-watch>`_, but it has not been released to pypi as of this writing.

sga-lti's People

Contributors

alvinsiu avatar zags avatar koljanos avatar kyfantaz avatar pdpinch avatar

Watchers

 avatar  avatar

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.