Viewing file: 2551-11-14-1.0.02-resultCourseTeachTQ.php (19.08 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
include_once "../../class/clsDB.php";
include_once "../../class/clsConnection.php";
include_once "../global.php";
include_once "../link/function.php";
include_once "../class/clsReg_SysSemesterDes.php";
include_once "../class/clsReg_Program.php";
include_once "../class/clsRegistration.php";
include_once "../class/clsCourseAssess.php";
include_once "../class/clsClassAssess.php";
include_once "../class/clsClassOpenForAssess.php";
include_once "../class/clsClassInStructorAssess.php";
include_once "../class/clsOfficerAssess.php";
include_once "../class/clsDefineAssessment.php";
include_once "../class/clsAssessForm.php";
include_once "../class/clsDoAssessment.php";
include_once "../class/clsSectionAll.php";
include_once "../class/clsSectionTQ.php";
include_once "../class/clsTextQuestion.php";
include_once "../class/clsResultTQ.php";
include_once "../class/clsTimeTableAssess.php";
tabChoose();
confirmSubmit();
openWindow();
$oCR = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB_REG'], $GLOBALS['USER_REG'], $GLOBALS['PASSWORD_REG']);
$oCA = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB_EASS'], $GLOBALS['USER_EASS'], $GLOBALS['PASSWORD_EASS']);
$oTTA=new TimeTableAssess($oCA);
$oCourse = new CourseAssess($oCA);
$oCourse->SearchByKey($courseId);
$oCourse->GetRecord();
$oDo = new DoAssessment($oCA);
$oClsOpen = new ClassOpenForAssess($oCA);
$oClass = new ClassAssess($oCA);
$oClass->SearchByKey($classId);
$oClass->GetRecord();
$oOFA = new OfficerAssess($oCA);
$oOFA->SearchByKey($officerId);
$oOFA->GetRecord();
$oProg = new Program($oCR);
$numAllCourseReg=0;
$oReg = new Registration($oCA);
$oReg->RSByClassIdAcYSe($classId,$acadYear,$semester);
while($oReg->GetRecord()){
$oCIS = new ClassInStructorAssess($oCA);
$oCIS->SearchByClassIdOfficerId($oReg->classId,$officerId);
if($oCIS->GetRecord()){
$numAllCourseReg++;
}
}
$numAllDo=$numAllCourseReg;
// หลายสัปดาห์
if($officerId != 0 && $ttId==0){
$week=0;
$oTTA->RSJoinHCByDefineidClIdOfId($defineid,$classId,$officerId);
while($oTTA->GetRecord()){
$week++;
}
$numAllDo=$numAllCourseReg*$week;
}
$numCourseDoAss = 0;
if($officerId == 0){
$oDo->SearchByDefineIdClassId($defineid,$classId);
while($oDo->GetRecord()){
$numCourseDoAss++;
}
}else{
if($ttId==0){
$numCourseDoAss=$oDo->CountDoidByDefineIdClassIdOfficeridSection($defineid,$classId,$officerId,$oClass->section);
// $numCourseDoAss=$oDo->CountDistinctStdByDefineidOfficeridClassId($defineid,$officerId,$classId);
}else{
$numCourseDoAss=$oDo->CountDistinctStdByDefineidOfficeridClassIdttId($defineid,$officerId,$classId,$ttId);
// $numCourseDoAss=$oDo->CountDistinctStdByDefineidOfficeridClassId($defineid,$officerId,$classId);
}
}
$now = GetNowDate();
list($y, $m, $d) = split('[-]', $now);
$y=$y+543;
$nowDate=$y."-".$m."-".$d;
$oAF = new AssessForm($oCA);
$oAF->RSAssessFormByAssid($assid);
$oAF->GetRecord();
$oSse = new SysSemesterDes($oCR);
$oSse->SearchByKey($semester);
$oSse->GetRecord();
$oDA = new DefineAssessment($oCA);
$oDA->SearchByDefineid($defineid);
$oDA->GetRecord();
//ค้นหาคำถามปลายเปิดในแบบประเมินนี้ sectionRQid > 0
$oSA = new SectionAll($oCA);
$CntSRQid = $oSA->RSCountSectionRQid($assid);
?>
<title>รายงานทั่วไปของการประเมิน โดยจำแนกตามลักษณะคำถาม/ส่วน/หัวข้อการประเมิน</title>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="../source/style.css" rel="stylesheet" type="text/css">
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <br>
<div id="tabmargin">
<form name="pc" method="post" action="<?php echo $PHP_SELF;?>" enctype="multipart/form-data">
<div align="center">
<table width="658" border="0">
<tr>
<? if($CntSRQid != 0) { ?>
<td width="455" height="29" ><div align="right"></div></td>
<td width="110" background="../picture/coverBG1.gif"><div align="center"><a href="resultCourseTeachRQ.php?defineid=<? echo $defineid ?>&assid=<? echo $assid ?>&officerId=<? echo $officerId ?>&officerCode=<? echo $officerCode ?>&classId=<? echo $classId ?>&courseId=<? echo $courseId ?>&acadYear=<? echo $acadYear?>&semester=<? echo $semester ?>&ttId=<?=$ttId ?>"><img src="../picture/RQ.png" border="0"><font size="2"> คำถามปลายปิด</font></a></div></td>
<td width="110" background="../picture/coverBG.gif"><div align="center"><font size="2"> <img src="../picture/TQ.png" border="0">
คำถามปลายเปิด</font></div></td>
<? } else { ?>
<td width="455" height="29" ><div align="right"></div></td>
<td width="110" > </td>
<td width="110" background="../picture/coverBG.gif"><div align="center"><img src="../picture/TQ.png"><font size="2"> คำถามปลายเปิด</font></div></td>
<? } ?>
</tr>
</table>
<table width="655" align="center" cellpadding="1" cellspacing="1" bgcolor="#0080C0">
<tr bgcolor="#FFFFFF">
<td>
<table width="649" align="center" border="0" cellpadding="0" cellspacing="1">
<tr>
<td width="647"> <table width="646" border="0" align="center">
<tr>
<td height="10"></td>
</tr>
</table>
<table width="612" align="center" cellpadding="1" cellspacing="1" bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_6'];?>">
<tr>
<td height="22" align="center"><font size="2"><span class = "fontMark5">รายงานทั่วไปของการประเมิน
โดยจำแนกตามลักษณะคำถาม/ส่วน/หัวข้อการประเมิน </span></font></td>
</tr>
<tr>
<td width="606" height="22" align="center"><font size="2"><span class = "fontMark6"> ส่วนของคำถามปลายเปิด : ชนิดให้เลือกตอบได้อย่างอิสระ</span></font></td>
</tr>
</table>
<table width="95%" border="0" align="center">
<tr>
<td><hr></td>
</tr>
</table>
<br>
<table width="100%" border="0" align="center">
<tr>
<td><font size="2"><b><img src="../picture/bullet.gif">
ชื่อทางการแบบประเมิน</b></font></td>
<td colspan="3"><font size="2"><b>: </b>
<? if($oAF->maintopic == ""){ echo "-"; }else{ echo $oAF->maintopic; } ?>
</font></td>
</tr>
<tr bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_11'];?>">
<td><font size="2"><b><img src="../picture/bullet.gif">
ชื่อทั่วไปแบบประเมิน</b></font></td>
<td colspan="3"><font size="2"><b>: </b><? echo $oAF->nameAss ?></font></td>
</tr>
<tr>
<td width="164"><font size="2"><b><img src="../picture/bullet.gif">
ปีการศึกษา</b></font></td>
<td colspan="3"><font size="2"><b>: </b></font><? echo $acadYear ?>
/ <? echo $oSse->semesterName;?></td>
</tr>
<tr bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_11'];?>">
<td height="22" <? if(($oClass->programId == 0) || ($oClass->programId == "")){ echo "valign=\"baseline\""; } ?>><font size="2"><b><img src="../picture/bullet.gif"> หลักสูตร</b></font></td>
<td colspan="3"><font size="2"><b>: </b></font><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>">
<? if(($oClass->programId == 0) || ($oClass->programId == "")){
$z = 0;
$oClsOpen->SearchByClassId($oClass->classId);
while($oClsOpen->GetRecord()){
$oProg->SearchByKey($oClsOpen->programId);
$oProg->GetRecord();
$arrCls[$z] = $oProg->programName;
$z++;
} // end while oClsOpen
for($a=0;$a<=$z;$a++){
echo $arrCls[$a];
if($a < $z-1) echo ",<br> ";
}
}else{
$oProg->SearchByKey($oClass->programId);
$oProg->GetRecord();
echo $oProg->programName;
}
?>
</font></td>
</tr>
<tr>
<td width="164"><font size="2"><b><img src="../picture/bullet.gif">
รหัสรายวิชา</b></font></td>
<td width="136"><font size="2"><b>: </b></font><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><?php echo $oCourse->courseCode?>
(<?php echo $oCourse->courseCodeEng?>)</font></td>
<td width="130"> </td>
<td width="150"> </td>
</tr>
<tr bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_11'];?>">
<td height="22"><font size="2"><b><img src="../picture/bullet.gif">
ชื่อรายวิชา</b></font></td>
<td colspan="3"><font size="2"><b>: </b></font><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><?php echo $oCourse->courseName?></font><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>">
(<?php echo $oCourse->courseNameEng?>) </font></td>
</tr>
<tr>
<td height="22"><font size="2"><b><img src="../picture/bullet.gif">
ช่วงเวลาประเมิน</b></font></td>
<td colspan="2"><font size="2"><b>: </b></font><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><? echo abbreDate(splitDateDb2($oDA->startDate,'/')); ?>
- <? echo abbreDate(splitDateDb2($oDA->endDate,'/')); ?></font></td>
<td height="22" ><font size="2"><b><img src="../picture/bullet.gif">
ชั้นปี : </b></font><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><?php echo $oClass->studentYear?> </font><font size="2"><b>
<img src="../picture/bullet.gif" /> กลุ่ม : </b></font><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><?php echo $oClass->section?></font></td>
</tr>
<tr bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_11'];?>">
<td height="22"><font size="2"><b><img src="../picture/bullet.gif">
ประเมินอาจารย์</b></font></td>
<? if($officerId!=0){ ?> <td ><? }else {?><td colspan="3"><? }?>
<font size="2"><b>: </b></font><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>">
<?php if($officerId == ""){ ?>
<font size="2" color="<?php echo $GLOBALS['COLOR_FONT_3'];?>"><? echo "- ไม่พบรายชื่ออาจารย์ผู้สอน -"; ?></font>
<? }else if($officerId == 0){
$t=0;
$oCIS->SearchByClassIdGroupClassIdOfficerId($classId);
while($oCIS->GetRecord()){
$oOFA->SearchByKey($oCIS->officerId);
$oOFA->GetRecord();
$Teachers[$t] = "อ.".$oOFA->officerName." ".$oOFA->officerSurname;
$t++;
}
echo "<img src=\"../picture/usersGp.gif\" border =\"0\"> ";
for($s=0;$s<$t;$s++){
echo $Teachers[$s];
if($s<$t-1){
echo ", ";
}
}
}else{
$oOFA->SearchByKey($officerId);
$oOFA->GetRecord();
echo $oOFA->prefixName.$oOFA->officerName." ".$oOFA->officerSurname;
} ?>
</font></td>
<? if($oDA->flag==7){ ?>
<td align="left" colspan="2"><img src="../picture/bullet.gif" /><font size="2"><b> สัปดาห์ที่ : </b></font>
<? if($ttId!=0){
$oTTA->SearchTimeTableByttId($ttId);
$oTTA->GetRecord();
echo $oTTA->ttWdAcYWeekNo;
}else{
$i=0;
$oTTA->RSJoinHCByDefineidClIdOfId($defineid,$classId,$officerId);
while($oTTA->GetRecord()){
if($i>=1)
echo " , " ;
echo $oTTA->ttWdAcYWeekNo;
$i=$i+1;
}
}
?> </td>
<? } ?>
</tr>
<tr>
<td height="22" colspan="2"><font size="2"><b><img src="../picture/bullet.gif"> นักศึกษาที่ลงทะเบียน : </b><?=$numAllCourseReg ?><b> คน</b></font></td>
<? if($oDA->flag==7) {?>
<td height="22" colspan="2"><img src="../picture/bullet.gif" /><font size="2"><b> ประเมิน : </b>
<? if($ttId!=0) echo '1'; else echo $i; ?>
<b> สัปดาห์</b></font></td>
<? }else{ ?> <td height="22" colspan="2"> </td> <? }?>
</tr>
<? if($oDA->flag==7) {?>
<tr bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_11'];?>">
<td height="22" colspan="2"><font size="2"><b><img src="../picture/bullet.gif">
จำนวนครั้งที่ต้องประเมิน : </b></font><font size="2" color="<?php echo $GLOBALS['COLOR_FONT_4'];?>"><?=$numAllDo?><b> ครั้ง</b></font></td>
<td height="22" colspan="2"><font size="2"><b><img src="../picture/bullet.gif">
จำนวนครั้งที่เข้ามาประเมิน : </b></font><font size="2"> <? echo $numCourseDoAss ?>
<b> ครั้ง</b></font></td>
</tr>
<? }// end $officerId!=0?>
<tr>
<? if($oDA->flag==7) {?>
<td height="22" colspan="2"> </td>
<? }else{?>
<td height="22" colspan="2"><font size="2"><b><img src="../picture/bullet.gif">
นักศึกษาที่เข้าประเมิน : </b></font><font size="2"> <? echo $numCourseDoAss ?>
<b> คน</b></font></td>
<? $numAllDo=$numAllCourseReg;} ?>
<td height="22" colspan="2"><font size="2"><b><img src="../picture/bullet.gif">
ร้อยละเฉลี่ยการเข้ามาประเมิน : </b></font><font size="2">
<? $percentDo = ($numCourseDoAss/$numAllDo)*100; printf ("%.2f",$percentDo);?>
</font></td>
</tr>
<tr><td colspan="4"> </td></tr>
</table>
<?
$oSA = new SectionAll($oCA);
$numSection= $oSA->RSCountSectionAll($assid);
$oSA->RSByKeyAss($assid);
$i = 1;
$indexSection = 1;
while ($oSA->GetRecord()){
/*---------------- กรณีที่เลือกเป็นคำถามชนิดปลายปิด------------------*/
//สร้าง oSRQ แสดงหัวข้อของส่วนการประเมิน
if($oSA->sectionTQid != '0'){
$oSTQ = new SectionTQ($oCA);
$oSTQ->RSSectionTQAll($assid,$oSA->sectionTQid);
while($oSTQ->GetRecord()){
?>
<!--------------------------------- Tab1 คำถามปลายปิด -------------------------------------------->
<table width="582" align="center">
<tr>
<td colspan="4" align="right"> :</td>
</tr>
<tr>
<td colspan="3"><font size="2"><span class = "fontMarkTD1"><? if($numSection == '1') { echo "คำอธิบาย"; } else { echo "ส่วนที่ ".$indexSection; }?></span> : </font></td>
<td width="518"><font size="2"><? echo $oSTQ->topicSectionTQ ?></font></td>
</tr>
</table>
<br>
<table width="579" border="0" align="center">
<?
$index1 = 1;
$index_color1 = 1;
$oTQ = new TextQuestion($oCA);
$oTQ->RSTextQByKey($assid,$oSA->sectionTQid);
//---------->แสดงคำถามชนิดปลายปิดข้อหลัก
while($oTQ->GetRecord()){
?>
<tr bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_7'];?>">
<td height="22" colspan="2"><? echo $index1."." ?> <? echo $oTQ->nameTQ ?></td>
</tr>
<?
$oDo = new DoAssessment($oCA);
if($ttId==0)
$oDo->SearchDoidByDefineidOfficeridClassId($defineid,$officerId,$classId);
else
$oDo->SearchDoidByDefineidOfficeridClassIdttId($defineid,$officerId,$classId,$ttId);
while($oDo->GetRecord()){
$oRTQ = new ResultTQ($oCA);
$oRTQ->SearchByDoidSectionTQid($oDo->doid,$oSA->sectionTQid,$oTQ->TQid);
while($oRTQ->GetRecord()){
//echo "<br> =====> comment = ".$oRTQ->comment;
if($index_color1%2 == 0) //EEF2FB
echo '<tr bgcolor="'.$GLOBALS["COLOR_BG_TD_4"].'">';
else
echo '<tr bgcolor="'.$GLOBALS["COLOR_BG_TD_11"].'">';
?>
<td width="41" height="22"> <? if($index_color1 == '1') { echo "<font size=\"2\"><u>ตอบ</u></font>"; } ?></td>
<td width="531" ><font size="2"><? echo nl2br($oRTQ->comment) ?></font></td>
</tr>
<? $flag = 1;
$index_color1++;
} //end while oRTQ
}//end oDo
if($flag == 0){ ?>
<tr>
<td width="41"> <? if($index_color1 == '1') { echo "<font size=\"2\"><u>ตอบ</u></font>"; } ?> </td>
<td width="531"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_5"];?>">-ไม่พบข้อมูล -</font></td>
</tr>
<? }
$index1++;
$index_color1=1;
} //end while oTQ ?>
</table>
<br>
<?
} //end while oSTQ
} // end if oSA
$indexSection++;
} //end while oSA ?>
<br> </td>
</tr>
</table></td>
</tr>
</table>
</div>
</form>
</div>
</label>
<? if($CntSRQid != 0) { ?>
<table width="655" border="0" align="center">
<tr>
<td width="68" height="27"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"];?>"><strong>หมายเหตุ
: </strong></font></td>
<td width="633" colspan="2"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"];?>">เลือกคลิกอินเด็กซ์ข้อความ
"<img src="../picture/RQ.png" border="0"> คำถามปลายปิด"
ที่อยู่ด้านบน เมื่อต้องการดูแบบประเมินในส่วนของคำถาม<u>ปลายปิด</u>
</font></td>
</tr>
</table>
<? } ?>
</td>
</tr>
</table>
</body>
|