X-Git-Url: https://git.llucax.com/z.facultad/75.52/sercom.git/blobdiff_plain/5a5fd7200d429896765a5043908441683e5f06ea..46c223fbb59fa6af6c640915558bb5b633129d3b:/sercom/subcontrollers/curso/__init__.py diff --git a/sercom/subcontrollers/curso/__init__.py b/sercom/subcontrollers/curso/__init__.py index ae1ed7a..0a30cda 100644 --- a/sercom/subcontrollers/curso/__init__.py +++ b/sercom/subcontrollers/curso/__init__.py @@ -10,7 +10,7 @@ from turbogears import identity from turbogears import paginate from docutils.core import publish_parts from sercom.subcontrollers import validate as val -from sercom.model import Curso, Ejercicio, Alumno, Docente, Grupo, DocenteInscripto +from sercom.model import Curso, Correccion, Ejercicio, Alumno, Docente, Grupo, DocenteInscripto from curso_alumno import * from sqlobject import * from sqlobject.dberrors import * @@ -23,21 +23,7 @@ name = 'curso' namepl = name + 's' #}}} -ajax = u""" - function makeOption(option) { - return OPTION({"value": option.value}, option.text); - } - - function moveOption( fromSelect, toSelect) { - // add 'selected' nodes toSelect - appendChildNodes(toSelect, - map( makeOption,ifilter(itemgetter('selected'), $(fromSelect).options))); - // remove the 'selected' fromSelect - replaceChildNodes(fromSelect, - list(ifilterfalse(itemgetter('selected'), $(fromSelect).options)) - ); - } - +ajax = u""" function alumnos_agregar_a_la_lista(texto, lista) { t = MochiKit.DOM.getElement(texto); @@ -82,19 +68,19 @@ ajax = u""" d.addCallbacks(procesar, err); } - function onsubmit() + function doSubmit() { /* TODO : Validar datos y evitar el submit si no esta completo */ /* Selecciono todos los miembros si no, no llegan al controllere*/ l = MochiKit.DOM.getElement('form_alumnos'); - for (i=0; i 0: + col["Grupo"] = miembro[0].grupo.shortrepr() + correctas = 0 + for ej in r.ejercicios: + for ins in ej.instancias: + c = Correccion.selectBy(instancia=ins, entregador=i) + if c.count() > 0: + col["E"+str(ej.numero)+str(ins.numero)] = c[0].nota + if c[0].nota > 7: + correctas += 1 + else: + col["E"+str(ej.numero)+str(ins.numero)] = "" + col["EA"] = correctas + col["NP"] = i.nota_practica + col["NF"] = i.nota_final + col["NL"] = i.nota_libreta + rows.append(col) + return dict(curso=r, rows=rows, cols=cols) #}}}