--- db/prgsrc/db.cgi 2002/05/10 16:42:40 1.64 +++ db/prgsrc/db.cgi 2002/05/13 23:59:42 1.65 @@ -1026,6 +1026,8 @@ sub PrintQuestion { my ($dbh, $Id, $answer, $qnum, $title, $text) = @_; my ($output, $titles) = ('', ''); my (%Question) = &GetQuestion($dbh, $Id); + $qnum = $Question{'Number'} + if ($qnum == 0); if (!$text) { $output .= hr({width=>"50%"}); if ($title) { @@ -1038,13 +1040,13 @@ sub PrintQuestion { a({href=>url . "?tour=$fname"}, $Tournament{'Title'}, $Tournament{'PlayedAt'})); $titles .= dl(dd(img({src=>"/icons/folder.open.gif"}) . " " . - a({href=>url . "?tour=$fname.$Tour{Number}"}, $Tour{'Title'}))); + a({href=>url . "?tour=$fname.$Tour{Number}#$qnum"}, $Tour{'Title'}))); } $output .= dl(strong($titles)); } - $qnum = $Question{'Number'} - if ($qnum == 0); + + $output.= ""; $output .= &PrintField("Вопрос $qnum", $Question{'Question'}, $text); @@ -1651,7 +1653,19 @@ $sstr=~s/[^йцукенгшщзхъфывапролджэячсмит $tour = ($sth->fetchrow)[0]; $sth->finish; } - print &PrintTournament($dbh, $tour, param('answer')); + my $QuestionNumber=0; + if (my $qnum=param('qnumber')){ + my ($sth) = $dbh->prepare("SELECT QuestionId FROM Questions + WHERE ParentId=$tour AND Number=$qnum"); + $sth->execute; + $QuestionNumber=($sth->fetchrow)[0]||0; + } + if ($QuestionNumber) { + + print &PrintQuestion($dbh, $QuestionNumber, param('answer'), 0, 1); + } else { + print &PrintTournament($dbh, $tour, param('answer')); + } } if (!$text) { print &Include_virtual("../dimrub/db/footer.html");