Skip to content

Commit

Permalink
Merge branch 'master' into feature/dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Michionlion committed Apr 25, 2019
2 parents 3b44178 + eb7a163 commit 32515d3
Show file tree
Hide file tree
Showing 13 changed files with 227 additions and 20 deletions.
56 changes: 56 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"contributorsPerLine": 7,
"badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg?style=flat)](#contributors)",
"contributors": [
{
"login": "yeej2",
"name": "Joshua Yee",
"avatar_url": "https://avatars1.githubusercontent.com/u/22895281?v=4",
"profile": "https://github.com/yeej2",
"contributions": [
"code",
"infra",
"review",
"doc"
]
},
{
"login": "Michionlion",
"name": "Saejin Mahlau-Heinert",
"avatar_url": "https://avatars1.githubusercontent.com/u/5274499?v=4",
"profile": "https://saejinmh.com",
"contributions": [
"code",
"infra",
"platform",
"review"
]
},
{
"login": "quigley-c",
"name": "Carson Quigley",
"avatar_url": "https://avatars1.githubusercontent.com/u/35495466?v=4",
"profile": "https://github.com/quigley-c",
"contributions": [
"doc"
]
},
{
"login": "JattMones",
"name": "Matt",
"avatar_url": "https://avatars0.githubusercontent.com/u/22432176?v=4",
"profile": "https://github.com/JattMones",
"contributions": [
"doc"
]
}
],
"projectName": "quizagator",
"projectOwner": "GatorEducator",
"repoType": "github",
"repoHost": "https://github.com"
}
8 changes: 4 additions & 4 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ignore-patterns=
#init-hook=

# Use multiple processes to speed up Pylint.
jobs=2
jobs=1

# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
Expand Down Expand Up @@ -50,13 +50,13 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=invalid-name,no-absolute-import,suppressed-message,locally-disabled
disable=invalid-name,import-error,no-name-in-module,no-absolute-import,suppressed-message,locally-disabled

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-enabled,file-ignored,useless-suppression,deprecated-pragma,bare-except,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
enable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-enabled,file-ignored,useless-suppression,deprecated-pragma,bare-except,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,exec-used,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call

[REPORTS]

Expand Down Expand Up @@ -315,7 +315,7 @@ indent-after-paren=4
indent-string=' '

# Maximum number of characters on a single line.
max-line-length=88
max-line-length=100

# Maximum number of lines in a module
max-module-lines=1000
Expand Down
95 changes: 83 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,95 @@
![logo](logo.jpg "Professor Spidey")

# Quiz-A-Gator

![logo](logo.jpg "Professor Spidey")

[![Build Status](https://travis-ci.com/GatorEducator/quizagator.svg?branch=master)](https://travis-ci.com/GatorEducator/quizagator)
[![codecov.io](http://codecov.io/github/GatorEducator/quizagator/coverage.svg?branch=master)](
http://codecov.io/github/GatorEducator/gatorquizagator?branch=master)
http://codecov.io/github/GatorEducator/quizagator?branch=master)
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat)](#contributors)
[![made-with-python](
https://img.shields.io/badge/Made%20with-Python-blue.svg)](
https://www.python.org/)

This Django web application provides an interface for faculty to develop and
distribute quizzes to students. The student answers can then be
automatically graded based on information or scripts the faculty member
uploads.
## A Quiz Creation Tool for File Upload and Custom Grading

It may seem obvious that there are many other tools for creating quizzes, but
interestingly the quiz creation tools out there all have one thing in common:
Web-based GUI. Quizagator is a web application that provides an interface for
creating quizzes without the overhead of a GUI making quizzes creation tedious
and--in the case that the design of the GUI tool changes--confusing. By allowing
quiz creation through a text-based syntax it is possible to make quiz creation
lightning fast and much more consistent than fiddling with GUI tools. Not to
mention a text-based quiz creation allows for easy question duplication and
modification. Quizagator supports uploading quizzes in CSV format and allows for
grading with a custom grading program. The tool uses Flask with noSQL to manage
quizzes and results, as well as storing any custom grading tools uploaded to the
quizzes.

Quizagator uses it's own custom quiz creation syntax in CSV format that is
designed to be programmer-friendly to allow for more mutable quiz creation that
comes with all the benefits a text-based system allows, namely the ability to use
your favorite text editor rather than the ever-present GUI's.

Quiz questions look like this:

```csv
"Quizquestion?","correct answer","answer1","answer2","answer3","answer4"
"What's the best quiz creation tool?","1","Quizagator","Google Forms","Sakai Quizzes","Quiz Maker"
```

Once a quiz has been created a grading program can be uploaded to implement a
custom grading scheme for the quiz. Quizagator will run the program on the
results of the quiz and return the output.

## Pipenv

Quizagator uses a [Pipenv](https://project/pipenv/)-built virtual environment
to standardize the execution of the project. If you don't have pipenv we highly
recommend installing it using `pip`:

```
pip install pipenv
```

If for some reason this doesn't work for you, you can check out the [pipenv
github](https://github.com/pypa/pipenv).

## Commands
After cloning the repo for the first time, run the `pipenv install --dev`
command to install develop and default packages. Other commands can be seen
below.

List of scripts: `cat Pipfile`
After cloning the repo for the first time, run

```
pipenv install --dev
```

to install the developer and default packages. To get a list of scripts for the
project, inspect the `[scripts]` tag in `Pipfile`:

```
cat Pipfile
```

Finally, to run the project locally:

```
pipenv run server
```

Or use the following to see all the options:

```
pipenv run python run.py --help
```

## Contributors

Check out our contributors!

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<table><tr><td align="center"><a href="https://github.com/yeej2"><img src="https://avatars1.githubusercontent.com/u/22895281?v=4" width="100px;" alt="Joshua Yee"/><br /><sub><b>Joshua Yee</b></sub></a><br /><a href="https://github.com/GatorEducator/quizagator/commits?author=yeej2" title="Code">💻</a> <a href="#infra-yeej2" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#review-yeej2" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/GatorEducator/quizagator/commits?author=yeej2" title="Documentation">📖</a></td><td align="center"><a href="https://saejinmh.com"><img src="https://avatars1.githubusercontent.com/u/5274499?v=4" width="100px;" alt="Saejin Mahlau-Heinert"/><br /><sub><b>Saejin Mahlau-Heinert</b></sub></a><br /><a href="https://github.com/GatorEducator/quizagator/commits?author=Michionlion" title="Code">💻</a> <a href="#infra-Michionlion" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#platform-Michionlion" title="Packaging/porting to new platform">📦</a> <a href="#review-Michionlion" title="Reviewed Pull Requests">👀</a></td><td align="center"><a href="https://github.com/quigley-c"><img src="https://avatars1.githubusercontent.com/u/35495466?v=4" width="100px;" alt="Carson Quigley"/><br /><sub><b>Carson Quigley</b></sub></a><br /><a href="https://github.com/GatorEducator/quizagator/commits?author=quigley-c" title="Documentation">📖</a></td><td align="center"><a href="https://github.com/JattMones"><img src="https://avatars0.githubusercontent.com/u/22432176?v=4" width="100px;" alt="Matt"/><br /><sub><b>Matt</b></sub></a><br /><a href="https://github.com/GatorEducator/quizagator/commits?author=JattMones" title="Documentation">📖</a></td></tr></table>

<!-- ALL-CONTRIBUTORS-LIST:END -->

Serve our site: `pipenv run server`
Don't know what the emoji's mean? Check out the [key](https://allcontributors.org/docs/en/emoji-key)!
2 changes: 1 addition & 1 deletion application/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# LOGIN THE USER
@app.route("/login/", methods=["POST"])
def login():
""" undocumented """
""" function that logs student or teacher in """
# get form information
form_data = flask.request.form

Expand Down
18 changes: 18 additions & 0 deletions application/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@
</style>
</head>
<body>
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
New to us? <a class="brand" href="/register/">Register!</a><br>
<div class="nav-collapse collapse">
<ul class="nav" id="main-menu-left">
{% for link_href, link_name, link_text in navigation_items %}
<li
{% if link_name == active_page %} class="active"{% endif%}>
<a href="{{ link_href|e }}">{{ link_text|e }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
<div class="container">
<div class="row">
<h1 style="text-align: center;">Login to the LMS</h1>
Expand Down
18 changes: 18 additions & 0 deletions application/templates/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@
</style>
</head>
<body>
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
Already have an account? <a class="brand" href="/">Login</a><br>
<div class="nav-collapse collapse">
<ul class="nav" id="main-menu-left">
{% for link_href, link_name, link_text in navigation_items %}
<li
{% if link_name == active_page %} class="active"{% endif%}>
<a href="{{ link_href|e }}">{{ link_text|e }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
<div class="container">
<div class="row-fluid">
<h1 style="text-align: center;">Create an Account</h1>
Expand Down
3 changes: 2 additions & 1 deletion application/templates/students/base_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="/students/">Student Dashboard</a>
<a class="brand" href="/students/">Student Dashboard</a><br>
<a class="brand" href="/students/classes/">Classes</a>
<div class="nav-collapse collapse">
<ul class="nav" id="main-menu-left">
{% for link_href, link_name, link_text in navigation_items %}
Expand Down
2 changes: 1 addition & 1 deletion application/templates/students/classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="container">
<div class="row">
<div class="span12">
<h1>Classes Home</h1>
<h1>Classes</h1>
</div>
</div>
<div class="row">
Expand Down
7 changes: 6 additions & 1 deletion application/templates/students/quiz_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ <h2>Take the Quiz</h2>
<span style="text-decoration: underline;">{{ question.text }}</span>
{% set answer_num = 0 %}
{% for answer in question.answers %}
<div class="answer-div"><input required type="radio" name="{{question.id}}" class="answer" value="{{answer_num}}"/><span>{{answer}}</span></div>
<div class="answer-div"><input
required type="radio"
name="{{question.id}}" class="answer"
value="{{answer_num}}"/><span>{{answer}}</span>
</div>
{% set answer_num = answer_num + 1 %}
{% endfor %}<br/>
{% endfor %}
<input type="submit" class="btn btn-primary" />
</fieldset>
</form>
</div>

{% endif %}
{% with messages = get_flashed_messages() %}
{% if messages %}
Expand Down
1 change: 1 addition & 0 deletions application/templates/teachers/base_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<span class="icon-bar"></span>
</a>
<a class="brand" href="/teachers/">Teacher Dashboard</a>
<a class="brand" href="/teachers/classes/">Classes</a>
<div class="nav-collapse collapse">
<ul class="nav" id="main-menu-left">
{% for link_href, link_name, link_text in navigation_items %}
Expand Down
Binary file added quizagator.db
Binary file not shown.
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Configuration file for the test suite"""

import os
import sys

GO_BACK_A_DIRECTORY = "/../"

# set the system path to contain the previous directory
PREVIOUS_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, PREVIOUS_DIRECTORY + GO_BACK_A_DIRECTORY)
27 changes: 27 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
""" basic tests """
import pytest

from application import app
from application import login



def test_app_created():
"""Start with a blank database."""
assert app is not None

class FlaskrTestCase(unittest.TestCase):

def setUp(self):
self.db_fd, flaskr.app.config['DATABASE'] = tempfile.mkstemp()
flaskr.app.testing = True
self.app = flaskr.app.test_client()
with flaskr.app.app_context():
flaskr.init_db()


# def test_index(app):
# res = app.get("/")
# # print(dir(res), res.status_code)
# assert res.status_code == 200
# assert b"" in res.data

0 comments on commit 32515d3

Please sign in to comment.