#!/usr/bin/perl
require 'parse.pl';
&parse_form;
$mainf="evalresult.txt";
print "Content-type: text/html\n\n";
print "<body bgcolor=#fffffd>";
open(STDIN, $mainf );
@ar = <STDIN>;
close(STDIN);
$cntar = @ar;
for $i (0 .. $cntar-1) {
@rg = split (',',$ar[$i]);
$cntrg = split (',',$ar[$i]);
if ($rg[0] eq $v{'id'} && $rg[1] eq $v{'subj'}) { $found=1; }
}
print "แบบประเมิน<br>รหัส: $v{'id'} Subject: ",substr($v{'subj'},0,6);
print " Section: ",substr($v{'subj'},6,2),"<hr>";
if ($found eq "1") { print "ประเมิน วิชานี้ไปแล้ว"; exit; }
print '<FORM ACTION=evalsave.pl METHOD=POST>';
print "<input type=hidden name=id value=$v{'id'}>";
print "<input type=hidden name=subj value=$v{'subj'}>";
print "<table width=100%><tr><td>OPT</td>";
print '<td>Criterion</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td></tr>';
print "<tr><td><input type=radio name=q11 value=0 checked></td>";
print '<td>1.1 นำเสนอเข้าใจง่าย</td>';
for($i=5;$i>=1;$i--){print"<td><input type=radio name=q11 value=$i></td>";}
print "</tr><tr><td><input type=radio name=q12 value=0 checked></td>";
print '<td>1.2 การวัดผลยุติธรรม</td>';
for($i=5;$i>=1;$i--){print"<td><input type=radio name=q12 value=$i></td>";}
print "</tr><tr><td><input type=radio name=q13 value=0 checked></td>";
print '<td>1.3 มีแผนการสอนชัดเจน</td>';
for($i=5;$i>=1;$i--){print"<td><input type=radio name=q13 value=$i></td>";}
print "</tr></table>";
print '4. ความคิดเห็นอื่น<br>';
print '<textarea name=qopen rows=3 cols=75></textarea><br>';
print '<INPUT TYPE=submit VALUE=Save></form></body>';
จำนวน : 36 บรรทัด