<?
//include("../fnc.php");
enlinea_c();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Examen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../estilo1.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
        margin-left: 0px;
        margin-top: 0px;
        margin-right: 0px;
        margin-bottom: 0px;
}
.style1 {font-size: 12px}
.style2 {
	font-size: 9px;
	font-family: Arial, Helvetica, sans-serif;
	color: #333333;
}
-->
</style></head>

<body>
<table width="640" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#FFFFFF"><div align="right"><img src="../images/logo_4.gif" width="300" height="50"></div></td>
  </tr>
  <tr>
    <td bgcolor="#EAEAEA" class="lbl_campo">Instrucciones: <span class="parrafo"><?=$txtinstrucciones;?></span> </td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF" class="lbl_campo"><div align="center" class="style1"><?=$txttitulo;?></div></td>
  </tr>
</table>
<br>
<table width="640"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>
    <?
    $tmp=mysql_query("select * from tmp_examen where usuario = '$uuser'");
    $numprgs=mysql_num_rows($tmp);

    $insprg=0;
    $lst="0";
    $cont_prg_examen=0;
    while($insprg<$numprgs){

    $qprg=mysql_query("select bp_preguntas.*
                       from tmp_examen inner join bp_preguntas
                         on tmp_examen.pregunta = bp_preguntas.id
                       where tmp_examen.usuario = '$uuser'
                       and bp_preguntas.id not in ($lst)");
    //echo mysql_error();
    $num_result=mysql_num_rows($qprg);
    $numero=rand(1,$num_result);
    for($j=1;$j<=$numero;$j++){
     $iprg=mysql_fetch_array($qprg);
    }

//    while($iprg=mysql_fetch_array($qprg)){
    $cont_prg_examen++;
    $insprg++;
    $lst.=",{$iprg[id]}";
    ?>
    <table width="100%"  border="0" cellspacing="1" cellpadding="1">
      <tr>
        <td colspan="2" class="lbl_campo"><?=$cont_prg_examen.".- ".$iprg[pregunta];?></td>
        </tr>
      <?
      $qops=mysql_query("select * from
                         bp_opciones
                         where pregunta = {$iprg[id]}");
      while($iops=mysql_fetch_array($qops)){
      ?>
      <tr>
        <td width="3%">&nbsp;</td>
        <td width="97%"><img src="../images/cuad_1.png" width="9" height="9"><span class="parrafo">
          <?=$iops[respuesta];?>
        </span></td>
      </tr>
      <?
      }
      ?>
    </table>
    <br>
    <?
//     }
    }
    ?>
    <br>
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><span class="style2">Herramienta:  e-ducativo, para m&aacute;s informaci&oacute;n visite www.e-ducativo.com </span></td>
      </tr>
    </table>
</td>
  </tr>
</table>
</body>
</html>