1. Este site usa cookies. Ao continuar a usar este site está a concordar com o nosso uso de cookies. Saber Mais.

JavaScript Quiz

Discussão em 'Web Development' iniciada por skinnedpt, 9 de Dezembro de 2008. (Respostas: 3; Visualizações: 1703)

  1. skinnedpt

    skinnedpt Power Member

    Muitos javascript quiz que tenho visto basta ver o Source que tem lá a resposta mas por exemplo neste caso:

    Código:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
    <head>
    
    <title>W3Schools Quiz Test</title>
     
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />
    
    <meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />
    
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache" />
    
    <link rel="stylesheet" type="text/css" href="/stdtheme.css" />
    
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-3855518-1");
    pageTracker._initData();
    pageTracker._trackPageview();
    </script>
    
    </head>
    <body>
    
    <a name="top"></a>
    <table cellpadding="0" cellspacing="0" width="100%" style="background-color:#808080">
    <tr>
    <td width="234" valign="bottom">
    <a href="http://www.w3schools.com"><img src="/images/w3default80.jpg" style="margin:0px" border="0" alt="W3Schools" /></a>
    </td>
    <td valign="top" align="left">
    <script type="text/javascript"><!--
    google_ad_client = "pub-3440800076797949";
    /*txtimg*/
    google_ad_slot = "5330033957";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    <noscript>
    <a href="/default.asp" target="_blank"><img src="/banners/w6.gif" border="0" alt="W3Schools" /></a>
    </noscript>
    </td>
    </tr>
    </table>
    <table width="797" class="topnav" border="0" cellpadding="0" cellspacing="0" style="margin-top:2px;">
    <tr>
    <td width="137" class="topnav">
    <a class="left" href="/default.asp">
    <img src="/images/home.gif" border="0" alt="home" />
    <b>HOME</b></a>
    </td>
    <td class="topnav">
    <a class="topnav" href="/sitemap.asp">Tutorials</a> | 
    <a class="topnav" href="/sitemap.asp">References</a> | 
    <a class="topnav" href="/sitemap.asp">Examples</a> | 
    <a class="topnav" href="/forum/default.asp" target="_blank">Forum</a> |
    <a class="topnav" href="/about/default.asp">About</a>
    </td>
    <td align="right" class="topnav">
    <form style="margin:0px" method="get" name="searchform" action="http://www.google.com/search" target="_blank">
    Search W3Schools : <input type="hidden" name="sitesearch" value="www.w3schools.com" />
    <input alt="search" type="text" style="width:115px" name="as_q" size="20" value="" />
    <input type="image" align="middle" src="/images/pic_search.gif" />
    </form>
    </td>
    </tr>
    </table>
    <table style="margin-left:1px" width="800" border="0" cellpadding="0" cellspacing="2">
    <tr>
    <td width="137" class="content" valign="top">
    <br /><br />
    <b>Selected Reading</b><br />
    <a class="left" target="_top" href="/browsers/browsers_stats.asp">Web Statistics</a><br />
    <a class="left" target="_top" href="/site/site_glossary.asp">Web Glossary</a><br />
    <a class="left" target="_top" href="/hosting/default.asp">Web Hosting</a><br />
    <a class="left" target="_top" href="/quality/default.asp">Web Quality</a><br /><br />
    <a class="left" target="_top" href="/default.asp">W3Schools Tutorials</a><br />
    <a class="left" target="_blank" href="/forum/default.asp">W3Schools Forum</a><br /><br />
    <a class="left" target="_top" href="/about/about_helping.asp">Helping W3Schools</a><br /><br />
    </td>
    <td valign="top">
    <table style="border: 1px solid gray" width="100%" bgcolor="#FFFFFF" border="0" cellpadding="5" cellspacing="0">
    <tr>
    <td>
    
    
    <h1>W3Schools JAVASCRIPT Quiz</h1>
    
    
    
    <form name="quizform" action='quiztest.asp?qtest=JavaScript' method='post'>
    <input type="hidden" name="starttime" value="12/9/2008 2:09:29 PM">
    <input type="hidden" name="answers" value="00000000000000000000" size="20">
    <input type="hidden" name="qnumber" value="1" size="20">
    
    <table class='front' width='100%' border='0' cellspacing="0" cellpadding="1">
    <tr>
    <th class='front' align='left'>&nbsp;JavaScript QUIZ</th>
    <th class='front' align='right'>http://www.w3schools.com&nbsp;</th>
    </tr>
    <tr>
    <td class='front' colspan='2'>
    <br /><table><tr><td valign='top'><b>&nbsp;1. </td><td valign='top'><b>Inside which HTML element do we put the JavaScript?<b></td></tr></table><br /><table border='0'><tr><td valign='top'><input type='radio' name='quiz' value='1' /></td><td>&lt;scripting&gt;</td></tr>
    <tr><td valign='top'><input type='radio' name='quiz' value='4' /></td><td>&lt;js&gt;</td></tr>
    <tr><td valign='top'><input type='radio' name='quiz' value='3' /></td><td>&lt;javascript&gt;</td></tr>
    <tr><td valign='top'><input type='radio' name='quiz' value='2' /></td><td>&lt;script&gt;</td></tr>
    </table>
    <br />
    &nbsp;<input type='submit' value=' Next '>
    <br /><br />
    </td>
    </tr>
    <tr>
    <th class='front' align='left'>&nbsp;Total 20 questions</th>
    <th class='front' align='right'>Time spent 0:00&nbsp;</th>
    </tr></table>
    </form>
    
    
    
    <p>
    W3Schools is for training only. We do not warrant its correctness or its fitness to be used.
    The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
    <a href="/about/about_copyright.asp">terms of use</a> and 
    <a href="/about/about_privacy.asp">privacy policy</a>.</p>
    <p>
    <a href="/about/about_copyright.asp">Copyright 1999-2008</a> by Refsnes Data. All Rights Reserved</p>
    </td>
    </tr></table>
    
    </body>
    </html>
    
    Como é que o javascript sabe qual será a resposta correcta?
    Este é o source code da 1º pergunta(de 20) deste site: http://www.w3schools.com/quiztest/quiztest.asp?qtest=JavaScript

    Aguardo resposta.
    Abraço
     
  2. Aparicio

    Aparicio /dev/mod
    Staff Member

    Isso é um quiz sobre javascript, não feito com javascript.
    A verificação das respostas nesse caso é feita do lado do servidor.
     
  3. skinnedpt

    skinnedpt Power Member

    Obrigado pela resposta.
    Então qual foi a linguagem utilizada?
    Cumprimentos
     
  4. AliFromCairo

    AliFromCairo Power Member

    Provavelmente, ASP:

    Código:
    action='quiztest.[B]asp[/B]?qtest=JavaScript'
    
     

Partilhar esta Página