function Question (qname,
type,
qstring,
response,
corrects,
explan,
ifcorrect,ifwrong,ifnull,
img)
{this.qname=qname;
this.type=type;
this.qstring=qstring;
this.response=response;
this.corrects=corrects;
this.explan=explan;
this.ifcorrect=ifcorrect;
this.ifwrong=ifwrong;
this.ifnull=ifnull;
this.img=img;
}

resp=new Array("Tra tensione di ingresso e resistenza di ingresso","Tra tensione di uscita e tensione di ingresso","Tra tensione di ingresso e tensione di uscita","Tra tensione di uscita &nbsp;e resistenza di uscita")
corr=new Array("0","1","0","0")
quest001 = new Question(
"Domanda 1",
0,
"<b>Si dice guadagno di tensione A</b><b><sub>V &nbsp;</sub></b><b>di un quadripolo il rapporto:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("Che ha corrente di collettore costante","Che ha corrente di base costante","In grado di regolare la corrente di collettore mediante una piccola corrente di base","In grado di regolare lacorrente di collettore mediante la corrente di emettitore")
corr=new Array("0","0","1","0")
quest002 = new Question(
"Domanda 2",
0,
"<b>Il transistor BJT &egrave; un componente:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("In modo che il collettore sia negativo rispetto all'emettitore","In modo che il collettore sia positivo rispetto all'emettitore","In modo che si possa invertire a piacere la tensione tracollettore ed emettitore","In modo che la base sia negativa rispetto all'emettitore")
corr=new Array("0","1","0","0")
quest003 = new Question(
"Domanda 3",
0,
"<b>Il transistor BJT di tipo NPN va polarizzato:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("Della corrente di collettore I<sub>C </sub>&nbsp;in funzione della tensione V<sub>CE</sub>","Della corrente di collettore I<sub>C &nbsp;</sub>in funzione della corrente di base I<sub>B</sub>","Della corrente di base I<sub>B &nbsp;</sub>in funzione della tensione tra base ed emettitore V<sub>BE</sub>","Della corrente di base I<sub>B </sub>in funzione della corrente di collettore I<sub>C</sub>")
corr=new Array("0","0","1","0")
quest004 = new Question(
"Domanda 4",
0,
"<b>La caratteristica di ingresso di un BJT esprime l'andamento :</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("Polarizzando inversamente la giunzione base-emettitore","Applicando tensione nulla sulla base","Polarizzando direttamente la giunzione base-emettitore","Nessuna delle altre risposte")
corr=new Array("0","0","1","0")
quest005 = new Question(
"Domanda 5",
0,
"<b>Un transistor BJT si comporta da interruttore chiuso:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("Base e collettore","Base ed emettitore","Collettore ed emettitore","Tutte le altre 3 risposte sono esatte")
corr=new Array("0","0","1","0")
quest006 = new Question(
"Domanda 6",
0,
"<b>In un transistore le zone drogate dello stesso tipo sono:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("1,75 mA","1,550 mA","2 mA","51,5 mA")
corr=new Array("0","1","0","0")
quest007 = new Question(
"Domanda 7",
0,
"<b>La corrente di base di un transistor &egrave; di 50 <img src=\"wbqst7_1.PNG\" width=16 height=17 border=0></b><b>A. &nbsp;La corrente di collettore &egrave; di 1,5 mA. Quanto vale la corrente di emettitore?</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("1 mA","10 mA","200 mA","10000 mA")
corr=new Array("0","1","0","0")
quest008 = new Question(
"Domanda 8",
0,
"<b>Un transistor BJT ha un guadagno statico di corrente pari a 100. &nbsp;La sua corrente di base I</b><b><sub>B &nbsp;</sub></b><b>&egrave; di 100 <img src=\"wbqst8_1.PNG\" width=16 height=17 border=0></b><b>A. Quanto vale la corrente di collettore I</b><b><sub>C </sub></b><b>?</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("V<sub>CC </sub>/ 2","V<sub>CC</sub>","0 volt","2 volte la &nbsp;V<sub>CC</sub>")
corr=new Array("0","0","1","0")
quest009 = new Question(
"Domanda 9",
0,
"<b>Quando un transistor &egrave; saturo, la sua V</b><b><sub>CE &nbsp;</sub></b><b>&egrave; circa uguale a :</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("SI","NO","Solo per certe applicazioni","Dipende dalla ampiezza del segnale di ingresso")
corr=new Array("0","1","0","0")
quest010 = new Question(
"Domanda 10",
0,
"<b>Un multivibratore astabile necessita del segnale di ingresso?</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("Sommatori","Differenziatori","Comparatori","Amplificatori")
corr=new Array("0","0","1","0")
quest011 = new Question(
"Domanda 11",
0,
"<b>I due operazionali presenti all'interno dell'integrato 555 hanno il ruolo di:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("1,386 msec.","7,95 msec.","1,4 sec.","8 sec.")
corr=new Array("1","0","0","0")
quest012 = new Question(
"Domanda 12",
0,
"<b>Il multivibratore astabile in figura, realizzato con l'I.C. 555 &nbsp;ha R</b><b><sub>1 </sub></b><b>= 6 KOhm , R</b><b><sub>2 </sub></b><b>= 7 KOhm &nbsp;e &nbsp;C= 100 nF. Quanto vale il periodo totale?</b>",
resp,
corr,
"<small>La formula per calcolare il periodo è: T = 0,693 * (R<sub>1 </sub>+ 2R<sub>2</sub> ) * C</small>",
4,
-1,
0,
"555.gif");

resp=new Array("52 %","65 %","82 %","33 %")
corr=new Array("0","1","0","0")
quest013 = new Question(
"Domanda 13",
0,
"<b>Nel multivibratore indicato in figura, quanto vale il Duty Cycle (in %) ?</b>",
resp,
corr,
"<small>Il Duty Cycle si calcola con la formula <img src=\"wbexp13_1.PNG\" width=170 height=41 border=0></small>",
4,
-1,
0,
"555.gif");

resp=new Array("T = 0,7 * <img src=\"wbans014_1.PNG\" width=13 height=14 border=0>","T = 1,4 * <img src=\"wbans114_1.PNG\" width=13 height=14 border=0>","T = 1,4 * R","T = 1,4 * C")
corr=new Array("0","1","0","0")
quest014 = new Question(
"Domanda 14",
0,
"<b>In un multivibratore astabile realizzato con transistor, nell'ipotesi che le resistenze di base siano uguale tra loro e che i condensatori siano anch'essi di uguale valore tra loro, il periodo T del segnale sar&agrave; uguale a: </b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("Conserva lo stato dell'uscita (memorizza)","Porta l'uscita Q = 0","Porta l'uscita Q = 1","E' una combinazione non ammissibile")
corr=new Array("0","1","0","0")
quest015 = new Question(
"Domanda 15",
0,
"<b>In un flip-flop SR, la combinazione S = 0 &nbsp;, R = 1 :</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("Complementari","NPN","Uguali","PNP")
corr=new Array("0","0","1","0")
quest016 = new Question(
"Domanda 16",
0,
"<b>I transistor costituenti un amplificatore differenziale (lo stadio d'ingresso di un A.O.) debbono essere:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("Prporzionale al segnale d'ingresso maggiore","Proporzionale alla differenza dei segnali d'ingresso","Proporzionale alla somma dei segnali d'ingresso","Proporzionale al prodotto dei segnali d'ingresso")
corr=new Array("0","1","0","0")
quest017 = new Question(
"Domanda 17",
0,
"<b>In un amplificatore differenziale il segnale di uscita &egrave;:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("La massima corrente a cui può lavorare un l' operazionale","La massima velocità di variazione della tensione di uscita nell'unità di tempo","La massima tensione che può essere prelevata all' uscita dell'operazionale","La massima tensione che può essere applicata all'ingresso dell'operazionale")
corr=new Array("0","1","0","0")
quest018 = new Question(
"Domanda 18",
0,
"<b>Lo Slew Rate di un operazionale indica:</b>",
resp,
corr,
"<small><img src=\"wbexp18_1.PNG\" width=65 height=41 border=0></small>",
4,
-1,
0,
"");

resp=new Array("500 mV","5 V","0 V","100 mV")
corr=new Array("0","0","1","0")
quest019 = new Question(
"Domanda 19",
0,
"<b>Agli ingressi di un amplificatore differenziale con guadagno A</b><b><sub>d</sub></b><b> = 100, sono applicati due segnali sinusoidali della stessa frequenza, in fase fra di loro ed entrambi di valore massimo V</b><b><sub>M</sub></b><b> = 50 mV. &nbsp;Il segnali di uscita sar&agrave;:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("30 V","6 V","10 V","- 10 V")
corr=new Array("0","0","1","0")
quest020 = new Question(
"Domanda 20",
0,
"<b>Un amplificatore operazionale in configurazione ad anello aperto ha guadagno A</b><b><sub>d</sub></b><b> = 15 ed &egrave; alimentato con tensione di alimentazione di <img src=\"wbqst20_1.PNG\" width=14 height=16 border=0></b><b>10 V. Se all'ingresso invertente &egrave; applicato un segnale continuo V</b><b><sub>1</sub></b><b> = 2 V &nbsp;e a quello non invertente un segnale, anch'esso continuo, di valore V</b><b><sub>2</sub></b><b> = 4 V, l'uscita sar&agrave; uguale a :</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("Di aumentare il guadagno","Di aumentare il guadagno e diminuire la banda passante","Di diminuire il guadagno","Di diminuire il guadagno ed allargare la banda passante")
corr=new Array("0","0","0","1")
quest021 = new Question(
"Domanda 21",
0,
"<b>Le configurazioni ad anello chiuso degli Amp. Op. consentono:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("Ingresso invertente e uscita","Ingresso invertente e non invertente","Uscita e ingresso non invertente","Ingresso invertente e positivo dell'alimentazione")
corr=new Array("1","0","0","0")
quest022 = new Question(
"Domanda 22",
0,
"<b>I piedini 2 e 6 dell'I.C. TL081, rappresentano rispettivamente:</b>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("<img src=\"wbans023_1.PNG\" width=16 height=13 border=0>","0","2 MOhm","Mancano altri elementi per calcolarla")
corr=new Array("1","0","0","0")
quest023 = new Question(
"Domanda 23",
0,
"<font face=\"Times New Roman\" size=2><b>I</b></font><b>n un Amp.Op . ideale la resistenza d'ingresso Ri &nbsp;vale:</b><br>",
resp,
corr,
"",
4,
-1,
0,
"");

resp=new Array("- 12 V","+ 12 V","- 6 V","+ 6 V")
corr=new Array("0","0","1","0")
quest024 = new Question(
"Domanda 24",
0,
"<b>Il circuito rappresentato in figura &egrave; alimentato con una tensione di <img src=\"wbqst24_1.PNG\" width=14 height=16 border=0></b><b>15 V. &nbsp;Quanto vale la tensione di uscita?</b>",
resp,
corr,
"",
4,
-1,
0,
"sommatore.gif");

resp=new Array("0,3 V","15 V","1 V","Nessuna delle altre risposte")
corr=new Array("0","0","1","0")
quest025 = new Question(
"Domanda 25",
0,
"<b>Quale dovr&agrave; essere il valore massimo del segnale di ingresso (per non avere distorsioni in uscita) di un Amp. Op. invertente, con guadagno di tensione pari a 15 e tensione di alimentazione di <img src=\"wbqst25_1.PNG\" width=14 height=16 border=0></b><b>15 V</b>",
resp,
corr,
"",
4,
-1,
0,
"");

questions = new Array (
quest001,quest002,quest003,quest004,quest005,quest006,quest007,quest008,quest009,quest010,quest011,quest012,quest013,quest014,quest015,quest016,quest017,quest018,quest019,quest020,quest021,quest022,quest023,quest024,quest025)

function doQuestion(quest)
{
var numdo;
var numord=eval(quest+1);
var i=-1, ii, type, myname, gadget;
type=questions[quest].type;
numdo=type>=3?1:questions[quest].response.length;
if (type<3) {
respcopy=new Array(numdo);corrcopy=new Array(numdo);
for (i=0; i<numdo; i++) respcopy[i]=questions[quest].response[i];
respcopy.sort(myrandom);
for (i=0; i<numdo; i++) {
for (ii=0; ii<numdo; ii++) {
if (respcopy[i]==questions[quest].response[ii]) {
corrcopy[i]=questions[quest].corrects[ii];break;}}}
questions[quest].response=respcopy;
questions[quest].corrects=corrcopy;}

document.writeln ("<a name=\""+questions[quest].qname+"\"></a>")
document.write("\n")
document.write("    <tr>\n")
document.write("      <td width=\"5%\" align=\"center\" valign=\"top\" bgcolor=\"#E6E6FF\"><font face=\"Verdana\"\n")
document.write("      color=\"#000080\"><strong><small>")
document.write(numord)
document.write("</small></strong></font></td>\n")
document.write("      <td width=\"95%\" valign=\"top\" bgcolor=\"#F4F4FF\"><font face=\"Verdana\"><font color=\"#000080\"><strong><small>\n")
document.write("      ")
if (questions[quest].img!="") {
document.write("\n")
document.write("         <img border=\"0\" hspace=\"10\" vspace=\"5\" align=\"left\" src=\"")
document.write(questions[quest].img)
document.write("\">\n")
document.write("      ")
}
document.write("\n")
document.write("      ")
document.writeln(questions[quest].qstring)
document.write("</small></strong></font><br>\n")
document.write("      <br><small><small>\n")
document.write("      ")
for (i=0; i<numdo; i++) {
myname=questions[quest].qname;
gadget="radio";
if (type>=3) gadget="text";
else if (type==1) {
myname+="_"+(i<9?"0":"")+(i+1);
gadget="checkbox";}
document.write("\n")
document.write("         ")
document.write(" <input type="+gadget+" name=\""+myname);
if (type<3) document.write("\" value=\""+i+"\">\n")
else document.write("\" class=\"input\" value=\"\">\n")
if (type<3) document.write(questions[quest].response[i]);
document.write("<br>\n")
document.write("      ")
}
document.write("\n")
document.write("      </small></small></font></td>\n")
document.write("    </tr>\n")
document.write("    ")
}
function doTest() {
var count, i;
questions.sort(myrandom);
for (i=0; i<questions.length; i++) {
questions[i].qname="Domanda "+(i+1);}
count=questions.length;
for (i=0; i<count; i++) doQuestion(i);
}
function fill(s,l){
s=s+""
for (y=1;y<=l;y++)
if (s.length>=l) break; else s="0"+s;
return s
}
function CheckQName(wapf,ii,i,multi,selection){
var len;
if (!multi) return(wapf.elements[ii].name==questions[i].qname);
len=questions[i].qname.length;
if (wapf.elements[ii].name.substring(0,len)!=questions[i].qname) return false;
if (wapf.elements[ii].name.substring(len,len+1)!="_") return false;
if (eval(wapf.elements[ii].name.substring(len+1,len+3))==(selection+1)) return true;
return false;
}
function errore(uno,due,tre)
{
if (!errori) winr.document.write("<H3>Hai commesso i seguenti errori:</H3>");
++errori;
winr.document.write("<p><b>"+uno+"</b><br>"+due+"<br>"+tre+"</p>");
}
function correct(wapf)
{
var i, ii, tmp, selection, multi, type, isnull, iswrong, iscorrect, evaluation=0, total=0, udat;
errori=0;
udat=new Array();
for (i=0, ii=0; i<wapf.elements.length; i++)
{tmp=wapf.elements[i];
if (tmp.name.substring(0,13)=="Quiz.UserData")
udat[ii++]=tmp.name.substring(14,tmp.name.length)+": <i>"+tmp.value+"</i><br>";}
winr=window.open('','wapres', 'titlebar=1,location=0,directories=0,menubar=1,toolbar=0,scrollbars=1,resizable=1,status=1')
winr.document.write("<html><head><title>Risultati</title><BASE target='_blank'></head><body bgcolor='#FFFFFF'><font face='Verdana, Arial'><table border=0 cellpadding=0 cellspacing=0 width='100%' bgcolor='#C0C0C0'><tr><td width='100%'><font face='Verdana, Arial' size=5 color='#FFFFFF'><b>&nbsp;Risultati</b></font></td></tr></table>")
now= new Date()
winr.document.write("<small><p>"+fill(now.getDate(),2)+"/"+fill((now.getMonth()+1),2)+"/"+now.getYear()+"&nbsp;&nbsp;"+fill(now.getHours(),2)+":"+fill(now.getMinutes(),2)+"</p>")
if (udat.length>0) {
winr.document.write("<b>Dati utente</b><br>\n");
for (i=0; i<udat.length; i++) winr.document.write(udat[i]);}

for (i=0; i<questions.length; i++) {
type=questions[i].type;
if (type==1) multi=1;
else multi=0;
isnull=true;
iscorrect=false;iswrong=false;
selection=0;
evaluation=0;
for (ii=0; ii<wapf.elements.length; ii++) {
if (CheckQName(wapf,ii,i,multi,selection)) {
if (type>=3 && wapf.elements[ii].value!="") {
isnull=false;
if (wapf.elements[ii].value.toLowerCase()==questions[i].corrects.toLowerCase()) iscorrect=true;
else iswrong=true;
++selection;}
else if (wapf.elements[ii].checked) {
if (isnull) isnull=false;
if (questions[i].corrects[selection]=="1") iscorrect=(iswrong==false)?true:false;
else {
iswrong=true;
if (multi) errore(questions[i].qname,"La casella <i>"+questions[i].response[selection]+"</i> non andava selezionata.",questions[i].explan)
}} else {
if (questions[i].corrects[selection]=="1") {
iswrong=true;
if (multi) errore(questions[i].qname,"La casella <i>"+questions[i].response[selection]+"</i> andava selezionata.",questions[i].explan);
}}
++selection;
}}
if (multi==false && (isnull || iswrong)) {
var okresp, z;
if (type>=3) okresp=questions[i].corrects;
else {
for (z=0; z<questions[i].corrects.length; z++) {
if (questions[i].corrects[z]==1) {
okresp=questions[i].response[z];
break;
}}}
errore(questions[i].qname,"La risposta corretta era <i>"+okresp+".</i>",questions[i].explan);
}
if (isnull) evaluation+=questions[i].ifnull;
else if (iswrong) evaluation+=questions[i].ifwrong;
else if (iscorrect) evaluation+=questions[i].ifcorrect;
total+=evaluation;}
if (errori) {var voc=(errori==1)?"e":"i";winr.document.write("<br><b>In totale hai commesso "+errori+" error"+voc+".</b>");}
else winr.document.write("<h3>Complimenti, non hai commesso alcun errore!</h3>")
{var voc=(total==1)?"o":"i";winr.document.write("<br><b>Punteggio realizzato: "+total+" punt"+voc+".</b><br>");}

winr.document.write("</small><hr noshade><center><form>")
printest=(((navigator.appName=='Netscape') && (navigator.appVersion.charAt(0)>='4')) || (navigator.appVersion.lastIndexOf('MSIE 5') !=-1))? 'print()': 'alert("Questo pulsante funziona soltanto con Netscape Navigator 4 o Microsoft Internet Explorer 5 (o versioni successive). Per stampare con gli altri browser, seleziona il comando Stampa nel menu File.")'
winr.document.write("<input type='button' value='Stampa...' onClick='"+printest+"'>&nbsp;&nbsp;&nbsp;&nbsp;")
winr.document.write("<input type='button' value='Chiudi questa finestra' onClick='window.close()'></form></center>")
winr.document.write(aknw)
winr.document.close()
if (navigator.appVersion.lastIndexOf('MSIE 3') == -1) nomsie3=true
else nomsie3=false
if (nomsie3) winr.focus()
}
aknw="<br><p align='center'><small><small>Creato e gestito con <a title='Premi qui per visitare il sito di WebQuiz' href='http://www.smartlite.it/go.asp?OLDLO' target = '_blank'>SmartLite WebQuiz</a></small></small></p>"
function myrandom(a,b)
{
var rc;
do {rc=Math.floor(Math.random()*3)-1;} while (rc==2);
return(rc);
}

