Skip to content

Harvard-ATG/academic_integrity_tool_v2

Repository files navigation

Coverage Status

AI Policy Tool (V2) (Formerly Academic Integrity Policy Tool)

This is a django application that enables instructors to prepare AI policies from templates made by instructional technologists and publish said policies for students to view. It is an LTI tool that is embedded into and launched from the Canvas LMS.

Installing the tool in the Canvas LMS

Follow the Canvas Admin Guide on How do I configure an external app for an account using XML?. This can be done at either the sub-account level or in a specific canvas course by visiting that course's settings.

The key details you will need include:

Once installed, the tool should be displayed in the left-hand course navigation as AI Policy. Note that it may be disabled in the navigation by default, so you may need to manually enable it in the course settings navigation (drag and drop to move to the desired position).

Developer Notes

The instructions below assume you have Docker installed on your machine.

Getting setup

Configure django settings:

$ cp academic_integrity_tool_v2/.env.example academic_integrity_tool_v2/settings/.env

Run the application:

$ docker compose up

Open the tool in your web browser to verify it is up and running:

open http://localhost:8000

Testing

$ docker compose run web python manage.py test

Integrated Testing

When this tool is launched from Canvas, it is embedded in an iframe from a secure (https- based) site. For the cross-domain session and CSRF cookies to function correctly, our Django settings are configured with SESSION_COOKIE_SECURE = True and CSRF_COOKIE_SECURE = True. These settings command the browser to only send cookies over a secure HTTPS connection.

While local development on http://localhost:8000 may appear to work for basic views, this is because modern browsers often treat localhost as a "secure context" and relax this policy. However, this does not accurately simulate the production LTI environment and will fail when trying to establish a valid cross-domain session.

To properly test the LTI flow locally, you must expose your local development server on a public HTTPS URL. NGROK is a tool that provides this functionality.

NGrok Configuration Steps
  1. Install NGROK: Follow the official instructions

  2. Start the Django Server: Run the local development server as usual.

    docker-compose up
  3. Start NGROK: In a separate terminal, run the following command to expose your local port 8000 on a public HTTPS URL.

    ngrok http --scheme=https 8000
    • This command tells ngrok to forward traffic to your local http://localhost:8000 but to set the forwarding scheme in the HTTP headers to https. This ensures Django recognizes the connection as secure, which is necessary for the secure cookie flags.
  4. Update Environment Variables: NGROK will provide a public URL (ex., https://<random-string>.ngrok-free.app).

  5. Update Canvas: In your Canvas course settings, add the LTI tool (see Original demos section below) using your new public NGROK URL XML page (ex., https://<random-string>.ngrok-free.app/lti/config). You can now launch the tool from Canvas to fully test the LTI flow against your local development server with behavior similar to production.

Update the Coverage Badge

$ coverage run --source='.' manage.py test
$ coverage-badge -f -o coverage.svg
  • Then commit and push the changes!

Resources

Original demos

These are demos of the original academic integrity tool and are slightly out of date, but preserved for reference.

About

Version 2 of https://github.com/Harvard-ATG/AcademicIntegrityTool. Upgrades include architectural navigation improvements, UI changes to make the interfaces consistent with the Canvas UI, and rewriting the tool itself in Python/Django (as opposed to Ruby). The tool will be deployed to the TLT environment.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors