<?xml version="1.0"?>
       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
       <html xmlns="http://www.w3.org/1999/xhtml"
             xml:lang="en"><head><meta name="author" content="Created with TexToys by Half-Baked Software, registered to Unregistered."></meta><meta name="keywords" content="Hot Potatoes, Half-Baked Software, Windows, University of Victoria"></meta>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 

<title>Clases de foros</title>

<!-- Made with executable version 2.1 Release 3 Build 0 -->

<style type="text/css">

body{

	background-color: #ffffff;
	font-family: Geneva,Arial,sans-serif;
	color: #000000;
	margin-right: 5%;
	margin-left: 5%;
	font-size: 10pt;
}

div,span,td{
	font-size: 10pt;
	color: #000000;
}

div.Titles{
	padding-top: 10px;
	text-align: center;
	margin-bottom: 4px;
	color: #000000;
}

.ExerciseTitle{
	font-size: large;
	color: #000000;
}

.Instructions{
	color: #000000;
}

div.TimerDiv{
	text-align: center;
	margin-left: auto;
	margin-right: auto;
	margin-top: 10px;
	margin-bottom: 10px;
}

span#ClockFace{
	padding: 5px;
	background-color: #ffffff;
	color: #000000;
	border-width: 1px;
	border-style: solid;
}

div.StdDiv{
	background-color: #dddddd;
	text-align: center;
	font-size: smaller;
	color: #000000;
	padding: 8px;
	border-style: solid;
	border-width: 1px 1px 1px 1px;
	border-color: #000000;
	margin: 1px;
}

div#Stars{
	text-align: left;
	color: #000000;
	font-family: Geneva,Arial,sans-serif;
	background-color: #dddddd;
	margin-left: 5%;
	margin-right: 5%;
	padding: 10px;
	border-width: 1px;
	border-style: solid;
	border-color: #000000;
}



.FunctionButton {
	background-color: #dddddd;
	color: #000000;
	text-align: center;
	border-style: solid;
	border-color: #dddddd;
	border-width: 2px;
	padding: 3px 6px 3px 6px;
	cursor: pointer;
}

div.NavButtonBar{
	background-color: #999999;
	text-align: center;
	margin: 2px 0px 2px 0px;
	clear: both;
	font-size: small;
}

div.NavButtonBar button {
	border-style: solid;
	border-color: #999999;
	background-color: #999999;
	border-width: 2px;
	padding: 2px 2px 2px 2px;
	color: #000000;
	cursor: pointer;	
}

a{
	color: #0000cc;
}

a:visited{
	color: #0000ff;
}

a:hover{
	color: #0000cc;
}

</style>

<script type="text/javascript">

//<![CDATA[

<!--

// BrowserCheck Object

function BrowserCheck() {
	var b = navigator.appName;
	this.mac = (navigator.appVersion.indexOf('Mac') != -1);
	if (b=="Netscape") this.b = 'ns';
	else if (b=="Microsoft Internet Explorer") this.b = 'ie';
	else this.b = b;
	this.ns = (this.b == 'ns');
	this.ie = (this.b == 'ie');
	this.version = navigator.appVersion;
	if (this.b == 'ie'){
		var x = this.version.indexOf('MSIE ') + 5;
		var vnum = '';

		while ((this.version.charAt(x) > -1)&&(this.version.charAt(x) < 10)){
			vnum += this.version.charAt(x);
			x++;
		}
		this.v = parseInt(vnum);
	}
	else{
		this.v = parseInt(this.version);
	}
	if (this.ns&&(this.v == 5)){
		this.v = 6;
	}
	this.min = (this.v > 5);
}

var is = new BrowserCheck();

if (is.min == false){
	alert('Your browser can\'t handle this page. You need NS6+ or IE5+ on Windows, or NS6+ on Mac.');
}

var NavLightColor = '#cccccc';
var NavShadeColor = '#4c4c4c';
var NavBarColor = '#999999';
var FuncLightColor = '#eeeeee';
var FuncShadeColor = '#6e6e6e';
var ExBGColor = '#dddddd';

function NavBtnOver(Btn){
	Btn.style.padding = '1px 3px 3px 1px';
	Btn.style.borderLeftColor = NavLightColor;
	Btn.style.borderTopColor = NavLightColor;
	Btn.style.borderRightColor = NavShadeColor;
	Btn.style.borderBottomColor = NavShadeColor;
}

function NavBtnOut(Btn){
	Btn.style.borderColor = NavBarColor;
	Btn.style.padding = '2px 2px 2px 2px';
}

function NavBtnDown(Btn){
	Btn.style.borderLeftColor = NavShadeColor;
	Btn.style.borderTopColor = NavShadeColor;
	Btn.style.borderRightColor = NavLightColor;
	Btn.style.borderBottomColor = NavLightColor;
	Btn.style.padding = '3px 1px 1px 3px';
}

function FuncBtnOver(Btn){
	Btn.style.padding = '2px 7px 4px 5px';
	Btn.style.borderLeftColor = FuncLightColor;
	Btn.style.borderTopColor = FuncLightColor;
	Btn.style.borderRightColor = FuncShadeColor;
	Btn.style.borderBottomColor = FuncShadeColor;
}

function FuncBtnOut(Btn){
	Btn.style.borderColor = '#dddddd';
	Btn.style.padding = '3px 6px 3px 6px';
}

function FuncBtnDown(Btn){
	Btn.style.borderLeftColor = FuncShadeColor;
	Btn.style.borderTopColor = FuncShadeColor;
	Btn.style.borderRightColor = FuncLightColor;
	Btn.style.borderBottomColor = FuncLightColor;
	Btn.style.padding = '4px 5px 2px 7px';
}

//  \u002A (*) removed from Punc list, <br />  added

var Punc = ' \u0021 \u0022 \u0023 \u0025 \u0026 \u0027 \u0028 \u0029 \u002C \u002D \u002E \u002F \u003A \u003B \u003F \u0040 \u005B \u005C \u005D \u007B \u007D \u00A1 \u00AB \u00AD \u00B7 \u00BB \u00BF \u037E \u0387 \u055A \u055B \u055C \u055D \u055E \u055F \u0589 \u058A \u05BE \u05C0 \u05C3 \u05F3 \u05F4 \u060C \u061B \u061F \u066A \u066B \u066C \u066D \u06D4 \u0700 \u0701 \u0702 \u0703 \u0704 \u0705 \u0706 \u0707 \u0708 \u0709 \u070A \u070B \u070C \u070D \u0964 \u0965 \u0970 \u0DF4 \u0E4F \u0E5A \u0E5B \u0F04 \u0F05 \u0F06 \u0F07 \u0F08 \u0F09 \u0F0A \u0F0B \u0F0C \u0F0D \u0F0E \u0F0F \u0F10 \u0F11 \u0F12 \u0F3A \u0F3B \u0F3C \u0F3D \u0F85 \u104A \u104B \u104C \u104D \u104E \u104F \u10FB \u1361 \u1362 \u1363 \u1364 \u1365 \u1366 \u1367 \u1368 \u166D \u166E \u169B \u169C \u16EB \u16EC \u16ED \u17D4 \u17D5 \u17D6 \u17D7 \u17D8 \u17D9 \u17DA \u17DC \u1800 \u1801 \u1802 \u1803 \u1804 \u1805 \u1806 \u1807 \u1808 \u1809 \u180A \u2010 \u2011 \u2012 \u2013 \u2014 \u2015 \u2016 \u2017 \u2018 \u2019 \u201A \u201B \u201C \u201D \u201E \u201F \u2020 \u2021 \u2022 \u2023 \u2024 \u2025 \u2026 \u2027 \u2030 \u2031 \u2032 \u2033 \u2034 \u2035 \u2036 \u2037 \u2038 \u2039 \u203A \u203B \u203C \u203D \u203E \u2041 \u2042 \u2043 \u2045 \u2046 \u2048 \u2049 \u204A \u204B \u204C \u204D \u207D \u207E \u208D \u208E \u2329 \u232A \u3001 \u3002 \u3003 \u3008 \u3009 \u300A \u300B \u300C \u300D \u300E \u300F \u3010 \u3011 \u3014 \u3015 \u3016 \u3017 \u3018 \u3019 \u301A \u301B \u301C \u301D \u301E \u301F \u3030 \uFD3E \uFD3F \uFE30 \uFE31 \uFE32 \uFE35 \uFE36 \uFE37 \uFE38 \uFE39 \uFE3A \uFE3B \uFE3C \uFE3D \uFE3E \uFE3F \uFE40 \uFE41 \uFE42 \uFE43 \uFE44 \uFE49 \uFE4A \uFE4B \uFE4C \uFE50 \uFE51 \uFE52 \uFE54 \uFE55 \uFE56 \uFE57 \uFE58 \uFE59 \uFE5A \uFE5B \uFE5C \uFE5D \uFE5E \uFE5F \uFE60 \uFE61 \uFE63 \uFE68 \uFE6A \uFE6B \uFF01 \uFF02 \uFF03 \uFF05 \uFF06 \uFF07 \uFF08 \uFF09 \uFF0A \uFF0C \uFF0D \uFF0E \uFF0F \uFF1A \uFF1B \uFF1F \uFF20 \uFF3B \uFF3C \uFF3D \uFF5B \uFF5D \uFF61 \uFF62 \uFF63 \uFF64 <br /> ';

var TriedWords = '';
var Correct = 0;
var TotalWords = 0;
var Finished = '\u00A1Fin del ejercicio!';
var AllDone = false;
var DoneList = new Array();
var Words = new Array();
var BlankWords = new Array();
var FreeWords = new Array();
var StartTime = (new Date()).getTime();

var FinalScore = 0;

function StartUp(){

//[Startup code for getting student id]

	TotalWords = Words.length;

	var x = 0;
	var y = 0;
	var Temp = '';

	for (x=0; x<Words.length; x++){
		DoneList[x] = 1;
		if (Words[x] == 'xxxNewParaxxx'){
			BlankWords[x] = '<br />';
			Words[x] = '<br />';
			TotalWords--;
			DoneList[x] = 0;
		}
		else{
			if (Punc.indexOf(Words[x]) > -1) {
				BlankWords[x] = Words[x];
				TotalWords--;
				DoneList[x] = 0;
			}
			else {
				Temp = '';
				for (y=0; y<Words[x].length; y++) {
					if (Words[x].charAt(y) == '\''){
						Temp += '\'';
					}
					else{
						Temp += '*';
					}
				}
			BlankWords[x] = Temp;
			}
		}
	}

	if (FreeWords.length > 0){
		for (x=0; x<FreeWords.length; x++){
			for (y=0; y<Words.length; y++){
				if (FreeWords[x].toUpperCase() == Words[y].toUpperCase()){
					BlankWords[y] = Words[y];
					DoneList[y] = 0;
					TotalWords--;
				}
			}
		}
	}

	WriteText();
	document.getElementById('Guess').value = '';
	document.getElementById('Guess').focus();


}

function WriteText() {

	var Output = '';
	var x = 0;
	var LastOne = 'Punc';

	for (x=0; x<BlankWords.length; x++) {
		if ((Punc.indexOf(BlankWords[x]) == -1) && (LastOne != 'Punc')) {
			Output += ' ';
		}

		Output += BlankWords[x];

		if (Punc.indexOf(BlankWords[x]) > -1) {
			LastOne = 'Punc';
		}

		else {
			LastOne = 'NotPunc';
		}
	}
	document.getElementById('Stars').innerHTML = Output;
}


function CheckGuess(InputWord) {

	if (AllDone == true){
		return;
	}

	InputWord = TrimString(document.getElementById('Guess').value);

	if (InputWord.length == 0) {
		return;
	}

	var x = 0;
	var FoundOne = 0;

	for (x=0; x<Words.length; x++) {
		if (InputWord.toUpperCase() == Words[x].toUpperCase()) {

			FoundOne = -1;
			if (BlankWords[x] != Words[x]){
				Correct++;
			}
			BlankWords[x] = Words[x];
			DoneList[x] = 0;
		}
	}

	if (FoundOne == -1) {
		WriteText();
	}

	else {
		document.getElementById('UsedBoxLabel').innerHTML = 'Palabras errneas:';
		document.getElementById('UsedBox').innerHTML += InputWord + '<br />';
		Correct--;
	}

	document.getElementById('ScoreBox').innerHTML = Correct + '/' + TotalWords;

	document.getElementById('Guess').value = '';
	CheckFinished();	
	document.getElementById('Guess').focus();
}

function Hint(){

	if (AllDone == true){
		return;
	}
	
	var x = 0;
	var y = 0;

//find the first unrevealed word

	while ((Words[x] == BlankWords[x]) && (x < Words.length - 1)) {
		x = x + 1;
	}

//find the first incorrect letter

	while ((Words[x].charAt(y) == BlankWords[x].charAt(y)) && (y < Words[x].length - 1)) {
		y = y + 1;
	}

	BlankWords[x] = Words[x].substring(0, y+1) + BlankWords[x].substring(y+1, BlankWords[x].length);


	if (BlankWords[x] == Words[x]){
		DoneList[x] = 0;
	}

	WriteText();

	Correct--;

	document.getElementById('ScoreBox').innerHTML = Correct + '/' + TotalWords;
	CheckFinished();
	document.getElementById('Guess').focus();
}

function CheckFinished(){
	var Done = true;
	for (var x=0; x<DoneList.length; x++){
		if (DoneList[x] == 1){
			Done = false;
		}
	}
	if (Done == true){
		document.getElementById('Guess').value = Finished;
		AllDone = true;
		FinalScore = Math.floor((100 * Correct)/TotalWords);
		Finish();
	}
}

function TrimString(InString){
        var x = 0

        if (InString.length != 0) {
                while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){
                        InString = InString.substring(0, InString.length - 1)
                }

                while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){
                        InString = InString.substring(1, InString.length)
                }

                while (InString.indexOf('  ') != -1) {
                        x = InString.indexOf('  ')
                        InString = InString.substring(0, x) + InString.substring(x+1, InString.length)
                 }

                return InString;
        }

        else {
                return '';
        }
}

function Finish(){
//If there's a form, fill it out and submit it
	if (document.store != null){
		Frm = document.store;
		Frm.starttime.value = StartTime;
		Frm.endtime.value = (new Date()).getTime();
		Frm.mark.value = FinalScore;
		Frm.submit();

	}
}






Words[0] = '\u004C\u006F\u0073';
Words[1] = '\u0066\u006F\u0072\u006F\u0073';
Words[2] = '\u0070\u0075\u0065\u0064\u0065\u006E';
Words[3] = '\u0073\u0065\u0072';
Words[4] = '\u0070\u00FA\u0062\u006C\u0069\u0063\u006F\u0073';
Words[5] = '\u006F';
Words[6] = '\u0070\u0072\u0069\u0076\u0061\u0064\u006F\u0073';
Words[7] = '\u002C\u0020';
Words[8] = '\u0070\u0075\u0065\u0064\u0065\u006E';
Words[9] = '\u0073\u0065\u0072';
Words[10] = '\u0067\u0065\u006E\u0065\u0072\u0061\u006C\u0065\u0073';
Words[11] = '\u002C\u0020';
Words[12] = '\u0073\u00F3\u006C\u006F';
Words[13] = '\u0064\u0065';
Words[14] = '\u006C\u0065\u0063\u0074\u0075\u0072\u0061';
Words[15] = '\u006F';
Words[16] = '\u0073\u00F3\u006C\u006F';
Words[17] = '\u0070\u0075\u0065\u0064\u0065\u006E';
Words[18] = '\u0072\u0065\u0073\u0070\u006F\u006E\u0064\u0065\u0072';
Words[19] = '\u006C\u006F\u0073';
Words[20] = '\u0061\u006C\u0075\u006D\u006E\u006F\u0073';
Words[21] = '\u002E\u0020';


FreeWords[0] = '\u004C\u006F\u0073';
FreeWords[1] = '\u0066\u006F\u0072\u006F\u0073';
FreeWords[2] = '\u0070\u0075\u0065\u0064\u0065\u006E';
FreeWords[3] = '\u0073\u0065\u0072';
FreeWords[4] = '\u006F';
FreeWords[5] = '\u0070\u0072\u0069\u0076\u0061\u0064\u006F\u0073';
FreeWords[6] = '\u0067\u0065\u006E\u0065\u0072\u0061\u006C\u0065\u0073';
FreeWords[7] = '\u0064\u0065';
FreeWords[8] = '\u0073\u00F3\u006C\u006F';
FreeWords[9] = '\u0072\u0065\u0073\u0070\u006F\u006E\u0064\u0065\u0072';
FreeWords[10] = '\u0061\u006C\u0075\u006D\u006E\u006F\u0073';



//-->

//]]>

</script>

</head>

<body onload="StartUp()">

<!-- BeginTopNavButtons -->



<!-- EndTopNavButtons -->

<div class="Titles">
	<span class="ExerciseTitle">Clases de foros</span><br />
	<span class="Instructions"></span><br />
</div>

<!-- [Student login info] -->



<div class="StdDiv">

<table border="0" cellpadding="8" style="margin-left: auto; margin-right: auto;"><tr>

<td style="text-align: center; vertical-align: top;">

<form id="Rhubarb" action="" onsubmit="CheckGuess(); return false">
<div style="margin-top: 10px;">
<label for="Guess">Hueco</label>
<input type="text" id="Guess" size="15"></input>

<br />

<button id="CheckButton" class="FunctionButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOver(this)" onclick="CheckGuess(); return false;">Comprobar</button>


<button id="HintButton" class="FunctionButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOver(this)" onclick="Hint(); return false;">Pista</button>




</div>
</form>

<span class="Label">Su puntuacin es:</span> <span id="ScoreBox">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>


<br /><br />

<span class="Label" id="UsedBoxLabel"></span><br />
<span id="UsedBox"></span>

</td>

<td style="text-align: center; vertical-align: top;">

<div id="Stars">
Preparing exercise...
</div>

</td>

</tr></table>

</div>

<!-- BeginBottomNavButtons -->



<!-- EndBottomNavButtons -->

<!-- BeginSubmissionForm -->

<!-- EndSubmissionForm -->

</body>
</html>
