X-Git-Url: https://git.llucax.com/software/sercom-old.git/blobdiff_plain/cf10ff674a6eae399b2612038097de9d9b6dbaa4..a5e74d07c813bd39e77a5d3253dda1f19768f892:/src/sc_suwi?ds=sidebyside diff --git a/src/sc_suwi b/src/sc_suwi index fe9c5fc..a6b23bc 100755 --- a/src/sc_suwi +++ b/src/sc_suwi @@ -21,6 +21,10 @@ import cgitb; cgitb.enable() #XXX HORRIBLE PASSWD = conf.get('general', 'cgipw') +def cmp_correccion_padron(e1, e2): + 'Compara 2 entregas, según el padrón del alumno.' + return cmp(e1.inscripto.padron, e2.inscripto.padron) + def http_header_html(req): return 'Content-type: text/html\r\n\r\n' @@ -246,7 +250,7 @@ def zip(req, entrega_id): def zip_path(path, base, zipfd): paths = os.listdir(path) for p in paths: - if os.path.isdir(p): + if os.path.isdir(os.path.join(path, p)): zip_path(os.path.join(path, p), os.path.join(base, p), zipfd) else: zipfd.write(os.path.join(path, p), os.path.join(base, p)) @@ -303,7 +307,9 @@ def correcciones(req, entrega_id): r = '

Entrega %d.%d del curso %d-%d-%d

\n' \ % (e.nroEjercicio, e.entrega, c.anio, c.cuatrimestre, c.curso) r += header() - for c in e.correcciones: + correcciones = list(e.correcciones) + correcciones.sort(cmp_correccion_padron) + for c in correcciones: r += row(c) r += footer() return r