version 1.65, 2002/05/13 23:59:42
|
version 1.68, 2002/06/13 00:16:10
|
Line 821 sub PrintTournament {
|
Line 821 sub PrintTournament {
|
} |
} |
} else { |
} else { |
my ($qnum) = GetQNum($dbh); |
my ($qnum) = GetQNum($dbh); |
$output .= h2("Банк Вопросов: $qnum вопросов") . p . "\n"; |
$output .= h2("Банк Вопросов: $qnum вопрос".&Suffix($qnum)) |
|
. p . "\n"; |
} |
} |
|
|
for ($i = 0; $i <= $#Tours; $i++) { |
for ($i = 0; $i <= $#Tours; $i++) { |
Line 1051 sub PrintQuestion {
|
Line 1052 sub PrintQuestion {
|
$output .= |
$output .= |
&PrintField("Вопрос $qnum", $Question{'Question'}, $text); |
&PrintField("Вопрос $qnum", $Question{'Question'}, $text); |
|
|
if ($answer) { |
if ($answer==1) { |
$output .= |
$output .= |
&PrintField("Ответ", $Question{'Answer'}, $text); |
&PrintField("Ответ", $Question{'Answer'}, $text); |
|
|
Line 1097 sub PrintQuestion {
|
Line 1098 sub PrintQuestion {
|
$output .= &PrintField("Комментарии", $Question{'Comments'}, $text); |
$output .= &PrintField("Комментарии", $Question{'Comments'}, $text); |
} |
} |
} |
} |
|
elsif ($answer==2) { |
|
my $text=$Question{'Answer'}; |
|
$text=~s/\n/<option>/mg; |
|
$output.="<select><option selected>Ответ:<option>$text</select>"; |
|
$text=$Question{'Comments'}||''; |
|
if ($text) { |
|
$text=~s/\n/<option>/mg; |
|
$output.="<select><option selected>Комментарий:<option>$text</select>" |
|
} |
|
} |
|
elsif ($answer==3) { |
|
$output.= <<EOTT |
|
<div align=right STYLE="cursor:hand;" OnStart="toggle(document.all.HideShow$qnum);" OnClick="toggle(document.all.HideShow$qnum);"> |
|
<font size=-2 color=red> Показать/убрать ответ</font></div> |
|
<span style="display:none" id=HideShow$qnum> |
|
EOTT |
|
.&PrintField("Ответ", $Question{'Answer'}, $text); |
|
if ($Question{'Authors'}) { |
|
$output .= &PrintField("Автор(ы)", $Question{'Authors'}, $text); |
|
} |
|
if ($Question{'Sources'}) { |
|
$output .= &PrintField("Источник(и)", $Question{'Sources'}, $text); |
|
} |
|
|
|
if ($Question{'Comments'}) { |
|
$output .= &PrintField("Комментарии", $Question{'Comments'}, $text); |
|
} |
|
|
|
|
|
$output.="</span>" |
|
|
|
} |
# $output.=br.a({href=> url."?metod=proxy&qid=$Id"}, 'Близкие вопросы').p |
# $output.=br.a({href=> url."?metod=proxy&qid=$Id"}, 'Близкие вопросы').p |
# if $answer; |
# if $answer; |
return $output; |
return $output; |
Line 1654 $sstr=~s/[^йцукенгшщзхъфывапролджэячсмит
|
Line 1687 $sstr=~s/[^йцукенгшщзхъфывапролджэячсмит
|
$sth->finish; |
$sth->finish; |
} |
} |
my $QuestionNumber=0; |
my $QuestionNumber=0; |
if (my $qnum=param('qnumber')){ |
my $qnum; |
|
if ($qnum=param('qnumber')){ |
my ($sth) = $dbh->prepare("SELECT QuestionId FROM Questions |
my ($sth) = $dbh->prepare("SELECT QuestionId FROM Questions |
WHERE ParentId=$tour AND Number=$qnum"); |
WHERE ParentId=$tour AND Number=$qnum"); |
$sth->execute; |
$sth->execute; |
$QuestionNumber=($sth->fetchrow)[0]||0; |
$QuestionNumber=($sth->fetchrow)[0]||0; |
} |
} |
if ($QuestionNumber) { |
if ($QuestionNumber) { |
|
print &PrintQuestion($dbh, $QuestionNumber, param('answer')||0, $qnum, 1); |
print &PrintQuestion($dbh, $QuestionNumber, param('answer'), 0, 1); |
# $dbh, $Id, $answer, $qnum, $title, $text |
} else { |
} else { |
print &PrintTournament($dbh, $tour, param('answer')); |
print &PrintTournament($dbh, $tour, param('answer')); |
} |
} |
} |
} |
if (!$text) { |
if (!$text) { |
print &Include_virtual("../dimrub/db/footer.html"); |
print &Include_virtual("../dimrub/db/footer.html"); |
|
print <<EEE |
|
<SCRIPT LANGUAGE="JavaScript"> |
|
function toggle(e) { |
|
if (e.style.display == "none") { |
|
e.style.display=""; |
|
} else { |
|
e.style.display = "none"; |
|
} |
|
} |
|
</SCRIPT> |
|
EEE |
|
; |
print end_html; |
print end_html; |
} |
} |
$dbh->disconnect; |
$dbh->disconnect; |