项目作者: ucfopen

项目描述 :
Faculty Tools - A tool to launch other tools
高级语言: Python
项目地址: git://github.com/ucfopen/faculty-tools.git
创建时间: 2019-07-02T20:25:38Z
项目社区:https://github.com/ucfopen/faculty-tools

开源协议:MIT License

下载


Build Status
Coverage Status
Join UCF Open Slack Discussions

Documentation for Faculty Tools

Settings

Create a new settings.py file from the template

  1. cp settings.py.template settings.py

Edit settings.py to configure the application. All fields are required,
unless specifically noted.

Developer Key

You will need a developer key for the OAuth2 flow. Check out the Canvas
documentation for creating a new developer key

  • Have your redirect URI (oauth2_uri) ready, since you need it to make
    the key.
  • When you make a key, copy the ID to oauth2_id and the key into oauth2_key
    in your settings file.

Tool Whitelist

Add the tools you want instructors and faculty to see to whitelist.json.

  1. [
  2. {
  3. // The name of the tool from within the Settings page
  4. "name": "Installed Tool Name",
  5. // The unique tool id, not currently used
  6. "tool_id": "tool_id",
  7. // Allows viewable name to be different from installed name, ie: Attendance vs. RollCall
  8. "display_name": "Name to Display",
  9. // Short description of the tool to be displayed to the user
  10. "desc": "Tool Description",
  11. // Filename of screenshot. Must be in static/img/screenshots
  12. "screenshot": "screenshot.png",
  13. // Filename of logo. Must be in static/img/logos
  14. "logo": "logo.svg",
  15. // Link to the tool's documentation. Appears as the Learn More button
  16. "docs_url": "https://example.com/tool/docs/",
  17. // Turns off/on launch button inside Faculty Tools - Useful for docs
  18. "is_launchable": true,
  19. // What category to put the tool in. Options: Course Tool, Assignment Editor, Rich Content Editor
  20. "category": "Course Tool",
  21. // For future use
  22. "filter_by": ["all"],
  23. "allowed_roles": [""],
  24. },
  25. ]

Virtual Environment

Create a new virtual environment.

  1. virtualenv env

Activate the environment.

  1. source env/bin/activate

Install everything:

  1. pip install -r requirements.txt

Create DB

Change directory into the project folder. Create the database in python shell:

  1. from lti import db
  2. db.create_all()

If you want to look at your users table in the future, you can do so in the
python shell:

  1. from lti import Users
  2. Users.query.all()

Environment Variables

Set the flask app to lti.py and debug to true.

  1. export FLASK_APP=lti.py
  2. export FLASK_DEBUG=1

Alternatively, you can run the setup script to simultaneously setup environment
variables and the virtual environment.

  1. source setup.sh

Run the App

Run the lti script while your virtual environment is active.

  1. flask run

Go to the /xml page, http://0.0.0.0:5000/xml by default

Copy the xml, install it into a course.