Skip to content

Commit

Permalink
Merge pull request #2 from GatorEducator/master
Browse files Browse the repository at this point in the history
Updating fork with master
  • Loading branch information
leonardoz15 authored Feb 20, 2019
2 parents 4e977b2 + 10f0457 commit e0e63e7
Show file tree
Hide file tree
Showing 26 changed files with 78 additions and 40 deletions.
58 changes: 48 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ pip3 install -r requirements.txt

Note that you may have Python 3 setup in different ways on your computer. For
instance, you may prefer to install GatorGrouper's dependencies in a site-wide
location and then you would have to type, for instance, `sudo pip install -r
location and then you would have to type `sudo pip install -r
requirements.txt`. Alternatively, you may choose to install the dependencies by
typing `pip install --user -r requirements.txt`.

GatorGrouper was developed to easily run in conjunction with a [venv-based
Python 3 virtual environment](https://docs.python.org/3/library/venv.html). This
means that if you are in the directory that contains the `gatorgrouper`
directory then you could type `python3 -m venv gatorgrouper` to create all of
means that if you are in the directory that contains `gatorgrouper`
then you could type `python3 -m venv gatorgrouper` to create all of
the components of a venv-based virtual environment in the `gatorgrouper`
directory. Once you complete this step, you can type the command `source
gatorgrouper/bin/activate` to activate the venv-based virtual environment.
Expand All @@ -43,27 +43,65 @@ Interested in learning more about the basics of virtual environments in Python
[article](http://www.cs.allegheny.edu/sites/gkapfham/programming/research/idea/2017/07/14/Virtual-Environments/)
to further develop your understanding of this topic.

GatorGrouper requires users to use Python 3. You can type `python --version`
into the terminal window to check the current version of Python on your
workstation. If you do not have the right Python version, you can go to
[Python](https://www.python.org/downloads/) to download the latest version of
Python. If you can not download or upgrade Python on your workstation, you can
download the [Pyenv](https://github.com/pyenv/pyenv) tool to set up a virtual
environment for the newest Python version.

To install Pyenv, you can use [Pyenv Installer](https://github.com/pyenv/pyenv-installer)
by typing the command in terminal:

```shell
curl https://pyenv.run | bash
```

After the completion of this command, Pyenv should be installed. Please make
sure that you have the following lines in your `~/.bashrc` or similar file
types. Notices that different development evironment may have different
configuration configuration files (i.e., "dotfiles"). You can see more examples
and learn more in the instructions of Professor Kapfhammer's
[dotfiles](https://github.com/gkapfham/dotfiles) repository.

```shell
export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
```

Once Pyenv is installed, you can install the latest version of Python
for your Pyenv. We suggest developers to use `Python 3.7.2` for `gatorgrouper`.
However, any version after `Python 3.6.8` would work well. To install, you
should restart your terminal window by typing `pyenv install 3.7.2`
and `pyenv global 3.7.2`.

After you finish this process, you should be able
to type `python --version` and get `Python 3.7.2` or other version after
`Python 3.6.8` in your terminal.

## Initial Setup

Ensure that you have installed gspread and oauth2client installed in the root
directory of the repository. In the terminal use the command:
Ensure that you have installed gspread and oauth2client in the root
directory of the repository. In the terminal use the command:

```shell
python3 -m pip install --user gspread oauth2client
```

Create a Google Sheets spreadsheet and a Google Form in Google Drive. In the
Create a Google Sheets spreadsheet and a Google Form in Google Drive. In the
Form, create yes or no questions to measure the capabilities and skills of the
students that you wish to group. After you have at least one submission of the
Form, you can go to the responses tab and click on the green icon with the white
cross through it. This will enable you to link the Sheet to the Form. You can
either create a new Sheet or link to a preexisting one. If you need to change
cross through it. This will enable you to link the Sheet to the Form. You can
either create a new Sheet or link to a preexisting one. If you need to change
the destination, you can click on the three dot icon menu to the right of the
green icon and select "Select response destination".

Open the `.json` file in the `gatorgrouper` repository and find the `"client-email"`.
Copy the quoted text that looks like an email address. Return to the Sheet and
open the sharing options. Paste the address and click send. Alternatively, if
Copy the quoted text that looks like an email address. Return to the Sheet and
open the sharing options. Paste the address and click send. Alternatively, if
you would like to create your own service account for confidentiality and
security, follow the tutorial found at [www.twolio.com](https://www.twilio.com/blog/2017/02/an-easy-way-to-read-and-write-to-a-google-spreadsheet-in-python.html)
to create a personal service account.
Expand Down
Empty file added django/django.py
Empty file.
28 changes: 14 additions & 14 deletions gatorgrouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
import sys
import logging

import parse_arguments
from read_student_file import read_student_file
from remove_absent_students import remove_absent_students
from display import display_welcome_message
from display import display_student_groups
from display import create_escaped_string_from_list
from group_random import shuffle_students
from group_random import group_random_group_size
from group_random import group_random_num_group
from group_rrobin import group_rrobin_group_size
from group_rrobin import group_rrobin_num_group
from spreadsheet import create_csv
from defaults import DEFAULT_CSVFILE
from defaults import DEFAULT_NUMGRP
from src.controllers import parse_arguments
from src.controllers import read_student_file
from src.controllers import remove_absent_students
from src.controllers.display import display_welcome_message
from src.controllers.display import display_student_groups
from src.controllers.display import create_escaped_string_from_list
from src.controllers.group_random import shuffle_students
from src.controllers.group_random import group_random_group_size
from src.controllers.group_random import group_random_num_group
from src.controllers.group_rrobin import group_rrobin_group_size
from src.controllers.group_rrobin import group_rrobin_num_group
from src.controllers.spreadsheet import create_csv
from src.controllers.defaults import DEFAULT_CSVFILE
from src.controllers.defaults import DEFAULT_NUMGRP


if __name__ == '__main__':
Expand Down
Empty file added manage.py
Empty file.
Empty file added src/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion group_random.py → src/controllers/group_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import itertools
from random import shuffle

from group_scoring import score_groups
from .group_scoring import score_groups


def group_random_group_size(responses, grpsize):
Expand Down
2 changes: 1 addition & 1 deletion group_rrobin.py → src/controllers/group_rrobin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
from random import shuffle
from itertools import cycle
from group_scoring import score_groups
from .group_scoring import score_groups


def group_rrobin_group_size(responses, grpsize):
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions parse_arguments.py → src/controllers/parse_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import argparse
import logging

from defaults import DEFAULT_CSVFILE
from defaults import DEFAULT_GRPSIZE
from defaults import DEFAULT_NUMGRP
from read_student_file import read_student_file
from .defaults import DEFAULT_CSVFILE
from .defaults import DEFAULT_GRPSIZE
from .defaults import DEFAULT_NUMGRP
from .read_student_file import read_student_file


def parse_arguments(args):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions spreadsheet.py → src/controllers/spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import logging
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from defaults import DEFAULT_CSVFILE
from defaults import DEFAULT_WORKBOOK
from .defaults import DEFAULT_CSVFILE
from .defaults import DEFAULT_WORKBOOK


def create_csv():
Expand Down
Empty file added src/models/model.py
Empty file.
Empty file added src/static/static.py
Empty file.
Empty file added src/templates/template.py
Empty file.
Empty file added src/urls.py
Empty file.
Empty file added src/views/views.py
Empty file.
Empty file added src/wsgi.py
Empty file.
2 changes: 1 addition & 1 deletion tests/test_absent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import remove_absent_students
from src.controllers import remove_absent_students


def test_remove_absent_students():
Expand Down
6 changes: 3 additions & 3 deletions tests/test_arguments.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import parse_arguments
import logging
import defaults
import group_random
from src.controllers import parse_arguments
from src.controllers import defaults
from src.controllers import group_random


def test_parse_arguments1():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_display.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import display
from src.controllers import display


def test_display_student_groups(capsys):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_group_method.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import group_random
import group_rrobin
from src.controllers import group_random
from src.controllers import group_rrobin
import gatorgrouper


Expand Down
2 changes: 1 addition & 1 deletion tests/test_group_size.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import parse_arguments
from src.controllers import parse_arguments


def test_check_valid_group_size_one():
Expand Down

0 comments on commit e0e63e7

Please sign in to comment.