thaiall logomy background
coding : checkans.asp.
my town
Source : Perl | PHP | ASP | JSP | HTML | HTML5 | JavaScript | Java | COBOL | C++ | MS Access | VBNet | VB | Python | โค้ดดี
File : checkans.asp. ID : 5101
Skin : Default | Sons-of-obsidian | Sunburst | Highlighter | Full
<% ' version 4.May 7,2545 %>
<!--#include file="header.asp"-->
<%
  dim yourscore, yourans, youdo, youdodiv
  yourscore = 0
  youdo = 0
  response.write("<ol><font color=blue><b>ผลการเฉลยข้อสอบ</b></font>")
  for j = 1 to request.form("tot")
    i = request.form("num"&j)
    yourans = cint(request.form("a"&i) / 13 / request.form("qid"&i))      
    response.write("<li>คำถาม :: "& request.form("ques"&i) &"<br>คำตอบ :: <font color=#800000>"& request.form("ans"& yourans &"x"&i) & "</font>")	
    if cint(request.form("q"&i)) > 0 then
      if yourans = cint(request.form("q"&i)) then
        yourscore = yourscore + 1
      end if
      youdo = youdo + 1
    end if
  next
  response.write("</ol><center>")
  response.write("<table width=90% bgcolor=red><td><font color=white size=6>")
  response.write("<center>ท่านได้คะแนน : "& yourscore & "<br>")
  response.write("จำนวนข้อสอบที่ท่านทำ : "& youdo & "<br>")
  youdodiv = youdo
  if youdo = 0 then
   youdodiv = 1
  end if
  response.write("คิดเป็น % ของที่ทำได้ : "& yourscore / youdodiv * 100 & "<br>")  
  response.write("จำนวนข้อสอบทั้งหมด : "& request.form("tot") & "<br>")  
  response.write("</td></table>")
  if youdo > 0 then
  %><!--#include file="connectdatabase.asp"-->
<%
  if session("mu") <> "guest"  and len(session("mu")) > 0 then
  sql = "select * from signin where intime= #" & session("intime") & "# and mu= '" & session("mu") &"'"
  set rs = server.createobject("ADODB.recordset")
  rs.open sql,connect,1,3
  tots = rs.recordcount
  response.write(tots)
  sql = "update signin set usequiz ="& rs("usequiz") + yourscore &" where intime=#" & session("intime") & "# and mu = '"& session("mu")&"'" 
  connect.execute(sql)  
  end if
%>   
  <!--#include file="connectsubj.asp"--><%
  sql = "insert into eval(edate,mu,selectscore,rightscore,quiztype) values ('" & now
  sql = sql & "','"& session("mu") &"',"& youdo &","& yourscore &",'"& request.form("tot") &"')"
  connect.execute(sql)
  response.write("<br>ข้อมูลเหล่านี้ถูกจัดเก็บเข้าฐานข้อมูลแล้ว")  
  end if
  response.write("<br><a href=default.asp>คลิ๊กที่นี่</a> :: เพื่อกลับสู่หน้าแรก")  
  set rs = nothing
  set connect = nothing  
%>  
<!--#include file="footer.asp"-->
จำนวน : 53 บรรทัด
าษาเฮชทีเอ็มแอล (HTML = HyperText Markup Language) คือ ภาษาคอมพิวเตอร์ที่ออกแบบมาเพื่อใช้ในการสร้างเว็บเพจที่เรียกดูผ่านทางเว็บเบราว์เซอร์ (Web Browser) เริ่มพัฒนาโดย ทิม เบอร์เนอรส์ ลี (Tim Berners Lee) ในปัจจุบัน HTML ล่าสุดคือ รุ่น 5 เป็นมาตรฐานหนึ่งของ ISO ซึ่งจัดการโดย World Wide Web Consortium (W3C) ในปัจจุบัน ทาง W3C ผลักดัน รูปแบบของ HTML แบบใหม่ ที่เรียกว่า XHTML รุ่นแรกคือ 1.0 (ม.ค.2543) ซึ่งมีโครงสร้างเป็นแบบ XML (eXtensible Markup Language)
าษาพีเอชพี (PHP Language) คือ ภาษาคอมพิวเตอร์ประเภทโอเพนท์ซอร์ท (Open Source Computer Language) สำหรับพัฒนาเว็บเพจแบบไดนามิก เมื่อเครื่องบริการได้รับคำร้องจากผู้ใช้ก็จะส่งให้กับ ตัวแปลภาษา ทำหน้าที่ประมวลผลและส่งข้อมูลกลับไปยังเครื่องของผู้ใช้ที่ร้องขอ ในรูปเอชทีเอ็มแอล ภาพ หรือแฟ้มดิจิทอลอื่นใด ลักษณะของภาษามีรากฐานคำสั่งมาจากภาษาซี เป็นภาษาที่สามารถพัฒนาให้ใช้งานแบบโต้ตอบกับผู้ใช้ได้
ตัวอย่าง Hello World
ปรับปรุงโปรแกรม source.pl : 2565-07-24
rspsocial
Thaiall.com