Gruntmaster::Data - Gruntmaster 6000 Online Judge -- database interface and tools
Gruntmaster::Data is the interface to the Gruntmaster 6000 database.
All functions are exported by default.
This function connects to the database. @args are the arguments passed to the DBIx::Simple constructor.
Purges a relative URL from the Varnish Cache by sending PURGE $url_path requests to all hosts in the PURGE_HOSTS environment variable.
Returns a DBIx::Simple object for interacting with the database directly. Use this when no other function in this module is suitable.
Returns an arrayref of the top 200 users.
Returns a hashref describing the user $id.
Returns an arrayref of problems.
Takes the following named arguments:
Only show problems owned by this user
Only show problems in this contest
If true, include private problems. Always true if contest is present.
If true, include problem solutions
Returns a hashref describing the problem $id. If $contest is present, contest start and stop times are included, and the solution is deleted.
Returns an arrayref of contests.
Returns a hashref describing the contest $id.
Returns true if the contest $contest includes the problem $problem, false otherwise.
In scalar context, returns an arrayref of jobs. In list context, returns an arrayref of jobs and a hashref of information about pages.
Show this page of the job log. Defaults to 1.
Only show jobs submitted by this user.
Only show jobs submitted in this contest.
Only show jobs submitted for this problem.
Only show jobs with this result (see the constants in Gruntmaster::Daemon::Constants).
If true, include private jobs. Defaults to false.
Returns a hashref describing the job $id.
Insert a new job into the database. This function also updates the lastjob field for the job's owner.
Returns an arrayref of the standings of contest $ct.
Rebuilds the problem_status and contest_status tables.
Marks the job $id as pending and clears its results, so that it will be run again by the daemon.
Marks a random job as being run by $daemon. Returns a hashref describing the job, or undef if no job was available.
Updates the job $job with the results in %results. If $private is false, also updates the problem_status table.
Notes that $owner has opened the problem $problem of contest $contest at time $time. If the opens table already contains this ($contest, $problem, $owner) triplet, this function does nothing.
opens
Marius Gavrilescu <marius@ieval.ro>
Copyright (C) 2014-2016 by Marius Gavrilescu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.1 or, at your option, any later version of Perl 5 you may have available.
To install Gruntmaster::Data, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gruntmaster::Data
CPAN shell
perl -MCPAN -e shell install Gruntmaster::Data
For more information on module installation, please visit the detailed CPAN module installation guide.