Spotlight Reports is a tool provider for Instructure's Canvas Learning Mangagement System.
It offers a way to view stats about the instructors within a sub-account.
- Generate an API Token from Canvas
- Go to your canvas installation, navigate to Account -> Settings (
/profile/settings
) and add a New Access Token - Copy the access token that's generated. This will be your
API_TOKEN
.
- Go to your canvas installation, navigate to Account -> Settings (
- Use the button above to deploy Spotlight Reports to Heroku.
- Set the Environment variables that are being requested.
- For
OAUTH_KEY
andOAUTH_SECRET
, we'll let Heroku generate random ones.
- Grab the
OAUTH_KEY
andOAUTH_SECRET
for the next step- Navigate to https://heroku.com/apps
- Select the app you created
- Go to Settings and Reveal Config Vars
- Add Spotlight Reports to your Canvas installation
- Switch to Admin View in canvas if you're not already there
- Navigate to Admin -> Main Account -> Settings (
/accounts/1/settings
) - Go to the
Apps
tab - Add a New App
- Under
Configuration Type
, selectBy URL
- Type Spotlight Reports for the Name
- Enter the
OAUTH_KEY
andOAUTH_SECRET
you made up previously for the Consumer Key and Shared Secret, resepectively - For the
Config URL
, enterhttps://my-app.herokuapp.com/tool_config.xml
(replacing my-app with the name of your heroku instance). - Submit, refresh the page, and you should see Spotlight Reports listed as an Admin Tool (but it won't have data for the main account)
- Go to Sub Accounts and select a School
- Go to Spotlight Reports and view a report
- To keep the data up-to-date, add a nightly data import
- Go to https://heroku.com/apps
- Select the app you created
- Go to Resources
- Select the Scheduler app
- Schedule a task to run each night with the command
bundle exec rake update_database
- this is the nightly database update. Feel free to schedule more or less frequently.
To work on this project you will need an instance of Canvas running and API access to that instance.
Clone this repo and set up your credentials. To do so, create a file called canvas.yml
in the /config
folder. It should contain the following:
development:
OAUTH_KEY: <generate one of these yourself>
OAUTH_SECRET: <generate one of these yourself>
API_URL: <this is the link to your canvas instance API>
API_TOKEN: <this is the token you got when you set up API access>
production:
OAUTH_KEY:
OAUTH_SECRET:
API_URL:
API_TOKEN:
Start the app.
bundle install
rake db:create
rake db:migrate
rails s
Install the app add-on into your Canvas instance.
Note: If your Canvas instance is not running locally, you will need to expose the port on which you are running Spotlight Reports to the internet. ngrok is a good solution for this.
In your Canvas instance do the following:
- Go to your Managed Accounts
- Click Settings in the left-hand nav
- Click the Apps tab
- Click View App Configurations
- Click Add App
- In the Configuration Type drop down, select "By URL"
- Type in the name: Spotlight Reports
- Paste in the Consumer key and Shared Secret that you created for canvas.yml
- Paste the URL for the Configuration XML. For example: "https://localhost:3000/tool_config.xml" or "https://******.ngrok.com/tool_config.xml"
- Click Submit
You should be told the app was successfully added. Refresh the page again and you will see "Spotlight Reports" added to the left-hand nav.
Populate your database
rake populate_database
Once all those steps are done, you should be able to go to a sub-account, click Spotlight Reports, and see a list of teachers with published courses.