Skip to content

Add two features: the ability to view the first failed test case and to copy and paste code directly. #2696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
__pycache__
*.o
.idea
db-data/
44 changes: 44 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
services:
domjudge:
volumes:
- domjudge-sync:${PWD}

volumes:
domjudge-sync:

x-mutagen:
sync:
defaults:
ignore:
paths:
- .idea
- .docker-sync
- output
- webapp/var/log
- webapp/var/cache/dev/twig
- webapp/var/cache/dev/profiler
- webapp/var/cache/dev/doctrine
- webapp/var/cache/dev/jms_serializer
- webapp/var/cache/dev/pools
- webapp/var/cache/prod/twig
- webapp/var/cache/prod/profiler
- webapp/var/cache/prod/doctrine
- webapp/var/cache/prod/jms_serializer
- webapp/var/cache/prod/pools
- webapp/var/cache/test
- webapp/var/cache/de_
- webapp/var/cache/de~
- webapp/var/cache/pro_
- webapp/var/cache/pro~
- webapp/var/cache/tes_
- webapp/var/cache/tes~
domjudge-sync:
alpha: '.'
beta: 'volume://domjudge-sync'
permissions:
defaultDirectoryMode: 0755
defaultFileMode: 0644
configurationBeta:
permissions:
defaultOwner: 'id:1000'
defaultGroup: 'id:1000'
40 changes: 36 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,51 @@ services:
- 127.0.0.1:13306:3306
command: --max-connections=1000 --max-allowed-packet=512M
volumes:
- /var/lib/mysql
- ./db-data:/var/lib/mysql
networks:
- domjudge
domjudge:
image: docker.io/domjudge/domjudge-contributor
hostname: domjudge-contributor
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
- .:${PWD}:cached
- .:${PWD}
- /chroot
links:
- mariadb:mariadb
ports:
- 12345:80
privileged: true
working_dir: ${PWD}
environment:
- PROJECT_DIR=${PWD}
networks:
- domjudge
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
- PMA_HOST=mariadb
- PMA_USER=domjudge
- PMA_PASSWORD=domjudge
ports:
- 8080:80
networks:
- domjudge
# judgehost
judge-01:
depends_on:
- domjudge
image: domjudge/judgehost:8.3.0
restart: always
privileged: true
hostname: judgehost
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
environment:
DAEMON_ID: 0
DOMSERVER_BASEURL: http://domjudge:80/
JUDGEDAEMON_PASSWORD: q0NjumUdiIsvn1pSqqyeC/Cph5pnX0JF
CONTAINER_TIMEZONE: Asia/Taipei
networks:
- domjudge

networks:
domjudge:
18 changes: 18 additions & 0 deletions etc/db-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@
- category: Display
description: Options related to the DOMjudge user interface.
items:
- name: default_submission_code_mode
type: int
default_value: 0
public: true
description: Select the default submission method for the team
options:
0: Paste
1: Upload
- name: output_display_limit
type: int
default_value: 2000
Expand Down Expand Up @@ -228,6 +236,16 @@
default_value: false
public: true
description: Show affiliation logos on the scoreboard?
- name: show_test_results
type: bool
default_value: true
public: true
description: Can the team see which test cases are correct or incorrect?
- name: show_first_wrong_testcase
type: bool
default_value: false
public: true
description: Display the first incorrect test case.
- name: show_teams_submissions
type: bool
default_value: true
Expand Down
58 changes: 58 additions & 0 deletions webapp/public/css/as6325400.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.result-container {
border: 1px solid #ddd;
padding: 20px;
margin: 20px;
border-radius: 10px;
background-color: #f9f9f9;
}

.text-danger {
color: #d9534f;
}

.text-success {
color: #5cb85c;
}

.input-section,
.output-section,
.expected-section {
margin-top: 10px;
max-height: 200px !important;
overflow-y: auto !important;
}

.input-item,
.input-value,
.output-value,
.expected-value {
font-size: 16px;
font-family: monospace;
padding: 5px;
background-color: #f0f0f0;
border-radius: 5px;
}

.visualization-note {
font-size: 14px;
color: #888;
}

.text-center {
text-align: center;
}

.editor-container {
border: 1px solid #ddd;
border-radius: 4px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
padding: 10px;
margin-top: 10px;
background-color: #fafafa;
max-height: 400px;
overflow: auto;
}

.editor-container:hover {
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
3 changes: 2 additions & 1 deletion webapp/src/Controller/Jury/SubmissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ public function viewAction(
->getQuery()
->getSingleScalarResult();
}

// $test = [1321, 3123,3123];
// print_r($test);
$twigData = [
'submission' => $submission,
'lastSubmission' => $lastSubmission,
Expand Down
2 changes: 0 additions & 2 deletions webapp/src/Controller/Team/MiscController.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,12 @@ public function homeAction(Request $request): Response
->addOrderBy('c.clarid', 'DESC')
->getQuery()
->getResult();

$data['clarifications'] = $clarifications;
$data['clarificationRequests'] = $clarificationRequests;
$data['categories'] = $this->config->get('clar_categories');
$data['allowDownload'] = (bool)$this->config->get('allow_team_submission_download');
$data['showTooLateResult'] = $this->config->get('show_too_late_result');
}

if ($request->isXmlHttpRequest()) {
$data['ajax'] = true;
return $this->render('team/partials/index_content.html.twig', $data);
Expand Down
Loading