Web M&M
https://mam.matfyz.cz
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
966 B
38 lines
966 B
3 years ago
|
from .utils import data_vysledkovky_cisla, \
|
||
|
data_vysledkovky_rocniku
|
||
|
|
||
|
|
||
|
def vysledkovka_cisla(cislo, context=None):
|
||
|
if context is None:
|
||
|
context = {}
|
||
|
context['cislo'] = cislo
|
||
|
|
||
|
(
|
||
|
context['radky_vysledkovky'],
|
||
|
context['problemy'],
|
||
|
context['ostatni'],
|
||
|
context['podproblemy'],
|
||
|
context['podproblemy_iter']
|
||
|
) = data_vysledkovky_cisla(cislo)
|
||
|
return context
|
||
|
|
||
|
|
||
|
def vysledkovka_rocniku(rocnik, context=None, request=None, sneverejnou=False):
|
||
|
if context is None:
|
||
|
context = {}
|
||
|
|
||
|
(
|
||
|
context['radky_vysledkovky'],
|
||
|
context['cisla']
|
||
|
) = data_vysledkovky_rocniku(rocnik)
|
||
|
|
||
|
context['vysledkovka'] = len(context['cisla']) != 0
|
||
|
|
||
|
if sneverejnou and request and request.user.je_org:
|
||
|
(
|
||
|
context['radky_vysledkovky_s_neverejnymi'],
|
||
|
context['cisla_s_neverejnymi']
|
||
|
) = data_vysledkovky_rocniku(rocnik, jen_verejne=False)
|
||
|
|
||
|
return context
|