Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
07d3b23c
Commit
07d3b23c
authored
4 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Odkaz na stažení všech řešení
Zatím jenom u celkové tabulky bodů.
parent
47c8afe2
No related branches found
No related tags found
2 merge requests
!14
Asynchronní joby
,
!9
WIP: Zárodek uživatelské části webu a submitování
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/web/org_contest.py
+9
-2
9 additions, 2 deletions
mo/web/org_contest.py
mo/web/templates/org_contest_solutions.html
+4
-1
4 additions, 1 deletion
mo/web/templates/org_contest_solutions.html
with
13 additions
and
3 deletions
mo/web/org_contest.py
+
9
−
2
View file @
07d3b23c
...
...
@@ -16,6 +16,7 @@ import mo
import
mo.csv
import
mo.db
as
db
import
mo.imports
import
mo.jobs.submit
import
mo.rights
from
mo.rights
import
Right
,
Rights
import
mo.util
...
...
@@ -426,8 +427,8 @@ def make_contestant_table(query: Query, add_checkbox: bool = False, add_contest_
)
@app.route
(
'
/org/contest/c/<int:id>/reseni
'
)
@app.route
(
'
/org/contest/c/<int:id>/site/<int:site_id>/reseni
'
)
@app.route
(
'
/org/contest/c/<int:id>/reseni
'
,
methods
=
(
'
GET
'
,
'
POST
'
)
)
@app.route
(
'
/org/contest/c/<int:id>/site/<int:site_id>/reseni
'
,
methods
=
(
'
GET
'
,
'
POST
'
)
)
def
org_contest_solutions
(
id
:
int
,
site_id
:
Optional
[
int
]
=
None
):
contest
,
site
,
rr
=
get_contest_site_rr
(
id
,
site_id
,
Right
.
manage_contest
)
...
...
@@ -456,6 +457,12 @@ def org_contest_solutions(id: int, site_id: Optional[int] = None):
joinedload
(
db
.
Solution
.
final_feedback_obj
)
).
all
()
if
request
.
method
==
'
POST
'
and
'
download
'
in
request
.
form
:
paper_ids
=
[
sol
.
final_submit
for
sol
in
sols
if
sol
.
final_submit
is
not
None
]
mo
.
jobs
.
submit
.
schedule_download_submits
(
paper_ids
,
'
Odevzdaná řešení
'
,
g
.
user
)
flash
(
'
Příprava řešení ke stažení zahájena.
'
,
'
success
'
)
return
redirect
(
url_for
(
'
org_jobs
'
))
task_sols
:
Dict
[
int
,
Dict
[
int
,
db
.
Solution
]]
=
{}
for
t
in
tasks
:
task_sols
[
t
.
task_id
]
=
{}
...
...
This diff is collapsed.
Click to expand it.
mo/web/templates/org_contest_solutions.html
+
4
−
1
View file @
07d3b23c
...
...
@@ -49,7 +49,6 @@ konkrétní úlohu.</p>
{% else %}–{% endif %}
<td
class=
"sol"
>
{% else %}
<td
colspan=
3
>
–
<td>
{% endif %}
<a
class=
"btn btn-xs btn-link"
title=
"Detail řešení"
href=
"{{ url_for('org_submit_list', contest_id=contest.contest_id, user_id=u.user_id, task_id=task.task_id, site_id=site_id) }}"
>
🔍
</a>
{% endfor %}
<th>
{{ sum_points|sum }}
</th>
...
...
@@ -57,4 +56,8 @@ konkrétní úlohu.</p>
{% endfor %}
</table>
<form
method=
POST
action=
""
>
<button
type=
submit
name=
download
value=
go
>
Stáhnout všechna řešení jako ZIP
</button>
</form>
{% endblock %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment