Giter Site home page Giter Site logo

ucfopen / quiz-extensions Goto Github PK

View Code? Open in Web Editor NEW
16.0 8.0 5.0 257 KB

A self-service LTI for faculty to easily extend time for multiple users for all quizzes at once.

License: MIT License

Python 77.58% Mako 0.37% Shell 0.16% CSS 1.90% JavaScript 11.60% HTML 8.31% Ruby 0.09%
canvas-lms accessibility canvas education lti instructure a11y edtech hacktoberfest

quiz-extensions's Introduction

Build Status Coverage Status Join UCF Open Slack Discussions

A self-service LTI for faculty to easily extend time for multiple users for all quizzes at once.

Table of Contents

Installation

Development Installation

git clone [email protected]:ucfopen/quiz-extensions.git

Switch into the new directory

cd quiz-extensions

Create the config file from the template

cp config.py.template config.py

Fill in the config file

API_URL = ''  # Canvas API URL (e.g. 'http://example.com/api/v1/')
API_KEY = ''  # Canvas API Key

# The maximum amount of objects the Canvas API will return per page (usually 100)
MAX_PER_PAGE = 100

# A secret key used by Flask for signing. KEEP THIS SECRET! (e.g. 'Ro0ibrkb4Z4bZmz1f5g1+/16K19GH/pa')
SECRET_KEY = ''

LTI_KEY = ''  # Consumer Key
LTI_SECRET = ''  # Shared Secret

LTI_TOOL_ID = ''  # A unique ID for the tool

SQLALCHEMY_DATABASE_URI = ''  # URI for database. (e.g. 'mysql://root:root@localhost/quiz_extensions')

GOOGLE_ANALYTICS = ''  # The Google Analytics ID to use.

REDIS_URL = ''  # URL for the redis server (e.g. 'redis://localhost:6379')

Create a virtual environment

virtualenv env

Source the environment

source env/bin/activate

Install required packages

  • If you want to be able to run tests:

    pip install -r test_requirements.txt
  • Otherwise,

    pip install -r requirements.txt

Set FLASK_APP environment variable

export FLASK_APP=views.py

Migrate database

flask db upgrade

Run the server

flask run --with-threads

Ensure Redis is running. If not, start it with

redis-server --daemonize yes

Ensure RQ Worker is running. If not, start it with

rq worker quizext

Production Installation

This is for an Ubuntu 16.xx install but should work for other Debian/ubuntu based installs using Apache and mod_wsgi.

sudo apt-get update
sudo apt-get install libapache2-mod-wsgi python-dev apache2 python-setuptools python-pip python-virtualenv libxml2-dev libxslt1-dev zlib1g-dev

sudo a2enmod wsgi
sudo service apache2 restart

cd /var/www/

sudo git clone [email protected]:ucfopen/quiz-extensions.git

cd quiz-extensions/

sudo virtualenv env
source env/bin/activate

sudo env/bin/pip install -r requirements.txt

sudo nano /etc/apache2/sites-available/000-default.conf

Put this inside 000-default.conf after VirtualHost *:80 And before the ending </VirtualHost>:

#QUIZ EXTENSION CODE
Alias quiz-ext/static /var/www/quiz-extensions/static
<Directory /var/www/quiz-extensions/static>
    Require all granted
</Directory>

<Directory /var/www/quiz-extensions>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>

WSGIDaemonProcess quiz-ext
WSGIProcessGroup quiz-ext
WSGIScriptAlias /quiz-ext /var/www/quiz-extensions/wsgi.py

Then:

sudo service apache2 reload

sudo cp config.py.template config.py

sudo nano config.py

Edit your config.py and change the variables to match your server:

DEBUG = False  # Leave False on production

API_URL = ''  # Canvas API URL (e.g. 'http://example.com/api/v1/')
API_KEY = ''  # Canvas API Key

# The default number of objects the Canvas API will return per page (usually 10)
DEFAULT_PER_PAGE = 10
# The maximum amount of objects the Canvas API will return per page (usually 100)
MAX_PER_PAGE = 100

# A secret key used by Flask for signing. KEEP THIS SECRET! (e.g. 'Ro0ibrkb4Z4bZmz1f5g1+/16K19GH/pa')
SECRET_KEY = ''

LTI_KEY = ''  # Consumer Key
LTI_SECRET = ''  # Shared Secret

LTI_TOOL_ID = ''  # A unique ID for the tool
LTI_DOMAIN = ''  # Domain hosting the LTI

SQLALCHEMY_DATABASE_URI = ''  # URI for database. (e.g. 'mysql://root:root@localhost/quiz_extensions')

Finally:

sudo service apache2 reload

Third Party Licenses

This project uses ims_lti_py which is available on GitHub under the MIT license.

Contact Us

Need help? Have an idea? Just want to say hi? Come join us on the UCF Open Slack Channel and join the #quiz-extensions channel!

quiz-extensions's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quiz-extensions's Issues

Ignores Time Limit Changes

Quiz Extensions appears to ignore (or be unaware of) changes to time limits, in regards to "updating" quizzes from previous runs.

Steps to reproduce

  1. Create a quiz with no time limit
  2. Run quiz extensions, extending for at least 1 user
  3. Edit the quiz from step 1 to have a time limit
  4. Run quiz extensions, extending for a different user
  5. View the quiz moderation page for that quiz, and observe only the second user's time has been changed.
  6. Edit the quiz to have a different time limit
  7. Run quiz extensions, extending for yet another different user
  8. View the quiz moderation page and observe that the first user has no extension, the second user has the old time extension, and only the third user has the new extension.

Proposed Fix

Add a column to the quiz table for the time limit (probably an integer representing length in minutes). Whenever we do a check for updates, compare the time limits of each quiz against the one stored in the DB. If the time is different, run the update against that quiz the same way we do to new quizzes.

For the migration, we have two options: do a data migration that makes API calls to update existing quizzes to the appropriate time limit, or set the time limit to a temporary number (probably 0 or -1), and let the process naturally update the affected quizzes over time.

Upgrade instructions

I see that nothing has been updated since April of 2020. There were several comments asking about install instructions but I am not seeing any updates. We are running an older 3.x version and would like detailed instructions for upgrading to the latest version.
Thank you.

isort

Add and run isort to clean import sorting.

Warn if Extending Beyond Availability

Problem

We have reports of instructors setting highly restrictive availability dates on quizzes that end up causing issues with extensions.

For example, if an instructor sets a 60-minute quiz to be available from 8am to 9am, the quiz will end at 9am regardless of when the student begins the quiz. This also applies to students who receive time extensions, meaning a student who is supposed to receive double time would be recorded as having 120 minutes, but still be shut down at 9am, only 60 minutes after starting their exam. Part of the issue is that the instructor isn't necessarily aware that giving an extension doesn't override the available until time.

While the simplest solution is obviously to make the length of availability longer, not all instructors are amenable to this idea. The other option is to provide an overall time extension to just the affected students via differential dating.

Differential dating is outside the scope of the Quiz Extensions tool (not to mention I've had difficulty implementing it in Due Date Changer ucfopen/due-date-changer#11), but we can still do something to inform the instructor that they are making a mistake.

Proposed Solution

Add functionality to the extensions process to check for quizzes with availability dates and warn if the extension would exceed the due/lock date:

  1. Determine the length of time the quiz is available for (subtract lock_at and/or due_at from unlock_at)
  2. Compare that available length against the new extended length (time_limit * extension factor)
  3. If the extended length is greater than the available length, flag that quiz
  4. After all quizzes have been updated, display a warning message with a list of all the flagged quizzes stating that the instructor will need to add time for those students. Probably include a link on how to edit availability dates for individual students. (Maybe this one?)

At the very least, this will inform the instructor that action is still required of them.

Deactivated Extensions Cannot be Reactivated

Describe the bug

Once an extension has been set as inactive (active field is set to 0), there is no path for it to become active again, short of manually editing the database. This also happens without being fully transparent to the person running Quiz Extensions that a user's extension is being actively ignored.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new extension for a user via the usual Quiz Extensions process.
  2. Go to the extension table in the database and find the new extension entry.
  3. Observe that the active field is set to 1.
  4. Cause the user to be in a state that will mark them as inactive: remove them from the course, change their enrollment type to something other than "student", or change their enrollment state to something other than "active" or invited".
  5. Run the update process
  6. Observe that the active field is set to 0.
  7. Put the user back into a stable state: enrolled in the course as type "student" and status "active" or "invited".
  8. Create a new extension for the user via the usual Quiz Extensions process. This updates the existing extension record instead of creating a new one.
  9. Observe that (despite the user now being enrolled properly) the active field is still set to 0.

Expected behavior

When the update process is run, it should check whether or not users with inactive extensions have changed into an active state, instead of just ignoring them.

Note: This will have some minor performance hits, but will be part of the backgrounded process.

Also need to improve feedback to user to explain that x users are being ignored due to being inactive.

Environment information

  • Python version (python --version): any

How install??

Trying to test the plugin to integrate it with Canvas gives me an error.

What libraries are necessary to make it operational??

I get message WSGI no views module found

GitHub Actions

We previously used TravisCI for CI/CD, but our existing configuration on Travis no longer functions. Travis' new solution is a bit sketchy, so I would like to switch to GitHub Actions, like we did for CanvasAPI (ucfopen/canvasapi#445).

Statistics Reporting

We have received multiple requests for some built-in reporting. We should make a report that can directly generate the statistics rather than combing through the database manually.

See Previous Extensions

Several people have requested the ability to see which students have already received an accommodation for the course, and what percentages. Perhaps a button on the main page that opens a modal with this information?

Verbose Apply Now Response

At the moment, the "apply now" button for updating new quizzes only yield a success/failure message. We can be more verbose.

A faculty member has requested an improvement:

The apply now, I’ve used it before, but it doesn’t tell me really what it did. Just says 1 quiz has been updated. It isn’t very useful unless it gives me the students and the quizzes that were updated. Because I don’t really know what it did.

Implement CanvasAPI

CanvasAPI is a library created by UCF CDL that handles much of the heavy lifting when working with the Canvas API. Quiz Extensions has its own functions that handle Canvas API calls, but using a trusted library that has already handled all the edge cases would be much more reliable. It will also make Quiz Extensions' codebase smaller and easier to maintain.

CanvasAPI can be found here: https://github.com/ucfopen/canvasapi/

Production Setup Documentation

Our README, especially the part with setup instructions, is pretty out of date.

We need to add/update a few things:

  • Specify that a Redis server is necessary for the project to run
  • Document and/or link to documentation how to set up Redis
  • Show how to setup the RQ worker
  • Ensure that the rest of the existing setup docs are still accurate

[Feature Request] Display Extended Time Limit and Base Time Limit for Quizzes

Describe the Feature

It is difficult for students taking quizzes with extended time to easily tell if their quiz time has been extended. This feature would display both the student’s time limit with and the time limit without extension.

Use to Other Institutions

As there does not appear to be another way for students to verify their quiz extension has been added, I would assume it would be useful to students at all institutions.

How it Would Work

For example, a 15-minute quiz for a student with an accommodation for double time would appear as:
Time Limit: 30 Minutes (Extended from 15 Minutes)
For Example, current a quiz would display as:
time limit
With the feature added a quiz would display as:
time limit extended

Implementation

This is not a feature that I would be able to implement myself, but would be available for consultation.

Old Default Roles in Config

In config.py.template under PYLTI_CONFIG, our "roles" dictionary is out of date. It creates two roles, "admin" and "student", neither of which are referenced in current versions of the code.

We currently use a "staff" role for everything in Quiz Extensions, which on our production server looks like this:

'staff': [
    'urn:lti:instrole:ims/lis/Administrator',
    'Instructor',
    'ContentDeveloper',
    'urn:lti:role:ims/lis/TeachingAssistant'
]

Change the default to use "staff" and set it to something reasonable. The defaults for UCF might be too permissive for some institutions, so may only include Admin and Instructor by default. Possibly leave the others in the template, but commented out with explanations?

WSGI file errors

When we did the update from python 2 -> python 3, we didn't update the wsgi.py file. Running it often leads to errors, including import errors.

Update wsgi.py to be more in line with our internal WSGI file.

Update Badges

At the top of our README, we have badges for Travis build status, coverage, and our Slack channel. As of #52 (#49), we have moved from Travis to GitHub actions, and from Coveralls to CodeCov.

Update the first two badges to use GitHub Actions and CodeCov, respectively.

Additionally, remove the old .travis.yml file.

[Feature Request] Automatically apply Quiz Extensions to New Quizzes

Describe the Feature
The current way this tool works is for instructors to extend quiz time for specific students for all existing students and then when new quizzes are added the instructor goes back in and applies the previous extension to the new quizzes. This is much better than starting from scratch but we would prefer a workflow where those previous extensions would automatically apply to all new quizzes.

Given our process, once a student is qualified to receive time extension that accommodation applies to all quizzes for the course and we haven't come across any scenarios where doing so would be problematic. On the contrary, we have had some difficulty getting instructors to remember to go in and apply the existing extensions when new quizzes are added.

Use to Other Institutions
I don't know if this would be useful to other institutions, but I would love to hear and understand the rationale for the current workflow.

How it Would Work
I assume that if this were to be implemented it would be as an option which would require the following changes to the configuration and UI:

  1. Add an option in config.py.template to enable the option, something like, "AUTOMATIC_APPLICATION = 'YES'
  2. Setup a cron job at a determined amount to pick up new quizzes and apply extensions or figure out a way for new quizzes being added to trigger the extension.
  3. In userselect.html change the text:

This tool will apply extra time to all existing quizzes/exams. For example, Suzy Johnson and Stephen Smith need double time. Select the students below and choose the appropriate amount of extra time e.g., double (2x).
If additional quizzes/exams are added during the semester, a message will appear below stating there are new quizzes which need extensions. Click the Apply Now button to add the same extensions.

to something like:

This tool will apply extra time to all existing and future quizzes/exams. For example, Suzy Johnson and Stephen Smith need double time. Select the students below and choose the appropriate amount of extra time e.g., double (2x).
If additional quizzes/exams are added during the semester, your extensions will automatically be applied.

Implementation
I may be able to convince one of our developers to work on this and will start having those conversations. In the meantime, if there is any interest from the developers to implement I would be more than happy to help in any way I could.

Thanks!

Tests Failing

Describe the bug

Currently, every single test is throwing an unexpected AttributeError exception. This can be seen in the "run tests" portion of this GH Actions run. It also happens on my local machine.

To Reproduce

Steps to reproduce the behavior:

  1. Configure application
  2. coverage run -m unittest discover

Expected behavior

All tests to run and pass, or at least run and fail with relevant errors.

Environment information

  • Python version (python --version) Python 3.9.6

Additional context

It seems like this might be related to compatibility with old versions of Flask and/or its dependencies, so upgrading could solve a lot of problems. There may be additional changes to the tests required due to these version changes.

Implement PyLTI

MIT has an LTI library for python that looks much more promising (and easier to use) than our current solution.

We have a fork of PyLTI on the ucfcdl GitHub. The branch roles has a solution for our special case regarding custom roles: https://github.com/ucfcdl/pylti/tree/roles

User defined minimum time

An idea to set a user defined minimum allowed time percentage in the settings file. Would set the right hand user defined input box to have a set minimum. Would fix the issue where a faculty member puts in less than 100%, and the left hand box becomes the default.

Adds more visible UI elements to the right hand input box.

Update all `http` URLs to the IMS Global LTI rules to `https`

Per 1EdTech

Upcoming Change to IMS Domain
Effective April 1, 2024
This is an important notice for organizations that are referencing hardcoded imsglobal.org XSDs in your software.
Effective April 1, 2024, 1EdTech will automatically redirect all traffic from its previous domain, http://www.imsglobal.org/, to https://www.imsglobal.org/.
Starting on April 1, we will redirect all files located on www.imsglobal.org to the new secure website—they will no longer be available via HTTP. This change will impact XSDs as well as other files.
The imsglobal.org will eventually be deprecated and go away completely.
Please check any URLs currently resolving to www.imsglobal.org and change them accordingly. XSDs are already located at the secure location so that testing can begin immediately.
We are implementing this change to ensure that we follow best practices. You should not have any issues if you properly respect the 301 redirect protocol by W3C.
1EdTech’s technical staff are available to help with questions.

Update http to https accordingly.

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.