예제 #1
0
        public function renderNotDeleted($problemSelected = null)
        {
            $bs = new EvaluationCaseBS(null);
            if (!isset($problemSelected) || $problemSelected == "") {
                $ecases = $bs->findNotDeleted(null);
            } else {
                $qbuilder = new QueryBuilder('evaluationcase');
                $qbuilder->addEqual('evc_prb_id', $problemSelected);
                $qbuilder->addOrder('evc_id', QueryBuilder::$ASC);
                $ecases = $bs->findNotDeleted($qbuilder);
            }
            if (count($ecases) <= 0) {
                ?>
					<br/><i>Nenhum caso de teste cadastrado ainda.</i><br />
				<?php 
            } else {
                ?>
					<script type="text/javascript">
					function deleteECase(id, probId) {
						if (confirm("Deseja realmente excluir este caso de teste?")) {
							$("#ecase-action-form input[name='_action']").val("delete");
							$("#ecase-action-form input[name='evc_id']").val(id);
							$("#ecase-action-form input[name='evc_prb_id']").val(probId);
							$("#ecase-action-form").submit();
						}
					}
					</script>
					<form method="POST" action="./controller/EvaluationCaseController.php" style="display:none;"
					id="ecase-action-form">
						<input type="hidden" name="_action" />
						<input type="hidden" name="evc_id" />
						<input type="hidden" name="evc_prb_id" />
					</form>
					<table class="dataView">
					<tr>
						<th>Problema</th>
						<th>Entradas</th>
						<th>Tipos das Entradas</th>
						<th>Saídas</th>
						<th>Tipos das Saídas</th>
						<th style="min-width: 60px;width: 60px;max-width: 60px;">Ações</th>
					</tr>
					<?php 
                foreach ($ecases as $ec => $ecase) {
                    ?>
						<tr class="color<?php 
                    echo $ec % 2;
                    ?>
">
							<td><?php 
                    echo $ecase->getForeignModel('evc_prb_id')->get('prb_title');
                    ?>
</td>
							<td><?php 
                    echo $ecase->get('evc_inputs');
                    ?>
</td>
							<td><?php 
                    echo $ecase->get('evc_inputsDataTypes');
                    ?>
</td>
							<td><?php 
                    echo $ecase->get('evc_outputs');
                    ?>
</td>
							<td><?php 
                    echo $ecase->get('evc_outputsDataTypes');
                    ?>
</td>
							<td class="actions">
								<span class="ui-state-default ui-corner-all" title="Editar Caso de Teste"
								onClick="location.assign('./evaluationCaseEdit.php?evc_id=<?php 
                    echo $ecase->get("evc_id");
                    ?>
&evc_prb_id=<?php 
                    echo $ecase->get('evc_prb_id');
                    ?>
');">
									<span class="ui-icon ui-icon-pencil"></span>
								</span>
								<span class="ui-state-default ui-corner-all" title="Excluir Problema"
								onClick="deleteECase(<?php 
                    echo $ecase->get('evc_id');
                    ?>
, <?php 
                    echo $ecase->get('evc_prb_id');
                    ?>
)">
									<span class="ui-icon ui-icon-trash"></span>
								</span>
							</td>
						</tr>
					<?php 
                }
                ?>
				</table>
				<?php 
            }
        }
예제 #2
0
$problems = $bs->findNotDeleted($qbuilder);
?>
 */
name = "<?php 
echo $problems[0]->getForeignModel("tpb_tst_id")->get("tst_title");
?>
";
cout << "Carregando conjunto de problemas: " << name << endl;
Problem *problem;
TestCase *testCase;
<?php 
foreach ($problems as $p => $tproblem) {
    ?>
/*<?php 
    $problem = $tproblem->getForeignModel("tpb_prb_id");
    $ecaseBS = new EvaluationCaseBS(null);
    $qbuilder = new QueryBuilder("evaluationcase");
    $qbuilder->addEqual("evc_prb_id", $problem->get("prb_id"));
    $ecases = $ecaseBS->findNotDeleted($qbuilder);
    $nECases = count($ecases);
    ?>
*/<?php 
    if ($nECases > 0) {
        ?>
problem = new Problem(<?php 
        echo $tproblem->get("tpb_questionNumber");
        ?>
, "<?php 
        echo $problem->get("prb_title");
        ?>
", <?php 
<?php

if (!isset($_POST['_action'])) {
    header("Location: ../");
    die;
}
include "./EvaluationCaseBS.php";
include "./UserSession.php";
$ecaseBS = new EvaluationCaseBS($_POST);
if ($_POST['_action'] == 'save') {
    $status = $ecaseBS->save();
    if ($status) {
        header("Location: ../evaluationCases.php?evc_prb_id=" . $_POST['evc_prb_id']);
    } else {
        die("Um erro inesperado ocorreu.");
    }
} else {
    if ($_POST['_action'] == 'delete') {
        $status = $ecaseBS->delete();
        if ($status) {
            header("Location: ../evaluationCases.php?evc_prb_id=" . $_POST['evc_prb_id']);
        } else {
            die("Um erro inesperado ocorreu.");
        }
    } else {
        die("<b>Action especificada é inválida.</b>");
    }
}
die;
예제 #4
0
<?php

$__REQUIRE_ACCESS_LEVEL__ = 3;
$__REDIRECT_TO__ = './';
include "static/header.php";
?>

<h1>Editar Caso de Teste</h1>

<div class="centering">
<?php 
include "controller/EvaluationCaseBS.php";
include "view/EvaluationCaseEdit.php";
$bs = new EvaluationCaseBS($_GET);
$model = $bs->retrieve();
if (isset($model)) {
    $widget = new EvaluationCaseEdit($model);
    $widget->render();
} else {
    echo "<br /><i>Este problema não existe.</i><br />";
}
?>
<br />
<button onClick="location.assign('./evaluationCases.php?evc_prb_id=<?php 
echo $_GET['evc_prb_id'];
?>
');">Voltar aos Casos de Teste</button>
</div>

<?php 
include "static/footer.php";