|
|
@ -125,11 +125,7 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size): |
|
|
|
''' |
|
|
|
cislo = cislo cisla v rocniku, nikoli objekt Cislo |
|
|
|
''' |
|
|
|
<<<<<<< HEAD |
|
|
|
======= |
|
|
|
|
|
|
|
>>>>>>> 69f9b54e7b5dbb36070d978d29d90987b1c9212b |
|
|
|
# ulohy resene v ci |
|
|
|
# ulohy resene v cisle |
|
|
|
jaka = ["Šachová", "Černá", "Větrná", "Dlouhá", "Křehká", "Rychlá", |
|
|
|
"Zákeřná", "Fyzikální"] |
|
|
|
co = ["kostka", "smršť", "díra", "zrada", "toulka", "tyč", |
|
|
@ -164,13 +160,6 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size): |
|
|
|
cislo_zadani=slovnik_cisel[cislo-2], |
|
|
|
cislo_reseni=slovnik_cisel[cislo], |
|
|
|
cislo_deadline=slovnik_cisel[cislo], |
|
|
|
<<<<<<< HEAD |
|
|
|
max_body = rnd.randint(1, 8)) |
|
|
|
p.zadani = " ".join([rnd.choice(sloveso), rnd.choice(koho), |
|
|
|
rnd.choice(ceho), rnd.choice(jmeno), rnd.choice(kde)]) |
|
|
|
p.vzorak = " - ".join([p.zadani, rnd.choice(reseni)]) |
|
|
|
p.opravovatele = rnd.sample(organizatori, poc_op) |
|
|
|
======= |
|
|
|
max_body = rnd.randint(1, 8) |
|
|
|
) |
|
|
|
p.zadani = " ".join( |
|
|
@ -181,7 +170,7 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size): |
|
|
|
rnd.choice(kde)] |
|
|
|
) |
|
|
|
p.vzorak = " - ".join([p.zadani, rnd.choice(reseni)]) |
|
|
|
>>>>>>> 69f9b54e7b5dbb36070d978d29d90987b1c9212b |
|
|
|
p.opravovatele = rnd.sample(organizatori, poc_op) |
|
|
|
p.save() |
|
|
|
|
|
|
|
# reseni ulohy |
|
|
@ -191,30 +180,18 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size): |
|
|
|
# (nebo skoro vsechny resitele, pokud jich je mene nez pocet reseni) |
|
|
|
res_vyber = rnd.sample(resitele, min(poc_reseni, len(resitele) - 2)) |
|
|
|
for resitel in res_vyber: |
|
|
|
<<<<<<< HEAD |
|
|
|
# problem a resitele přiřadíme později, ManyToManyField |
|
|
|
# se nedá vyplnit v create() |
|
|
|
res = Reseni.objects.create(forma=rnd.choice(Reseni.FORMA_CHOICES)) |
|
|
|
res.resitele = [resitel] |
|
|
|
res.problem = p |
|
|
|
res.save() |
|
|
|
hod = Hodnoceni.objects.create( |
|
|
|
body=rnd.randint(0, p.max_body), |
|
|
|
cislo_body=slovnik_cisel[cislo], |
|
|
|
reseni=res, problem=p) |
|
|
|
======= |
|
|
|
res = Reseni.objects.create( |
|
|
|
problem = p, |
|
|
|
resitele=[resitel], |
|
|
|
forma=rnd.choice(Reseni.FORMA_CHOICES) |
|
|
|
) |
|
|
|
hod = Hodnoceni.objects.create( |
|
|
|
body=rnd.randint(0, p.max_body), |
|
|
|
cislo_body=slovnik_cisel[cislo], |
|
|
|
reseni=res, |
|
|
|
problem=p |
|
|
|
) |
|
|
|
>>>>>>> 69f9b54e7b5dbb36070d978d29d90987b1c9212b |
|
|
|
return |
|
|
|
|
|
|
|
def gen_soustredeni(): |
|
|
|