Views and page rendering¶
Default Views¶
judge.views.index(request)¶Renders the index page.
- Parameters
request (HttpRequest) – the request object used
judge.views.handler404(request, *args)¶Renders 404 page.
- Parameters
request (HttpRequest) – the request object used
judge.views.handler500(request, *args)¶Renders 500 page.
- Parameters
request (HttpRequest) – the request object used
Creation Views¶
judge.views.new_contest(request)¶Renders view for the page to create a new contest.
- Parameters
request (HttpRequest) – the request object used
judge.views.new_problem(request, contest_id)¶Renders view for the page to create a new problem in a contest.
- Parameters
request (HttpRequest) – the request object used
contest_id (int) – the contest ID
Modification Views¶
judge.views.edit_problem(request, problem_id)¶Renders view for the page to edit selected fields of a pre-existing problem.
- Parameters
request (HttpRequest) – the request object used
problem_id (str) – the problem ID
judge.views.add_person(request, contest_id, role)¶Function to render the page for adding a person - participant or poster to a contest.
- Parameters
request (HttpRequest) – the request object used
contest_id (int) – the contest ID
role (bool) –
Truefor Poster,Falsefor Participant
judge.views.add_poster(request, contest_id)¶Renders the page for adding a poster. Dispatches to
add_person()withroleset toTrue.
- Parameters
request (HttpRequest) – the request object used
contest_id (int) – the contest ID
judge.views.add_participant(request, contest_id)¶Renders the page for adding a participant. Dispatches to
add_person()withroleset toFalse.
- Parameters
request (HttpRequest) – the request object used
contest_id (int) – the contest ID
Detail Views¶
judge.views.contest_detail(request, contest_id)¶Renders the contest preview page after the contest has been created.
- Parameters
request (HttpRequest) – the request object used
contest_id (int) – the contest ID
judge.views.problem_detail(request, problem_id)¶Renders the problem preview page after the problem has been created. This preview will be changed based on the role of the user (poster or participant).
- Parameters
request (HttpRequest) – the request object used
problem_id (str) – the problem ID
judge.views.submission_detail(request, submission_id)¶Renders the page where a detailed breakdown with respect to judge’s evaluation, additional scores, error messages displayed and so on.
- Parameters
request (HttpRequest) – the request object used
submission_id (str) – the submission ID
judge.views.get_people(request, contest_id, role)¶Function to render the page for viewing participants and posters for a contest based on
role.
- Parameters
request (HttpRequest) – the request object used
contest_id (int) – the contest ID
role (bool) –
Truefor Poster,Falsefor Participant
judge.views.get_posters(request, contest_id)¶Renders the page for posters of a contest. Dispatches to
get_people()withroleset toTrue.
- Parameters
request (HttpRequest) – the request object used
contest_id (int) – the contest ID
judge.views.get_participants(request, contest_id)¶Renders the page for posters of a contest. Dispatches to
get_people()withroleset toFalse.
- Parameters
request (HttpRequest) – the request object used
contest_id (int) – the contest ID
judge.views.problem_submissions(request, problem_id)¶Renders the page where all submissions to a given problem can be seen. For posters, this renders a set of tables for each participant. For participants, this renders a table with the scores of their submissions only.
- Parameters
request (HttpRequest) – the request object used
problem_id (str) – the problem ID
Deletion Views¶
judge.views.delete_contest(request, contest_id)¶Function to provide the option to delete a contest.
- Parameters
request (HttpRequest) – the request object used
contest_id (int) – the contest ID
judge.views.delete_problem(request, problem_id)¶Function to provide the option to delete a problem.
- Parameters
request (HttpRequest) – the request object used
problem_id (str) – the problem ID
judge.views.delete_testcase(request, problem_id, testcase_id)¶Function to provide the option to delete a test-case of a particular problem.
- Parameters
request (HttpRequest) – the request object used
problem_id (str) – the problem ID
testcase_id (str) – the testcase ID
Downloading Views¶
judge.views.contest_scores_csv(request, contest_id)¶Function to provide the facility to download a CSV of scores of participants in a contest at a given point in time.
- Parameters
request (HttpRequest) – the request object used
contest_id (int) – the contest ID
judge.views.problem_starting_code(request, problem_id)¶Function to provide the facility to download the starting code for a problem.
- Parameters
request (HttpRequest) – the request object used
problem_id (str) – the problem ID
judge.views.problem_compilation_script(request, problem_id)¶Function to provide the facility to download the compilation script for a problem after creating the problem.
- Parameters
request (HttpRequest) – the request object used
problem_id (str) – the problem ID
judge.views.problem_test_script(request, problem_id)¶Function to provide the facility to download the testing script for a problem after creating the problem.
- Parameters
request (HttpRequest) – the request object used
problem_id (str) – the problem ID
judge.views.problem_default_script(request, script_name)¶Function to provide the facility to download the default compilation or test script.
- Parameters
request (HttpRequest) – the request object used
script_name (str) – name of the script - one of compilation_script or test_script
judge.views.submission_download(request, submission_id)¶Function to provide the facility to download a given submission.
- Parameters
request (HttpRequest) – the request object used
submission_id (str) – the submission ID