Test finale


"; $criteri0 = "SELECT $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id "; $criteri0 .= "FROM $tbl_domande WHERE ($tbl_domande.idtest = $fine)"; //echo $criteri5; $result0 = mysql_query($criteri0, $db); if ($myrow0 = mysql_fetch_array($result0)) { echo "
"; echo ""; $n = 1; do { echo ""; $criteri01 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow0[id]) "; //echo $criteri01; $result01 = mysql_query($criteri01, $db); if ($myrow01 = mysql_fetch_array($result01)) { do { if ($riga == true) { echo ""; $riga = false; } else { echo ""; $riga = true; } }while ($myrow01 = mysql_fetch_array($result01)); } $n++; }while ($myrow0 = mysql_fetch_array($result0)); echo ""; echo "
$n) $myrow0[domanda]
$myrow01[risposta]
$myrow01[risposta]
 
"; } else { echo "

Nessun record trovato!



"; } } else { $criteri = "SELECT count(*) as download "; $criteri .= "FROM $tbl_lezioni LEFT JOIN $tbl_download ON $tbl_lezioni.id = $tbl_download.idlezione "; $criteri .= "WHERE ($tbl_download.idlezione = $lez)"; //echo $criteri; $result = mysql_query($criteri, $db); $myrow = mysql_fetch_array($result); //echo $myrow[download]; if ($myrow[download] != 0) { $criteri1 = "SELECT $tbl_test.id as test, $tbl_prove.id as prove "; $criteri1 .= "FROM $tbl_test LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest "; $criteri1 .= "WHERE ($tbl_test.idlezione = $lez) AND ($tbl_test.posizione = '$s_dopo') AND ($tbl_prove.idutente = $validato)"; //echo $criteri1; $result1 = mysql_query($criteri1, $db); if ($myrow1 = mysql_fetch_array($result1)) { echo "

Impossibile accedere al corso oppure il test è stato svolto!



"; } else { $criteri2 = "SELECT $tbl_lezioni.id, $tbl_test.posizione, $tbl_domande.domanda, $tbl_domande.id, $tbl_test.id as test, $tbl_test.nome "; $criteri2 .= "FROM ($tbl_lezioni LEFT JOIN $tbl_test ON $tbl_lezioni.id = $tbl_test.idlezione) LEFT JOIN $tbl_domande ON $tbl_test.id = $tbl_domande.idtest "; $criteri2 .= "WHERE ($tbl_lezioni.id = $lez) AND ($tbl_test.posizione = '$s_dopo') "; $result2 = mysql_query($criteri2, $db); if ($myrow2 = mysql_fetch_array($result2)) { $num_test = $myrow2[test]; echo "
"; echo ""; echo ""; $n = 1; do { echo ""; $criteri3 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow2[id]) AND (visibile = '$s_vero') "; //echo $criteri3; $result3 = mysql_query($criteri3, $db); if ($myrow3 = mysql_fetch_array($result3)) { do { if ($riga == true) { echo ""; $riga = false; } else { echo ""; $riga = true; } }while ($myrow3= mysql_fetch_array($result3)); } $n++; }while ($myrow2 = mysql_fetch_array($result2)); echo ""; echo "
".$myrow2["nome"]."

$n) $myrow2[domanda]
$myrow3[risposta]
$myrow3[risposta]
 
"; } else { echo "

Nessun record trovato!



"; } } } else { if (test_prima($lez) == true) { $criteri4 = "SELECT $tbl_test.id as test, $tbl_prove.id as prove "; $criteri4 .= "FROM $tbl_test LEFT JOIN $tbl_prove ON $tbl_test.id = $tbl_prove.idtest "; $criteri4 .= "WHERE ($tbl_test.idlezione = $lez) AND ($tbl_test.posizione = '$s_prima')"; //echo $criteri4; $result4 = mysql_query($criteri4, $db); $myrow4 = mysql_fetch_array($result4); //$num_rows = mysql_num_rows($result4); if ($myrow4[prove] != 0) //if ($num_rows != 0) { echo "

Impossibile accedere al corso oppure il test è stato svolto!



"; } else { if (controllo_test($lez, $validato)) { $num_test = $myrow4[test]; if ($num_test != "") { $criteri5 = "SELECT $tbl_domande.idtest, $tbl_domande.domanda, $tbl_domande.id "; $criteri5 .= "FROM $tbl_domande WHERE ($tbl_domande.idtest = $num_test)"; //echo $criteri5; $result5 = mysql_query($criteri5, $db); $myrow5 = mysql_fetch_array($result5); //if ($myrow5 = mysql_fetch_array($result5)) echo "
"; echo ""; $n = 1; do { echo ""; //$criteri6 = "SELECT * FROM risposte WHERE (iddomanda = $myrow5[id]) AND (visibile = 'true') "; $criteri6 = "SELECT * FROM $tbl_risposte WHERE (iddomanda = $myrow5[id]) "; //echo $criteri6; $result6 = mysql_query($criteri6, $db); if ($myrow6 = mysql_fetch_array($result6)) { do { if ($riga == true) { echo ""; $riga = false; } else { echo ""; $riga = true; } }while ($myrow6 = mysql_fetch_array($result6)); } $n++; }while ($myrow5 = mysql_fetch_array($result5)); echo ""; echo "
$n) $myrow5[domanda]
$myrow6[risposta]
$myrow6[risposta]
 
"; } else { echo "

Nessun record trovato!



"; } } else { echo "

Prima di passare a questa lezione occorre concludere quella precedente!



"; } } } else { echo "

Prima di effettuare il test occorre scaricare la lezione!



"; } } } //echo "

Torna ai corsi

"; echo "

Torna

"; ?>