X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=html%2Fdo-start-round.pl;h=ff0a4178068b46e1273794bb2d1d5981d9984e78;hp=2e503bbb8f5ca1cb3a20527221d21724633ad951;hb=81edbdf60931cc5343964a86e95a43a4dfd6d103;hpb=503f2b80dd3991ae1c49806117294a820be39e89 diff --git a/html/do-start-round.pl b/html/do-start-round.pl index 2e503bb..ff0a417 100755 --- a/html/do-start-round.pl +++ b/html/do-start-round.pl @@ -55,6 +55,17 @@ for my $g (1..$num_groups) { my $ref = $dbh->selectrow_hashref('SELECT * FROM songs ORDER BY random() LIMIT 1'); $dbh->do('INSERT INTO roundrandomsongs (tournament, round, parallel, song) VALUES (?,?,?,?)', undef, $tournament, $round, $g, $ref->{'song'}); + + $dbh->do('INSERT INTO scores SELECT tournament,round,parallel,player,?,?,NULL,NULL,\'f\',NULL FROM roundparticipation WHERE tournament=? AND round=? AND parallel=?', undef, + $s, $ref->{'song'}, $tournament, $round, $g); + } +} + +# Add empty "score" records for the chosen songs. +for my $g (1..$num_groups) { + for my $s (1..$num_chosen) { + $dbh->do('INSERT INTO scores SELECT tournament,round,parallel,player,?,NULL,NULL,NULL,\'t\',NULL FROM roundparticipation WHERE tournament=? AND round=? AND parallel=?', undef, + $s + $num_random, $tournament, $round, $g); } }