Purple exclamation mark.svg Planning the future of Botwiki! - Help us bring Botwiki up to date, contribute to our strategy discussion, add bot scripts, and contribute manuals, guides, and tutorials! Almost anything related to bots, particularly those used to edit mediawiki, is welcome.

Red exclamation mark.svg UNABLE TO EDIT? - We've experienced attacks by spambots lately and now require you to confirm your e-mail before you can edit (go to your preferences, enter an e-mail address, and request a confirmation e-mail, then go to your e-mail and click on the confirmation link). We also require new accounts to make a few edits and wait a few minutes before before you can create a page; however, if this is a problem contact us in #botwiki and we can manually confirm your account. Sorry for the inconvenience.

Php:Regolamento.php

From Botwiki
Jump to: navigation, search
<?
include("http_lib.php");
include("headers_lib.php");
init_html("Questionario sul regolamento");
?>
			<p>Questo programma ti proporrĂ  varie domande sul regolamento del giuoco del calcio.
			<br/><br/>
<?
function giveMeQuestion($alreadyAskedQuestionsArray){
	$question = "Quanti giocatori titolari può avere al massimo sul campo una squadra?";
	$choices["1"] = "7";
	$choices["2"] = "9";
	$choices["3"] = "11";
	$choices["4"] = "13";
	$answer = "3";
	return array($question, $choices, $answer, $alreadyAskedQuestionsArray);
}
 
function formatChoice($choice, $groupNumber, $internalGroupNumber){
	return "<tr><td> </td><td> </td><td> </td><td> </td><td><li></li></td><td>$choice</td><td><input type='checkbox' value='0' id='checkbox-$groupNumber-$internalGroupNumber' name='checkbox-$groupNumber-$internalGroupNumber' /></td></tr>";
}
 
$alreadyAskedQuestionsArray = array();
 
$questionArray = giveMeQuestion($alreadyAskedQuestionsArray);
$question = $questionArray["0"];
$choices = $questionArray["1"];
$answer = $questionArray["2"];
 
if (!isset($_REQUEST['check'])){
	echo "<form method='post' action='{$_SERVER['PHP_SELF']}'/>";
 
	echo "<ul><li>$question</li>";
	echo "<table>";
	echo formatChoice($choices["1"], 1, 1);
	echo formatChoice($choices["2"], 1, 2);
	echo formatChoice($choices["3"], 1, 3);
	echo formatChoice($choices["4"], 1, 4);
	echo "</table></ul>";
	echo "<input type='submit' value='Invia' />";
}else{
	if (isset($_REQUEST["checkbox-1-$answer"])){
		echo "Giusto!<br/>";
	}else{
		echo "Sbagliato!<br/>";
	}
}
 
 
		//echo "<form method=\"get\" action=\"{$_SERVER['PHP_SELF']}\"  />
		//Domain: <input type=\"text\" name=\"domain\" value=\"$domain\" />
		//Category: <input type=\"text\" name=\"category\" value=\"$category\" />";
		//
		//<input type="submit" value="Enter" />
		//<br/>
 
?>
<input type='hidden' name="check" value="ok"/>
<?
end_html();
?>
Personal tools
Share