Skip to content

Commit 58a60de

Browse files
committed
write.php
1 parent 8f1012c commit 58a60de

File tree

5 files changed

+80
-4
lines changed

5 files changed

+80
-4
lines changed

config.js

+50-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,53 @@
1-
var students = [
2-
"username1", "username2"
3-
];
1+
var students = ["perycles",
2+
"andrepda",
3+
"andreson",
4+
"anthonini",
5+
"werewolf",
6+
"caiocesarms",
7+
"carine-cad",
8+
"ceac13",
9+
"diego.hdo",
10+
"diegomuniz",
11+
"dilberto",
12+
"lroktu",
13+
"duartefq",
14+
"tolkiendili",
15+
"emersonaltura",
16+
"ericlemos",
17+
"gilzitoz",
18+
"gabvasiljevic",
19+
"gabioliveira",
20+
"george.inf",
21+
"igordp",
22+
"isaacnewton",
23+
"ic3berg",
24+
"jandsonribeiro",
25+
"jeansilva",
26+
"joaopinto",
27+
"lkzfox",
28+
"juc",
29+
"titiocaju",
30+
"kalinegreiros",
31+
"leilacristina",
32+
"lilirisi",
33+
"xxduduxx",
34+
"lucascasoares",
35+
"lucas_tac",
36+
"marcelodl",
37+
"nmclemente",
38+
"master_pedro",
39+
"sonhador",
40+
"tadeuslima",
41+
"tamyreslucena",
42+
"tiagodantass",
43+
"victor2105",
44+
"absolutezero",
45+
"_vivianep",
46+
"wanderson.m",
47+
"wtts",
48+
"wendell.cmd",
49+
"leandru",
50+
"patrickts"];
451

552
var num_students = students.length;
653

index.html

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ <h1>Adicionar exercícios</h1>
101101
<a id="codigo" class="click hover">Código</a>
102102
<a id="exerc" class="click hover">Exercícios</a>
103103
<a id="detalhes" class="click hover">Detalhes</a>
104+
<a id="salvar">Salvar</a>
104105
</div>
105106
<div id="c_codigo" class="tab">
106107
<textarea name="codigo"></textarea>

query.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ $(document).ready(function () {
157157
},
158158
success: function(data) {
159159
$('#c_detalhes').show().html('<pre>' + JSON.stringify(data, null, 4));
160-
$('#c_exerc').show().html('<pre>' + JSON.stringify(combine(data), null, 4));
160+
$('#c_exerc').show().html('<pre>' + JSON.stringify(combine(data)));
161161

162162
test = data;
163163

req

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl -d "$(< "$1")" http://log.local/write.php; echo

write.php

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
set_time_limit(0);
3+
4+
$handle = fopen('php://input','r');
5+
$jsonInput = fgets($handle);
6+
7+
$decoded = json_decode($jsonInput,true);
8+
9+
foreach($decoded as $n => $s) {
10+
$d = '/opt/p/' . $n;
11+
12+
mkdir($d);
13+
14+
foreach($decoded[$n]['nd'] as $i => $v)
15+
file_put_contents($d . '/' . 'avaliacao_' . $i . '_nd.v', $v);
16+
17+
foreach($decoded[$n]['sem'] as $i => $v)
18+
file_put_contents($d . '/' . 'avaliacao_' . $i . '_sem.v', $v);
19+
20+
21+
//echo('/opt/p/' . $n);
22+
}
23+
24+
//file_put_contents('/opt
25+
26+
//die(json_encode($decoded));
27+
?>

0 commit comments

Comments
 (0)