Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <fieldset>
- <legend id="q1"> What are one of the basic rules while writing XML?</legend>
- <p>
- <label for="o1"><input type="radio" name="XMLRule" id="o1" value="XML should have no root element" required="required"/>All XML should have no root element at all</label>
- <br>
- <label for="o2"><input type="radio" name="XMLRule" id="o2" value="Attribute must appear outside quotes" required="required" />Attribute value must appear outside quotes</label>
- <br>
- <label for="o3"><input type="radio" name="XMLRule" id="o3" value="Tags should be closed" required="required" />All tags should be closed</label> <!-- first answer -->
- <br>
- <label for="o4"><input type="radio" name="XMLRule" id="o4" value="Tag contains spaces" required="required" />Tag names contain spaces</label>
- </p>
- </fieldset>
- <br>
- <fieldset>
- <legend id="q2">When was SGML first developed?</legend>
- <p>
- <select name="DevelopedWhen" id="DevelopedWhen" required="required">
- <option value="">Please select</option>
- <option value="1980">1980's</option>
- <option value="21">21st century</option>
- <option value="1990">1990's</option>
- <option value="1960s" id="1960s">1960's</option> <!-- second answer -->
- </select>
- </p>
- </fieldset>
- <br>
- <fieldset>
- <legend id="q3">What does SGML stand for?</legend>
- <p>
- <label for="sgml">Answer:</label> <!-- third answer: "Standard Generalized Markup Language" -->
- <input type="text" name="sgml" id="sgml" maxlength="50" size="20" />
- </p>
- </fieldset>
- <br><br>
- <fieldset>
- <legend id="q4">What are the differences between HTML and XML? (more than one correct answer)</legend>
- <p>
- <label for="option1">Case sensitivity</label>
- <input id="option1" type="checkbox" name="html_xml_differences" value="Case sensitivity"/> <!-- fourth answer -->
- <br>
- <label for="option2">Designing web pages</label>
- <input id="option2" type="checkbox" name="html_xml_differences" value="Designing web pages" />
- <br>
- <label for="option3">Tags</label>
- <input id="option3" type="checkbox" name="html_xml_differences" value="Tags" />
- <br>
- <label for="option4">Preserving white spaces</label>
- <input id="option4" type="checkbox" name="html_xml_differences" value="Preserving white spaces" /> <!-- fifth answer -->
- </p>
- <br>
- </fieldset>
- <br><br>
- <fieldset>
- <legend id="q5">What are 2 features of XML? (more than one correct answer)</legend>
- <p>
- <label for="xml_features1"></label>
- <label for="xml_features1">Decreases data availability</label>
- <input id="xml_features1" type="checkbox" name="xml_features" value="Decreases data availability"/>
- <br>
- <label for="xml_features2">Used to create new programming languages</label>
- <input id="xml_features2" type="checkbox" name="xml_features" value="Used to create new programming languages" />
- <br>
- <label for="xml_features3">Simplifies data sharing</label>
- <input id="xml_features3" type="checkbox" name="xml_features" value="Simplifies data sharing" /> <!-- sixth answer -->
- <br>
- <label for="xml_features4">Separates data from HTML</label>
- <input id="xml_features4" type="checkbox" name="xml_features" value="Separates data from HTML" /> <!-- seventh answer -->
- </p>
- </fieldset>
- function setCorrectAnswers() {
- $correct = 0;
- $myanswers = array ($_GET["o3"], $_GET["1960s"], $_GET["sgml"], $_GET["option1"], $_GET["option4"], $_GET["xml_features3"], $_GET["xml_features4"]);
- $useranswers = array ("Tags should be closed", "1960s", "Standard Generalized Markup Language", "Case sensitivity", "Preserving white space", "Simplifies data sharing", "Separates data from HTML");
- if ($myanswers[0] == $useranswers[0]) {
- $correct++; }
- if ($myanswers[1] == $useranswers[1]) {
- $correct++; }
- if ($myanswers[2] == $useranswers[2]) {
- $correct++; }
- if ($myanswers[3] == $useranswers[3]) {
- $correct++; }
- if ($myanswers[4] == $useranswers[4]) {
- $correct++; }
- if ($myanswers[5] == $useranswers[5]) {
- $correct++; }
- if ($myanswers[6] == $useranswers[6]) {
- $correct++; }
- return $correct;
- // echo "<p>$correct/7</p>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement