TEN TEST CENTER
Home
Top score
Computer
BNK48 (1)
BNK48 (2)
Developer
MENU
SOURCE CODE
<?php # updated : 660318 - php74 # ini_set('display_errors', 'on'); # ini_set('error_reporting', '2047'); /* ปรับปรุง : 2565-02-20 (เริ่มพัฒนา : 2549-02-02 - test10.php) ลักษณะของโปรแกรม (Program Specification) - ใช้ histats.com - เลิกใข้ WRTishkid2 และ thchakrapetch เปลี่ยนใช้ ChulabhornLikit - เปลี่ยน charset จาก windows-874 เป็น tis-620 และเป็น utf-8 // - ตั้ง timezone ให้ตรงกับกรุงเทพ - ปรับเป็น responsive web design สำหรับ smartphone - เพิ่ม font ลายมือ THChakraPetch, WRTishkid2, TLWGTypewriter สวย ๆ - กำหนด og:image indexo.jpg สำหรับ facebook.com - เพิ่มขนาดปุ่ม radio จะได้เห็นชัดเจน - สุ่มทั้ง คำถาม และคำตอบ นั่งติดกันจะได้ดูกันยากขึ้น - จำนวนแบบทดสอบมีเท่าใดก็ได้ ขึ้นกับแฟ้มแบบทดสอบ โดยไม่ต้องแก้ไขโปรแกรม - ตัวเลือกมีสูงสุดได้ 7 ตัวเลือก เพราะตัวแปร $c[ ] กำหนดไว้อย่างนั้น - ปรับการใช้ฟังก์ชัน session_save_path() ไม่ให้แสดงใน source code - เพิ่มบริการ share certificate ใน version 2 เมื่อ 20 มกราคม 2560 ตรวจด้วยบริการ ดังนี้ - https://developers.facebook.com/tools/debug - https://pagespeed.web.dev/ - https://validator.w3.org/check?uri=http%3A%2F%2Fwww.thaiall.com%2Fquiz%2Ftest10.php */ // ============================= session_start(); date_default_timezone_set('Asia/Bangkok'); // Variables 1 : REQUEST, SESSION, POST $bgcolor = "#ddffdd"; if (isset($_REQUEST["subj"])) $gsubj = "subj=".$_REQUEST["subj"]; else $gsubj = ""; if (isset($_SESSION['name'])) $name = $_SESSION['name']; else $name = ""; if (isset($_SESSION['surname'])) $surname = $_SESSION['surname']; else $surname = ""; if (isset($_POST["name"])) { $name = $_POST["name"]; $_SESSION['name'] = $name; } if (isset($_POST["surname"])) { $surname = $_POST["surname"]; $_SESSION['surname'] = $surname; } // ============================= // Variable 2 : Configuration $version = "4.650222"; $program_name = "test10.php"; $directory = "/quiz/"; // "http://www.thaiall.com/quiz/"; $data_name_prefix = "test10"; $data_name = "computer1"; $score_name = "test10score.txt"; $background = "test10bg.gif"; $t_now = date("M j,Y H:i:s"); $fbog = "indexo.jpg"; $total_user = 100; // เก็บข้อมูลสมาชิกเพียง 100 ระเบียนเท่านั้น // ============================= // Variable 3 : Title of Test $qid["comfun01"] = "Computing Fundamentals (Quiz ID : 1)"; $qid["comfun02"] = "Computing Fundamentals (Quiz ID : 2)"; $qid["computer1"] = "Computer (Quiz ID : 3)"; $qid["computer2"] = "Computer (Quiz ID : 4)"; $qid["computer3"] = "Computer (Quiz ID : 5)"; $qid["computer4"] = "Computer (Quiz ID : 6)"; $qid["computer5"] = "Computer (Quiz ID : 7)"; $qid["computer6"] = "Computer (Quiz ID : 8)"; $qid["computer7"] = "Computer (Quiz ID : 9)"; $qid["eenetwork1"] = "Network (Quiz ID : 10)"; $qid["engl101"] = "English Language (Quiz ID : 11)"; $qid["engl102"] = "English Language (Quiz ID : 12)"; $qid["engl103"] = "English Language (Quiz ID : 13)"; $qid["gm101"] = "Mathematic (Quiz ID : 14)"; $qid["internet1"] = "Internet (Quiz ID : 15)"; $qid["internet2"] = "Internet (Quiz ID : 16)"; $qid["javakey1"] = "Java Language (Quiz ID : 17)"; $qid["javaloop1"] = "Java Language (Quiz ID : 18)"; $qid["keyapp01"] = "Key Application (Quiz ID : 19)"; $qid["keyapp02"] = "Key Application (Quiz ID : 20)"; $qid["keyapp03"] = "Key Application (Quiz ID : 21)"; $qid["keyapp04"] = "Key Application (Quiz ID : 22)"; $qid["keyapp05"] = "Key Application (Quiz ID : 23)"; $qid["keyapp06"] = "Key Application (Quiz ID : 24)"; $qid["linux1"] = "Linux (Quiz ID : 25)"; $qid["math01"] = "Mathematics (Quiz ID : 26)"; $qid["math02"] = "Mathematics (Quiz ID : 27)"; $qid["math03"] = "Mathematics (Quiz ID : 28)"; $qid["math"] = "Mathematics (Quiz ID : 29)"; $qid["os1"] = "Operating System 1 (Quiz ID : 30)"; $qid["prejava01"] = "Java Language (Quiz ID : 31)"; $qid["prejava02"] = "Java Language (Quiz ID : 32)"; $qid["vbnet01"] = "Visual Basic.NET (Quiz ID : 33)"; $qid["fanbnk481"] = "Fan of BNK48 (Quiz ID : 34)"; $qid["fanbnk482"] = "Fan of BNK48 (Quiz ID : 35)"; $qid["basiccomputer1"] = "IT Competency 1 (Quiz ID : 36)"; $qid["javaloop2"] = "Java Language (Quiz ID : 37)"; $qid["os01"] = "Operating System 01 (Quiz ID : 38)"; // ============================= // Variable 4 : Google banner if ($_SERVER["SERVER_NAME"] == "localhost" || (isset($_REQUEST["action"]) && $_REQUEST["action"] == "source")) { $google160=""; $google300=""; $googlersp=""; } else { $google300 = '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:inline-block;width:300px;height:250px" data-ad-client="ca-pub-3309619467978767" data-ad-slot="2527426157"></ins><script type="text/javascript">(adsbygoogle = window.adsbygoogle || []).push({});</script><!-- 43 quiztest 300 -->'; $google160 = '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:inline-block;width:160px;height:600px" data-ad-client="ca-pub-3309619467978767" data-ad-slot="4004159354"></ins><script type="text/javascript">(adsbygoogle = window.adsbygoogle || []).push({});</script><!-- 43 quiztest 160 -->'; $googlersp = '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3309619467978767" data-ad-slot="8000711351" data-ad-format="auto"></ins><script type="text/javascript">(adsbygoogle = window.adsbygoogle || []).push({});</script><!-- 06 quiz rsp -->'; } // ============================= // Variable 5 : General variable $menu = "<table class='m_still'><tr><td><table id='bar_topnav'><tr><td> <ul class='topnav'> <li><a href='/quiz/indexo.html' class='active' style='margin:0px;'>Home</a></li> <li><a href='/quiz/test10.php?action=report' style='margin:0px;'>Top score</a></li> <li><a href='/quiz/test10.php' style='margin:0px;'>Computer</a></li> <li><a href='/quiz/test10.php?subj=fanbnk481' style='margin:0px;'>BNK48 (1)</a></li> <li><a href='/quiz/test10.php?subj=fanbnk482' style='margin:0px;'>BNK48 (2)</a></li> <li><a href='/me' style='margin:0px;'>Developer</a></li> <li class='icon'><a href='javascript:void(0);' onclick='menu()' style='margin:0px;'>MENU</a></li> </ul></td></tr></table></td></tr></table>"; if (isset($_REQUEST["subj"])) $data_name = $_REQUEST["subj"]; $og = $data_name_prefix . $data_name . ".jpg"; if(file_exists($og)) $fbog = $og; $title = "แบบทดสอบ ชุด ". $data_name; $keyword = "quiz,examination,tutor,practice,exercise,certification,standard,test,quota"; $description = "แบบทดสอบ 30+ คือ แบบทดสอบที่สุ่มชุดละ 10 คำถามแบบสุ่ม และสลับตัวเลือก เพื่อให้ผู้ทำข้อสอบได้ทดสอบตนเอง มีฟังก์ชันการแสดงรายงานคะแนนผู้ทำข้อสอบ 100 อันดับแรก และฟังก์ชันการแสดงรหัสต้นฉบับ และเพื่อสนับสนุนนโยบายโค้ดดิ้งของกระทรวงศึกษาธิการ และกระทรวงการอุดมศึกษา วิทยาศาสตร์ วิจัยและนวัตกรรม"; $title_cert ="CERTIFICATE by TEN TEST CENTER"; $keyword_cert ="certificate,ten test cener,enthusiasm,quiz,exercise"; $description_cert ="CERTIFICATE by TEN TEST CENTER คือ ใบรับรอง (Certificate) ที่ออกให้กับผู้เข้ามาทำข้อสอบ และได้คะแนนเต็มในแต่ละชุดข้อสอบ เพื่อเป็นขวัญและกำลังใจแก่ผู้มีความมุ่งมั่นเป็นที่ตั้ง ขอชื่นชม"; $image = "http://www.thaiall.com/quiz/test10.jpg"; if (isset($_REQUEST["action"]) && $_REQUEST["action"] =="report") { $title ="สถิติการทำข้อสอบ 100 รายการล่าสุด"; $keyword = "evaluation," . $keyword; $description = "แบบรายงานผล" . $description; $fbimage = $menu; } else { $fbimage = "<table class='m_still'><tr><td><img alt='child' src='". $fbog ."' style='width:100%' /></td></tr></table>". $menu ; } $header = '<!DOCTYPE html><html lang="th"><head><title>'. $title ."</title><script async src='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3309619467978767' crossorigin='anonymous'></script> <meta http-equiv='content-type' content='text/html; charset=utf-8' /><meta name='viewport' content='width=device-width,initial-scale=1' /><meta property='fb:app_id' content='457891482255937' /> <meta name='keywords' content='". $keyword ."' /> <meta name='description' content='". $description ."' /> <meta property='og:image' content='". $image ."' /> <link type='text/css' rel='stylesheet' href='rsp81.css' /><link rel='icon' type='image/x-icon' href='rsp.ico' /> <meta property='og:url' content='http://www.thaiall.com/quiz/test10.php' /><meta property='og:title' content='".$title."' /><meta property='og:description' content='".$description."' /><meta property='og:type' content='article' /> <script type='text/javascript'>function menu(){document.getElementsByClassName('topnav')[0].classList.toggle('responsive');}</script> <style type='text/css'>input[type='radio'] { -ms-transform: scale(2); /* IE 9 */ -webkit-transform: scale(2); /* Chrome, Safari, Opera */ transform: scale(2); } td{font-family:ChulabhornLikit;font-size:14px;} body{font-family:ChulabhornLikit;font-size:14px;} ul.topnav li a{padding:2px 5px;height:26px;} </style></head><body id='main'><table class='m_still'><tr><td style='background-color:black;font-size:36px;color:white;text-align:center;font-weight:bold;'>TEN TEST CENTER</td></tr></table>" . $fbimage; $header_cert = '<!DOCTYPE html><html lang="th"><head><title>'. $title_cert ."</title> <meta http-equiv='content-type' content='text/html; charset=utf-8' /><meta name='viewport' content='width=device-width,initial-scale=1' /> <meta name='keywords' content='". $keyword_cert ."' /> <meta name='description' content='". $description_cert ."' /> <link type='text/css' rel='stylesheet' href='rsp81.css' /><link rel='icon' type='image/x-icon' href='rsp.ico' /><style type='text/css'> td{font-family:ChulabhornLikit;font-size:14px;} body{font-family:ChulabhornLikit;font-size:14px;} ul.topnav li a{padding:2px 5px;height:26px;} </style></head><body id='main'><table class='m_still'><tr><td style='background-color:black;font-size:36px;color:white;text-align:center'>CERTIFICATE by TEN TEST CENTER</td></tr></table>"; $footer = "<table class='m_still'><tr><td style='text-align:center'>" . $googlersp . "</td></tr></table> <table class='m_still'><tr><td><table class='m_hidden'><tr><td style='font-size:14px;text-align:center'> <a href='". $directory . $program_name ."?action=report'>สถิติ 100 รายการ</a> : <a href='". $directory . $program_name ."?$gsubj'>เริ่มใหม่</a> : <a href='test10.gif'>ภาพเตรียมข้อสอบ</a> : <a href='?action=source'>รหัสต้นฉบับ</a> : รุ่น $version : เวลา : $t_now <table cellspacing='5' cellpadding='0' bgcolor='white' align='center' style='font-size:10px;'> <tr><td style='width:120px;'><b>คอมพิวเตอร์</b><br/> <a href='/quiz/test10.php?subj=fanbnk481'>แฟน BNK48 (1)</a><br/> <a href='/quiz/test10.php?subj=keyapp01'>คีย์แอพพลิเคชั่น(1)</a><br/> <a href='/quiz/test10.php?subj=javaloop1'>จาวาทำซ้ำ(1)</a><br/> <a href='/quiz/test10.php?subj=computer7'>คอมพิวเตอร์(7)</a><br/> <a href='/quiz/test10.php?subj=vbnet01'>vb.net(1)</a><br/> </td><td bgcolor='gray' width='1px'> </td><td style='width:120px;'><b>คณิต</b><br/> <a href='/quiz/test10.php?subj=math01'>บวกเลข(1)</a><br/> <a href='/quiz/test10.php?subj=math02'>บวกเลข(2)</a><br/> <a href='/quiz/test10.php?subj=gm101'>อนุกรม ก.พ.(1)</a><br/> <a href='http://www.thainame.net/quiz/test3.php?subj=pepe_math_001'>คณิต(1)</a><br/> <a href='/cgi/quiz.pl?math&5'>เตรียม คณิต ก.พ.</a><br/> </td><td bgcolor='gray' width='1px'> </td><td style='width:120px;'><b>อังกฤษ</b><br/> <a href='/quiz/test10.php?subj=engl101'>ถาม - ตอบ</a><br/> <a href='/quiz/tense10.php?subj=present1'>present 1</a><br/> <a href='/quiz/tense10.php?subj=presentper1'>present perfect 1</a><br/> <a href='/cgi/quiz.pl?operatingsystem&5'>อังกฤษเบื้องต้น</a><br/> <a href='/quiz/test10_aiken.php'>aiken format</a> </td><td bgcolor='gray' width='1px'> </td><td style='width:120px;'><b>ไทย สังคม</b><br/> <a href='/cgi/quiz.pl?social&5'>สังคมศึกษา</a><br/> <a href='/cgi/quiz.pl?rung&5'>ความรู้ทั่วไป</a><br/> <a href='http://www.thainame.net/quiz/test3.php?subj=fondao_thai_001'>ไทย f.1</a><br/> <a href='http://www.thainame.net/quiz/test3.php?subj=pepe_thai_001'>ไทย p.1</a><br/> <a href='http://www.thainame.net/quiz/test3.php?subj=maya_thai_001'>ไทย m.1</a> </td><td bgcolor='gray' width='1px'> </td><td style='width:120px;'><b>เกี่ยวกับเรา</b><br/> <a href='/'>หน้าหลัก</a><br/> <a href='/me'>ทีมงาน</a><br/> <a href='/quiz'>ศูนย์สอบออนไลน์</a><br/> <a href='/sponsor'>สนับสนุน</a><br/> <a href='http://www.facebook.com/thaiall'>facebook page</a> </td></tr></table></td></tr></table> <table class='m_still'><tr><td style='background-color:#dddddd;'> <div style='margin-top:20px;font-size:20px;text-align:center;'> <a href=". $directory . $program_name ."?action=report>สถิติ 100 รายการล่าสุด</a> <br/><script>page='quiz_test10';</script><script src='http://hits.truehits.in.th/data/c0001941.js'></script> <noscript><a target='_blank' href='http://truehits.net/stat.php?id=c0001941'><img src='http://hits.truehits.in.th/noscript.php?id=c0001941' alt='Thailand Web Stat' border='0' width='14' height='17' /></a> <a target='_blank' href='http://truehits.net/'>Truehits.net</a></noscript> <!-- Histats.com (div with counter) --><div id='histats_counter'></div> <!-- Histats.com START (aync)--> <script type='text/javascript'>var _Hasync= _Hasync|| []; _Hasync.push(['Histats.start', '1,4598082,4,9,110,60,00011111']); _Hasync.push(['Histats.fasi', '1']); _Hasync.push(['Histats.track_hits', '']); (function() { var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true; hs.src = ('//s10.histats.com/js15_as.js'); (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs); })();</script> <noscript><a href='/' target='_blank'><img src='//sstatic1.histats.com/0.gif?4598082&101' alt='free web page counters' border='0'></a></noscript> <!-- Histats.com END --> </div></td></tr></table> </body></html>"; $error_name = "<table align='center'><td bgcolor='white'><font color='red' size='6'>กรอกชื่อ หรือนามสกุล ไม่ครบ<br/>ต้องอ่านคำชี้แจงนะครับ ตอนนี้กลับไป [เริ่มใหม่] ได้เลย</td></table>"; $error_subj = "<table align='center'><td bgcolor='white'><font color='red' size='6'>ไม่พบแฟ้มวิชาที่ท่านต้องการสอบ<br/>ต้องกลับไปเลือกวิชาให้ถูกต้อง</td></table>"; $remark = "<tr><td bgcolor='#660000' colspan='2' style='font-size:18px;color:white;text-align:left;'> - ถ้าไม่กรอกทั้ง Name และ Surname จะไม่ตรวจให้ <br/>- ถ้าทำแบบทดสอบไม่ครบทุกข้อ จะไม่ตรวจให้ <br/>- ระบบเก็บผลสอบเพียง 100 ระเบียนล่าสุด <br/>- ผลการตรวจจะเผยแพร่ทั้ง ชื่อ สกุล คะแนน และเวลา </td></tr>"; $remark_send = "<span style='font-size:20px;color:red;'>ต้องกรอกชื่อและสกุล(อังกฤษ)และทำทุกข้อ</span>"; // ============================= // Share Certificate if (isset($_REQUEST["cert"]) && $_REQUEST["cert"] =="share") { header('Content-Type: text/html; charset=utf-8'); echo $header_cert; echo "<table class='m_still'><tr><td style='background-color:#444444;text-align:center;'>"; $getsubj = "computer1"; foreach ($qid as $k=>$v) { if ($v == base64_decode($_GET["course"])) $getsubj = $k; } echo "<a href=?subj=$getsubj>"; echo "<img alt='quiz' src=$program_name" . "?cert=print&name=" . $_GET['name'] . "&surname=" . $_GET['surname'] . "&course=" . $_GET['course'] . "&time=" . $_GET['time'] . " class='m_still' /></a>"; echo '<br/><span style="color:white;">เพื่อเป็นขวัญและกำลังใจแก่ผู้มีความมุ่งมั่นเป็นที่ตั้ง<br/>ในการทำแบบทดสอบชุดนี้<br/>จึงขอชื่นชมในความสำเร็จมา ณ โอกาสนี้</span></td></tr><tr><td align=center> <script type="text/javascript">var switchTo5x=true;</script> <script type="text/javascript" id="st_insights_js" src="http://w.sharethis.com/button/buttons.js?publisher=f53e4e65-4d03-4886-8585-139c248fbbd1"></script> <script type="text/javascript">stLight.options({publisher: "f53e4e65-4d03-4886-8585-139c248fbbd1", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script> <div style="text-align:center;">'; echo "<span class='st_sharethis_vcount' displayText='ShareThis'></span> <span class='st_facebook_vcount' displayText='Facebook'></span> <span class='st_twitter_vcount' displayText='Tweet'></span> <span class='st_linkedin_vcount' displayText='LinkedIn'></span> <span class='st_pinterest_vcount' displayText='Pinterest'></span> <span class='st_email_vcount' displayText='Email'></span> </div></td></tr></table>"; echo $footer; exit; } // ============================= // Print Certificate if (isset($_REQUEST["cert"]) && $_REQUEST["cert"] =="print") { function cthai($str) { $res=array(); for($i=0;$i<strlen($str);$i++) { array_push($res,"".getThaiUniCodeVal($str[$i]).";"); } $ress=implode("",$res); return $ress; } function getThaiUniCodeVal($ch) { if(ord($ch)>128) return (3552+(ord($ch)-128)); else return (ord($ch)); } header('Content-Type: image/png'); $certbg = 'test10cert.png'; $font = $_SERVER["DOCUMENT_ROOT"] . "/quiz/rsp_thchakrapetch.ttf"; $im = imagecreatefrompng($certbg); $blue = ImageColorAllocate($im, 10, 10, 200); $gname = base64_decode($_GET["name"]); $gsurname = base64_decode($_GET["surname"]); $gcourse = base64_decode($_GET["course"]); $on = base64_decode($_GET["time"]); // imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text ) 320 - (strlen($name) * 30) imagettftext($im,30, 0, 320 - (strlen($gname . " " . $gsurname) * 6), 165, $blue, $font, cthai($gname . " " .$gsurname)); imagettftext($im,24, 0, 320 - (strlen($gcourse) * 5), 260, $blue, $font, cthai($gcourse)); imagettftext($im,24, 0, 320 - (strlen($on) * 5), 300, $blue, $font, cthai($on)); imagepng ($im); imagedestroy($im); exit; } // ============================= // View Source Code if (isset($_GET["action"])) { echo $header; if ($_GET["action"] == "source") { echo "<style type='text/css'>textarea { width:100%;font-family:TLWGTypewriter; } .textwrapper{ border:1px solid #999999; margin:5px 0; padding:3px; }</style>"; $ar = file($program_name); echo "<table class='m_still'><td bgcolor=#dddddd><center><font size=6>SOURCE CODE</font><br/><div style='display: block'><textarea cols=120 rows=25 wrap=off>"; $line = 0; foreach ($ar as $k=>$v) { if($line++ != 4) { echo str_replace("<","<",$v); } } // echo htmlspecialchars($v); echo "</textarea></div></td></table>"; } if ($_GET["action"] == "report") { $ar = file($score_name); ?> <table class='m_still'><tr><td> <table class='m_min420'><tr><td style='font-size:16px;'> <span style='font-weight:bold;'>ความหมายของการทดสอบ</span> <br/><span class='bigcap'>ก</span><span style='font-weight:bold;color:green;'>ารทดสอบ (Testing) หรือ การประเมิน (Evaluation)</span> เป็นกลไกสำคัญของการประกันคุณภาพการศึกษา เป็นตัวบ่งชี้ระดับความสามารถของผู้เรียน ซึ่งมี 2 แบบ คือ <span style='font-weight:bold;color:red;'>แบบทดสอบแบบปรนัย</span> เป็นแบบที่เหมาะสำหรับวัดผลการเรียน ของผู้เข้าสอบจำนวนมาก มีความเที่ยงตรง และเกณฑ์การให้คะแนนที่เชื่อถือได้ <span style='font-weight:bold;color:blue;'>แบบทดสอบแบบอัตนัย</span> เป็นแบบที่เหมาะกับการวัดความคิดริเริ่มสร้างสรรค์ โดยเปิดให้แสดงความคิดเห็นสำหรับแบบทดสอบที่มีโอกาสถูกได้หลายแบบ แต่ไม่เหมาะกับผู้เข้าสอบจำนวนมาก </td></tr></table> <table class='m_min300'><tr><td><?php echo $google300; ?></td></tr></table> </td></tr></table> <?php echo "<table class='m_still'><tr style='font-size:40px;background-color:black;color:white;text-align:center;'><td style='text-align:center;' colspan=7>สถิติผู้ทำแบบทดสอบ</td></tr> <tr style='font-size:20px;background-color:#dddddd;color:black;text-align:center;'><td> <table class='m_min300'><tr><td style='font-size:18px;'> ลำดับ ชื่อ-สกุล</td></tr></table><table class='m_min420'><tr><td style='font-size:18px;'> ถูก:ทั้งหมด ใน รหัสวิชา [เริ่มต้น - สิ้นสุด]</td></tr></table></td></tr>"; $i=0; $bg = ""; foreach ($ar as $k=>$v) { $i++; if (!isset($_GET["top"]) || $i <= 10) { $ar = preg_split("/[\t]/",$v); if (strlen($bg) == 0) $bg = " bgcolor=#ddffff"; else $bg = ""; if ($ar[3] == $ar[4]) {$bg = " bgcolor=#ffdddd"; $cert_blue = "color:blue;";} else { $cert_blue = ""; } $stoptime = preg_split("/[ ]/",$ar[6]); echo "<tr $bg><td><table class='m_min300'><tr><td style='font-size:16px;'> <span style='font-weight:bold;". $cert_blue ."'>$i. $ar[0] $ar[1]</span></td></tr></table> <table class='m_min420'><tr><td style='font-size:14px;'> <span style='color:red;font-weight:bold;'>$ar[3]</span> : $ar[4] in <a href=?subj=$ar[2]>$ar[2]</a> [<span style='color:gray;'>$ar[5] - ". $stoptime[2] ."</span>]</div></td></tr></table></td></tr>"; } } echo "</table>"; } echo $footer; exit; } // ============================= // Get Random value and Read file $cnt_quiz = 0; $data_namef = $data_name_prefix . $data_name . ".php"; if (!file_exists($data_namef)) { echo $error_subj.$footer; exit; } $ar = file($data_namef); foreach ($ar as $v) { $q = preg_split("/[\t]/",$v); if (strlen($q[2]) > 0) { // ตรวจว่ามีเฉลยหรือไม่ $qok{$cnt_quiz} = $v; // iconv('TIS-620','UTF-8//ignore',$v); // $v; // http://www.thaiall.com/quiz/test10.php?subj=internet1 $rnd{$cnt_quiz} = rand(); $cnt_quiz = $cnt_quiz + 1; } } // ============================= // General Variable $c[1] = array(1,2,3,4,7,5,6); $c[2] = array(5,7,2,3,4,1,6); $c[3] = array(4,1,2,5,7,3,6); $c[4] = array(2,3,5,4,1,6,7); $c[5] = array(4,6,7,3,1,2,5); $c[6] = array(7,6,5,2,4,1,3); $c[7] = array(2,4,1,3,7,6,5); // ============================= // Check Answer if (isset($_POST["action"]) && isset($_SESSION['start'])) { echo $header; if ($_POST["action"] == "check") { if (strlen($_POST["name"]) == 0 || strlen($_POST["surname"]) == 0) { echo $error_name.$footer; unset($_SESSION["start"]); exit; } $right = 0; $wrong = 0; $qok{$cnt_quiz} = $v; foreach ($qok as $k=>$v) { $q = preg_split("/[\t]/",$v); $qans{$q[0]} = $q[2]; } foreach ($_POST as $k=>$v) { if ($k != "action" && $k != "name" && $k != "surname" && $k != "total" && $k != "subj") { if (strlen($v) > 0) { if ($qans{$k} == $v) $right++; else $wrong++; } } } $total = $_POST["total"]; if ($total <= ($right + $wrong)) { $wrong = $total - $right; echo "<table class='m_still'><tr><td style='font-size:30px;text-align:center;'> <b>ผลการสอบของ</b> ". $_POST["name"] . " " . $_POST["surname"] . " <br/><b>ทำถูก</b> = <font color=red>$right ข้อ</font> <br/><b>ทำผิด</b> = <font color=red>$wrong ข้อ</font> <br/><b>จำนวนข้อสอบ</b> = <font color=red>$total ข้อ</font> <span style='font-size:20px;'> <br/><b>เริ่มทำ</b> = <font color=blue>". $_SESSION['start'] ."</font> <br/><b>สิ้นสุด</b> = <font color=blue>". $t_now ."</font> </span></td></tr></table>"; if ($total == $right) { echo "<table class='m_still'><tr><td> <table class='m_min420'><tr><td style='font-size:40px;text-align:center;'> <a href=$program_name". "?cert=share&name=" . base64_encode($_SESSION['name']) . "&surname=" . base64_encode($_SESSION['surname']) . "&course=" . base64_encode($qid[$data_name]) . "&time=" . base64_encode($_SESSION['start']) . "> กดที่นี่<br/>เพื่อแชร์ <b>ใบรับรอง</b><br/>ไปยังเครือข่ายสังคม<br/>Click here<br/>to share this certificate<br/>in social media</a></td></tr></table> <table class='m_min300'><tr><td> <a href=$program_name". "?cert=share&name=" . base64_encode($_SESSION['name']) . "&surname=" . base64_encode($_SESSION['surname']) . "&course=" . base64_encode($qid[$data_name]) . "&time=" . base64_encode($_SESSION['start']) . "> <img alt='quiz' src=$program_name" . "?cert=print&name=" . base64_encode($_SESSION['name']) . "&surname=" . base64_encode($_SESSION['surname']) . "&course=" . base64_encode($qid[$data_name]) . "&time=" . base64_encode($_SESSION['start']) . " style='width:100%' /> </a></td></tr></table></td></tr></table>"; } $data = $_POST["name"]."\t".$_POST["surname"]."\t".$_POST["subj"]."\t"; $data = $data . $right."\t".$total."\t".$_SESSION['start']."\t".$t_now."\n"; $fr = array(); if (file_exists($score_name)) $fr = file($score_name); $limit = count($fr); if ($total_user <= $limit) $limit = $total_user - 1; $fw=fopen ($score_name,"w"); fputs ($fw,$data); for ($i=0;$i<$limit;$i++) fputs ($fw,$fr[$i]); fclose ($fw); echo "<meta http-equiv=refresh content='300;url=". $program_name . "?action=report&top=10'>"; unset($_SESSION["start"]); // session_unset(); } else { echo "<table align=center><td bgcolor=white><center><font color=red size=6>ท่านทำข้อสอบเพียง : " . ($right + $wrong) ." ข้อ<br/>"; echo "ไม่ครบ ". $total . " ข้อ<br/>จึงไม่ตรวจให้ .. ท่านต้องกลับไปทำให้ครบ</td></tr></table>"; } } } else { // ============================= // Show Question $ar = file($data_namef); $q = preg_split("/[\t]/",$ar[0]); echo $header; $_SESSION['start'] = $t_now; echo "<form id='testten' action='$directory". $program_name . "' method='post'> <table class='m_still'> <tr><td style='background-color:#ddffdd;text-align:center;'>$qid[$data_name]"; asort($rnd); // ทำให้ array จัดเรียงตามค่าสุ่ม $total_question = 0; echo "<table class='m_still'><tr><td><table class='m_min560' style='background-color:#f2f2f2;'>"; $bg = ""; foreach ($rnd as $k=>$v) { $total_question++; $q = preg_split("/[\t]/",$qok{$k}); if (strlen($bg) == 0) $bg = " bgcolor='#ffffdd'"; else $bg = ""; echo "<tr $bg><td style='font-size:40px;text-align:left;'>"; echo "<span style='font-weight:bold;font-size:44;'>". $total_question . ". " . $q[1] . '</span>'; $cok = rand(1,7); for($i=3;$i<10;$i++) { if (isset($q[$c[$cok][$i - 3] + 2])) { if (strlen($q[$c[$cok][$i - 3] + 2]) > 0 && $q[$c[$cok][$i - 3] + 2] != "\r\n" && $q[$c[$cok][$i - 3] + 2] != "\n") echo "<br/><input type='radio' id='". $q[0] ."-" . ($c[$cok][$i - 3]) ."' name='$q[0]' value='". ($c[$cok][$i - 3]) ."' /> <label for='". $q[0] ."-" . ($c[$cok][$i - 3]) ."'>". $q[$c[$cok][$i - 3] + 2] . "</label>"; } } echo "</td>"; // if ($total_question == 1) { echo ""; } เดิมวาง banner แนวตั้งที่นี่ แต่มีปัญหาการกด tab เลือกคำตอบตอบ จะเสียลำดับการทำงาน จึงย้ายไปนอกลูป echo "</tr>"; } echo "</table><table class='m_min160h'><tr><td>$google160</td></tr></table></td></tr></table>"; echo "<table class='m_still'><tr><td>"; if ($_SERVER["SERVER_NAME"] == "www.thaiabc.com") echo "ไม่มีบริการใน thaiabc.com"; else echo "<table class='m_min420'><tr><td><table class='m_min420' style='background-color:#dddddd;margin-left:0px;margin-right:0px;'> <tr><td style='font-size:30px;background-color:black;color:white;' colspan='2'>คำชี้แจง</td></tr>$remark <tr><td align='right'>Name :</td><td style='text-align:left;'><input name='name' type='text' size='20' value='$name' /> ex. burin</td></tr> <tr><td align='right'>Surname :</td><td style='text-align:left;'><input name='surname' type='text' size='20' value='$surname' /> ex. rujjy</td></tr> </table> <table class='m_min420' style='background-color:#dddddd'><tr><td style='text-align:center;'>$remark_send <br/><input type='submit' value='ส่งคำตอบ' style='width:300px;font-size:40px;font-weight:bold;height:50px;background-color:#ffff00' /> <input type='hidden' value='check' name='action' /><input type='hidden' value='$total_question' name='total' /><input type='hidden' value='$data_name' name='subj' /> </td></tr></table></td></tr></table>"; echo "<table class='m_min300h'><tr><td>". $google300 . "</td></tr></table></td></tr></table></form>"; } echo $footer; ?>
สถิติ 100 รายการ
:
เริ่มใหม่
:
ภาพเตรียมข้อสอบ
:
รหัสต้นฉบับ
: รุ่น 4.650222 : เวลา : Aug 22,2024 22:22:38
คอมพิวเตอร์
แฟน BNK48 (1)
คีย์แอพพลิเคชั่น(1)
จาวาทำซ้ำ(1)
คอมพิวเตอร์(7)
vb.net(1)
คณิต
บวกเลข(1)
บวกเลข(2)
อนุกรม ก.พ.(1)
คณิต(1)
เตรียม คณิต ก.พ.
อังกฤษ
ถาม - ตอบ
present 1
present perfect 1
อังกฤษเบื้องต้น
aiken format
ไทย สังคม
สังคมศึกษา
ความรู้ทั่วไป
ไทย f.1
ไทย p.1
ไทย m.1
เกี่ยวกับเรา
หน้าหลัก
ทีมงาน
ศูนย์สอบออนไลน์
สนับสนุน
facebook page
สถิติ 100 รายการล่าสุด
Truehits.net