Tu sei qui: Home / Lingua / Esercizi / Esercizi interattivi / I possessivi

I possessivi

Livello elementare (principianti). Inserire l'aggettivo o il pronome possessivo adeguato.

HTML icon Possessivib.html — HTML, 18 KB (18612 bytes)

Contenuto del file

<head>
	<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
	<meta name="generator" content="Adobe GoLive 4">
	<title>Inserisci l'aggettivo o il pronome possessivo adeguato</title>
	<meta name="author" content="Created with Hot Potatoes by Half-Baked Software, registered to Alberto Cairoli.">
	<meta name="keywords" content="Hot Potatoes, Half-Baked Software, Windows, University of Victoria">
	<script language="javascript" type="text/javascript"><!--
//<![CDATA[

<!--

function BrowserCheck() {
	var b = navigator.appName;
//HBS extension
	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.version = navigator.appVersion;
	this.v = parseInt(this.version);
	this.ns = (this.b=="ns" && this.v>=4);
	this.ns4 = (this.b=="ns" && this.v==4);
	this.ns5 = (this.b=="ns" && this.v==5);
	this.ie = (this.b=="ie" && this.v>=4);
	this.ie4 = (this.version.indexOf('MSIE 4')>0);
	this.ie5 = (this.version.indexOf('MSIE 5')>0);
	this.min = (this.ns||this.ie);
}

is = new BrowserCheck();

var FlipChars = (is.mac && is.ns);

var Feedback = '';
var Correct = 'Esatto! Ben fatto.';
var Incorrect = 'Alcune delle tue risposte sono sbagliate. Le risposte sbagliate sono state cancellate.'; 
var GiveHint = '&Egrave; stata aggiunta la successiva lettera giusta alla tua risposta.';
var CaseSensitive = true;
var YourScoreIs = 'Risultato: ';
var Instructions = 'Completa, secondo questo modello: " Ho un cane. Il mio cane &egrave; bello." Poi premi "Controlla" per verificare l\'esattezza delle tue risposte.';
var BuiltCloze = '';
var ExerciseSubtitle = '';
var ExerciseTitle = 'Inserisci l\'aggettivo o il pronome possessivo adeguato';
var FirstShow = true;
var ReadingURL = '';

var PreviousPage = history.length;





var NavBar='';



var TitleCode = '<tr><td align="center" valign="middle" bgcolor="#FFFFFF">';
TitleCode += '<font size="+1" face="Geneva,Arial" color="#000033">' + ExerciseTitle + '</font><br />';
TitleCode += '<font size="-1" face="Geneva,Arial" color="#000033">' + ExerciseSubtitle + '<br />';

TitleCode += '</font></td></tr>';

var WordBox = '';

var ClozeOpener = '<table border="0" width="85%" cellpadding="10">';
ClozeOpener += '<tr><td valign="top" bgcolor="">';
ClozeOpener += '<form name="Cloze"><font face="Geneva,Arial" color="#000033">';

var ClozeCloser = '</font></form></td></tr>';

var Buttons = '<tr><td align="center" valign="top" bgcolor="">';
Buttons += '<form name="Buttons"><font face="Geneva,Arial" color="#000033">';
Buttons += '<input type="button" value="Controlla" onclick="parent.CheckAnswers()"></input>';



Buttons += '</font></form></td></tr></table>';

var GapCode = '<input type="text" name="[strGapName]" size="[strGapSize]" onFocus="parent.TrackFocus([strItemNum])" value="[strValue]"></input>';
var ClueButton = '';

ClueButton = '<input type="button" value="[?]" onclick="parent.ShowClue([strItemNum])"></input>';


function GoBack(){
	var BackSkip = history.length - PreviousPage;
	if (BackSkip > 0){
		history.go((BackSkip+1)*-1);
	}
	else{
		parent.history.back();
	}
}




function BuildExercise(){
	var OutString = '';
	var ClozeStuff = '';

	for (var i=0; i<I.length; i++){

//Add the text
		ClozeStuff += Text[i];

//Create and add the gap
//If it's already right, then add it in bold:
		if (State[i][4] == 1){
			ClozeStuff += '<b><span id="CorrectAns">' + Webble(State[i][5]) + '</span></b>';
		}
		
		else{
			GapLen = I[i][1][0][0].length;
			if (GapLen < 3){GapLen = 3;}
			Gap = ReplaceStuff('[strGapSize]', GapLen, GapCode);
			Gap = ReplaceStuff('[strGapName]', 'Gap' + i + '', Gap);
			Gap = ReplaceStuff('[strItemNum]', i + '', Gap);
			Gap = ReplaceStuff('[strValue]', State[i][5], Gap);
			ClozeStuff += Gap;	

//Create and add the clue button
			if (I[i][2].length > 0){
				Btn = ReplaceStuff('[strItemNum]', i + '', ClueButton);
				ClozeStuff += Btn;
			}
		}
	}

//Add the last bit
	if (Text.length > I.length){
		ClozeStuff += Text[Text.length-1];
	}



//Put the final pieces together
	OutString = ClozeOpener + ClozeStuff + ClozeCloser + Buttons;
	BuiltCloze = OutString;
}

function WriteFeedback(Feedback) {
//Build the output string
	var OutString = '';
	OutString += '<html>';
	OutString += '<body  background="Sfondo.jpg" bgcolor="#FFFFFF" text="#000033" link="#0000cc" vlink="#0000ff">';
	OutString += '<center><table border="0" cellpadding="5" cellspacing="1" width="85%">';
	OutString += NavBar;
	if (Feedback.length>0){
		OutString += '<tr><td bgcolor="" align="center">'; 
		OutString += '<font face="Geneva,Arial" size="-1" color="#000033">';
		OutString += Feedback;
		OutString += '</font></td></tr>'
	}
	OutString += '</table></center></body></html>';
//Write it to the frame
	TopFrame.document.clear();
	TopFrame.document.open();
	TopFrame.document.write(OutString);
	TopFrame.document.close();
}

function DisplayExercise(){
//Build the output string
	var OutString = '';
	OutString += '<html>';
	OutString += '<body  background="Sfondo.jpg" bgcolor="#FFFFFF" text="#000033" link="#0000cc" vlink="#0000ff">';
	OutString += '<center><table border="0" cellpadding="5" cellspacing="1" width="85%">';
	OutString += TitleCode; 
	OutString += '<tr><td bgcolor="" align="center">'; 
	if (WordBox.length > 0){
		OutString += WordBox;
	}
	OutString += '<font face="Geneva,Arial" size="-1">';
	OutString += BuiltCloze;
	OutString += '</font></td></tr>';
	OutString += NavBar;
	OutString += '</table></center></body></html>';

//Write it to the frame
	BottomFrame.document.clear();
	BottomFrame.document.open();
	BottomFrame.document.write(OutString);
	BottomFrame.document.close();
}

function ShowClue(ItemNum){
//alert(ItemNum);
	State[ItemNum][0] = 1;
	WriteFeedback(I[ItemNum][2]);
}

function SaveCurrentAnswers(){
	for (var i=0; i<I.length; i++){
		State[i][5] = GetGapValue(i);
	}
}

function RestoreCurrentAnswers(){
	for (var i=0; i<I.length; i++){
		SetGapValue(i, State[i][5]);
	}
}

var CurrentWord = 0;

function ReplaceStuff(Token, Replacement, InString){
	var i = InString.indexOf(Token);
	var FirstBit = '';
	var LastBit = '';
	while (i>-1){
		FirstBit = InString.substring(0, i);
		LastBit = InString.substring(i + Token.length, InString.length);	
		InString = FirstBit + Replacement + LastBit;
		i = InString.indexOf(Token);
	}
	return InString;
}

var LowerString='abcdefghijklmnopqrstuvwxyz%9A%9C%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F8%F9%FA%FB%FC%FD%FE%FF';
var UpperString='ABCDEFGHIJKLMNOPQRSTUVWXYZ%8A%8C%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D8%D9%DA%DB%DC%DD%DE%9F';

LowerString = unescape(LowerString);
UpperString = unescape(UpperString);

I = new Array();

I[0] = new Array();
I[0][1] = new Array();
I[0][1][0] = new Array();
I[0][1][0][0]='Le tue';
I[0][2]='';

I[1] = new Array();
I[1][1] = new Array();
I[1][1][0] = new Array();
I[1][1][0][0]='il suo';
I[1][2]='';

I[2] = new Array();
I[2][1] = new Array();
I[2][1][0] = new Array();
I[2][1][0][0]='Il nostro';
I[2][2]='';

I[3] = new Array();
I[3][1] = new Array();
I[3][1][0] = new Array();
I[3][1][0][0]='La loro';
I[3][2]='';

I[4] = new Array();
I[4][1] = new Array();
I[4][1][0] = new Array();
I[4][1][0][0]='La vostra';
I[4][2]='';

I[5] = new Array();
I[5][1] = new Array();
I[5][1][0] = new Array();
I[5][1][0][0]='I tuoi';
I[5][2]='';

I[6] = new Array();
I[6][1] = new Array();
I[6][1][0] = new Array();
I[6][1][0][0]='Suo';
I[6][2]='';

I[7] = new Array();
I[7][1] = new Array();
I[7][1][0] = new Array();
I[7][1][0][0]='Le sue';
I[7][2]='';

I[8] = new Array();
I[8][1] = new Array();
I[8][1][0] = new Array();
I[8][1][0][0]='La mia';
I[8][2]='';

I[9] = new Array();
I[9][1] = new Array();
I[9][1][0] = new Array();
I[9][1][0][0]='I tuoi';
I[9][2]='';

I[10] = new Array();
I[10][1] = new Array();
I[10][1][0] = new Array();
I[10][1][0][0]='tua';
I[10][2]='';


Text = new Array();
Text[0]='Hai molte amiche. ';
Text[1]=' amiche sono svizzere.<br />Ha un bel giardino, ma ';
Text[2]=' giardino &egrave; piccolo.<br />Abbiamo un professore di storia. ';
Text[3]=' professore &egrave; vecchio.<br />Roberto e Silvia hanno una bambina. ';
Text[4]=' bambina &egrave; bella.<br />Abitate in una villa. ';
Text[5]=' villa &egrave; vicino al mare.<br />Hai tre figli. ';
Text[6]=' figli sono grandi.<br />Paolo ha uno zio. ';
Text[7]=' zio &egrave; simpatico.<br />Francesca ha due sorelle. ';
Text[8]=' sorelle abitano a Milano.<br />Ho un\'idea. ';
Text[9]=' idea &egrave; buona.<br />Hai due fratelli e una sorella. ';
Text[10]=' fratelli sono all\'universit&agrave; e ';
Text[11]=' sorella va ancora al liceo.<br />';


State = new Array();

CharList = new Array();

EscapeList = new Array();


function StartUp(){

	var i = 0;

	for (i=0; i<I.length; i++){
		for (j=0; j<I[i][1].length; j++){
			I[i][1][j][0] = unescape(I[i][1][j][0]);
		}
	}



	State.length = 0;
	for (i=0; i<I.length; i++){
		State[i] = new Array();
		State[i][0] = 0; // clue asked for or not
		State[i][1] = 0; // hints asked for, or penalties for checking a wrong answer
		State[i][2] = 0; // length of answer matched
		State[i][3] = 0; // score for this item
		State[i][4] = 0; // already answered correctly 
		State[i][5] = ''; // answer entered in text box (right or not)
	}
	BuildExercise();
	WriteFeedback(Instructions);
	DisplayExercise();





}

function Webble(InString){
	var OutString = '';
	var NextChar = '';
	var FoundCode = '';
	var j = 0;
	var i = 0;
	for (i=0; i<InString.length; i++){
		FoundCode = '';
		NextChar = InString.charAt(i);
		for (j=0; j<CharList.length; j++){
			if (NextChar == CharList[j]){
				FoundCode = EscapeList[j];
			}
		}
		if (FoundCode.length > 0){
			OutString += FoundCode;
		}
		else{
			OutString += NextChar;
		}
	}
	return OutString;
}

var MacChars = '%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A';
MacChars += '%9B%9C%9D%9E%9F%A0%A1%A4%A5%A6%A7%A8%AA%AB%AC%AE%AF%B4%B6%BB%BC%BE%BF%C0%C1%C2%C4%C7%C8';
MacChars += '%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D8%D9%DA%DB%DC%DD%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9';
MacChars += '%EA%EB%EC%ED%EE%EF%F1%F2%F3%F4%F5%F6%F7%F8%FB%FD';

var WinChars = '%C4%C5%C7%C9%D1%D6%DC%E1%E0%E2%E4%E3%E5%E7%E9%E8%EA%EB%ED%EC%EE%EF%F1%F3%F2%F4';
WinChars += '%F6%F5%FA%F9%FB%FC%86%BA%A7%95%B6%DF%AE%99%92%A8%C6%D8%A5%F0%AA%BA%E6%F8%BF%A1%AC%83%AB%BB';
WinChars += '%85%82%C0%C3%D5%8C%9C%96%97%93%94%91%92%F7%FFY/%A4%8B%9B%87%B7%82%84%89%C2%CA%C1%CB';
WinChars += '%C8%CD%CE%CF%CC%D3%D4%D2%DA%DB%D9%B9%88%98%AF%B0%94';


WinChars = unescape(WinChars);
MacChars = unescape(MacChars)

function MacStringToWin(InString){

	var OutString = '';
	for (i=0; i<InString.length; i++){
		if ( (InString.charAt(i) > '~') && (MacChars.indexOf(InString.charAt(i)) > -1) ){
			OutString += WinChars.charAt(MacChars.indexOf(InString.charAt(i)));
		}
		else {
			OutString += InString.charAt(i);
		}
	}
	return OutString;
}

function WinStringToMac(InString){

	var OutString = '';
	for (i=0; i<InString.length; i++){
		if ( (InString.charAt(i) > '~') && (WinChars.indexOf(InString.charAt(i)) > -1) ){
			OutString += MacChars.charAt(WinChars.indexOf(InString.charAt(i)));
		}
		else {
			OutString += InString.charAt(i);
		}
	}
	return OutString;
}

function TrimString(InString){
        var x = 0

        if (InString.length != 0) {
                while ((escape(InString.charAt(InString.length - 1)) == '%20') || (escape(InString.charAt(InString.length - 1)) == '%0A') || (escape(InString.charAt(InString.length - 1)) == '%0D')){
                        InString = InString.substring(0, InString.length - 1)
                }

                while ((escape(InString.charAt(0)) == '%20') || (escape(InString.charAt(0)) == '%0A') || (escape(InString.charAt(0)) == '%0D')){
                        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 ConvertCase(InString, Direction){

	var FromString = '';
	var ToString = '';

	if (Direction == 0){
		FromString = UpperString;
		ToString = LowerString;
	}
	else{
		FromString = LowerString;
		ToString = UpperString;
	}

	var i = 0;
	j = 0;
	var OutString = '';
	for (i=0; i<InString.length; i++){
		if (FromString.indexOf(InString.charAt(i)) > -1){
			j = FromString.indexOf(InString.charAt(i));			
			OutString += ToString.charAt(j);
		}
		else{	
			OutString += InString.charAt(i);
		}
	}
	return OutString;
}

function CheckAnswers(){

	SaveCurrentAnswers();
	var AllCorrect = 1;

//Check each answer
	for (var i = 0; i< I.length; i++){

		if (State[i][4] != 1){
//If it's right, calculate its score
			if (CheckAnswer(i, true) > -1){
				var TotalChars = GetGapValue(i).length;
				State[i][3] = (TotalChars-State[i][1])/TotalChars;
				if (State[i][0] > 0){State[i][3] = State[i][3]/2;}
				if (State[i][3]<0){State[i][3] = 0;}
				State[i][4] = 1;
			}
			else{
//Otherwise, add zero to the array and increment the hints for this item, as a penalty
				State[i][1]++;
				State[i][3] = 0;

//then set the flag
				AllCorrect = 0;
			}
		}
	}

//Calculate the total score
	var TotalScore = 0;
	for (i=0; i<State.length; i++){
		TotalScore += State[i][3];
	}
	TotalScore = Math.floor((TotalScore * 100)/I.length);

//Compile the output
	Output = '';

	if (AllCorrect == 1){
		Output = Correct + '<br />';
	}

	Output += YourScoreIs + ' ' + TotalScore + '%.<br />';
	if (AllCorrect == 0){
		Output += '<br />' + Incorrect;
	}
	BuildExercise();
	WriteFeedback(Output);



	DisplayExercise();
	RestoreCurrentAnswers();
}


function TrackFocus(BoxNumber){
	CurrentWord = BoxNumber;
}

function CheckBeginning(Guess, Answer){
	var OutString = '';
	var i = 0;
	var UpperGuess = '';
	var UpperAnswer = '';

	if (CaseSensitive == false) {
		UpperGuess = ConvertCase(Guess, 1);
		UpperAnswer = ConvertCase(Answer, 1);
	}
	else {
		UpperGuess = Guess;
		UpperAnswer = Answer;
	}

	while (UpperGuess.charAt(i) == UpperAnswer.charAt(i)) {
		OutString += Guess.charAt(i);
		i++;
	}
	OutString += Answer.charAt(i);
	return OutString;
}

function FindLongest(InArray){
	if (InArray.length < 1){return -1;}

	var Longest = 0;
	for (var i=1; i<InArray.length; i++){
		if (InArray[i].length > InArray[Longest].length){
			Longest = i;
		}
	}
	return Longest;
}

function GetGapValue(GNum){
	var RetVal = '';
	if ((GNum<0)||(GNum>=I.length)){return RetVal;}
	if (eval('BottomFrame.document.Cloze.Gap' + GNum) != null){
		RetVal = eval('BottomFrame.document.Cloze.Gap' + GNum).value;
		if (FlipChars==true){RetVal = MacStringToWin(RetVal);}
		RetVal = TrimString(RetVal);
	}
	else{
		RetVal = State[GNum][5];
	}
	return RetVal;
}

function SetGapValue(GNum, Val){
	if ((GNum<0)||(GNum>=I.length)){return;}
	if (FlipChars==true){Val = WinStringToMac(Val);}
	if (eval('BottomFrame.document.Cloze.Gap' + GNum) != null){
		eval('BottomFrame.document.Cloze.Gap' + GNum).value = Val;
	}
}

function FindCurrent() {
	var x = 0;
	FoundCurrent = -1;

//Test the current word:
//If it's state is not set to already correct, check the word.
	if (State[CurrentWord][4] != 1){
		if (CheckAnswer(CurrentWord, false) < 0){
			return CurrentWord;
		}
	}
	
	x=CurrentWord + 1;
	while (x<I.length){
		if (State[x][4] != 1){
			if (CheckAnswer(x, false) < 0){
				return x;
			}
		}
	x++;	
	}

	x = 0;
	while (x<CurrentWord){
		if (State[x][4] != 1){
			if (CheckAnswer(x, false) < 0){
				return x;
			}
		}
	x++;	
	}
	return FoundCurrent;
}

function CheckAnswer(GapNum, MarkAnswer){
	var Guess = GetGapValue(GapNum);
	var UpperGuess = '';
	var UpperAnswer = '';
	if (CaseSensitive == false){
		UpperGuess = ConvertCase(Guess, 1);
	}
	else{
		UpperGuess = Guess;
	}
	var Match = -1;
	for (var i = 0; i<I[GapNum][1].length; i++){
		if (CaseSensitive == false){
			UpperAnswer = ConvertCase(I[GapNum][1][i][0], 1);
		}
		else{
			UpperAnswer = I[GapNum][1][i][0];
		}
		if (TrimString(UpperGuess) == UpperAnswer){
			Match = i;
			if (MarkAnswer == true){
				State[GapNum][4] = 1;
			}
			State[GapNum][5] = Guess;
		}
	}
	return Match;
}

function GetHint(GapNum){
	Guess = GetGapValue(GapNum);

	if (CheckAnswer(GapNum, false) > -1){return ''}
	RightBits = new Array();
	for (var i=0; i<I[GapNum][1].length; i++){
		RightBits[i] = CheckBeginning(Guess, I[GapNum][1][i][0]);
	}
	var RightOne = FindLongest(RightBits);
	var Result = I[GapNum][1][RightOne][0].substring(0,RightBits[RightOne].length);
//Add another char if the last one is a space
	if (Result.charAt(Result.length-1) == ' '){
		Result = I[GapNum][1][RightOne][0].substring(0,RightBits[RightOne].length+1);
	}
	return Result;
}

function ShowHint(){
	var CurrGap = FindCurrent();
	if (CurrGap < 0){return;}

	var HintString = GetHint(CurrGap);

	if (HintString.length > 0){
		SetGapValue(CurrGap, HintString);
		State[CurrGap][1] = State[CurrGap][1] + 1;
	}
	WriteFeedback(GiveHint);
}




function Blank(){
	return '<html><body>&copy;Half-Baked Software. Loading...</body></html>';
}
// -->
	</script>
</head>

<frameset rows="15%,*" framespacing="0" border="0" onload="StartUp()">
	<frame src="javascript:parent.Blank()" frameborder="0" name="TopFrame">
	<frame src="javascript:parent.Blank()" frameborder="0" name="BottomFrame">
</frameset>
<noframes>
	<!--<body>Fool those dumb ad-inserting ISPs</body>-->
	<!--For full XHTML 1.0 compatibility, remove the border and framespacing attributes.
These are required for proper display in current browsers, but render the document incompatible. Then, you'll need to add the appropriate Document Type Declaration; use
the W3C XHTML 1 frameset DTD.-->
	</html>
</noframes>