Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rizvir committed Mar 1, 2016
0 parents commit 125b1df
Show file tree
Hide file tree
Showing 80 changed files with 51,998 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
env/
28 changes: 28 additions & 0 deletions README.md
@@ -0,0 +1,28 @@
Ever put up a technical job posting and be inundated with CVs from people who claim to know a lot but actually could hardly even spell what they profess to be good at?

Upload Sievee (pronounced "Upload CV") is a simple open source job application/CV uploading site, designed to sift candidates by asking them a set of compulsory questions (which they have to answer in order to continue). It's not unduly strict, in that it allows for an unlimited amount of retries as well as feedback of which particular question was answered wrong, but each incorrect attempt is noted in the final report. It's divided into three sections:
- Timed compulsory questions with fixed answers
- Timed optional free-form questions with no particular answers
- Untimed optional free-form or radio-selection questions with no answers
before finally allowing the candidate to upload their CV or any additional files. You then get their report and CV via email (there is no admin web interface to view previous applicants, it's email only)
It has some basic anti-cheating measures in the sense that it could try to guess if the candidate looked at the questions before, but it's far from perfect.


#### Installation:

```
git clone ...
sudo yum install mysql-devel # or mariadb-devel
virtualenv env
source env/bin/activate
pip install -r requirements.txt
# Then create a MySQL/MariaDB database according to create_db.mysql
mv settings.cfg.example settings.cfg
# Edit settings.cfg with your details.
python upload_sievee.py # Test
# Go to a web browser and check http://yourserver:5000
# or deploy to your webserver via the wsgi file.
```

Customize the text and links on the site by editing `templates/customize.html`, and change the questions by editing the `questions.yaml` file.

35 changes: 35 additions & 0 deletions create_db.mysql
@@ -0,0 +1,35 @@
CREATE DATABASE upload_cv;

CREATE USER 'upload_cv_user'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL ON upload_cv.* TO 'upload_cv_user'@'localhost';

USE upload_cv;

CREATE TABLE candidates (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
entry_date DATETIME,
name VARCHAR(254),
email VARCHAR(254),
phone VARCHAR(50),
ip VARCHAR(15),
useragent VARCHAR(254),
read_intro BOOLEAN,
basic_questions_start DATETIME,
basic_questions_end DATETIME,
basic_questions_timeaway INT DEFAULT 0,
basic_questions_incorrect INT DEFAULT 0,
extra_questions_start DATETIME,
extra_questions_end DATETIME,
extra_questions_timeaway INT DEFAULT 0,
cv_uploaded BOOLEAN DEFAULT FALSE
);

CREATE INDEX idx_c_id ON candidates(id);

CREATE INDEX idx_c_uploaded ON candidates(cv_uploaded);
CREATE INDEX idx_c_email ON candidates(email);
CREATE INDEX idx_c_phone ON candidates(phone);
CREATE INDEX idx_c_ip ON candidates(ip);



20 changes: 20 additions & 0 deletions permissions.sh
@@ -0,0 +1,20 @@
#!/bin/bash
set -u

ROOTDIR="/the/dir/with/upload_sievee"
READ_WRITE_DIRS="repo"

# Set everything to root/read-only by default
chown -v -R root:root $ROOTDIR
chmod -v -R 644 $ROOTDIR

# Set all the directory permissions
find $ROOTDIR -type d -exec chmod 755 {} \;

# Set permissions for writing
for i in $READ_WRITE_DIRS; do
chown -v -R www-upload-cv:www-upload-cv $ROOTDIR/$i
find $ROOTDIR/$i -type f -exec chmod -v 664 {} \;
find $ROOTDIR/$i -type d -exec chmod -v 775 {} \;
done

69 changes: 69 additions & 0 deletions questions.yaml
@@ -0,0 +1,69 @@
basic-questions:
- question: "What is the right answer to this question?"
id: "question01"
type: "radio"
options:
- "The incorrect answer"
- "Another wrong answer"
- "The right answer"
- "One more incorrect answer"
answer: "The right answer"


- question: "The answer to the following question is /etc/fstab"
id: "question02"
type: "line"
hint: "/etc"
answer: "/etc/fstab"

- question: "You can include <i>some</i> HTML in the <abbr title='Yet Another Markup Language'>YAML</abbr> file. Do you want to continue?"
id: "question03"
type: "radio"
options:
- "Not really"
- "I prefer sticking to this page"
- "Mesmerized by the stopwatch"
- "Yes!"
answer: "Yes!"


extra-questions:
- question: "Just a free-form question, you don't have to fill this up"
id: "question01"
type: "multiline"
height: 100
width: 400

- question: "Another question that could be answered."
id: "question02"
type: "multiline"
height: 100
width: 400

- question: "The height and width of the textbox can be customized in the YAML, what do you think of that?"
id: "question03"
type: "multiline"
height: 200
width: 600


nontech-questions:
- question: "This is similar to the questions on the previous page (but not timed)"
id: "question01"
type: "multiline"
height: 100
width: 600

- question: "Did you know you could have a one line answer box?"
id: "question02"
type: "line"

- question: "You could even have a radio selection"
id: "question03"
type: "radio"
options:
- "Really?"
- "I knew that."
- "You could have a what selection?"


10 changes: 10 additions & 0 deletions requirements.txt
@@ -0,0 +1,10 @@
Flask==0.10.1
Jinja2==2.7.3
MarkupSafe==0.23
PyYAML==3.11
MySQL-python
SQLAlchemy==1.0.5
Werkzeug==0.10.4
itsdangerous==0.24
mailer==0.8.1
wsgiref==0.1.2
Binary file added screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions settings.cfg.example
@@ -0,0 +1,16 @@
SQL_DB = 'upload_cv'
SQL_IP = "127.0.0.1"
SQL_USER = "upload_cv_user"
SQL_PASSWORD = "yourpassword"
REPO_DIR = "/tmp/repo"
SECRET_KEY = '1234abcd'

DEMO_MODE = True

# It's mandatory that you have a working mail server, unless demo_mode is set to True
# No need for authentication if you point it to the recipient MX record
MAIL_FROM = "opensievee@yourdomain.com"
MAIL_TO = [ "careers@yourdomain.com" ]
MAIL_SERVER = "127.0.0.1"


108 changes: 108 additions & 0 deletions static/app.css
@@ -0,0 +1,108 @@
.redhighlight{
background-color: #fbd6d6;
}


/* CV upload progress bar */

.overall{ height:100%; line-height: 26px;}
.name{ height:100%; float:left; overflow: hidden;}
.size{ padding: 0 10px; width: 100px; text-align: right; float: right;}
.remove_file{ float:right; width:15px; padding-left: 10px;}
.status{
float: right;
position: relative;
margin-top: 4px;
width: 80px;
height: 16px;
line-height: 16px;
border: 1px solid #A4BED4;
border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px;
}
.progress{ height: 100%; position: absolute; background-color: #b8e6ff;}
.message{ z-index: 1; width:100%; text-align:center; position: absolute;}
.message.error{ color: #e83b3b;}



/* Stopwatch - http://www.htmlbestcodes.com/beautiful_stopwatch_by_html__javascript_and_css3.htm */
.stopwatch-container {
padding: 10px;
text-align: center;
}

.stopwatch-timer {
padding: 10px;
background: #ffffff;
overflow: hidden;
display: inline-block;
position: relative;
}

.stopwatch-cell {
/*Should only display 1 digit. Hence height = line height of .numbers
* and width = width of .numbers*/
width: 0.60em;
height: 40px;
font-size: 24px;
overflow: hidden;
position: relative;
float: left;
}

.stopwatch-numbers {
width: 0.6em;
line-height: 40px;
font-family: digital, arial, verdana;
text-align: center;
color: #000000;

position: absolute;
top: 0;
left: 0;

/*Glow to the text*/
text-shadow: 0 0 5px rgba(150, 150, 150, 1);
}

.stopwatch-moveten {
/*The digits move but dont look good. We will use steps now
* 10 digits = 10 steps. You can now see the digits swapping instead of
* moving pixel-by-pixel*/
animation: stopwatch-moveten 1s steps(10, end) infinite;
/*By default animation should be paused*/
animation-play-state: running;
}
.stopwatch-movesix {
animation: stopwatch-movesix 1s steps(6, end) infinite;
animation-play-state: running;
}

/*Now we need to sync the animation speed with time speed*/
/*One second per digit. 10 digits. Hence 10s*/
.second {animation-duration: 10s;}
.tensecond {animation-duration: 60s;} /*60 times .second*/

.milisecond {animation-duration: 1s;} /*1/10th of .second*/
.tenmilisecond {animation-duration: 0.1s;}

.minute {animation-duration: 600s;} /*60 times .second*/
.tenminute {animation-duration: 3600s;} /*60 times .minute*/

.hour {animation-duration: 36000s;} /*60 times .minute*/
.tenhour {animation-duration: 360000s;} /*10 times .hour*/

@keyframes stopwatch-moveten {
0% {top: 0;}
100% {top: -400px;}
/*height = 40. digits = 10. hence -400 to move it completely to the top*/
}

@keyframes stopwatch-movesix {
0% {top: 0;}
100% {top: -240px;}
/*height = 40. digits = 6. hence -240 to move it completely to the top*/
}



Binary file added static/check-animate-once-delay.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/check-animate-once-small-static.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/check-animate-once-small.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/check-animate-once.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions static/jquery-1.11.3.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions static/jquery-ui.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions static/jquery-ui.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions static/jquery-ui.structure.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added static/logo-right.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 125b1df

Please sign in to comment.