Skip to content

Commit

Permalink
write.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dlight committed Apr 2, 2012
1 parent 8f1012c commit 58a60de
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 4 deletions.
53 changes: 50 additions & 3 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
var students = [
"username1", "username2"
];
var students = ["perycles",
"andrepda",
"andreson",
"anthonini",
"werewolf",
"caiocesarms",
"carine-cad",
"ceac13",
"diego.hdo",
"diegomuniz",
"dilberto",
"lroktu",
"duartefq",
"tolkiendili",
"emersonaltura",
"ericlemos",
"gilzitoz",
"gabvasiljevic",
"gabioliveira",
"george.inf",
"igordp",
"isaacnewton",
"ic3berg",
"jandsonribeiro",
"jeansilva",
"joaopinto",
"lkzfox",
"juc",
"titiocaju",
"kalinegreiros",
"leilacristina",
"lilirisi",
"xxduduxx",
"lucascasoares",
"lucas_tac",
"marcelodl",
"nmclemente",
"master_pedro",
"sonhador",
"tadeuslima",
"tamyreslucena",
"tiagodantass",
"victor2105",
"absolutezero",
"_vivianep",
"wanderson.m",
"wtts",
"wendell.cmd",
"leandru",
"patrickts"];

var num_students = students.length;

Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ <h1>Adicionar exercícios</h1>
<a id="codigo" class="click hover">Código</a>
<a id="exerc" class="click hover">Exercícios</a>
<a id="detalhes" class="click hover">Detalhes</a>
<a id="salvar">Salvar</a>
</div>
<div id="c_codigo" class="tab">
<textarea name="codigo"></textarea>
Expand Down
2 changes: 1 addition & 1 deletion query.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ $(document).ready(function () {
},
success: function(data) {
$('#c_detalhes').show().html('<pre>' + JSON.stringify(data, null, 4));
$('#c_exerc').show().html('<pre>' + JSON.stringify(combine(data), null, 4));
$('#c_exerc').show().html('<pre>' + JSON.stringify(combine(data)));

test = data;

Expand Down
1 change: 1 addition & 0 deletions req
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl -d "$(< "$1")" http://log.local/write.php; echo
27 changes: 27 additions & 0 deletions write.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
set_time_limit(0);

$handle = fopen('php://input','r');
$jsonInput = fgets($handle);

$decoded = json_decode($jsonInput,true);

foreach($decoded as $n => $s) {
$d = '/opt/p/' . $n;

mkdir($d);

foreach($decoded[$n]['nd'] as $i => $v)
file_put_contents($d . '/' . 'avaliacao_' . $i . '_nd.v', $v);

foreach($decoded[$n]['sem'] as $i => $v)
file_put_contents($d . '/' . 'avaliacao_' . $i . '_sem.v', $v);


//echo('/opt/p/' . $n);
}

//file_put_contents('/opt

//die(json_encode($decoded));
?>

0 comments on commit 58a60de

Please sign in to comment.