<commit_before>#!/usr/bin/perl
#
# The user and submission website for the grader
#
# Design:
#  NO fancy javascript/CSS/Ajax; just perl+html
#
#  a fairly simple email + password login system
#  upload programs to a user-specific directory
#  store user email and password hash in the DB
#  
#  session: login creates a session ( random ID)
#   session table: ID and last use date
#   sessions are date-checked before use
#   invalid sessions are deleted and a login page presented
#
#  uploads:
#   uploads go to a user-specific directory
#   grader script runs once every 5-10 minutes, processes any incoming
#   submissions
#
#   grader emails results to users based on email in DB
#   uploads only allowed during official time window
#
#  problem:
#   web interface only presents problem during offical submission window
#
#  user management:
#   separate cli tool for initial user creation
#   users can change their password from the web interface
#
# Database schema:
#  users table: id, username, password hash, start time
#  session table: session id, userid, last use
#  submissions table: id, submission time, problem, file, result, notes
#  results table?
#  problems table?
#
# Filesystem layout:
#  /opt/crashandcompile/
#                       <userID>/ - uploads
#                       problems/<problem>/ - problem files
#                       tmp/ - grading temp space
#
# TODO:
#  standings page
#  password change page
#  links on landing page
#

use strict;
use CGI qw/:standard *table/;
use DBI;
use Crypt::PasswdMD5;
use Crypt::Random qw( makerandom makerandom_octet );
use MIME::Base64;
use File::Copy;

# define problem number
my $problem = 1;

my $basedir = "/opt/crashandcompile";
my $timelimit = 60 * 60 * 2; # 2 hours
<commit_msg>Up time limit to 3 hours.<commit_after>#!/usr/bin/perl
#
# The user and submission website for the grader
#
# Design:
#  NO fancy javascript/CSS/Ajax; just perl+html
#
#  a fairly simple email + password login system
#  upload programs to a user-specific directory
#  store user email and password hash in the DB
#  
#  session: login creates a session ( random ID)
#   session table: ID and last use date
#   sessions are date-checked before use
#   invalid sessions are deleted and a login page presented
#
#  uploads:
#   uploads go to a user-specific directory
#   grader script runs once every 5-10 minutes, processes any incoming
#   submissions
#
#   grader emails results to users based on email in DB
#   uploads only allowed during official time window
#
#  problem:
#   web interface only presents problem during offical submission window
#
#  user management:
#   separate cli tool for initial user creation
#   users can change their password from the web interface
#
# Database schema:
#  users table: id, username, password hash, start time
#  session table: session id, userid, last use
#  submissions table: id, submission time, problem, file, result, notes
#  results table?
#  problems table?
#
# Filesystem layout:
#  /opt/crashandcompile/
#                       <userID>/ - uploads
#                       problems/<problem>/ - problem files
#                       tmp/ - grading temp space
#
# TODO:
#  standings page
#  password change page
#  links on landing page
#

use strict;
use CGI qw/:standard *table/;
use DBI;
use Crypt::PasswdMD5;
use Crypt::Random qw( makerandom makerandom_octet );
use MIME::Base64;
use File::Copy;

# define problem number
my $problem = 1;

my $basedir = "/opt/crashandcompile";
my $timelimit = 60 * 60 * 3; # 3 hours

{'fraction_non_alphanumeric': 0.08173076923076923, 'fraction_numerical': 0.007635746606334841, 'mean_word_length': 3.287272727272727, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5651987', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1019, 'n_words': 435}