I'm making the pointer change it changes to "wait" with javascript and I do not have any errors. When I run my program if I get to execute my javascript code, but the results are not displayed. I do not know what may be happening, I've had problems like that before. Thank you in advance to help me.
My archivo "cursor.js"
$(document).ready(function () {
$("#btnTerminar").submit(function () {
$("body").css('cursor', 'wait');
setInterval(function () { $("body").css('cursor', 'auto'); }, 3000);
});
});
My View "SimuladorExamen.aspx"
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="Simulacro.Master" CodeBehind="SimuladorExamen.aspx.vb" Inherits="waSimExamen.SimuladorExamen" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="css/demos.css" rel="stylesheet" />
<script src="jscript/jquery-1.9.1.js" type="text/javascript"></script>
<script src="jscript/ui/jquery.ui.core.js" type="text/javascript"></script>
<script src="jscript/ui/jquery.ui.widget.js" type="text/javascript"></script>
<script src="jscript/ui/jquery.ui.mouse.js" type="text/javascript"></script>
<script src="jscript/ui/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="jscript/ui/jquery.ui.position.js" type="text/javascript"></script>
<script src="jscript/ui/jquery.ui.resizable.js" type="text/javascript"></script>
<script src="jscript/ui/jquery.ui.button.js" type="text/javascript"></script>
<script src="jscript/ui/jquery.ui.dialog.js" type="text/javascript"></script>
<link href="jscript/themes/blitzer/jquery.ui.all.css" rel="stylesheet" />
<script src="jscript/cursor.js" type="text/javascript"></script> <!--THIS WOULD BE THE CURSOR CODE
-->
<script type="text/javascript">
function Message(msg) {
$("#msg").html(msg);
$("#dialog-message").dialog({
modal: true,
buttons: {
Aceptar: function () {
$(this).dialog("close");
}
}
});
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<%-- <asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer2" runat="server" Interval="185000"></asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>--%>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Timer ID="Timer2" runat="server" Interval="185000"></asp:Timer>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="1000"></asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="btnTerminar" />
</Triggers>
<ContentTemplate>
<!-- MESSAGE BOX -->
<div id="dialog-message" title="Simulacro de examen">
<p id="msg"></p>
</div>
<!-- Fin del Message Box -->
<%--<asp:Timer ID="Timer1" runat="server" Interval="1000"></asp:Timer>--%>
<table width="950">
<tr>
<td height="10"></td>
</tr>
<tr>
<td align="center" style="font-family: Verdana, Geneva, Tahoma, sans-serif; font-size: medium; font-weight: bold; color: #FFFFFF;" bgcolor="Red" height="35">SIMULACRO DE EXAMEN DE ADMISION</td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td align="center">
<div style="position: fixed; width: 950px;">
<table width="90%">
<tr>
<td></td>
<td align="center" width="200" bgcolor="Red" height="30">
<asp:Label ID="lblTiempo" runat="server" Font-Bold="True" Font-Names="Arial" Font-Size="Small" ForeColor="White"></asp:Label>
<asp:LinkButton ID="lnkVolver" runat="server" CssClass="BotonLink" Font-Bold="True" Font-Names="Arial" Font-Size="Small" ForeColor="White" Visible="False">Volver a empezar</asp:LinkButton>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td height="10">
<asp:Label ID="lblMinuto" runat="server" Text="2" Visible="False"></asp:Label>
<asp:Label ID="lblSegundo" runat="server" Text="59" Visible="False"></asp:Label>
</td>
</tr>
<tr>
<td align="center" style="font-family: Arial, Helvetica, sans-serif; font-size: small">
<%-- <asp:Panel ID="Panel1" runat="server" Height="550" Width="92%" ScrollBars="Vertical" BorderStyle="Outset">--%>
<%-- <div style="overflow: auto; width: 92%; height: 550px">--%>
<asp:ListView ID="lvPreguntas" runat="server">
<LayoutTemplate>
<table width="90%">
<tr>
<td width="15%"></td>
<td width="15%"></td>
<td width="40%"></td>
<td width="30%"></td>
</tr>
<tr id="itemPlaceholder" runat="server"></tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td colspan="4" align="left" style="font-weight: bold" height="50" valign="bottom"><%#Eval("Tema")%></td>
</tr>
<tr>
<td colspan="4">
<hr />
</td>
</tr>
<tr>
<td style="font-weight: bold" valign="top"><%#Eval("Orden")%>.-</td>
<td colspan="3" align="left" style="text-align: justify"><%#Eval("Pregunta")%></td>
</tr>
<tr>
<td>
<asp:Image ID="imgA" runat="server" Height="20" Width="20" Visible="False" /></td>
<td valign="top">A.</td>
<td align="left" valign="top">
<asp:RadioButton ID="rdResp1" runat="server" Text='<%#Eval("Opcion1")%>' GroupName="Respuesta" />
</td>
<td rowspan="4">
<asp:Image ID="imgFigura" runat="server" Height="150" /></td>
</tr>
<tr>
<td>
<asp:Image ID="imgB" runat="server" Height="20" Width="20" Visible="False" /></td>
<td valign="top">B.<asp:Label ID="lblFigura" runat="server" Text='<%#Eval("Imagen")%>' Visible="False"></asp:Label></td>
<td align="left" valign="top">
<asp:RadioButton ID="rdResp2" runat="server" Text='<%#Eval("Opcion2")%>' GroupName="Respuesta" /></td>
</tr>
<tr>
<td>
<asp:Image ID="imgC" runat="server" Height="20" Width="20" Visible="False" /></td>
<td valign="top">C.<asp:Label ID="lblRespuesta" runat="server" Text='<%#Eval("Respuesta")%>' Visible="False"></asp:Label></td>
<td align="left" valign="top">
<asp:RadioButton ID="rdResp3" runat="server" Text='<%#Eval("Opcion3")%>' GroupName="Respuesta" /></td>
</tr>
<tr>
<td valign="top">
<asp:Image ID="imgD" runat="server" Height="20" Width="20" Visible="False" /></td>
<td valign="top">D.</td>
<td align="left" valign="top">
<asp:RadioButton ID="rdResp4" runat="server" Text='<%#Eval("Opcion4")%>' GroupName="Respuesta" /></td>
</tr>
</ItemTemplate>
</asp:ListView>
<%-- </div>--%>
<%-- </asp:Panel>--%>
</td>
</tr>
<tr>
<td align="center">
<table width="70%">
<tr>
<td align="center" height="50" width="50%">
<asp:Button ID="btnTerminar" runat="server" Text="Finalizar" Width="120px" Font-Bold="True" Font-Names="Arial" Font-Size="X-Small" Height="25px" />
</td>
<td align="center" width="50%">
<asp:Button ID="btnVolver" runat="server" Text="Volver a empezar" Width="120px" Font-Bold="True" Font-Names="Arial" Font-Size="X-Small" Height="25px" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
SimuladorExamen.aspx.vb
Imports SIMULADOR_LOG
Public Class SimuladorExamen
Inherits System.Web.UI.Page
Dim Minutos As Integer
Dim Segundos As Integer
Dim Duracion As Integer = 30 '------> duration in minuts
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Minutos = lblMinuto.Text.ToString
If Not Page.IsPostBack Then
MostrarPreguntas()
' DuracionExamen()
End If
End Sub
Sub MostrarPreguntas()
Dim clPreguntas As New clsExamenLOG
lvPreguntas.DataSource = clPreguntas.MostrarPreguntasExamen
lvPreguntas.DataBind()
Timer2.Interval = Duracion * 60000 + Duracion * 7000
lblMinuto.Text = Convert.ToString(Duracion - 1)
Timer1.Enabled = True
Timer2.Enabled = True
End Sub
Protected Sub lvPreguntas_ItemDataBound(sender As Object, e As ListViewItemEventArgs) Handles lvPreguntas.ItemDataBound
If CType(e.Item.FindControl("lblFigura"), Label).Text <> "" Then
CType(e.Item.FindControl("imgFigura"), Image).ImageUrl = "~/Figuras/" & CType(e.Item.FindControl("lblFigura"), Label).Text
Else
CType(e.Item.FindControl("imgFigura"), Image).Visible = False
End If
End Sub
Protected Sub btnTerminar_Click(sender As Object, e As EventArgs) Handles btnTerminar.Click
'Dim msgWaitCursor As String = "document.body.style.cursor = 'wait'"
'ClientScript.RegisterStartupScript(Me.GetType, "msg", msgWaitCursor)
'System.Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor
Corregir(False)
lblMinuto.Text = Convert.ToString(Duracion - 1)
lblSegundo.Text = "59"
'System.Windows.Forms.Cursor.Current = Windows.Forms.Cursors.Default
'Dim msgDefault As String = "document.body.style.cursor = 'auto'"
'ClientScript.RegisterStartupScript(Me.GetType, "msg", msgDefault)
End Sub
Protected Sub btnVolver_Click(sender As Object, e As EventArgs) Handles btnVolver.Click
VolverEmpezar()
End Sub
Sub Corregir(TiempoVencido As Boolean)
lblTiempo.Text = ""
lblTiempo.Visible = False
lnkVolver.Visible = True
btnTerminar.Enabled = False
Timer1.Enabled = False
Timer2.Enabled = False
Dim Responde As String = ""
Dim Respuesta As String = ""
Dim Correcto, Incorrecto, Blanco, TotalRespondido As Integer
Correcto = 0
Incorrecto = 0
Blanco = 0
TotalRespondido = 0
For Each item As ListViewItem In lvPreguntas.Items
If CType(item.FindControl("rdResp1"), RadioButton).Checked Then
Responde = "A"
Else
If CType(item.FindControl("rdResp2"), RadioButton).Checked Then
Responde = "B"
Else
If CType(item.FindControl("rdResp3"), RadioButton).Checked Then
Responde = "C"
Else
If CType(item.FindControl("rdResp4"), RadioButton).Checked Then
Responde = "D"
Else
Responde = "0"
Blanco += 1
End If
End If
End If
End If
Respuesta = CType(item.FindControl("lblRespuesta"), Label).Text
If Respuesta = Responde Then
Correcto += 1
CType(item.FindControl("img" & Responde), Image).Visible = True
CType(item.FindControl("img" & Responde), Image).ImageUrl = "~/Imagenes/ok.jpg"
ElseIf Responde <> "0" Then
Incorrecto += 1
CType(item.FindControl("img" & Responde), Image).Visible = True
CType(item.FindControl("img" & Responde), Image).ImageUrl = "~/Imagenes/no.jpg"
CType(item.FindControl("img" & Respuesta), Image).Visible = True
CType(item.FindControl("img" & Respuesta), Image).ImageUrl = "~/Imagenes/GoToNextHS.png"
End If
Next
TotalRespondido = Correcto + Incorrecto
Dim Mensaje As String
Dim Res As String = String.Empty
Select Case Correcto
Case 0 To 10
Res = "Prepárate mucho mas"
Case 11 To 19
Res = "Sigue preparándote"
Case 20 To 29
Res = "Obtuvistes nota aceptable"
Case 30 To 39
Res = "Obtuvistes buen puntaje"
Case 40 To 50
Res = "Felicitaciones, obtuvistes buen puntaje"
End Select
If TiempoVencido Then
Mensaje = "<script type=""text/javascript"">Message('Tu tiempo expiró<br><strong>Total de preguntas correctas: " & Correcto & _
"</strong><br>Total de preguntas incorrectas: " & Incorrecto & _
"<br>Total de preguntas sin responder: " & Blanco & _
"<br><br><strong>" & Res & "</strong>')</script>"
Else
Mensaje = "<script type=""text/javascript"">Message('<strong>Total de preguntas correctas: " & Correcto & _
"</strong><br>Total de preguntas incorrectas: " & Incorrecto & _
"<br>Total de preguntas sin responder: " & Blanco & _
"<br><br><strong>" & Res & "</strong>')</script>"
End If
'***********DESENCRIPT************
Dim Encrip As New clsEncrip("0123456")
Dim dni As String = Request.QueryString("dni")
Dim nombreCompleto As String = Request.QueryString("nombreCompleto")
Dim apellidoPaterno As String = Request.QueryString("apellidoPaterno")
Dim apellidoMaterno As String = Request.QueryString("apellidoMaterno")
dni = dni.Replace(" ", "+")
nombreCompleto = nombreCompleto.Replace(" ", "+")
apellidoPaterno = apellidoPaterno.Replace(" ", "+")
apellidoMaterno = apellidoMaterno.Replace(" ", "+")
Dim dni_user As String = Encrip.DecryptData(dni)
Dim nombreCompleto_user As String = Encrip.DecryptData(nombreCompleto)
Dim apellidoPaterno_user As String = Encrip.DecryptData(apellidoPaterno)
Dim apellidoMaterno_user As String = Encrip.DecryptData(apellidoMaterno)
'********SEND_MAIL********
'Resolver el tiempo de espera "cursos en modo cargar"
Dim clRegistrar As New clsExamenLOG
'El resultado del siguiente usuario es la siguiente
Dim MensajeCorreo As String = "Estimada área de gestión de TI: <br><br>" &
"El siguiente usuario, terminó su prueba:<br><br>" &
dni_user & "<br><br>" &
apellidoPaterno_user & "<br><br>" &
apellidoMaterno_user & "<br><br>" &
nombreCompleto_user & "<br><br>" &
"<strong>Resultados de su prueba:</strong>" & "<br><br>" &
"Correctas: " & Correcto & "<br><br>" &
"Incorrectas: " & Incorrecto & "<br><br>" &
"En blanco: " & Blanco & "<br><br>" &
"Mensaje: " & Res
clRegistrar.Enviar_Correo_Html("gpoma@sencico.gob.pe", "CORREO DE PRUEBA", MensajeCorreo, "", "")
''**************SHOW_THE_MESSAGE_OF_THE_RESULTS*****************
ClientScript.RegisterStartupScript(Me.GetType, "msg", Mensaje)
End Sub
Protected Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim Min, Seg As String
If Integer.Parse(lblSegundo.Text) = 0 Then
lblSegundo.Text = "60"
End If
Segundos = Integer.Parse(lblSegundo.Text) - 1
lblSegundo.Text = Segundos.ToString
If Segundos = 59 Then
Minutos = Integer.Parse(lblMinuto.Text) - 1
lblMinuto.Text = Minutos.ToString
End If
Min = IIf(Len(Minutos.ToString) = 1, "0" & Minutos.ToString, Minutos.ToString)
Seg = IIf(Len(Segundos.ToString) = 1, "0" & Segundos.ToString, Segundos.ToString)
lblTiempo.Text = "Tiempo restante: " & Min & ":" & Seg
If Minutos = 0 And Segundos = 0 Then
Timer1.Enabled = False
End If
End Sub
Protected Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
Corregir(True)
End Sub
Protected Sub lnkVolver_Click(sender As Object, e As EventArgs) Handles lnkVolver.Click
VolverEmpezar()
End Sub
Sub VolverEmpezar()
lblTiempo.Visible = True
lnkVolver.Visible = False
btnTerminar.Enabled = True
Timer1.Enabled = False
Timer2.Enabled = False
lblMinuto.Text = Convert.ToString(Duracion - 1)
lblSegundo.Text = "59"
MostrarPreguntas()
End Sub
End Class
Comments
Post a Comment