]> git.llucax.com Git - software/sercom.git/blob - sercom/subcontrollers/curso/ejercicio/instancia/templates/entregas.kid
aa9a9733d12bbea44a3af7635d06b32f0c4126a8
[software/sercom.git] / sercom / subcontrollers / curso / ejercicio / instancia / templates / entregas.kid
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <?python from sercom.model import Grupo, AlumnoInscripto ?>
3 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
4     py:extends="'../../../../../templates/master.kid'">
5 <head>
6 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" py:replace="''"/>
7 <title>list</title>
8 </head>
9 <body>
10
11 <h1>Entregas para la Instancia de Entrega <span py:replace="instancia.shortrepr()">Objetos</span></h1>
12
13 <table class="list">
14     <tr>
15                                 <th>Entregador</th>
16         <th>Correcta</th>
17         <th>InicioTareas</th>
18         <th>FinTareas</th>
19         <th>Observaciones</th>
20                                 <th>Operaciones</th>
21     </tr>
22                 <tr py:for="record in instancia.entregas">
23                                 <?python
24                                         def contar_comandos_mal(prueba, publico):
25                                                 total = 0
26                                                 tested = 0
27                                                 for c in prueba.comandos_ejecutados:
28                                                         if c.comando.publico == publico:
29                                                                 if not c.exito:
30                                                                         total += 1
31                                                                 tested += 1
32                                                 return (total, tested)
33
34                                         # Reviso que tan mal esta
35                                         # si no hay pruebas, esta mal porque no anduvieron los comandos
36                                         pruebas_pub_mal = 0
37                                         pruebas_priv_mal = 0
38                                         if len(record.pruebas) == 0:
39                                                 color = "#ff0000"
40                                         else:
41                                                 # Veo que onda con las pruebas
42                                                 pri_mal = 0
43                                                 pub_mal = 0
44                                                 pri_total = 0
45                                                 pub_total = 0
46                                                 color = "#000000"
47                                                 for prueba in record.pruebas:
48                                                         (rpub_mal, pub_tested) = contar_comandos_mal(prueba, True)
49                                                         (rpri_mal, pri_tested) = contar_comandos_mal(prueba, False)
50                                                         pri_mal += rpri_mal
51                                                         pub_mal += rpub_mal
52                                                         pri_total += pri_tested
53                                                         pub_total += pub_tested
54                                                 if pri_mal + pub_mal == 0:
55                                                         color = "entregaok"
56                                                 else:
57                                                         (r, g) = ("00", "00")
58                                                         r = hex(int(255 * (pub_mal*1.0 / pub_total)))[2:]
59                                                         g = hex(int(255 * ((pub_total-pub_mal)*1.0 / pub_total)))[2:]
60                                                         if len(r) < 2: r = "0"+r
61                                                         if len(g) < 2: g = "0"+g
62                                                         color = "#" + r + g + "00"
63
64                                 ?>
65                                 <td style="background:${color};"><span py:if="record.entregador" py:replace="record.entregador.shortrepr()">usuario</span></td>
66         <td style="background:${color};"><span py:replace="record.exito">fecha asignado</span></td>
67         <td style="background:${color};"><span py:replace="record.inicio">fecha corregido</span></td>
68         <td style="background:${color};"><span py:replace="record.fin">fecha corregido</span></td>
69         <td style="background:${color};"><span py:replace="record.observaciones">nota</span></td>
70                                 <td>
71                                         <a href="${tg.url('/mis_entregas/corrida/%d' % record.id)}">Corrida</a>
72                                         <a href="${tg.url('/mis_entregas/get_archivo/%d' % record.id)}">Bajar Archivo</a>
73                                 </td>
74     </tr>
75 </table>
76
77 <br/>
78 <a href="${tg.url('/curso/ejercicio/instancia/list/%s' % instancia.ejercicio.id)}">Volver</a>
79
80 </body>
81 </html>
82
83 <!-- vim: set et sw=4 sts=4 : -->