コード例 #1
0
ファイル: exercicio.php プロジェクト: adalardo/notaR
<?php

require 'head.php';
if (empty($_REQUEST['exerc'])) {
    echo "Erro. Se voc&ecirc; usou um link para chegar aqui, notifique o administrador";
    exit;
}
$X = new Exercicio($_REQUEST['exerc']);
?>
<h2><?php 
echo $X->getNome();
if ($USER->admin()) {
    echo "&nbsp;<a href='cadastra.php?exerc=" . $X->getId() . "'><img src='img/pen.png'></a>";
}
?>
</h2>
<?php 
echo $X->getHtml();
?>
<form name="notaR" action="#" method="post" enctype="multipart/form-data">
<input type="hidden" name="exerc" value="<?php 
echo $X->getId();
?>
">
<input type="hidden" name="MAX_FILE_SIZE" value="30000">
<input type="file" name="rfile" id="rfile" accept=".R">
<br><button type="submit" value="Submit">Submeter!</button>
<a href="https://github.com/lageIBUSP/notaR/wiki/Submetendo-respostas">ajuda?</a>
</form>
<div id="corretoR" >
<?php 
コード例 #2
0
ファイル: cadastra.php プロジェクト: adalardo/notaR
<?php

require_once "head.php";
### comeca aqui
if (!$USER->admin()) {
    echo "Acesso negado";
    exit;
}
if (isset($_REQUEST['exerc'])) {
    $X = new Exercicio($_REQUEST['exerc']);
} else {
    $X = new Exercicio();
}
$id = $X->getId();
if (isset($_POST['ntestes'])) {
    $ntestes = $_POST['ntestes'];
} elseif (!empty($id) && $X->maxTeste()) {
    $ntestes = $X->maxTeste();
} else {
    $ntestes = 10;
}
$imp = $X->getProibidos();
if (isset($_POST['nimp'])) {
    $nimp = $_POST['nimp'];
} elseif (!empty($id) && $imp) {
    $nimp = sizeof($imp);
} else {
    $nimp = 0;
}
if (isset($_POST['submit']) and $_POST['submit'] == "addnimp") {
    $nimp++;