Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
adc2019-system
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
adc2019
adc2019-system
Commits
491bda31
Commit
491bda31
authored
Aug 13, 2019
by
Kento HASEGAWA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add filling rates and highlights to the problem list
parent
8d492bac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
5 deletions
+37
-5
adc2019.css
static/css/adc2019.css
+11
-0
part_problem_status.html
templates/part_problem_status.html
+0
-2
part_problems.html
templates/part_problems.html
+10
-2
data.py
utils/data.py
+16
-1
No files found.
static/css/adc2019.css
View file @
491bda31
...
@@ -37,11 +37,22 @@ body{
...
@@ -37,11 +37,22 @@ body{
#problem-list-container
tr
.problem-row.q-selected
{
#problem-list-container
tr
.problem-row.q-selected
{
background-color
:
rgba
(
200
,
100
,
100
,
.3
);
background-color
:
rgba
(
200
,
100
,
100
,
.3
);
border
:
2px
solid
#888
;
}
}
#problem-list-container
tr
.problem-row
:hover
{
#problem-list-container
tr
.problem-row
:hover
{
background-color
:
rgba
(
200
,
100
,
100
,
.15
);
background-color
:
rgba
(
200
,
100
,
100
,
.15
);
}
}
#problem-list-container
tr
.problem-row.solution-tried
{
background-color
:
rgba
(
200
,
200
,
100
,
0.3
);
}
#problem-list-container
tr
.problem-row.solution-solved
{
background-color
:
rgba
(
100
,
200
,
200
,
0.3
);
}
#problem-list-container
tr
.problem-row.solution-saved
{
background-color
:
rgba
(
100
,
200
,
100
,
0.3
);
}
#client-control-pane
{
#client-control-pane
{
height
:
calc
(
100vh
-
20px
);
height
:
calc
(
100vh
-
20px
);
overflow-y
:
scroll
;
overflow-y
:
scroll
;
...
...
templates/part_problem_status.html
View file @
491bda31
...
@@ -25,9 +25,7 @@
...
@@ -25,9 +25,7 @@
{% set tr_class = '' %}
{% set tr_class = '' %}
{% set tr_class = tr_class + ' submit-solution' if k == problem.best_solution else '' %}
{% set tr_class = tr_class + ' submit-solution' if k == problem.best_solution else '' %}
{% set tr_class = tr_class + ' valid-solution' if v.is_valid_solution() else '' %}
{% set tr_class = tr_class + ' valid-solution' if v.is_valid_solution() else '' %}
{#% else %#}
<tr
class=
"solution-detail-row {{tr_class}}"
data-solution-id=
"{{k}}"
data-problem=
"{{problem.name}}"
>
<tr
class=
"solution-detail-row {{tr_class}}"
data-solution-id=
"{{k}}"
data-problem=
"{{problem.name}}"
>
{#% endif %#}
<td>
{{v.timestamp_str}}
</td>
<td>
{{v.timestamp_str}}
</td>
<td>
{{v.worker}}
</td>
<td>
{{v.worker}}
</td>
<td>
<td>
...
...
templates/part_problems.html
View file @
491bda31
...
@@ -12,10 +12,18 @@
...
@@ -12,10 +12,18 @@
</thead>
</thead>
<tbody>
<tbody>
{% for k, v in problems.items() %}
{% for k, v in problems.items() %}
<tr
class=
"problem-row"
data-problem=
"{{v.name}}"
>
{% set tr_class = '' %}
{% if v.status == 'Saved' %}
{% set tr_class = 'solution-saved' %}
{% elif v.status.startswith('Solved') %}
{% set tr_class = 'solution-solved' %}
{% elif v.status.startswith('Tried') %}
{% set tr_class = 'solution-tried' %}
{% endif %}
<tr
class=
"problem-row {{tr_class}}"
data-problem=
"{{v.name}}"
>
<td
class=
"large-cell"
>
{{v.name}}
</td>
<td
class=
"large-cell"
>
{{v.name}}
</td>
<td
class=
"small-cell"
>
<td
class=
"small-cell"
>
{{v.size_str}}
<br
/>
{{v.size_str}}
[{{'{:,.1f}%'.format(v.filling_rate * 100)}}]
<br
/>
{{v.block_num}} /
{{v.block_num}} /
{{v.line_numbers | length - 1}} /
{{v.line_numbers | length - 1}} /
{{v.block_groups | length}}
{{v.block_groups | length}}
...
...
utils/data.py
View file @
491bda31
...
@@ -15,8 +15,8 @@ class Problem(object):
...
@@ -15,8 +15,8 @@ class Problem(object):
self
.
size
=
(
0
,
0
)
self
.
size
=
(
0
,
0
)
self
.
block_num
=
0
self
.
block_num
=
0
self
.
blocks
=
dict
()
self
.
blocks
=
dict
()
self
.
tile_num
=
0
self
.
problem
=
''
self
.
problem
=
''
# self.status = 'Ready'
self
.
solutions
=
dict
()
self
.
solutions
=
dict
()
self
.
solution_path
=
solution_path
self
.
solution_path
=
solution_path
self
.
best_solution
=
None
self
.
best_solution
=
None
...
@@ -29,6 +29,17 @@ class Problem(object):
...
@@ -29,6 +29,17 @@ class Problem(object):
@
property
@
property
def
size_str
(
self
):
def
size_str
(
self
):
return
f
'{self.size[0]}X{self.size[1]}'
return
f
'{self.size[0]}X{self.size[1]}'
@
property
def
board_area
(
self
):
return
self
.
size
[
0
]
*
self
.
size
[
1
]
@
property
def
filling_rate
(
self
):
if
self
.
board_area
==
0
:
return
0
else
:
return
self
.
tile_num
/
self
.
board_area
@
property
@
property
def
problem_text
(
self
):
def
problem_text
(
self
):
...
@@ -91,6 +102,8 @@ class Problem(object):
...
@@ -91,6 +102,8 @@ class Problem(object):
block_num
=
0
block_num
=
0
blocks
=
dict
()
blocks
=
dict
()
tile_num
=
0
def
intplus
(
v
):
def
intplus
(
v
):
if
v
.
isdecimal
():
if
v
.
isdecimal
():
return
int
(
v
)
return
int
(
v
)
...
@@ -133,6 +146,7 @@ class Problem(object):
...
@@ -133,6 +146,7 @@ class Problem(object):
if
not
_line_num
in
line_number_list
:
if
not
_line_num
in
line_number_list
:
line_number_list
.
append
(
_line_num
)
line_number_list
.
append
(
_line_num
)
# _line_num = line_number_list.index(_line_num)
# _line_num = line_number_list.index(_line_num)
tile_num
+=
1
# Make connection list
# Make connection list
if
not
bi
in
block_to_line
:
if
not
bi
in
block_to_line
:
...
@@ -152,6 +166,7 @@ class Problem(object):
...
@@ -152,6 +166,7 @@ class Problem(object):
self
.
size
=
board_size
self
.
size
=
board_size
self
.
block_num
=
block_num
self
.
block_num
=
block_num
self
.
blocks
=
blocks
self
.
blocks
=
blocks
self
.
tile_num
=
tile_num
self
.
name
=
name
self
.
name
=
name
self
.
problem
=
q_text
self
.
problem
=
q_text
self
.
line_numbers
=
line_number_list
self
.
line_numbers
=
line_number_list
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment