Skip to content

whsky/questionator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Header Image

The Questionator

The lazy way to ask a random student a question

The Questionator is a Flask based web app that automatically collects student names and profile pictures from the Slack channel used for class.

It filters out any member with an @galvanize.com email address so you won't ask any support staff or instructors who are also on the channel questions.

Because this interacts with Slack's API, you will need an API token. You can get an API key here. Set this key to a local environment alias in your .bash_profile, .bashrc, or .zshrc resource file. Use the alias name SLACK_TOKEN so the python script will pull it in automatically when launched.

For example:

export SLACK_TOKEN="your token string here..."

Don't forget that you have to re-source you bash profile after editing it...

$ source ~/.bash_profile

API calls are made through python using the Slacker package. You will need to install this before you run the script.

$ pip install slacker

You will also have to specify what channel your class is using. You can do this by using a system argument when you call the script.

You can also specify whether our not you want the Questionator to send a Slack message to the user selected with the qbot Slack app built into the Questionator. This is set with True or False as the --ping system argument.

An example run code looks like this:

$ python questionator.py --chan='channel_name' --ping=False

This would collect student names, Slack usernames, and profile pics for members in the 'channel_name' channel, and would not send messages to the channel when a student is called on.

The script takes about 20 seconds to initialize with all the necessary info from the Slack API. After which, it will launch the Flask App (running on port 8080).

What It Does

After collecting all the class members, it initializes the number of questions asked to zero for everyone. When you press the button Ask a question it gets the list of students who have answered the fewest questions (initially, this will be everyone since they have all answered zero questions). It then makes a random selection from this list of whom to ask the question. The username and profile pic for that student are collected and displayed on screen. That student then has their "number of questions asked" incremented by one. This helps track how many questions have been asked, as well as remove the possibility of asking the same student two or more consecutive questions.

About

A flask web app to automatically collect a student roster and avatars from a Slack channel. The Questionator will select a student at random (in the pool of students who have answered the least questions) to ask a question in class.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors