Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/EjercitarClient
diff options
context:
space:
mode:
authorSamu <samurey@gmail.com>2013-03-24 14:03:33 (GMT)
committer Samu <samurey@gmail.com>2013-03-24 14:03:33 (GMT)
commit914ae3c7bc78f5f519213518bad3083ab45dfb21 (patch)
tree99363baac38ac434236585a4b5956d0fb4d8356d /EjercitarClient
parentfd73abb035904dd245a03924c444a3dc5083304f (diff)
Seleccion aleatoria y de utilidad maxima implementada
Diffstat (limited to 'EjercitarClient')
-rw-r--r--EjercitarClient/.pydevproject5
-rw-r--r--EjercitarClient/gui/ContenedorTareas.py (renamed from EjercitarClient/gui/ContenedorTemas.py)10
-rw-r--r--EjercitarClient/gui/ContenedorTareas.pycbin0 -> 1452 bytes
-rw-r--r--EjercitarClient/gui/ContenedorTemas.pycbin1377 -> 0 bytes
-rw-r--r--EjercitarClient/gui/Ejercitario.py38
-rw-r--r--EjercitarClient/gui/Ejercitario.pycbin2848 -> 3469 bytes
-rw-r--r--EjercitarClient/gui/Login.py3
-rw-r--r--EjercitarClient/gui/Login.pycbin4124 -> 4178 bytes
-rw-r--r--EjercitarClient/gui/Temas.py13
-rw-r--r--EjercitarClient/gui/Temas.pycbin1982 -> 2041 bytes
-rw-r--r--EjercitarClient/lib/suds-0.4-py2.6.eggbin0 -> 448327 bytes
11 files changed, 44 insertions, 25 deletions
diff --git a/EjercitarClient/.pydevproject b/EjercitarClient/.pydevproject
index 0b0da7e..6121ef5 100644
--- a/EjercitarClient/.pydevproject
+++ b/EjercitarClient/.pydevproject
@@ -4,10 +4,9 @@
<pydev_project>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/EjercitarClient</path>
+<path>/EjercitarClient/lib/suds-0.4-py2.6.egg</path>
</pydev_pathproperty>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
-<pydev_pathproperty name="org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH">
-<path>C:\Users\Samu\Downloads\suds-0.4-py2.6.egg</path>
-</pydev_pathproperty>
+
</pydev_project>
diff --git a/EjercitarClient/gui/ContenedorTemas.py b/EjercitarClient/gui/ContenedorTareas.py
index fd0d81c..ff60a10 100644
--- a/EjercitarClient/gui/ContenedorTemas.py
+++ b/EjercitarClient/gui/ContenedorTareas.py
@@ -6,18 +6,20 @@ Created on Feb 4, 2013
import gtk
from gui.Ejercitario import Ejercitario
-class ContenedorTemas(gtk.HBox):
+class ContenedorTareas(gtk.HBox):
# This is a callback function. The data arguments are ignored
# in this example. More on callbacks below.
- def __init__(self, id_tema, descripcion, ventana_padre, vista_temas, cliente_WS):
+ def __init__(self, id_alumno, id_tarea, descripcion, ventana_padre, vista_temas, cliente_WS):
# create a new window
- super(ContenedorTemas, self).__init__()
+ super(ContenedorTareas, self).__init__()
self.ventana_padre = ventana_padre
self.vista_temas = vista_temas
self.cliente_WS = cliente_WS
+ self.id_alumno = id_alumno
+ self.id_tarea = id_tarea
label_descripcion = gtk.Label(descripcion)
@@ -29,6 +31,6 @@ class ContenedorTemas(gtk.HBox):
def __comenzar_cb(self, boton):
self.ventana_padre.remove(self.vista_temas)
- ejercitario = Ejercitario(self.cliente_WS)
+ ejercitario = Ejercitario(self.cliente_WS, self.id_tarea, self.id_alumno)
self.ventana_padre.add (ejercitario)
\ No newline at end of file
diff --git a/EjercitarClient/gui/ContenedorTareas.pyc b/EjercitarClient/gui/ContenedorTareas.pyc
new file mode 100644
index 0000000..ef396c3
--- /dev/null
+++ b/EjercitarClient/gui/ContenedorTareas.pyc
Binary files differ
diff --git a/EjercitarClient/gui/ContenedorTemas.pyc b/EjercitarClient/gui/ContenedorTemas.pyc
deleted file mode 100644
index 2e3c80f..0000000
--- a/EjercitarClient/gui/ContenedorTemas.pyc
+++ /dev/null
Binary files differ
diff --git a/EjercitarClient/gui/Ejercitario.py b/EjercitarClient/gui/Ejercitario.py
index 16d3c44..7d60441 100644
--- a/EjercitarClient/gui/Ejercitario.py
+++ b/EjercitarClient/gui/Ejercitario.py
@@ -15,12 +15,17 @@ class Ejercitario(gtk.VBox):
# in this example. More on callbacks below.
- def __init__(self, cliente_WS):
+ def __init__(self, cliente_WS, id_tarea, id_alumno):
# create a new window
super(Ejercitario, self).__init__()
+
+ self.id_tarea = id_tarea
+ self.id_alumno = id_alumno
+ self.cliente_WS = cliente_WS
+
self.__inicializar_componentes()
- siguiente_ejercicio = self.__obtener_siguiente_ejercicio(cliente_WS)
- self.__organizar_gui(siguiente_ejercicio)
+ self.siguiente_ejercicio = self.__obtener_siguiente_ejercicio(cliente_WS)
+ self.__organizar_gui(self.siguiente_ejercicio)
#self.__sincronizar_temas()
self.show_all()
@@ -40,13 +45,13 @@ class Ejercitario(gtk.VBox):
def __organizar_gui(self, siguiente_ejercicio):
- #prueba
- self.solucion1.set_label("prueba1")
- self.solucion2.set_label("prueba2")
- self.solucion3.set_label("prueba3")
- self.solucion4.set_label("prueba4")
+ self.solucion1.set_label(siguiente_ejercicio.respuestaList.respuestaList[0].descripcion)
+ self.solucion2.set_label(siguiente_ejercicio.respuestaList.respuestaList[1].descripcion)
+ self.solucion3.set_label(siguiente_ejercicio.respuestaList.respuestaList[2].descripcion)
+ self.solucion4.set_label(siguiente_ejercicio.respuestaList.respuestaList[3].descripcion)
+
self.label_enunciado.set_label(siguiente_ejercicio.enunciado)
- #prueba
+
contenedor_soluciones = gtk.HBox()
contenedor_soluciones.add(self.solucion1)
@@ -65,11 +70,22 @@ class Ejercitario(gtk.VBox):
def __obtener_siguiente_ejercicio(self, cliente_WS):
try:
#cliente_WS = Client(self.WSDL_URL)
- siguiente_ejercicio = cliente_WS.service.getSiguienteEjercicio()
+ siguiente_ejercicio = cliente_WS.service.getSiguienteEjercicio(self.id_tarea, self.id_alumno, self.siguiente_ejercicio.idEjercicio, "respuesta")
except:
print "\n\nERROR al instanciar el SINCRONIZAR PROXY:"
return siguiente_ejercicio
def __responder_cb(self, boton):
- pass
+ siguiente_ejercicio = self.__obtener_siguiente_ejercicio(self.cliente_WS)
+ self.__actualizar_gui(siguiente_ejercicio)
+
+ def __actualizar_gui(self, siguiente_ejercicio):
+ self.solucion1.set_label(siguiente_ejercicio.respuestaList.respuestaList[0].descripcion)
+ self.solucion2.set_label(siguiente_ejercicio.respuestaList.respuestaList[1].descripcion)
+ self.solucion3.set_label(siguiente_ejercicio.respuestaList.respuestaList[2].descripcion)
+ self.solucion4.set_label(siguiente_ejercicio.respuestaList.respuestaList[3].descripcion)
+
+ self.label_enunciado.set_label(siguiente_ejercicio.enunciado)
+
+
diff --git a/EjercitarClient/gui/Ejercitario.pyc b/EjercitarClient/gui/Ejercitario.pyc
index 8109dfb..a162375 100644
--- a/EjercitarClient/gui/Ejercitario.pyc
+++ b/EjercitarClient/gui/Ejercitario.pyc
Binary files differ
diff --git a/EjercitarClient/gui/Login.py b/EjercitarClient/gui/Login.py
index 3e0c3d1..6afe9f7 100644
--- a/EjercitarClient/gui/Login.py
+++ b/EjercitarClient/gui/Login.py
@@ -120,5 +120,6 @@ class Login(gtk.VBox):
def __ingresar_cb(self, boton):
self.ventana_padre.remove(self)
- temas = Temas(self.ventana_padre)
+ id_alumno = int(self.id_estudiante_entry.get_text())
+ temas = Temas(self.ventana_padre, id_alumno)
self.ventana_padre.add(temas)
diff --git a/EjercitarClient/gui/Login.pyc b/EjercitarClient/gui/Login.pyc
index 18a58e5..fbf3991 100644
--- a/EjercitarClient/gui/Login.pyc
+++ b/EjercitarClient/gui/Login.pyc
Binary files differ
diff --git a/EjercitarClient/gui/Temas.py b/EjercitarClient/gui/Temas.py
index db18821..eee8826 100644
--- a/EjercitarClient/gui/Temas.py
+++ b/EjercitarClient/gui/Temas.py
@@ -9,7 +9,7 @@ Created on Feb 2, 2013
@author: Samu
'''
import gtk
-from gui.ContenedorTemas import ContenedorTemas
+from gui.ContenedorTareas import ContenedorTareas
import suds
from suds.client import Client
@@ -21,10 +21,11 @@ class Temas(gtk.VBox):
WSDL_URL = 'http://localhost:8080/EjercitarServer/EjercitarWSBean?wsdl'
- def __init__(self, ventana_padre):
+ def __init__(self, ventana_padre, id_alumno):
# create a new window
super(Temas, self).__init__()
self.ventana_padre = ventana_padre
+ self.id_alumno = id_alumno
self.__inicializar_componentes()
self.cliente_WS = self.__sincronizar_temas()
@@ -38,10 +39,10 @@ class Temas(gtk.VBox):
contenedor_lista = gtk.VBox()
- lista_temas = cliente_WS.service.getTemas()
- for tema in lista_temas:
- nuevo_tema = ContenedorTemas(tema.idTema, tema.nombre, self.ventana_padre, self, self.cliente_WS)
- contenedor_lista.add(nuevo_tema)
+ lista_tareas = cliente_WS.service.getTareas(self.id_alumno)
+ for tarea in lista_tareas:
+ nueva_tarea = ContenedorTareas(self.id_alumno, tarea.idTarea, tarea.descripcion, self.ventana_padre, self, self.cliente_WS)
+ contenedor_lista.add(nueva_tarea)
self.add(contenedor_lista)
diff --git a/EjercitarClient/gui/Temas.pyc b/EjercitarClient/gui/Temas.pyc
index f31e2e3..e07d867 100644
--- a/EjercitarClient/gui/Temas.pyc
+++ b/EjercitarClient/gui/Temas.pyc
Binary files differ
diff --git a/EjercitarClient/lib/suds-0.4-py2.6.egg b/EjercitarClient/lib/suds-0.4-py2.6.egg
new file mode 100644
index 0000000..a4a16a8
--- /dev/null
+++ b/EjercitarClient/lib/suds-0.4-py2.6.egg
Binary files differ