0% found this document useful (1 vote)
44 views

Quizapp Documentation: Release 0.0.1

QuizApp is a platform for conducting online experiments and surveys. It allows researchers to show participants a sequence of assignments like questions and have their responses stored in the database. Experiments contain multiple assignment sets that participants complete. The documentation provides information on installing, configuring, and using QuizApp to build experiments and analyze participant data.

Uploaded by

Arghya Sen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
44 views

Quizapp Documentation: Release 0.0.1

QuizApp is a platform for conducting online experiments and surveys. It allows researchers to show participants a sequence of assignments like questions and have their responses stored in the database. Experiments contain multiple assignment sets that participants complete. The documentation provides information on installing, configuring, and using QuizApp to build experiments and analyze participant data.

Uploaded by

Arghya Sen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

QuizApp Documentation

Release 0.0.1

Colin Gerber, Alexei Bendebury

Sep 16, 2016


Contents

1 Contents 3

2 Indices and tables 33

Python Module Index 35

i
ii
QuizApp Documentation, Release 0.0.1

QuizApp is a platform for conducting experiments in the form of online surveys. It is highly generalized, which makes
it useful for a wide variety of experiments.
At the fundamental level, QuizApp allows you to show a participant a sequence of assignments. These assignments can
be anything from instructional screens to questions to reviews of the participant’s past performance. The participant’s
responses to these assignments are stored in the database and associated with the assignment set that they completed.
An experiment contains several assignment sets.
This structure allows researchers to have fine grain control over what each participant sees as well as detailed infor-
mation about how each participant responded to each assignment.
For more information, please read through the documentation listed below.

Contents 1
QuizApp Documentation, Release 0.0.1

2 Contents
CHAPTER 1

Contents

1.1 Getting started with QuizApp

1.1.1 Quickstart

Cloning the repository

The first step is to clone the repository onto your disk.

git clone --branch=master [email protected]:PlasmaSheep/quizApp.git

This will check out the most recent stable version of QuizApp. If you like to live dangerously and want the bleeding
edge version, replace master with develop .

Installing python dependencies

It is best practice to install python dependencies using a virtual environment. This means that the packages that
QuizApp installs are independent from any packages you already have installed, which reduces any possible compati-
bility nightmares.
Before continuing, you should follow the installation instructions for virtualenvwrapper.
Now that you’ve done that, create a virtual environment for QuizApp.

mkvirtualenv quizApp

Now, in the QuizApp directory, run:

pip install -r requirements.txt

This will install all requirements necessary for QuizApp to run.

Setting up the database

Lastly, you need to set up the database. QuizApp uses MariaDB. If you use MySQL instead of MariaDB, QuizApp
should still work normally. If you have neither, you should install MariaDB.
Once you have MariaDB installed and running, you need to set up the database:

3
QuizApp Documentation, Release 0.0.1

./manage.py create-db

You will be prompted for your MySQL root password. This will create a database called quizapp and a user named
quizapp .
If you would like to have a different username/password combo, edit quizApp/config.py , find the configuration
you wish to modify (e.g. development, production) and modify the variables to your new values. You will then have
to re-run create-db . Note that your information is not secure if you do not modify the database username
and password.

Note: manage.py can handle creation and population of multiple database configurations. If you are running a
development sever, the above command is sufficient. This is because manage.py defaults to the development
configuration.
If you want to set up a production server, you must specify the --config option:

./mange.py --config production create-db

Keep this in mind when you see other commands using manage.py .

Creating a user

You will need to create a user to work with QuizApp. Full details are available on Managing users, but your command
should look something like this:

./manage.py create-user --username experimenter --password password --role


˓→experimenter

Running QuizApp

This is essentally all you have to do to install QuizApp. To run QuizApp using the default Flask webserver, simply
run:

./manage.py run

However, it is not recommended to use this server for production environments. See Production servers for instructions
on running QuizApp in a production environment.

1.1.2 Configuration and security

If you are running quizApp in a production environment, you are definitely going to want to modify the password of
the QuizApp database user for extra security. You are maybe going to want to modify the database name or username
that QuizApp uses.
In any case, the easiest method to change the database setup is by modifying quizApp/config.py . There are
3 main environments that QuizApp recognizes - testing, development, and production. You are probably most inter-
ested in modifying production settings - however note that the Production class does not contain any database
particulars. This is because database information for production is stored using instance configuration.
In QuizApp, the instance folder is called instance . There is a file there called instance_config.py.ex
. If you wish to override any of the default production database settings, you should copy this file to
instance/instance_config.py .

4 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

In that file, there are four options. The first option is the database URI. The full reference for the URI syntax is located
here.
The second is the secret key. This is used for various cryptographic purposes and needs to be randomly generated.
Refer to the flask documentation for instructions on generating secret keys.
Repeat the process above for the third option, SECURITY_PASSWORD_SALT .
The fourth option represents what email address QuizApp will use to send emails such as registration confirmation,
password recovery, etc.
In addition, if you plan to use QuizApp with Amazon Mechanical Turk, you will need to move
instance/mturk.yaml.ex to instance/mturk.yaml and update the AWS access key ID and secret key
for your mechanical turk user. Remember to follow best practices and use IAM for this.

1.1.3 Production servers

There are many ways to run QuizApp in a server. However, QuizApp is merely a platform and does not include a web
server.
One popular way to run a server is via gunicorn and nginx. Here is a good tutorial for setting up that configuration.
QuizApp already includes a wsgi file for use with gunicorn, located at wsgi.py .

1.2 Understanding the QuizApp structure

There are 3 principle parts of the quizApp system: the experiments, activities, and datasets. The experiment com-
ponents handle tasks related to rendering, running, and updating experiments - this includes showing assignments to
participants, saving their answers, generating experiment reports, and more. Activities is concerned primarily with
rendering and managing activities. Datasets is primarily concerned with managing datasets as well as rendering and
managing activities. Most components of quizApp are divided along these broad lines.
As far as application logic goes, quizApp follows a fairly typical MVC design pattern. The quizApp/ directory is
organized like so:
• forms : Contains logic used for rendering and validating forms
• static : Contains static files, like graphs, css, and js
• templates : Contains template files, which specify what is displayed to the users and in what format
• views : Contains view logic that interfaces with the models and sends data to templates for rendering
• models.py : Database models that specify how information is stored in the database and take care of valida-
tion. More information about models is available in Understanding the QuizApp models.
• filters.py : Various jinja filters that are used for formatting and rendering purposes
• __init__.py : File that handles setup and initialization of the application

1.2.1 QuizApp Flow

In general, each view file registers a number of URLs that are handled by some function in the view file. When a
user makes a request to a certain endpoint, the view function first checks authentication, then validates the URL (if
applicable, e.g. checking to make sure the requested experiment exists), accesses the database (if necessary), performs
any necessary processing, then sends some context variables to a template, which is rendered and shown to the user.

1.2. Understanding the QuizApp structure 5


QuizApp Documentation, Release 0.0.1

When it comes to running experiments, participants must first be given a link to the experiment itself. Once they arrive
at the landing page, they will see the experiment’s blurb and be assigned an assignment set. Once they click “start”
they will begin the first assignment in their set. Each assignment will be rendered as its media items followed by its
activity. The participant’s response will be stored as a Result object on the Assignment. Once the participant finalizes
their responses, their assignment set will be marked as completed and they will be unable to run the experiment again.

1.3 Understanding the QuizApp models

The structure of a QuizApp database may be confusing at first, but it is actually fairly understandable. This document
focuses on the relationships between the models. For information about the other fields, view the documentation for
quizApp.models .

1.3.1 Experiment

At the root, there is the quizApp.models.Experiment . An Experiment contains information such as when to
start running, when to stop running, and any introductory text necessary.

1.3.2 AssignmentSet

An Experiment also has a collection of quizApp.models.AssignmentSet . Each AssignmentSet


is an association between a quizApp.models.Participant , an Experiment, and a collection of
quizApp.models.Assignment s. This means that in a given Experiment, every Participant will have a dif-
ferent AssignmentSet containing a sequence of Assignments.

1.3.3 Assignment

An Assignment is the object that associates a Participant with an quizApp.models.Activity . The rea-
son that AssignmentSet does not directly contain Activities is that Activity is also associated with a collection of
quizApp.models.MediaItem s. This means that, for the same Activity, two Participants may see two different
Mediaitems. While performing an Experiment, Participants are shown Assignments in the order they appear in their
AssignmentSet class.

1.3.4 Activity

An Activity is some screen that the Participant sees in the course of an Experiment. Currently, the only Activity is
quizApp.models.Question , which displays a Question and some choices. However, it is possible to extend
QuizApp to have other types of Activities. This would require creating a subclass of Activity in models.py and
implementing the correct logic to handle creation, reading, and updating of your new Activity type.

Question

There are several subclasses of Question. They all operate around the principle of displaying a string of text, followed
by a series of quizApp.models.Choice s. Each Choice is related to only one Question, so Choices are not
recycled from Question to Question. Since each Choice has its own correct field, you can have a Question with
all correct choices, no correct choices, or anywhere in between. Questions are also associated with Datasets. This
represents which Datasets a Question’s MediaItems are drawn from. A Question not associated with any Datasets can
draw MediaItems from any dataset.

6 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

1.3.5 MediaItem

A MediaItem is some stimulus that should be displayed when a Participant is doing an Activity. Each MediaItem is
associated with a quizApp.models.Dataset . By default, QuizApp contains the quizApp.models.Graph
MediaItem. A Graph is simply an image file located on disk. Again, it is possible to expand QuizApp to have
MediaItems that are videos, sounds, or anything else. You would need to subclass MediaItem, then implement the
correct logic for rendering the new MediaItem type.

1.3.6 Dataset

A Dataset represents a collection of MediaItems that come from a common source.

1.4 Importing and exporting data

After creating your experiment, activities, media items, and datasets, you must set up your assignment sets and as-
signments to begin an experiment. Setting up your assignment sets and assignments is referred to as “importing data”.
Due to the diversity of methods for assigning assignments, quizApp does not provide a GUI but does allow a lot of
flexibility. Once an experiment has been run, you will want to export your data to analyze responses. The primary
way of importing and exporting data is through the /data/manage page. There are two operations you can do on
this page: importing and exporting.

1.4.1 Exporting

All data

To export a dump of all data in the database, click on the Export link. Alternatively, you can visit the /data/export
page. This will take some time due to the amount of database queries and processing, but it will give you all the data
in the database in spreadsheet form. The tab names correspond to the types of objects in the database, and the column
headers are in the format <table_name>:<database_column_name> . Each row in every tab represents one
database record.

One experiment’s data

To export just the data from one experiment, you can use the /experiments/<id>/results page. There is a
link there titled Export to XLSX. Clicking on this link will download a summary of answers to this experiment. Each
assignment set will have its own row, and each assignment in that assignment set will have three columns:
1. A string representation of that activity, e.g. the question text. The contents of this row is a string representation
of the result for this activity prepended with the assignment ID - so for example, the header might be the question
text and each cell under the header would be a participant’s answer (prepended with the ID of the assignment
itself).
2. Correct/incorrect, with each cell below that being TRUE or FALSE
3. Number of points awarded for the result
If a participant did not answer a question present in their assignment set, the token _BLANK_ will be present to
indicate this.

1.4. Importing and exporting data 7


QuizApp Documentation, Release 0.0.1

1.4.2 Importing

To import data into the database, you must modify a script provided with quizApp, namely
scripts/generate_import_sheet.py . There are two variables you are going to be interested in,
both defined in the beginning of the file:
1. DEST_FILE : The name of the output file
2. DATA : A list containing the actual data that should be written to the spreadsheet
DEST_FILE is self explanatory, and DATA has comments above it documenting its format. Note that you must know
the IDs of the experiments, activities, and media items you are interested in using. You can find them in the export
spreadsheet or in the web interface.
Once you have specified your DATA variable, you can simply run ./generate_import_sheet.py (make
sure you are in your quizApp virtual environment). There will be a file in the current directory named based on
DEST_FILE , and by uploading this spreadsheet in /data/manage your experiment will be populated with as-
signments and ready for use.
Note that there is no discovery mechanism for participants to find experiments - the experiment URL must be provided
to the participants, e.g. /experiments/5 where 5 is the ID of the experiment you are linking.
For a general overview of how the models work, refer to Understanding the QuizApp models. For a detailed documen-
tation of the models and their fields (which correspond to the columns in the spreadsheet), refer to quizApp.models
.

1.5 Using QuizApp with Amazon Mechanical Turk

QuizApp includes a small script which allows you to post an Experiment as a HIT on Amazon Mechanical Turk.
Using the script is fairly straightforward:
1. Modify instance/mturk.yaml to correspond to your AWS credentials
2. Run ./manage.py post-hits --experiment-id <experiment_id> with the ID of the experi-
ment you wish to post.

Note: Make sure you are still in the virtual environment you made previously: workon quizApp

3. If you are successful, you will see the message “HIT Created” followed by the ID of the HIT. You should now
be able to see them in the requester interface on mechanical turk.

Note: This only creates the HIT in the amazon turk sandbox. If you wish to post it in the production environ-
ment, you must specify --live on the command line.

Further information on using the post-hits subcommand can be found by doing ./manage.py post-hits
--help .

1.6 Managing users

Managing users is fairly straightforward with manage.py . The relevant commands are manage.py
create-user and mange.py delete-user . Remember that --help will give information about possi-
ble command line options.

8 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

Here are some examples:


1. Create a new participant with the username username and password password :

./manage.py create-user --role participant --email username --password password

2. Create a new experimenter with the username username and password password :

./manage.py create-user --role experimenter --email username --password password

3. Delete a user with the username username :

./manage.py delete-user --username username

1.7 API

1.7.1 quizApp package

Subpackages

quizApp.forms package

Submodules

quizApp.forms.activities module

Forms for the activities blueprint.


class quizApp.forms.activities. ActivityForm ( *args, **kwargs)
Bases: quizApp.forms.common.OrderFormMixin , wtforms_alchemy.ModelForm
Generalized class for creation/updating of Activities
class Meta
Bases: quizApp.forms.activities.Meta , wtforms_alchemy.Meta ,
wtforms.meta.DefaultMeta , object
ActivityForm. category = <UnboundField(StringField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: None, ‘label
ActivityForm. include_in_scorecards = <UnboundField(BooleanField, (), {‘widget’: None, ‘description’: ‘’, ‘d
ActivityForm. needs_comment = <UnboundField(BooleanField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: Non
ActivityForm. scorecard_settings = <UnboundField(ModelFormField, (<class ‘quizApp.forms.common.Scorec
ActivityForm. submit = <UnboundField(SubmitField, (‘Save’,), {})>
class quizApp.forms.activities. ChoiceForm ( *args, **kwargs)
Bases: quizApp.forms.common.OrderFormMixin , wtforms_alchemy.ModelForm
Form for creating or updating choices.
class Meta
Bases: quizApp.forms.activities.Meta , wtforms_alchemy.Meta ,
wtforms.meta.DefaultMeta , object
ChoiceForm. choice = <UnboundField(StringField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: None, ‘label’: u’C

1.7. API 9
QuizApp Documentation, Release 0.0.1

ChoiceForm. correct = <UnboundField(BooleanField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: None, ‘label’: u
ChoiceForm. label = <UnboundField(StringField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: None, ‘label’: u’La
ChoiceForm. points = <UnboundField(IntegerField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: 0, ‘label’: u’Poin
ChoiceForm. submit = <UnboundField(SubmitField, (‘Save’,), {})>
class quizApp.forms.activities. DatasetListForm ( formdata=<class flask_wtf.form._Auto>,
obj=None, prefix=’‘, csrf_context=None,
secret_key=None, csrf_enabled=None,
*args, **kwargs)
Bases: quizApp.forms.common.ListObjectForm
List a bunch of datasets.
get_choice_tuple ( dataset)
class quizApp.forms.activities. IntegerQuestionForm ( *args, **kwargs)
Bases: quizApp.forms.activities.ActivityForm
Create or update an IntegerQuestion.
class Meta
Bases: quizApp.forms.activities.Meta , wtforms_alchemy.Meta ,
wtforms_alchemy.Meta , wtforms.meta.DefaultMeta , object
IntegerQuestionForm. answer = <UnboundField(IntegerField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: Non
IntegerQuestionForm. explanation = <UnboundField(TextAreaField, (), {‘widget’: None, ‘description’: ‘’, ‘defa
IntegerQuestionForm. lower_bound = <UnboundField(IntegerField, (), {‘widget’: None, ‘description’: ‘’, ‘defaul
IntegerQuestionForm. num_media_items = <UnboundField(IntegerField, (), {‘widget’: None, ‘description’: ‘’, ‘d
IntegerQuestionForm. question = <UnboundField(TextAreaField, (), {‘widget’: None, ‘description’: ‘’, ‘default’:
IntegerQuestionForm. upper_bound = <UnboundField(IntegerField, (), {‘widget’: None, ‘description’: ‘’, ‘defaul
class quizApp.forms.activities. QuestionForm ( *args, **kwargs)
Bases: quizApp.forms.activities.ActivityForm
Form that can be used for creating or updating questions.
class Meta
Bases: quizApp.forms.activities.Meta , wtforms_alchemy.Meta ,
wtforms_alchemy.Meta , wtforms.meta.DefaultMeta , object
QuestionForm. explanation = <UnboundField(TextAreaField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: None
QuestionForm. num_media_items = <UnboundField(IntegerField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: N
QuestionForm. question = <UnboundField(TextAreaField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: None, ‘la
class quizApp.forms.activities. ScorecardForm ( *args, **kwargs)
Bases: quizApp.forms.activities.ActivityForm
Form that can be used for creating or updating scorecards.
class Meta
Bases: quizApp.forms.activities.Meta , wtforms_alchemy.Meta ,
wtforms_alchemy.Meta , wtforms.meta.DefaultMeta , object
ScorecardForm. prompt = <UnboundField(StringField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: u’‘, ‘label’: u’
ScorecardForm. title = <UnboundField(StringField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: u’‘, ‘label’: u’T

10 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

quizApp.forms.activities. get_activity_form ( activity, *args, **kwargs)


Return the update form for the actiivty of the given type.

quizApp.forms.common module

Common forms or form elements live here.


class quizApp.forms.common. DeleteObjectForm ( formdata=<class flask_wtf.form._Auto>,
obj=None, prefix=’‘, csrf_context=None,
secret_key=None, csrf_enabled=None, *args,
**kwargs)
Bases: flask_wtf.form.Form
Display a button to delete some object.
submit = <UnboundField(SubmitField, (‘Delete’,), {})>
class quizApp.forms.common. ListObjectForm ( formdata=<class flask_wtf.form._Auto>,
obj=None, prefix=’‘, csrf_context=None, se-
cret_key=None, csrf_enabled=None, *args,
**kwargs)
Bases: flask_wtf.form.Form
A form that has a MultiCheckboxField of some objet.
get_choice_tuple ( obj)
Populate the list of choices with the appropriate tuple.
objects = <UnboundField(MultiCheckboxField, (), {‘validators’: [<wtforms.validators.DataRequired object>]})>
objects_mapping = {}
populate_objects ( object_pool)
Given a list of objects, populate the object field with choices.
reset_objects ( )
Sometimes choices have to be reset.
submit = <UnboundField(SubmitField, (‘Submit’,), {})>
class quizApp.forms.common. MultiCheckboxField ( label=None, validators=None, co-
erce=<type ‘unicode’>, choices=None,
**kwargs)
Bases: wtforms.fields.core.SelectMultipleField
Like a SelectMultipleField, but use checkboxes instead,
option_widget = <wtforms.widgets.core.CheckboxInput object>
widget = <wtforms.widgets.core.ListWidget object>
class quizApp.forms.common. ObjectTypeForm ( formdata=<class flask_wtf.form._Auto>,
obj=None, prefix=’‘, csrf_context=None, se-
cret_key=None, csrf_enabled=None, *args,
**kwargs)
Bases: flask_wtf.form.Form
Select an object type from a drop down menu.
object_type = <UnboundField(SelectField, (‘Type’,), {})>
populate_object_type ( mapping)
Given a mapping of object types to human readable names, populate the object_type field.

1.7. API 11
QuizApp Documentation, Release 0.0.1

submit = <UnboundField(SubmitField, (‘Create’,), {})>


class quizApp.forms.common. OrderFormMixin ( *args, **kwargs)
Bases: object
This mixin allows us to set the order of fields in a ModelForm.
To use, specify a Meta class in your form class and define order as an attribute in the Meta class.
Based on https://gist.github.com/rombr/89d4d9db0229237f40bbd46482764918/
order_fields ( field_order)
Given a field order, order the fields of this form as specified.
class quizApp.forms.common. ScorecardSettingsForm ( *args, **kwargs)
Bases: wtforms_alchemy.ModelForm
Form for rendering scorecard options.
class Meta
Bases: quizApp.forms.common.Meta , wtforms_alchemy.Meta ,
wtforms.meta.DefaultMeta , object
ScorecardSettingsForm. display_correctness = <UnboundField(BooleanField, (), {‘widget’: None, ‘descripti
ScorecardSettingsForm. display_feedback = <UnboundField(BooleanField, (), {‘widget’: None, ‘description’:
ScorecardSettingsForm. display_score = <UnboundField(BooleanField, (), {‘widget’: None, ‘description’: ‘’, ‘
ScorecardSettingsForm. display_scorecard = <UnboundField(BooleanField, (), {‘widget’: None, ‘description
ScorecardSettingsForm. display_time = <UnboundField(BooleanField, (), {‘widget’: None, ‘description’: ‘’, ‘d

quizApp.forms.datasets module

Forms for dataset views.


class quizApp.forms.datasets. DatasetForm ( *args, **kwargs)
Bases: quizApp.forms.common.OrderFormMixin , wtforms_alchemy.ModelForm
Form for creation or update of a dataset.
class Meta
Bases: quizApp.forms.datasets.Meta , wtforms_alchemy.Meta ,
wtforms.meta.DefaultMeta , object
DatasetForm. info = <UnboundField(TextAreaField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: None, ‘label’: u’
DatasetForm. name = <UnboundField(StringField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: None, ‘label’: u’Na
DatasetForm. submit = <UnboundField(SubmitField, (‘Save’,), {})>
class quizApp.forms.datasets. GraphForm ( *args, **kwargs)
Bases: quizApp.forms.common.OrderFormMixin , wtforms_alchemy.ModelForm
Form for updating Graph objects.
class Meta
Bases: quizApp.forms.datasets.Meta , wtforms_alchemy.Meta ,
wtforms.meta.DefaultMeta , object
GraphForm. name = <UnboundField(StringField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: u’New media item’, ‘la
GraphForm. path = <UnboundField(UploadedFileField, (‘Replace graph’,), {‘render_kw’: {‘accept’: ‘image/*’}})>

12 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

GraphForm. submit = <UnboundField(SubmitField, (‘Save’,), {})>


class quizApp.forms.datasets. TextForm ( *args, **kwargs)
Bases: quizApp.forms.common.OrderFormMixin , wtforms_alchemy.ModelForm
Form for updating Text objects.
class Meta
Bases: quizApp.forms.datasets.Meta , wtforms_alchemy.Meta ,
wtforms.meta.DefaultMeta , object
TextForm. name = <UnboundField(StringField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: u’New media item’, ‘lab
TextForm. submit = <UnboundField(SubmitField, (‘Save’,), {})>
TextForm. text = <UnboundField(TextAreaField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: None, ‘label’: u’Text
class quizApp.forms.datasets. UploadedFileField ( label=None, validators=None, filters=(),
description=u’‘, id=None, default=None,
widget=None, render_kw=None,
_form=None, _name=None, _prefix=u’‘,
_translations=None, _meta=None)
Bases: wtforms.fields.simple.FileField
This behaves just like FileField, however when populate_obj is called it will overwrite the file pointed to
by obj.name with the uploaded file.
obj.directory must return the directory where the file is to be saved, if getattr(obj,name) does
not exist.
populate_obj ( obj, name)

quizApp.forms.experiments module

Forms for the Experiments blueprint.


class quizApp.forms.experiments. ActivityAnswerForm ( formdata=<class
flask_wtf.form._Auto>, obj=None,
prefix=’‘, csrf_context=None,
secret_key=None,
csrf_enabled=None, *args,
**kwargs)
Bases: flask_wtf.form.Form
Form for rendering a general Activity. Mostly just for keeping track of render and submit time.
comment = <UnboundField(TextAreaField, (), {})>
populate_assignment ( assignment)
Populate the given assignment based on this form.
populate_from_activity ( activity)
Given an activity, populate defaults/validators/other things of that nature.
This should not stomp on form data. This is called before validation to ensure that user input meets
validation requirements.
populate_from_assignment ( assignment)
Given an assignment, perform any processing necessary to display the activity - e.g. populate a list of
choices, set field validators, etc.

1.7. API 13
QuizApp Documentation, Release 0.0.1

This will call populate_from_result as well as populate_from_activity , so it will stomp


on any form data in this form. This function is useful to call before rendering rather than before validation.
populate_from_result ( result)
Given a result object, populate this form as necessary.
This will only be called if there is a result object associated with an assignment.
render_time = <UnboundField(HiddenField, (), {})>
result
Create a Result object based on this form’s data.
The Result should be appropriate to the type of activity this form is dealing with.
submit = <UnboundField(SubmitField, (‘Submit’,), {})>
submit_time = <UnboundField(HiddenField, (), {})>
class quizApp.forms.experiments. ChoiceAnswerFormMixin
Bases: object
Multiselect and singleselect questions both populate their choices in the same way, so this class serves as a base
class to handle this.
populate_from_activity ( question)
Given a pool of choices, populate the choices field.
class quizApp.forms.experiments. CreateExperimentForm ( *args, **kwargs)
Bases: quizApp.forms.common.OrderFormMixin , wtforms_alchemy.ModelForm
Form for creating or updating an experiment’s properties.
class Meta
Bases: quizApp.forms.experiments.Meta , wtforms_alchemy.Meta ,
wtforms.meta.DefaultMeta , object
CreateExperimentForm. blurb = <UnboundField(TextAreaField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: No
CreateExperimentForm. disable_previous = <UnboundField(BooleanField, (), {‘widget’: None, ‘description’: ‘
CreateExperimentForm. flash = <UnboundField(BooleanField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: Non
CreateExperimentForm. flash_duration = <UnboundField(IntegerField, (), {‘widget’: None, ‘description’: ‘’, ‘d
CreateExperimentForm. name = <UnboundField(StringField, (), {‘widget’: None, ‘description’: ‘’, ‘default’: None,
CreateExperimentForm. scorecard_settings = <UnboundField(ModelFormField, (<class ‘quizApp.forms.com
CreateExperimentForm. show_scores = <UnboundField(BooleanField, (), {‘widget’: None, ‘description’: ‘’, ‘defa
CreateExperimentForm. show_timers = <UnboundField(BooleanField, (), {‘widget’: None, ‘description’: ‘’, ‘defa
CreateExperimentForm. start = <UnboundField(DateTimeField, (), {‘widget’: None, ‘description’: ‘’, ‘format’: ‘%
CreateExperimentForm. stop = <UnboundField(DateTimeField, (), {‘widget’: None, ‘description’: ‘’, ‘format’: ‘%
CreateExperimentForm. submit = <UnboundField(SubmitField, (‘Save’,), {})>
CreateExperimentForm. validate ( )
Validate the start and stop times, then do the rest as usual.
class quizApp.forms.experiments. FreeAnswerForm ( formdata=<class flask_wtf.form._Auto>,
obj=None, prefix=’‘, csrf_context=None,
secret_key=None, csrf_enabled=None,
*args, **kwargs)
Bases: quizApp.forms.experiments.ActivityAnswerForm

14 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

Form for rendering a free answer Question.


populate_from_activity ( activity)
populate_from_result ( result)
result
text = <UnboundField(TextAreaField, (), {})>
class quizApp.forms.experiments. IntegerAnswerForm ( formdata=<class
flask_wtf.form._Auto>, obj=None,
prefix=’‘, csrf_context=None, se-
cret_key=None, csrf_enabled=None,
*args, **kwargs)
Bases: quizApp.forms.experiments.ActivityAnswerForm
Allow users to enter an integer as an answer.
integer = <UnboundField(IntegerField, (), {})>
populate_from_activity ( activity)
populate_from_result ( result)
result
class quizApp.forms.experiments. LikertField ( label=None, validators=None, coerce=<type
‘unicode’>, choices=None, **kwargs)
Bases: wtforms.fields.core.RadioField
Field for displaying a Likert scale. The only difference from a RadioField is how its rendered, so this class is
for rendering purposes.
class quizApp.forms.experiments. MultiSelectAnswerForm ( formdata=<class
flask_wtf.form._Auto>,
obj=None, prefix=’‘,
csrf_context=None,
secret_key=None,
csrf_enabled=None, *args,
**kwargs)
Bases: quizApp.forms.experiments.ChoiceAnswerFormMixin ,
quizApp.forms.experiments.ActivityAnswerForm
Form for rendering a multiple choice question with check boxes.
choices = <UnboundField(MultiCheckboxField, (), {‘validators’: [<wtforms.validators.DataRequired object>], ‘choices
populate_from_result ( result)
result
class quizApp.forms.experiments. MultipleChoiceAnswerForm ( formdata=<class
flask_wtf.form._Auto>,
obj=None, prefix=’‘,
csrf_context=None,
secret_key=None,
csrf_enabled=None,
*args, **kwargs)
Bases: quizApp.forms.experiments.ChoiceAnswerFormMixin ,
quizApp.forms.experiments.ActivityAnswerForm
Form for rendering a multiple choice question with radio buttons.
choices = <UnboundField(RadioField, (), {‘validators’: [<wtforms.validators.DataRequired object>], ‘choices’: []})>

1.7. API 15
QuizApp Documentation, Release 0.0.1

populate_from_result ( result)
result
class quizApp.forms.experiments. ScaleAnswerForm ( formdata=<class
flask_wtf.form._Auto>, obj=None,
prefix=’‘, csrf_context=None, se-
cret_key=None, csrf_enabled=None,
*args, **kwargs)
Bases: quizApp.forms.experiments.MultipleChoiceAnswerForm
Form for rendering a likert scale question.
choices = <UnboundField(LikertField, (), {‘validators’: [<wtforms.validators.DataRequired object>]})>
populate_from_activity ( activity)
class quizApp.forms.experiments. ScorecardAnswerForm ( formdata=<class
flask_wtf.form._Auto>, obj=None,
prefix=’‘, csrf_context=None,
secret_key=None,
csrf_enabled=None, *args,
**kwargs)
Bases: quizApp.forms.experiments.ActivityAnswerForm
Form to render when rendering a scorecard.
populate_from_activity ( activity)
populate_from_result ( result)
result
quizApp.forms.experiments. get_answer_form ( activity, data=None)
Given an activity, return the proper form that should be displayed to the participant.

Module contents

quizApp.views package

Submodules

quizApp.views.activities module

Views for CRUD of activities.


In order to be as general as possible, each of the activity-specific views tests the kind of activity it is loading and then
defers to a more specific function (for example, questions are read by read_question rather than read_activity itself).
class quizApp.views.activities. ActivityCollectionView
Bases: quizApp.views.common.ObjectCollectionView
View for the activity collection.
create_form ( )
create_member ( create_form)
decorators = [<function wrapper>]
get_members ( )

16 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

methods = [’GET’, ‘POST’]


resolve_kwargs
alias of dict
template = ‘activities/read_activities.html’
class quizApp.views.activities. ActivityView
Bases: quizApp.views.common.ObjectView
Views for a particular Activity.
collection_url ( **_)
get ( activity)
methods = [’GET’, ‘PUT’, ‘DELETE’]
object_key = ‘activity’
resolve_kwargs ( activity_id)
update_form ( activity)
class quizApp.views.activities. ChoiceCollectionView
Bases: quizApp.views.common.ObjectCollectionView
Handle a collection of choices.
create_form ( )
create_member ( create_form, question)
decorators = [<function wrapper>]
get_members = None
methods = [’POST’]
resolve_kwargs ( question_id)
template = None
class quizApp.views.activities. ChoiceView
Bases: quizApp.views.common.ObjectView
View for handling a singular Choice object.
collection_url ( **_)
methods = [’PUT’, ‘DELETE’]
object_key = ‘choice’
resolve_kwargs ( question_id, choice_id)
update_form ( **_)
quizApp.views.activities. create_question_dataset ( *args, **kwargs)
Associate this question with a dataset.
The request should contain the ID of the dataset to be associated.
quizApp.views.activities. delete_question_dataset ( *args, **kwargs)
Disassociate this question from a dataset.

1.7. API 17
QuizApp Documentation, Release 0.0.1

quizApp.views.activities. render_activity ( activity, *args, **kwargs)


Given an activity, render the template that displays this activity and return it.
This function is the central place where activities are rendered.
Extra args/kwargs will be passed on to the specific rendering function for the type of activity.
quizApp.views.activities. render_question ( question, disabled=False, assignment=None,
render_explanation=True)
Display a given question as it would appear to a participant.
Parameters
• question (Question) – The question to render
• disabled (bool) – if True, disable the form controls
• assignment (Assignment) – if given, use the assignment’s result and comment to
populate fields prior to rendering
• render_explanation (bool) – If True, render the explanation for this question
quizApp.views.activities. render_scorecard ( scorecard, disabled=False, assign-
ment_set=None, assignment=None,
this_index=0)
Render a scorecard. This is the central point of rendering for scorecards.
quizApp.views.activities. settings_activity ( *args, **kwargs)
Display settings for a particular activity.
quizApp.views.activities. settings_mc_question ( question, template_kwargs)
Display settings for the given question.
quizApp.views.activities. settings_question ( question)
Return a settings page for a question.
quizApp.views.activities. settings_scorecard ( scorecard)
Show settings for a scorecard.

quizApp.views.core module

This blueprint takes care of rendering static pages outside of the other blueprints.
quizApp.views.core. auto_register ( )
Convenience endpoint for using QuizApp embedded in another site.
When a logged in user accesses this endpoint, they will be redirected to the specified experiment.
When a user that is not logged in access this endpoint, an account will be created, they will be logged in, then
redirected to the specified experiment.
quizApp.views.core. getting_started ( *args, **kwargs)
Show some instructions for getting started with quizApp.
quizApp.views.core. home ( )
Display the homepage.
quizApp.views.core. post_login ( *args, **kwargs)
Once a user has logged in, redirect them based on their role.
quizApp.views.core. query_exists ( query)
Given a query, return True if it would return any rows, and False otherwise.

18 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

quizApp.views.datasets module

Views for CRUD datasets.


class quizApp.views.datasets. DatasetCollectionView
Bases: quizApp.views.common.ObjectCollectionView
View for managing a collection of Datasets.
create_form ( )
create_member ( create_form)
decorators = [<function wrapper>]
get_members ( )
methods = [’GET’, ‘POST’]
resolve_kwargs
alias of dict
template = ‘datasets/read_datasets.html’
class quizApp.views.datasets. DatasetView
Bases: quizApp.views.common.ObjectView
View for handling a particular dataset.
collection_url ( **kwargs)
methods = [’PUT’, ‘DELETE’]
object_key = ‘dataset’
resolve_kwargs ( dataset_id)
update_form ( **_)
class quizApp.views.datasets. MediaItemCollectionView
Bases: quizApp.views.common.ObjectCollectionView
Manage a collection of MediaItems.
create_form ( )
create_member ( create_form, dataset)
decorators = [<function wrapper>]
get_members = None
methods = [’POST’]
resolve_kwargs ( dataset_id)
template = None
class quizApp.views.datasets. MediaItemView
Bases: quizApp.views.common.ObjectView
View for handling a particular media item
collection_url ( dataset, **_)
methods = [’DELETE’, ‘PUT’, ‘GET’]
object_key = ‘media_item’

1.7. API 19
QuizApp Documentation, Release 0.0.1

resolve_kwargs ( dataset_id, media_item_id)


template = ‘datasets/read_media_item.html’
update_form ( media_item, **_)
quizApp.views.datasets. settings_dataset ( *args, **kwargs)
View the configuration of a particular dataset.
quizApp.views.datasets. settings_media_item ( *args, **kwargs)
View the configuration of some media item.
Ultimately this view dispatches to another view for the specific type of media item.

quizApp.views.experiments module

Views that handle CRUD for experiments and rendering questions for participants.
class quizApp.views.experiments. ExperimentCollectionView
Bases: quizApp.views.common.ObjectCollectionView
View for a collection of Experiments.
create_form ( )
create_member ( create_form)
decorators = [<function wrapper>]
get_members ( )
methods = [’GET’, ‘POST’]
resolve_kwargs ( **kwargs)
template = ‘experiments/read_experiments.html’
class quizApp.views.experiments. ExperimentView
Bases: quizApp.views.common.ObjectView
View for a particular experiment.
collection_url ( **_)
decorators = [<function login_required>]
delete ( **kwargs)
get ( experiment)
View the landing page of an experiment, along with the ability to start.
methods = [’GET’, ‘PUT’, ‘DELETE’]
object_key = ‘experiment’
put ( **kwargs)
resolve_kwargs ( experiment_id)
template = ‘experiments/read_experiment.html’
update_form ( **_)
quizApp.views.experiments. confirm_done_assignment_set ( *args, **kwargs)
Show the user a page before finalizing their quiz answers.

20 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

quizApp.views.experiments. done_assignment_set ( *args, **kwargs)


Show the user a screen indicating that they are finished.
quizApp.views.experiments. export_results_experiment ( *args, **kwargs)
Get a spreadsheet breaking down how participants did in this experiment.
quizApp.views.experiments. finalize_assignment_set ( *args, **kwargs)
Finalize the user’s answers for this experiment. They will no longer be able to edit them, but may view them.
quizApp.views.experiments. get_activity_column_index ( activity, activ-
ity_column_mapping, ac-
tivity_counter, headers)
Find the column index for this occurrence of the given activity. This will update headers, counter, and mapping
if necessary.
quizApp.views.experiments. get_next_assignment_url ( assignment_set, current_index)
Given an experiment, a assignment_set, and the current index, find the url of the next assignment in the sequence.
quizApp.views.experiments. get_question_stats ( assignment, question_stats)
Given an assignment of a question and a stats array, return statistics about this question in the array.
quizApp.views.experiments. get_results_workbook ( experiment)
Analyze the assignment sets in the experiment and return an excel workbook.
quizApp.views.experiments. populate_row_segment ( sheet, row_index, initial_col, row)
Populate the segment of row # row_index in sheet that starts at initial_col and contains the items
in row .
quizApp.views.experiments. read_assignment ( *args, **kwargs)
Given an assignment ID, retrieve it from the database and display it to the user.
quizApp.views.experiments. read_mc_question ( _, assignment)
Read a multiple choice question, making sure to save the choice order.
quizApp.views.experiments. read_question ( experiment, assignment)
Common code for reading questions.
quizApp.views.experiments. read_scorecard ( experiment, assignment)
Read an assignment that is a scorecard.
quizApp.views.experiments. results_experiment ( *args, **kwargs)
Render some results.
quizApp.views.experiments. settings_experiment ( *args, **kwargs)
Give information on an experiment and its activities.
quizApp.views.experiments. update_assignment ( experiment_id, assignment_set_id, assign-
ment_id)
Record a user’s answer to this assignment
quizApp.views.experiments. validate_assignment ( experiment_id, assignment_set_id, as-
signment_id)
Do everything validate_assignment_set does, but also check that the assignment exists and that it’s
part of the given assignment set.
quizApp.views.experiments. validate_assignment_set ( experiment_id, assign-
ment_set_id)
Check if this experiment and assignment set exist, if this assignment set is part of this experiment, and if the
current user owns the assignment set.

1.7. API 21
QuizApp Documentation, Release 0.0.1

quizApp.views.helpers module

Various functions that are useful in multiple views.


quizApp.views.helpers. get_first_assignment ( experiment)
Get the first assignment for this user in this experiment.
Note that this is not necessarily the same as the first assignment in an assignment set. This function will first
call get_or_create_assignment_set in order to retrieve an assignment set. If there is no assignment
set or it is empty, this function returns none.
If the set is complete, this function returns the first assignment in the set.
quizApp.views.helpers. get_or_create_assignment_set ( experiment)
Attempt to retrieve the AssignmentSet record for the current user in the given Experiment.
If no such record exists, grab a random AssignmentSet record in the experiment AssignmentSet pool, copy it to
be the current user’s AssignmentSet record, and return that.
quizApp.views.helpers. validate_form_or_error ( form)
Validate this form or return errors in JSON format.
If the form is valid, None is returned.
quizApp.views.helpers. validate_model_id ( model, model_id, code=404)
Given a model and id, retrieve and return that model from the database or abort with the given code.

Module contents

Submodules

quizApp.config module

Configurations for the project. These are loaded in app.py.


class quizApp.config. Config
Bases: future.types.newobject.newobject
Global default config.
DEBUG = False
EXPERIMENTS_PLACEHOLDER_GRAPH = u’missing.png’
GRAPH_DIRECTORY = u’graphs’
SECURITY_CHANGEABLE = True
SECURITY_POST_LOGIN_VIEW = u’core.post_login’
SECURITY_REGISTERABLE = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
TESTING = False
WTF_CSRF_ENABLED = True
WTF_CSRF_METHODS = [u’POST’, u’PUT’, u’PATCH’, u’DELETE’]
class quizApp.config. Development
Bases: quizApp.config.Config
Configuration for development environments.

22 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

DEBUG = True
SECRET_KEY = u’—‘
SECURITY_PASSWORD_HASH = u’bcrypt’
SECURITY_PASSWORD_SALT = u’—‘
SECURITY_SEND_REGISTER_EMAIL = False
SQLALCHEMY_DATABASE_URI = u’mysql://quizapp:foobar@localhost/quizapp’
SQLALCHEMY_ECHO = True
class quizApp.config. Production
Bases: quizApp.config.Config
Configuration for production environments.
DEBUG = False
SECURITY_PASSWORD_HASH = u’bcrypt’
TESTING = False
class quizApp.config. Testing
Bases: quizApp.config.Config
Config used for testing.
DEBUG = True
SECRET_KEY = u’—‘
SECURITY_PASSWORD_SALT = u’—‘
SQLALCHEMY_DATABASE_URI = u’mysql://quizapp:foobar@localhost/quizapp_test’
TESTING = True
WTF_CSRF_ENABLED = False

quizApp.models module

Models for the quizApp.


class quizApp.models. Activity ( *args, **kwargs)
Bases: quizApp.models.Base
An Activity is essentially a screen that a User sees while doing an Experiment. It may be an instructional screen
or show a Question, or do something else.
This class allows us to use Inheritance to easily have a variety of Activities in an Experiment, since we have
a M2M between Experiment and Activity, while a specific Activity may actually be a Question thanks to
SQLAlchemy’s support for polymorphism.
type
string – Discriminator column that determines what kind of Activity this is.
needs_comment
bool – True if the participant should be asked why they picked what they did after they answer the question.
category
string – A description of this assignment’s category, for the users’ convenience.

1.7. API 23
QuizApp Documentation, Release 0.0.1

assignments
list of Assignment – What Assignments include this Activity
scorecard_settings
ScorecardSettings – Settings for scorecards after this Activity is done
include_in_scorecards
bool – Whether or not to show this Activity in scorecards
class Meta
Bases: future.types.newobject.newobject
Define what kind of Result we are looking for.
result_class
alias of Result
Activity. get_score ( result)
Get the participant’s score for this Activity.
Given a Result object, an Activity subclass should be able to “score” the result in some way, and return an
integer quantifying the Participant’s performance.
Activity. is_correct ( result)
Given a result, return True if the answer was correct or False otherwise.
If this activity does not have a concept of correct/incorrect, return None.
class quizApp.models. Assignment ( **kwargs)
Bases: quizApp.models.Base
For a given Activity, determine which MediaItems, if any, a particular Participant sees, as well as recording the
Participant’s answer, or if they skipped this assignment.
comment
string – An optional comment entered by the student.
choice_order
string – A JSON object in string form that represents the order of choices that this participant was presented
with when answering this question, e.g. {[1, 50, 9, 3]} where the numbers are the IDs of those choices.
time_to_submit
timedelta – Time from the question being rendered to the question being submitted.
media_items
list of MediaItem – What MediaItems should be shown
activity
Activity – Which Activity this Participant should see
assignment_set
AssignmentSet – Which AssignmentSet this Assignment belongs to
correct
Check if this assignment was answered correctly.
score
Get the score for this assignment.
This method simply passes result to the activity‘s get_score method and returns the result.
Note that if there is no activity this will raise an AttributeError.

24 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

validate_activity ( _, activity)
Make sure that the number of media items on the activity is the same as the number of media items this
assignment has.
validate_result ( _, result)
Make sure that this assignment has the correct type of result.
class quizApp.models. AssignmentSet ( **kwargs)
Bases: quizApp.models.Base
An AssignmentSet represents a sequence of Assignments within an Experiment. All Assignments in an Assign-
mentSet are done in order by the same Participant.
progress
int – Which Assignment the user is currently working on.
complete
bool – True if the user has finalized their responses, False otherwise
participant
Participant – Which Participant this refers to
experiment
Experiment – Which Experiment this refers to
assignments
list of Assignment – The assignments that this Participant should do in this Experiment
class Meta
Bases: future.types.newobject.newobject
Specify field order.
AssignmentSet. score
Return the cumulative score of all assignments in this AssignmentSet,
Currently this iterates through all assignments. Profiling will be required to see if this is too slow.
class quizApp.models. Base ( **kwargs)
Bases: flask_sqlalchemy.Model
Base class for all models.
All models have an identical id field.
id
int – A unique identifier.
import_dict ( **kwargs)
Populate this object using data imported from a spreadsheet or similar. This means that not all fields
will be passed into this function, however there are enough fields to populate all necessary fields. Due to
validators, some fields need to be populated before others. Subclasses of Base to which this applies are
expected to override this method and implement their import correctly.
save ( commit=True)
Save this model to the database.
If commit is True, then the session will be comitted as well.
class quizApp.models. Choice ( **kwargs)
Bases: quizApp.models.Base
A Choice is a string that is a possible answer for a Question.

1.7. API 25
QuizApp Documentation, Release 0.0.1

choice
string – The choice as a string.
label
string – The label for this choice (1,2,3,a,b,c etc)
correct
bool – “True” if this choice is correct, “False” otherwise
question
Question – Which Question owns this Choice
points
int – How many points the Participant gets for picking this choice
class quizApp.models. Dataset ( **kwargs)
Bases: quizApp.models.Base
A Dataset represents some data that MediaItems are based on.
name
string – The name of this dataset.
info
string – Some information about this dataset
media_items
list of MediaItem – Which MediaItems this Dataset owns
questions
list of Questions – Which Questions reference this Dataset
class quizApp.models. Experiment ( *args, **kwargs)
Bases: quizApp.models.Base
An Experiment contains a list of Activities.
name
str – The name of this experiment
created
datetime – When this experiment was created
start
datetime – When this experiment becomes accessible for answers
stop
datetime – When this experiment stops accepting answers
assignment_sets
list of ParticiapntExperiment – List of AssignmentSets that are associated with this Experiment
disable_previous
bool – If True, don’t allow Participants to view and modify previous activities.
show_timers
bool – If True, display a timer on each activity expressing how long the user has been viewing this activity.
show_scores
bool – If True, show the participant a cumulative score on every activity.
scorecard_settings
ScorecardSettings – A ScorecardSettings instance that determines how scorecards will be rendered in this
Experiment.

26 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

If the display_scorecard field is False , then no scorecards will be displayed.


If the display_scorecard field is True , then scorecards will be displayed after Activities whose
own ScorecardSettings objects specify that scorecards should be shown. They will be rendered
according to the ScorecardSettings of that Activity.
In addition, a scorecard will be rendered after the experiment according to the Experiment’s
ScorecardSettings .
flash
bool – If True, flash the MediaItem for flash_duration milliseconds
flash_duration
int – How long to display the MediaItem in milliseconds
running
Returns True if this experiment is currently running, otherwise False.
class quizApp.models. FreeAnswerQuestion ( *args, **kwargs)
Bases: quizApp.models.Question
A FreeAnswerQuestion allows a Participant to enter an arbitrary answer.
class Meta
Bases: future.types.newobject.newobject
Define what kind of Result we are looking for.
result_class
alias of FreeAnswerQuestionResult
FreeAnswerQuestion. get_score ( result)
If this Question was answered, return 1.
class quizApp.models. FreeAnswerQuestionResult ( **kwargs)
Bases: quizApp.models.Result
What a Participant entered into a text box.
class quizApp.models. Graph ( **kwargs)
Bases: quizApp.models.MediaItem
A Graph is an image file located on the server that may be shown in conjunction with an Assignment.
path
str – Absolute path to this Graph on disk
directory
Return the directory this graph is located in.
If path is not empty, return the lowest directory specified by path . Otherwise, return the designated
graph directory.
filename ( )
Return the filename of this graph.
class quizApp.models. IntegerQuestion ( *args, **kwargs)
Bases: quizApp.models.Question
Ask participants to enter an integer, optionally bounded above/below.
All bounds are inclusive.
answer
int – The correct answer to this question

1.7. API 27
QuizApp Documentation, Release 0.0.1

bounded_below
bool – If True, enforce a lower bound
lower_bound
int – The minimum possible answer.
bounded_above
bool – If True, enforce an upper bound
upper_bound
int – The maximum possible answer.
class Meta
Bases: future.types.newobject.newobject
Specify the result class.
result_class
alias of IntegerQuestionResult
IntegerQuestion. get_score ( result)
If the choice is the answer, one point.
IntegerQuestion. validate_answer ( _, answer)
Ensure answer is within the bounds.
class quizApp.models. IntegerQuestionResult ( **kwargs)
Bases: quizApp.models.Result
The integer entered as an answer to an Integer Question.
integer
int – The answer entered to this question.
class quizApp.models. MediaItem ( **kwargs)
Bases: quizApp.models.Base
A MediaItem is any aid to be shown when displaying an assignment. It can be text, image, videos, sound,
whatever. Specific types should subclass this class and define their own fields needed for rendering.
name
str – Name for this Media Item
assignments
list of Assignment – Which Assignments display this MediaItem
dataset
Dataset – Which Dataset owns this MediaItem
class quizApp.models. MultiSelectQuestion ( *args, **kwargs)
Bases: quizApp.models.MultipleChoiceQuestion
A MultiSelectQuestion allows any number of Choices to be selected.
class Meta
Bases: future.types.newobject.newobject
Define what kind of Result we are looking for.
result_class
alias of MultiSelectQuestionResult
class quizApp.models. MultiSelectQuestionResult ( **kwargs)
Bases: quizApp.models.Result

28 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

The Choices that a Participant picked in a MultiSelectQuestion.


validate_choice ( value, *_)
Make sure this Choice is a valid option for this Question.
class quizApp.models. MultipleChoiceQuestion ( *args, **kwargs)
Bases: quizApp.models.Question
A MultipleChoiceQuestion has one or more choices that are correct.
class Meta
Bases: future.types.newobject.newobject
Define what kind of Result we are looking for.
result_class
alias of MultipleChoiceQuestionResult
MultipleChoiceQuestion. get_score ( result)
If this Question was answered, return the point value of this choice. Otherwise return 0.
class quizApp.models. MultipleChoiceQuestionResult ( **kwargs)
Bases: quizApp.models.Result
The Choice that a Participant picked in a MultipleChoiceQuestion.
validate_choice ( value, *_)
Make sure this Choice is a valid option for this Question.
class quizApp.models. Participant ( **kwargs)
Bases: quizApp.models.User
A User that takes Experiments.
opt_in
bool – Has this user opted in to data collection?
foreign_id
str – If the user is coming from an external source (e.g. canvas, mechanical turk) it may be necessary to
record their user ID on the other service (e.g. preventing multiple submission). This field holds the foreign
ID of this user.
assignment_sets
list of AssignmentSets – List of AssignmentSets that this participant has
class quizApp.models. Question ( *args, **kwargs)
Bases: quizApp.models.Activity
A Question is related to one or more MediaItems and has one or more Choices, and is a part of one or more
Experiments.
question
string – This question as a string
explantion
string – The explanation for why the correct answer is correct.
num_media_items
int – How many MediaItems should be shown when displaying this question
choices
list of Choice – What Choices this Question has

1.7. API 29
QuizApp Documentation, Release 0.0.1

datasets
list of Dataset – Which Datasets this Question can pull MediaItems from. If this is empty, this Question
can use MediaItems from any Dataset.
class quizApp.models. Result ( **kwargs)
Bases: quizApp.models.Base
A Result is the outcome of a Participant completing an Activity.
Different Activities have different data that they generate, so this model does not actually contain any infor-
mation on the outcome of an Activity. That is something that child classes of this class must define in their
schemas.
On the Assignment level, the type of Activity will determine the type of Result.
assignment
Assignment – The Assignment that owns this Result.
class quizApp.models. Role ( **kwargs)
Bases: quizApp.models.Base , flask_security.core.RoleMixin
A Role describes what a User can and can’t do.
class quizApp.models. ScaleQuestion ( *args, **kwargs)
Bases: quizApp.models.SingleSelectQuestion
A ScaleQuestion is like a SingleSelectQuestion, but it displays its options horizontally. This is useful for
“strongly agree/disagree” sort of questions.
class quizApp.models. Scorecard ( *args, **kwargs)
Bases: quizApp.models.Activity
A Scorecard shows some kind of information about all previous activities.
title
str – The title of this scorecard
prompt
str – The prompt to show when asking for a comment
class Meta
Bases: future.types.newobject.newobject
Define what kind of Result we are looking for.
result_class
alias of ScorecardResult
class quizApp.models. ScorecardResult ( **kwargs)
Bases: quizApp.models.Result
Result to a Scorecard activity. This class just exists to implement __str__ since there is no action to be taken in
a scorecard.
class quizApp.models. ScorecardSettings ( **kwargs)
Bases: quizApp.models.Base
A ScorecardSettings object represents the configuration of some kind of scorecard.
Scorecards may be shown after each Activity or after each Experiment (or both). Since the configuration of the
two scorecards is identical, it has been refactored to this class.
display_scorecard
bool – Whether or not to display this scorecard at all.

30 Chapter 1. Contents
QuizApp Documentation, Release 0.0.1

display_score
bool – Whether or not to display a tally of points.
display_time
bool – Whether or not to display a count of how much time elapsed.
display_correctness
bool – Whether or not to display correctness grades.
display_feedback
bool – Whether or not to display feedback on responses.
class quizApp.models. SingleSelectQuestion ( *args, **kwargs)
Bases: quizApp.models.MultipleChoiceQuestion
A SingleSelectQuestion allows only one Choice to be selected.
class quizApp.models. Text ( **kwargs)
Bases: quizApp.models.MediaItem
Text is simply a piece of text that can be used as a MediaItem.
text
str – The text of this media item.
class quizApp.models. User ( **kwargs)
Bases: quizApp.models.Base , flask_security.core.UserMixin
A User is used for authentication.
name
string – The username of this user.
password
string – This user’s password.
authenticated
bool – True if this user is authenticated.
type
string – The type of this user, e.g. experimenter, participant
has_any_role ( roles)
Given a list of Roles, return True if the user has at least one of them.

Module contents

Handle creating the app and configuring it.


quizApp. apply_default_user_role ( _, user, **__)
When a new user is registered, make them a participant.
quizApp. create_app ( config_name, overrides=None)
Create and return an instance of this application.

1.7. API 31
QuizApp Documentation, Release 0.0.1

32 Chapter 1. Contents
CHAPTER 2

Indices and tables

• genindex
• modindex
• search

33
QuizApp Documentation, Release 0.0.1

34 Chapter 2. Indices and tables


Python Module Index

q
quizApp, 31
quizApp.config, 22
quizApp.forms, 16
quizApp.forms.activities, 9
quizApp.forms.common, 11
quizApp.forms.datasets, 12
quizApp.forms.experiments, 13
quizApp.models, 23
quizApp.views, 22
quizApp.views.activities, 16
quizApp.views.core, 18
quizApp.views.datasets, 19
quizApp.views.experiments, 20
quizApp.views.helpers, 22

35
QuizApp Documentation, Release 0.0.1

36 Python Module Index


Index

A C
Activity (class in quizApp.models), 23 category (quizApp.forms.activities.ActivityForm at-
activity (quizApp.models.Assignment attribute), 24 tribute), 9
Activity.Meta (class in quizApp.models), 24 category (quizApp.models.Activity attribute), 23
ActivityAnswerForm (class inChoice (class in quizApp.models), 25
quizApp.forms.experiments), 13 choice (quizApp.forms.activities.ChoiceForm attribute),
ActivityCollectionView (class in 9
quizApp.views.activities), 16 choice (quizApp.models.Choice attribute), 25
ActivityForm (class in quizApp.forms.activities), 9 choice_order (quizApp.models.Assignment attribute), 24
ActivityForm.Meta (class in quizApp.forms.activities), 9 ChoiceAnswerFormMixin (class in
ActivityView (class in quizApp.views.activities), 17 quizApp.forms.experiments), 14
answer (quizApp.forms.activities.IntegerQuestionForm ChoiceCollectionView (class in
attribute), 10 quizApp.views.activities), 17
answer (quizApp.models.IntegerQuestion attribute), 27 ChoiceForm (class in quizApp.forms.activities), 9
apply_default_user_role() (in module quizApp), 31 ChoiceForm.Meta (class in quizApp.forms.activities), 9
Assignment (class in quizApp.models), 24 choices (quizApp.forms.experiments.MultipleChoiceAnswerForm
assignment (quizApp.models.Result attribute), 30 attribute), 15
assignment_set (quizApp.models.Assignment attribute), choices (quizApp.forms.experiments.MultiSelectAnswerForm
24 attribute), 15
assignment_sets (quizApp.models.Experiment attribute), choices (quizApp.forms.experiments.ScaleAnswerForm
26 attribute), 16
assignment_sets (quizApp.models.Participant attribute), choices (quizApp.models.Question attribute), 29
29 ChoiceView (class in quizApp.views.activities), 17
assignments (quizApp.models.Activity attribute), 23 collection_url() (quizApp.views.activities.ActivityView
assignments (quizApp.models.AssignmentSet attribute), method), 17
25 collection_url() (quizApp.views.activities.ChoiceView
assignments (quizApp.models.MediaItem attribute), 28 method), 17
AssignmentSet (class in quizApp.models), 25 collection_url() (quizApp.views.datasets.DatasetView
AssignmentSet.Meta (class in quizApp.models), 25 method), 19
authenticated (quizApp.models.User attribute), 31 collection_url() (quizApp.views.datasets.MediaItemView
auto_register() (in module quizApp.views.core), 18 method), 19
collection_url() (quizApp.views.experiments.ExperimentView
B method), 20
Base (class in quizApp.models), 25 comment (quizApp.forms.experiments.ActivityAnswerForm
blurb (quizApp.forms.experiments.CreateExperimentForm attribute), 13
attribute), 14 comment (quizApp.models.Assignment attribute), 24
bounded_above (quizApp.models.IntegerQuestion complete (quizApp.models.AssignmentSet attribute), 25
attribute), 28 Config (class in quizApp.config), 22
bounded_below (quizApp.models.IntegerQuestion confirm_done_assignment_set() (in module
attribute), 27 quizApp.views.experiments), 20

37
QuizApp Documentation, Release 0.0.1

correct (quizApp.forms.activities.ChoiceForm attribute), decorators (quizApp.views.datasets.MediaItemCollectionView


9 attribute), 19
correct (quizApp.models.Assignment attribute), 24 decorators (quizApp.views.experiments.ExperimentCollectionView
correct (quizApp.models.Choice attribute), 26 attribute), 20
create_app() (in module quizApp), 31 decorators (quizApp.views.experiments.ExperimentView
create_form() (quizApp.views.activities.ActivityCollectionView attribute), 20
method), 16 delete() (quizApp.views.experiments.ExperimentView
create_form() (quizApp.views.activities.ChoiceCollectionView method), 20
method), 17 delete_question_dataset() (in module
create_form() (quizApp.views.datasets.DatasetCollectionView quizApp.views.activities), 17
method), 19 DeleteObjectForm (class in quizApp.forms.common), 11
create_form() (quizApp.views.datasets.MediaItemCollectionView
Development (class in quizApp.config), 22
method), 19 directory (quizApp.models.Graph attribute), 27
create_form() (quizApp.views.experiments.ExperimentCollectionView
disable_previous (quizApp.forms.experiments.CreateExperimentForm
method), 20 attribute), 14
create_member() (quizApp.views.activities.ActivityCollectionView
disable_previous (quizApp.models.Experiment attribute),
method), 16 26
create_member() (quizApp.views.activities.ChoiceCollectionView
display_correctness (quizApp.forms.common.ScorecardSettingsForm
method), 17 attribute), 12
create_member() (quizApp.views.datasets.DatasetCollectionView
display_correctness (quizApp.models.ScorecardSettings
method), 19 attribute), 31
create_member() (quizApp.views.datasets.MediaItemCollectionView
display_feedback (quizApp.forms.common.ScorecardSettingsForm
method), 19 attribute), 12
create_member() (quizApp.views.experiments.ExperimentCollectionView
display_feedback (quizApp.models.ScorecardSettings at-
method), 20 tribute), 31
create_question_dataset() (in module display_score (quizApp.forms.common.ScorecardSettingsForm
quizApp.views.activities), 17 attribute), 12
created (quizApp.models.Experiment attribute), 26 display_score (quizApp.models.ScorecardSettings
CreateExperimentForm (class in attribute), 30
quizApp.forms.experiments), 14 display_scorecard (quizApp.forms.common.ScorecardSettingsForm
CreateExperimentForm.Meta (class in attribute), 12
quizApp.forms.experiments), 14 display_scorecard (quizApp.models.ScorecardSettings
attribute), 30
D display_time (quizApp.forms.common.ScorecardSettingsForm
Dataset (class in quizApp.models), 26 attribute), 12
dataset (quizApp.models.MediaItem attribute), 28 display_time (quizApp.models.ScorecardSettings at-
DatasetCollectionView (class in quizApp.views.datasets), tribute), 31
19 done_assignment_set() (in module
DatasetForm (class in quizApp.forms.datasets), 12 quizApp.views.experiments), 20
DatasetForm.Meta (class in quizApp.forms.datasets), 12
DatasetListForm (class in quizApp.forms.activities), 10 E
datasets (quizApp.models.Question attribute), 29 Experiment (class in quizApp.models), 26
DatasetView (class in quizApp.views.datasets), 19 experiment (quizApp.models.AssignmentSet attribute),
DEBUG (quizApp.config.Config attribute), 22 25
DEBUG (quizApp.config.Development attribute), 22 ExperimentCollectionView (class in
DEBUG (quizApp.config.Production attribute), 23 quizApp.views.experiments), 20
DEBUG (quizApp.config.Testing attribute), 23 EXPERIMENTS_PLACEHOLDER_GRAPH
decorators (quizApp.views.activities.ActivityCollectionView (quizApp.config.Config attribute), 22
attribute), 16 ExperimentView (class in quizApp.views.experiments),
decorators (quizApp.views.activities.ChoiceCollectionView 20
attribute), 17 explanation (quizApp.forms.activities.IntegerQuestionForm
decorators (quizApp.views.datasets.DatasetCollectionView attribute), 10
attribute), 19 explanation (quizApp.forms.activities.QuestionForm at-
tribute), 10

38 Index
QuizApp Documentation, Release 0.0.1

explantion (quizApp.models.Question attribute), 29 get_question_stats() (in module


export_results_experiment() (in module quizApp.views.experiments), 21
quizApp.views.experiments), 21 get_results_workbook() (in module
quizApp.views.experiments), 21
F get_score() (quizApp.models.Activity method), 24
filename() (quizApp.models.Graph method), 27 get_score() (quizApp.models.FreeAnswerQuestion
finalize_assignment_set() (in module method), 27
quizApp.views.experiments), 21 get_score() (quizApp.models.IntegerQuestion method),
flash (quizApp.forms.experiments.CreateExperimentForm 28
attribute), 14 get_score() (quizApp.models.MultipleChoiceQuestion
flash (quizApp.models.Experiment attribute), 27 method), 29
getting_started() (in module quizApp.views.core), 18
flash_duration (quizApp.forms.experiments.CreateExperimentForm
attribute), 14 Graph (class in quizApp.models), 27
flash_duration (quizApp.models.Experiment attribute), GRAPH_DIRECTORY (quizApp.config.Config at-
27 tribute), 22
foreign_id (quizApp.models.Participant attribute), 29 GraphForm (class in quizApp.forms.datasets), 12
FreeAnswerForm (class in quizApp.forms.experiments), GraphForm.Meta (class in quizApp.forms.datasets), 12
14
FreeAnswerQuestion (class in quizApp.models), 27 H
FreeAnswerQuestion.Meta (class in quizApp.models), 27 has_any_role() (quizApp.models.User method), 31
FreeAnswerQuestionResult (class in quizApp.models), home() (in module quizApp.views.core), 18
27
I
G id (quizApp.models.Base attribute), 25
get() (quizApp.views.activities.ActivityView method), 17 import_dict() (quizApp.models.Base method), 25
get() (quizApp.views.experiments.ExperimentView include_in_scorecards (quizApp.forms.activities.ActivityForm
method), 20 attribute), 9
get_activity_column_index() (in module include_in_scorecards (quizApp.models.Activity at-
quizApp.views.experiments), 21 tribute), 24
get_activity_form() (in module quizApp.forms.activities), info (quizApp.forms.datasets.DatasetForm attribute), 12
10 info (quizApp.models.Dataset attribute), 26
get_answer_form() (in module integer (quizApp.forms.experiments.IntegerAnswerForm
quizApp.forms.experiments), 16 attribute), 15
get_choice_tuple() (quizApp.forms.activities.DatasetListForm
integer (quizApp.models.IntegerQuestionResult at-
method), 10 tribute), 28
get_choice_tuple() (quizApp.forms.common.ListObjectFormIntegerAnswerForm (class in
method), 11 quizApp.forms.experiments), 15
get_first_assignment() (in module IntegerQuestion (class in quizApp.models), 27
quizApp.views.helpers), 22 IntegerQuestion.Meta (class in quizApp.models), 28
get_members (quizApp.views.activities.ChoiceCollectionView IntegerQuestionForm (class in quizApp.forms.activities),
attribute), 17 10
get_members (quizApp.views.datasets.MediaItemCollectionViewIntegerQuestionForm.Meta (class in
attribute), 19 quizApp.forms.activities), 10
get_members() (quizApp.views.activities.ActivityCollectionView
IntegerQuestionResult (class in quizApp.models), 28
method), 16 is_correct() (quizApp.models.Activity method), 24
get_members() (quizApp.views.datasets.DatasetCollectionView
method), 19 L
get_members() (quizApp.views.experiments.ExperimentCollectionView
label (quizApp.forms.activities.ChoiceForm attribute), 10
method), 20 label (quizApp.models.Choice attribute), 26
get_next_assignment_url() (in module LikertField (class in quizApp.forms.experiments), 15
quizApp.views.experiments), 21 ListObjectForm (class in quizApp.forms.common), 11
get_or_create_assignment_set() (in module lower_bound (quizApp.forms.activities.IntegerQuestionForm
quizApp.views.helpers), 22 attribute), 10

Index 39
QuizApp Documentation, Release 0.0.1

lower_bound (quizApp.models.IntegerQuestion at- name (quizApp.models.User attribute), 31


tribute), 28 needs_comment (quizApp.forms.activities.ActivityForm
attribute), 9
M needs_comment (quizApp.models.Activity attribute), 23
media_items (quizApp.models.Assignment attribute), 24 num_media_items (quizApp.forms.activities.IntegerQuestionForm
media_items (quizApp.models.Dataset attribute), 26 attribute), 10
MediaItem (class in quizApp.models), 28 num_media_items (quizApp.forms.activities.QuestionForm
MediaItemCollectionView (class in attribute), 10
quizApp.views.datasets), 19 num_media_items (quizApp.models.Question attribute),
MediaItemView (class in quizApp.views.datasets), 19 29
methods (quizApp.views.activities.ActivityCollectionView
attribute), 16 O
methods (quizApp.views.activities.ActivityView at- object_key (quizApp.views.activities.ActivityView
tribute), 17 attribute), 17
methods (quizApp.views.activities.ChoiceCollectionView object_key (quizApp.views.activities.ChoiceView at-
attribute), 17 tribute), 17
methods (quizApp.views.activities.ChoiceView at- object_key (quizApp.views.datasets.DatasetView at-
tribute), 17 tribute), 19
methods (quizApp.views.datasets.DatasetCollectionView object_key (quizApp.views.datasets.MediaItemView at-
attribute), 19 tribute), 19
methods (quizApp.views.datasets.DatasetView attribute), object_key (quizApp.views.experiments.ExperimentView
19 attribute), 20
methods (quizApp.views.datasets.MediaItemCollectionViewobject_type (quizApp.forms.common.ObjectTypeForm
attribute), 19 attribute), 11
methods (quizApp.views.datasets.MediaItemView objects (quizApp.forms.common.ListObjectForm at-
attribute), 19 tribute), 11
objects_mapping (quizApp.forms.common.ListObjectForm
methods (quizApp.views.experiments.ExperimentCollectionView
attribute), 20 attribute), 11
methods (quizApp.views.experiments.ExperimentView ObjectTypeForm (class in quizApp.forms.common), 11
attribute), 20 opt_in (quizApp.models.Participant attribute), 29
MultiCheckboxField (class in quizApp.forms.common), option_widget (quizApp.forms.common.MultiCheckboxField
11 attribute), 11
MultipleChoiceAnswerForm (class in order_fields() (quizApp.forms.common.OrderFormMixin
quizApp.forms.experiments), 15 method), 12
MultipleChoiceQuestion (class in quizApp.models), 29 OrderFormMixin (class in quizApp.forms.common), 12
MultipleChoiceQuestion.Meta (class in quizApp.models),
29 P
MultipleChoiceQuestionResult (class in Participant (class in quizApp.models), 29
quizApp.models), 29 participant (quizApp.models.AssignmentSet attribute), 25
MultiSelectAnswerForm (class in password (quizApp.models.User attribute), 31
quizApp.forms.experiments), 15 path (quizApp.forms.datasets.GraphForm attribute), 12
MultiSelectQuestion (class in quizApp.models), 28 path (quizApp.models.Graph attribute), 27
MultiSelectQuestion.Meta (class in quizApp.models), 28 points (quizApp.forms.activities.ChoiceForm attribute),
MultiSelectQuestionResult (class in quizApp.models), 28 10
points (quizApp.models.Choice attribute), 26
N populate_assignment() (quizApp.forms.experiments.ActivityAnswerForm
name (quizApp.forms.datasets.DatasetForm attribute), 12 method), 13
name (quizApp.forms.datasets.GraphForm attribute), 12 populate_from_activity()
name (quizApp.forms.datasets.TextForm attribute), 13 (quizApp.forms.experiments.ActivityAnswerForm
name (quizApp.forms.experiments.CreateExperimentForm method), 13
attribute), 14 populate_from_activity()
name (quizApp.models.Dataset attribute), 26 (quizApp.forms.experiments.ChoiceAnswerFormMixin
name (quizApp.models.Experiment attribute), 26 method), 14
name (quizApp.models.MediaItem attribute), 28

40 Index
QuizApp Documentation, Release 0.0.1

populate_from_activity() QuestionForm.Meta (class in quizApp.forms.activities),


(quizApp.forms.experiments.FreeAnswerForm 10
method), 15 questions (quizApp.models.Dataset attribute), 26
populate_from_activity() quizApp (module), 31
(quizApp.forms.experiments.IntegerAnswerForm quizApp.config (module), 22
method), 15 quizApp.forms (module), 16
populate_from_activity() quizApp.forms.activities (module), 9
(quizApp.forms.experiments.ScaleAnswerForm quizApp.forms.common (module), 11
method), 16 quizApp.forms.datasets (module), 12
populate_from_activity() quizApp.forms.experiments (module), 13
(quizApp.forms.experiments.ScorecardAnswerForm quizApp.models (module), 23
method), 16 quizApp.views (module), 22
populate_from_assignment() quizApp.views.activities (module), 16
(quizApp.forms.experiments.ActivityAnswerFormquizApp.views.core (module), 18
method), 13 quizApp.views.datasets (module), 19
populate_from_result() (quizApp.forms.experiments.ActivityAnswerForm
quizApp.views.experiments (module), 20
method), 14 quizApp.views.helpers (module), 22
populate_from_result() (quizApp.forms.experiments.FreeAnswerForm
method), 15 R
populate_from_result() (quizApp.forms.experiments.IntegerAnswerForm
read_assignment() (in module
method), 15 quizApp.views.experiments), 21
populate_from_result() (quizApp.forms.experiments.MultipleChoiceAnswerForm
read_mc_question() (in module
method), 15 quizApp.views.experiments), 21
populate_from_result() (quizApp.forms.experiments.MultiSelectAnswerForm
read_question() (in module quizApp.views.experiments),
method), 15 21
populate_from_result() (quizApp.forms.experiments.ScorecardAnswerForm
read_scorecard() (in module
method), 16 quizApp.views.experiments), 21
populate_obj() (quizApp.forms.datasets.UploadedFileField render_activity() (in module quizApp.views.activities),
method), 13 17
populate_object_type() (quizApp.forms.common.ObjectTypeForm
render_question() (in module quizApp.views.activities),
method), 11 18
populate_objects() (quizApp.forms.common.ListObjectFormrender_scorecard() (in module quizApp.views.activities),
method), 11 18
populate_row_segment() (in module render_time (quizApp.forms.experiments.ActivityAnswerForm
quizApp.views.experiments), 21 attribute), 14
post_login() (in module quizApp.views.core), 18 reset_objects() (quizApp.forms.common.ListObjectForm
Production (class in quizApp.config), 23 method), 11
progress (quizApp.models.AssignmentSet attribute), 25 resolve_kwargs (quizApp.views.activities.ActivityCollectionView
prompt (quizApp.forms.activities.ScorecardForm at- attribute), 17
tribute), 10 resolve_kwargs (quizApp.views.datasets.DatasetCollectionView
prompt (quizApp.models.Scorecard attribute), 30 attribute), 19
put() (quizApp.views.experiments.ExperimentView resolve_kwargs() (quizApp.views.activities.ActivityView
method), 20 method), 17
resolve_kwargs() (quizApp.views.activities.ChoiceCollectionView
Q method), 17
query_exists() (in module quizApp.views.core), 18 resolve_kwargs() (quizApp.views.activities.ChoiceView
Question (class in quizApp.models), 29 method), 17
question (quizApp.forms.activities.IntegerQuestionForm resolve_kwargs() (quizApp.views.datasets.DatasetView
attribute), 10 method), 19
question (quizApp.forms.activities.QuestionForm at- resolve_kwargs() (quizApp.views.datasets.MediaItemCollectionView
tribute), 10 method), 19
question (quizApp.models.Choice attribute), 26 resolve_kwargs() (quizApp.views.datasets.MediaItemView
question (quizApp.models.Question attribute), 29 method), 19
QuestionForm (class in quizApp.forms.activities), 10

Index 41
QuizApp Documentation, Release 0.0.1

resolve_kwargs() (quizApp.views.experiments.ExperimentCollectionView
ScorecardForm.Meta (class in quizApp.forms.activities),
method), 20 10
resolve_kwargs() (quizApp.views.experiments.ExperimentViewScorecardResult (class in quizApp.models), 30
method), 20 ScorecardSettings (class in quizApp.models), 30
Result (class in quizApp.models), 30 ScorecardSettingsForm (class in
result (quizApp.forms.experiments.ActivityAnswerForm quizApp.forms.common), 12
attribute), 14 ScorecardSettingsForm.Meta (class in
result (quizApp.forms.experiments.FreeAnswerForm at- quizApp.forms.common), 12
tribute), 15 SECRET_KEY (quizApp.config.Development attribute),
result (quizApp.forms.experiments.IntegerAnswerForm 23
attribute), 15 SECRET_KEY (quizApp.config.Testing attribute), 23
result (quizApp.forms.experiments.MultipleChoiceAnswerFormSECURITY_CHANGEABLE (quizApp.config.Config
attribute), 16 attribute), 22
result (quizApp.forms.experiments.MultiSelectAnswerFormSECURITY_PASSWORD_HASH
attribute), 15 (quizApp.config.Development attribute),
result (quizApp.forms.experiments.ScorecardAnswerForm 23
attribute), 16 SECURITY_PASSWORD_HASH
result_class (quizApp.models.Activity.Meta attribute), 24 (quizApp.config.Production attribute), 23
result_class (quizApp.models.FreeAnswerQuestion.Meta SECURITY_PASSWORD_SALT
attribute), 27 (quizApp.config.Development attribute),
result_class (quizApp.models.IntegerQuestion.Meta at- 23
tribute), 28 SECURITY_PASSWORD_SALT
result_class (quizApp.models.MultipleChoiceQuestion.Meta (quizApp.config.Testing attribute), 23
attribute), 29 SECURITY_POST_LOGIN_VIEW
result_class (quizApp.models.MultiSelectQuestion.Meta (quizApp.config.Config attribute), 22
attribute), 28 SECURITY_REGISTERABLE (quizApp.config.Config
result_class (quizApp.models.Scorecard.Meta attribute), attribute), 22
30 SECURITY_SEND_REGISTER_EMAIL
results_experiment() (in module (quizApp.config.Development attribute),
quizApp.views.experiments), 21 23
Role (class in quizApp.models), 30 settings_activity() (in module quizApp.views.activities),
running (quizApp.models.Experiment attribute), 27 18
settings_dataset() (in module quizApp.views.datasets), 20
S settings_experiment() (in module
save() (quizApp.models.Base method), 25 quizApp.views.experiments), 21
ScaleAnswerForm (class in quizApp.forms.experiments), settings_mc_question() (in module
16 quizApp.views.activities), 18
ScaleQuestion (class in quizApp.models), 30 settings_media_item() (in module
score (quizApp.models.Assignment attribute), 24 quizApp.views.datasets), 20
score (quizApp.models.AssignmentSet attribute), 25 settings_question() (in module quizApp.views.activities),
Scorecard (class in quizApp.models), 30 18
Scorecard.Meta (class in quizApp.models), 30 settings_scorecard() (in module
scorecard_settings (quizApp.forms.activities.ActivityForm quizApp.views.activities), 18
attribute), 9 show_scores (quizApp.forms.experiments.CreateExperimentForm
scorecard_settings (quizApp.forms.experiments.CreateExperimentForm attribute), 14
attribute), 14 show_scores (quizApp.models.Experiment attribute), 26
scorecard_settings (quizApp.models.Activity attribute), show_timers (quizApp.forms.experiments.CreateExperimentForm
24 attribute), 14
scorecard_settings (quizApp.models.Experiment at- show_timers (quizApp.models.Experiment attribute), 26
tribute), 26 SingleSelectQuestion (class in quizApp.models), 31
ScorecardAnswerForm (class in SQLALCHEMY_DATABASE_URI
quizApp.forms.experiments), 16 (quizApp.config.Development attribute),
ScorecardForm (class in quizApp.forms.activities), 10 23

42 Index
QuizApp Documentation, Release 0.0.1

SQLALCHEMY_DATABASE_URI text (quizApp.forms.experiments.FreeAnswerForm at-


(quizApp.config.Testing attribute), 23 tribute), 15
SQLALCHEMY_ECHO (quizApp.config.Development text (quizApp.models.Text attribute), 31
attribute), 23 TextForm (class in quizApp.forms.datasets), 13
SQLALCHEMY_TRACK_MODIFICATIONS TextForm.Meta (class in quizApp.forms.datasets), 13
(quizApp.config.Config attribute), 22 time_to_submit (quizApp.models.Assignment attribute),
start (quizApp.forms.experiments.CreateExperimentForm 24
attribute), 14 title (quizApp.forms.activities.ScorecardForm attribute),
start (quizApp.models.Experiment attribute), 26 10
stop (quizApp.forms.experiments.CreateExperimentForm title (quizApp.models.Scorecard attribute), 30
attribute), 14 type (quizApp.models.Activity attribute), 23
stop (quizApp.models.Experiment attribute), 26 type (quizApp.models.User attribute), 31
submit (quizApp.forms.activities.ActivityForm attribute),
9 U
submit (quizApp.forms.activities.ChoiceForm attribute), update_assignment() (in module
10 quizApp.views.experiments), 21
submit (quizApp.forms.common.DeleteObjectForm at- update_form() (quizApp.views.activities.ActivityView
tribute), 11 method), 17
submit (quizApp.forms.common.ListObjectForm at- update_form() (quizApp.views.activities.ChoiceView
tribute), 11 method), 17
submit (quizApp.forms.common.ObjectTypeForm update_form() (quizApp.views.datasets.DatasetView
attribute), 11 method), 19
submit (quizApp.forms.datasets.DatasetForm attribute), update_form() (quizApp.views.datasets.MediaItemView
12 method), 20
submit (quizApp.forms.datasets.GraphForm attribute), 12 update_form() (quizApp.views.experiments.ExperimentView
submit (quizApp.forms.datasets.TextForm attribute), 13 method), 20
submit (quizApp.forms.experiments.ActivityAnswerForm UploadedFileField (class in quizApp.forms.datasets), 13
attribute), 14 upper_bound (quizApp.forms.activities.IntegerQuestionForm
submit (quizApp.forms.experiments.CreateExperimentForm attribute), 10
attribute), 14 upper_bound (quizApp.models.IntegerQuestion at-
submit_time (quizApp.forms.experiments.ActivityAnswerForm tribute), 28
attribute), 14 User (class in quizApp.models), 31

T V
template (quizApp.views.activities.ActivityCollectionView validate() (quizApp.forms.experiments.CreateExperimentForm
attribute), 17 method), 14
template (quizApp.views.activities.ChoiceCollectionView validate_activity() (quizApp.models.Assignment
attribute), 17 method), 24
template (quizApp.views.datasets.DatasetCollectionView validate_answer() (quizApp.models.IntegerQuestion
attribute), 19 method), 28
template (quizApp.views.datasets.MediaItemCollectionViewvalidate_assignment() (in module
attribute), 19 quizApp.views.experiments), 21
template (quizApp.views.datasets.MediaItemView validate_assignment_set() (in module
attribute), 20 quizApp.views.experiments), 21
template (quizApp.views.experiments.ExperimentCollectionView
validate_choice() (quizApp.models.MultipleChoiceQuestionResult
attribute), 20 method), 29
template (quizApp.views.experiments.ExperimentView validate_choice() (quizApp.models.MultiSelectQuestionResult
attribute), 20 method), 29
Testing (class in quizApp.config), 23 validate_form_or_error() (in module
TESTING (quizApp.config.Config attribute), 22 quizApp.views.helpers), 22
TESTING (quizApp.config.Production attribute), 23 validate_model_id() (in module quizApp.views.helpers),
TESTING (quizApp.config.Testing attribute), 23 22
Text (class in quizApp.models), 31 validate_result() (quizApp.models.Assignment method),
text (quizApp.forms.datasets.TextForm attribute), 13 25

Index 43
QuizApp Documentation, Release 0.0.1

W
widget (quizApp.forms.common.MultiCheckboxField at-
tribute), 11
WTF_CSRF_ENABLED (quizApp.config.Config at-
tribute), 22
WTF_CSRF_ENABLED (quizApp.config.Testing
attribute), 23
WTF_CSRF_METHODS (quizApp.config.Config
attribute), 22

44 Index

You might also like