From 8994fdf645f4a8d14ffe24d4c7120383b314439b Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Thu, 19 May 2016 14:22:31 -0300 Subject: [PATCH] Corrigido bug da sessao e implementado api nota do mobile --- Aeacus/compiler/code/codigo.cpp | 7 +--- Aeacus/runner/entrada.txt | 2 -- Aeacus/runner/gmon.out | Bin 325 -> 309 bytes Aeacus/runner/programa.out | Bin 9874 -> 9612 bytes Aeacus/runner/resposta.txt | 2 -- Aeacus/runner/saida.txt | 2 -- Athena/settings.py | 3 +- Promachos/APImobile.py | 34 ++++++++++++++++-- Promachos/views.py | 1 + arquivos/atividades/4/6/Atv1/entrada1 | 0 arquivos/atividades/4/6/Atv1/roteiro1 | 0 arquivos/atividades/4/6/Atv1/saida1 | 0 arquivos/atividades/4/6/Atv2/roteiro2 | 0 arquivos/atividades/4/6/Atv2/roteiro2_EQDXelf | 0 arquivos/atividades/4/6/Atv2/saida2 | 0 15 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 arquivos/atividades/4/6/Atv1/entrada1 create mode 100644 arquivos/atividades/4/6/Atv1/roteiro1 create mode 100644 arquivos/atividades/4/6/Atv1/saida1 create mode 100644 arquivos/atividades/4/6/Atv2/roteiro2 create mode 100644 arquivos/atividades/4/6/Atv2/roteiro2_EQDXelf create mode 100644 arquivos/atividades/4/6/Atv2/saida2 diff --git a/Aeacus/compiler/code/codigo.cpp b/Aeacus/compiler/code/codigo.cpp index dffdb70..2d413fa 100644 --- a/Aeacus/compiler/code/codigo.cpp +++ b/Aeacus/compiler/code/codigo.cpp @@ -1,8 +1,3 @@ -#include - -int main() -{ - printf("2 3 4 3\n"); - printf("4 3 0 0"); +int main(){ return 0; } diff --git a/Aeacus/runner/entrada.txt b/Aeacus/runner/entrada.txt index c83bb30..e69de29 100644 --- a/Aeacus/runner/entrada.txt +++ b/Aeacus/runner/entrada.txt @@ -1,2 +0,0 @@ -2 3 5 6 -1 2 3 4 diff --git a/Aeacus/runner/gmon.out b/Aeacus/runner/gmon.out index fdf386be4e59c649eb64410076ddf8fc4a0c69e6..a3bfe64bca24e8d86d499e0db67c4c0dc859d893 100644 GIT binary patch literal 309 rcmYe#&Cg?GKm!+89Ka$w*dTNbke33)#i_~pc`3zUIS?1d7-=*BuptNs literal 325 rcmYe#&Cg?GKm!S^4q%ZCb_m@9`o4#b5qMmh}uT4x7Q diff --git a/Aeacus/runner/programa.out b/Aeacus/runner/programa.out index 697b2868ea4ca5534198232dbcf109e09a1756ec..de3fa50e70ac8f05e8681f21af547b08e35ec546 100755 GIT binary patch delta 2308 zcmZuyeQZ-z6u(}UByHVSH1xB*f3etoL>wttekfgw-kT}@D!K%PE7~vy? z6^FKHfXA^4N+Vk1J`45H>O^Aq}~`bIvOzvJR4x-k*btEMyo5IOzwjtL6-M)toW8 zYKAZ9UGL4;9w!>^?7wxkdhVu)p04!4A1)nWb`qQxR9V8^-i{5&V3f|JWsnk7_(||k z58Kg7wifwO#f3A@9l~v9Y>jQ)RI#(AVm_P{-+-s0$E|UR$I+ngEVxSGGpR7sl$|qs z3M#-#Q)P$N`9#)^OJAaz_Wp3YH1-+Wb>5J#>*kY7`qdNG07;jAgsa^j!5!n9nSA_y z8b@h2<0<2lI{zNy*)zw7b$%b?MaK8*{0_!6&lfzai@nvvl+ zMo}BN=FrK=gcKoTr%>_PX1jkWAxEXh&^P8W$e4lXfPtpMk(`VY$w_b zvB3MlUqBAviO0(s zUGsX`}L#xjfc!vjkYSEsB>GM>-? z<#KW1Hner1E~&OT4hu_i%qy}jtN}0sWIxUZXp@(DkDwOs1jO)WoWJ0V501*aC3q?i zJCm3{Hu^awy`Sd7R$I19<3*jLiwU`8hHl$>8ijG2pVoq6ucCXP#_o3}#fYwgceSuh zKkT*pX&+EuF5Xak!r>`A%+ET>>3L4CaC#F$sC=KApuw?0VI{?e16xmpsN1yCr1LVJ zkJNMs7uKAUYPvA9=#Qmz`TvONC!$G;ZEq*g;&hi(kSeceTVSoU*5o>=%M$UNTI?l6 zEFo6wBCE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pzv1EO^HKu@RI zMvAwAE&$C3@I0hJUlT#SWr#qHhXE1vICqy994M(Ip~ z(hEv=9vUh>4{eXE1p@{OeUrIln*T%ImdtK_wx z-rxYIr`axf*m=Ck;Y)SiFoRp8$+JjXj?4U81!rkMfOFTTRf%F`cPBQT^Eje zN<+cwwuq;?xv?eO5Nd@^O^6V8B-R)W_CINTO`vf$l;M%PL@zFybm6rG5@6Kkk;geY z&QS|1wRud_9EEDI6+NsGOJeWHc{T(bt;7b{ec+7qA{pnLE>@c9k+rW;05=Wf0XvxK zN!kr38wHB;(@eKRtM7Ua*GuXs$zU|Yne{dpaF*bRCS=ZcYOS)`6z5Ly{+LomshqivZ1UZdX?SJDlz%96a1%G>4GBL;l&9ni6>IE*jb0d#;Kiswx9!VfNYy65jsAb8MmlnHkF&gv|6VEGxglPqF5K2TUL-gz&?o;drC=Px_qagaV0GxZE~vceI(#!S-6=en{VP33~#}$yb@hDRICpB$H@6sd+9Sz8H|Y5yC!pU^eR0xmePL#^;kyX diff --git a/Aeacus/runner/resposta.txt b/Aeacus/runner/resposta.txt index 5fd4397..e69de29 100644 --- a/Aeacus/runner/resposta.txt +++ b/Aeacus/runner/resposta.txt @@ -1,2 +0,0 @@ -4 6 10 12 -4 3 2 1 diff --git a/Aeacus/runner/saida.txt b/Aeacus/runner/saida.txt index ceb8f43..e69de29 100644 --- a/Aeacus/runner/saida.txt +++ b/Aeacus/runner/saida.txt @@ -1,2 +0,0 @@ -2 3 4 3 -4 3 0 0 \ No newline at end of file diff --git a/Athena/settings.py b/Athena/settings.py index 25968a9..49099fb 100755 --- a/Athena/settings.py +++ b/Athena/settings.py @@ -54,7 +54,8 @@ ) SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' -AUTO_LOGOUT_DELAY = 1 +AUTO_LOGOUT_DELAY = 60 +SESSION_EXPIRE_AT_BROWSER_CLOSE = True ROOT_URLCONF = 'Athena.urls' diff --git a/Promachos/APImobile.py b/Promachos/APImobile.py index 5192e43..433b2bc 100644 --- a/Promachos/APImobile.py +++ b/Promachos/APImobile.py @@ -56,7 +56,7 @@ def atividades(request): atividades_buf = [] for relAlunoAtividade in RelAlunoAtividade.objects.filter(aluno=aluno): - atividades_buf.append(dict(relAlunoAtividade.aluno_json_data().items())) + atividades_buf.append(relAlunoAtividade.aluno_json_data()) atividades_json['valido'] = True atividades_json['atividades'] = atividades_buf @@ -90,4 +90,34 @@ def atividades(request): def notas(request): - return JsonResponse({'valido': False}) \ No newline at end of file + if request.method == 'GET': + + # Get aluno in db + userId = request.GET.get('id', '') + aluno = Aluno.objects.filter(Id=userId).first() + + if aluno is not None: + ret_json = {} + + # Iterate over submissoes + submissoes = Submissao.objects.filter(aluno = aluno) + for submissao in submissoes: + ret_json['NOTA-'+submissao.atividade.nome] = submissao.nota + ret_json['PRAZO-'+submissao.atividade.nome] = submissao.atividade.data_limite + + return JsonResponse(ret_json) + + return JsonResponse({'valido': False}) + + + + + + + + + + + + + diff --git a/Promachos/views.py b/Promachos/views.py index d37f19d..6c78601 100755 --- a/Promachos/views.py +++ b/Promachos/views.py @@ -58,6 +58,7 @@ def login(request): try: if request.session['advise'] == 'true': + request.session['advise'] = 'false' return render_to_response( 'login.html', { diff --git a/arquivos/atividades/4/6/Atv1/entrada1 b/arquivos/atividades/4/6/Atv1/entrada1 new file mode 100644 index 0000000..e69de29 diff --git a/arquivos/atividades/4/6/Atv1/roteiro1 b/arquivos/atividades/4/6/Atv1/roteiro1 new file mode 100644 index 0000000..e69de29 diff --git a/arquivos/atividades/4/6/Atv1/saida1 b/arquivos/atividades/4/6/Atv1/saida1 new file mode 100644 index 0000000..e69de29 diff --git a/arquivos/atividades/4/6/Atv2/roteiro2 b/arquivos/atividades/4/6/Atv2/roteiro2 new file mode 100644 index 0000000..e69de29 diff --git a/arquivos/atividades/4/6/Atv2/roteiro2_EQDXelf b/arquivos/atividades/4/6/Atv2/roteiro2_EQDXelf new file mode 100644 index 0000000..e69de29 diff --git a/arquivos/atividades/4/6/Atv2/saida2 b/arquivos/atividades/4/6/Atv2/saida2 new file mode 100644 index 0000000..e69de29