<style type="text/css">
.centrado {
width: 240px;
margin: 0 auto;
text-align: center;
border: 1px solid #444;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
padding: 6px;
background-color: #ffc;
}
</style>
</head>
<body>
<form name="redirect" class="centrado">
<span>Tiempo restante para finalizar</span>
<br />
<input type="text" size="3" name="destino" />
<br />
segundos
<script type="text/javascript">
<!--
var targetURL="cursos.php" //página que se abrirá al finalizar el conteo
var countdownfrom=50 //tiempo en segundos de la cuenta atrás
var currentsecond=document.redirect.destino.value=countdownfrom+1
function countredirect(){
if (currentsecond!=1){
currentsecond-=1
document.redirect.destino.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}
countredirect()
//-->
</script>
</form>
</body>
<?php
@$tematicaId=$_GET['tematicasId'];
@$usuario=$_SESSION['MM_Username'];
@$sql5 = "SELECT estudianteId, tematicaId FROM notas WHERE tematicaId='".$tematicaId."' and estudianteId='".$usuario."'";
if ($iNumReg>0)
{
{
@$usuconsulta = $rowEmp['estudianteId'];
@$idconsulta = $rowEmp['tematicaId'];
if ($tematicaId==$idconsulta && $usuario==$usuconsulta)
{
echo"Ya presentaste tu evaluacion";
echo "<br/>";
$prueba=0;
}
}
}
else
{
if (isset($_GET['tematicasId']) && !isset($_POST['submit'])) {
@$aux=$_GET['tematicasId'];
@$var=$row_Recordset1['tematicasId'];
if ($aux==$var)
{
$sTematica=$row_Recordset1['tematicasId'];
$show='0';
@$respuestas=$_POST['respuesta'];
$prueba=1;
}
else
{
echo "Aun no se ha subido una evaluacion";
echo "<br/>";
$prueba=0;
}
}
else
{
if (isset($_POST['submit'])) {
@$aux=$_GET['tematicasId'];
@$sTematica=$row_Recordset1['tematicasId'];
@$respuestas=$_POST['respuesta'];
@$show='1';
$prueba=1;
}
else
{
echo "No se ha especificado una tematica de la evaluacion";
}
}
}
?>
<?php
if (@$prueba==1)
{
@$sql = "SELECT * FROM evaluaciones WHERE tematicasId='".$aux."'";
?>
<table width="615" border="1">
<form action='' method='post' name="presentar" >
<?php
if (@$show=='0')
{
if ($iNumReg>0)
{
$i = 0;
{
@$dbpregunta = $rowEmp['evaluacionPregunta'];
@$dbR1=$rowEmp['evaluacionR1'];
@$dbR2=$rowEmp['evaluacionR2'];
@$dbR3=$rowEmp['evaluacionR3'];
echo "<tr>";
echo "<td colspan='3'>Pregunta: ".$dbpregunta."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width='38'>Opcion</td>";
echo "<td width='486'>Respuesta</td>";
echo "<td width='69'>Correcta</td>";
echo "</tr>";
echo "<tr>";
echo "<td>a</td>";
echo "<td>".$dbR1."</td>";
echo "<td><input name='respuesta[".$i."]' type='radio' value='1' required></td>";
echo "</tr>";
echo "<tr>";
echo "<td>b</td>";
echo "<td>".$dbR2."</td>";
echo "<td><input name='respuesta[".$i."]' type='radio' value='2' required></td>";
echo "</tr>";
echo "<tr>";
echo "<td>c</td>";
echo "<td>".$dbR3."</td>";
echo "<td><input name='respuesta[".$i."]' type='radio' value='3' required></td>";
echo "</tr>";
$i += 1;
}
}
}
else
{
if ($iNumReg>0)
{
$i = 0;
{
$dbpregunta = $rowEmp['evaluacionPregunta'];
$dbR1=$rowEmp['evaluacionR1'];
$dbR2=$rowEmp['evaluacionR2'];
$dbR3=$rowEmp['evaluacionR3'];
$dbcorrecta=$rowEmp['evaluacionRCorrecta'];
echo "<tr>";
echo "<td colspan='3'>Pregunta: ".$dbpregunta."</td>";
echo "</tr>";
echo "<tr>";
echo "<td width='38'>Opcion</td>";
echo "<td width='486'>Respuesta</td>";
echo "<td width='69'>Resultado</td>";
echo "</tr>";
echo "<tr>";
echo "<td>a</td>";
if (@$respuestas[$i]=='1')
{
echo "<td style='background-color: beige;'>".$dbR1." (Seleccionada)</td>";
}
else
{
echo "<td>".$dbR1."</td>";
}
if (@$respuestas[$i]==$dbcorrecta)
{
echo "<td style='background-color: aquamarine;' rowspan='3'>Bien</td>";
@$acum=$acum+1;
}
else
{
echo "<td style='background-color: salmon;'rowspan='3'>Mal</td>";
}
echo "</tr>";
echo "<tr>";
echo "<td>b</td>";
if (@$respuestas[$i]=='2')
{
echo "<td style='background-color: beige;'>".$dbR2." (Seleccionada)</td>";
}
else
{
echo "<td>".$dbR2."</td>";
}
echo "</tr>";
echo "<tr>";
echo "<td>c</td>";
if (@$respuestas[$i]=='3')
{
echo "<td style='background-color: beige;'>".$dbR3." (Seleccionada)</td>";
}
else
{
echo "<td>".$dbR3."</td>";
}
echo "</tr>";
$i += 1;
}
}
if (@$acum==0)
{
$nota=0;
}
else
{
$nota=($acum/$iNumReg)*5;
}
@$tematicaId=$_GET['tematicasId'];
echo @$docenteId;
$matriculaId=$row_Recordset2['matriculaId'];
$estudianteId=$row_Recordset2['estudianteId'];
$sql2="select docenteId from tematicas where tematicasId='".$tematicaId."'";
$docenteId=$rowEmp['docenteId'];
@$sql = "insert into notas values ('','$estudianteId','$tematicaId','$nota','$matriculaId','$docenteId')";
{
echo "Evaluacion enviada";
echo "<br/><br/>";
}
echo "Tu nota final es de ".$nota;
}
echo "<tr><br/><br/>";
if (@$show=='0')
{
echo "<td><br><br></td><td style='text-align: center;'><input name='submit' type='submit' value='Enviar evaluacion'<a class='button white' href='#'></a></td>";
}
}
echo "</tr>";
?>
</form>
</table>
<br/>
<a href="curso_desarrollo.php?tematicasId=<?php echo $row_Recordset1['tematicasId']; ?>">Regresar</a>