- for my $problem (problems) {
- say "Problem name: " . problem_name $problem;
- say "Problem level: " . problem_level $problem;
- ...
- }
-
-=head1 DESCRIPTION
-
-Gruntmaster::Data is the Redis interface used by the Gruntmaster 6000 Online Judge. It exports many functions for talking to the database. All functions are exported by default.
-
-The current contest is selected by setting the C<< $Gruntmaster::Data::contest >> variable.
-
- local $Gruntmaster::Data::contest = 'mycontest';
- say 'There are' . jobcard . ' jobs in my contest';
-
-=head1 FUNCTIONS
-
-=head2 Redis
-
-Gruntmaster::Data exports some functions for talking directly to the Redis server. These functions should not normally be used, except for B<MULTI>, B<EXEC>, B<PUBLISH>, B<SUBSCRIBE> and B<WAIT_FOR_MESSAGES>.
-
-These functions correspond to Redis commands. The current list is: B<< MULTI EXEC SMEMBERS GET HGET HGETALL HDEL HSET SADD SREM INCR HMSET HSETNX DEL PUBLISH SUBSCRIBE WAIT_FOR_MESSAGES >>.
-
-=head2 Problems
-
-=over
-
-=item B<problems>
-
-Returns a list of problems in the current contest.
-
-=item B<problem_meta> I<$problem>
-
-Returns a problem's meta.
-
-=item B<set_problem_meta> I<$problem>, I<$meta>
-
-Sets a problem's meta.
-
-=item B<problem_name> I<$problem>
-
-Returns a problem's name.
-
-=item B<set_problem_name> I<$problem>, I<$name>
-
-Sets a problem's name.
-
-=item B<problem_level> I<$problem>
-
-Returns a problem's level. The levels are beginner, easy, medium, hard.
-
-=item B<set_problem_level> I<$problem>, I<$level>
-
-Sets a problem's level. The levels are beginner, easy, medium, hard.
-
-=item B<problem_difficulty> I<$problem>
-
-Returns a problem's difficulty.
-
-=item B<set_problem_difficulty> I<$problem>, I<$name>
-
-Sets a problem's difficulty.
-
-=item B<problem_statement> I<$problem>
-
-Returns a problem's statement.
-
-=item B<set_problem_statement> I<$problem>, I<$statement>
-
-Sets a problem's statement.
-
-=item B<problem_owner> I<$problem>
-
-Returns a problem's owner.
-
-=item B<set_problem_owner> I<$problem>, I<$owner>
-
-Sets a problem's owner.
-
-=item B<problem_author> I<$problem>
-
-Returns a problem's author.
-
-=item B<set_problem_author> I<$problem>, I<$author>
-
-Sets a problem's author.
-
-=item B<problem_private> I<$problem>
-
-Returns a problem's private flag (true if the problem is private, false otherwise).
-
-=item B<set_problem_private> I<$problem>, I<$private>
-
-Sets a problem's private flag.
-
-=item B<problem_generator> I<$problem>
-
-Returns a problem's generator. The generators are File, Run and Undef. More might be added in the future.
-
-=item B<set_problem_generator> I<$problem>, I<$generator>
-
-Sets a problem's generator.
-
-=item B<problem_runner> I<$problem>
-
-Returns a problem's runner. The runners are File, Verifier and Interactive. More might be added in the future.
-
-=item B<set_problem_runner> I<$problem>, I<$runner>
-
-Sets a problem's runner.
-
-=item B<problem_judge> I<$problem>
-
-Returns a problem's judge. The judges are Absolute and Points. More might be added in the future.
-
-=item B<set_problem_judge> I<$problem>, I<$judge>
-
-Sets a problem's judge.
-
-=item B<problem_testcnt> I<$problem>
-
-Returns a problem's test count.
-
-=item B<set_problem_testcnt> I<$problem>, I<$testcnt>
-
-Sets a problem's test count.
-
-=item B<problem_timeout> I<$problem>
-
-Returns a problem's time limit, in seconds.
-
-=item B<set_problem_timeout> I<$problem>, I<$timeout>
-
-Sets a problem's time limit, in seconds.
-
-=item B<problem_olimit> I<$problem>
-
-Returns a problem's output limit, in bytes.
-
-=item B<set_problem_olimit> I<$problem>, I<$olimit>
-
-Sets a problem's output limit, in bytes.
-
-=item B<get_open> I<$problem>, I<$user>
-
-Returns the time when I<$user> opened I<$problem>.
-
-=item B<mark_open> I<$problem>, I<$user>
-
-Sets the time when I<$user> opened I<$problem> to the current time. Does nothing if I<$user> has already opened I<$problem>.
-
-=item B<insert_problem> I<$id>, I<$key> => I<$value>, ...
-
-Inserts a problem with id I<$id> and the given initial configuration. Does nothing if a problem with id I<$id> already exists. Returns true if the problem was added, false otherwise.
-
-=item B<edit_problem> I<$id>, I<$key> => I<$value>, ...
-
-Updates the configuration of a problem. The values of the given keys are updated. All other keys/values are left intact.
-
-=item B<remove_problem> I<$id>
-
-Removes a problem.