Browse Source

testutils.py: oprava gitových mergů

export_seznamu_prednasek
Tomáš Domes 6 years ago
parent
commit
200efcbed0
  1. 31
      seminar/testutils.py

31
seminar/testutils.py

@ -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(
@ -180,8 +169,8 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size):
rnd.choice(jmeno),
rnd.choice(kde)]
)
p.vzorak = " - ".join([p.zadani, rnd.choice(reseni)])
>>>>>>> 69f9b54e7b5dbb36070d978d29d90987b1c9212b
p.vzorak = " - ".join([p.zadani, rnd.choice(reseni)])
p.opravovatele = rnd.sample(organizatori, poc_op)
p.save()
# reseni ulohy
@ -191,7 +180,6 @@ 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))
@ -201,21 +189,10 @@ def gen_ulohy_do_cisla(rnd, cislo, organizatori, resitele, slovnik_cisel, size):
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
return
def gen_soustredeni():
# TODO: vice soustredeni a k nim nahodne podmnoziny organizatoru a ucastniku

Loading…
Cancel
Save