예제 #1
0
                    $recr = new stdClass();
                    $recr->number = $j;
                    $recr->question_id = $questionid[$llaves[$i]]->id;
                    $recr->text = $datas->{$idr};
                    $allanswers[] = $recr;
                }
            }
            $DB->insert_records("evapares_answers", $allanswers);
            $action = "view";
        }
    }
}
if (has_capability('mod/evapares:courseevaluations', $context) && $action == "add") {
    $addform->display();
} elseif (has_capability('mod/evapares:courseevaluations', $context) && $action == "view") {
    echo $OUTPUT->tabtree(evapares_edit_tabs($cmid), get_string('summary', 'mod_evapares'));
    $excelsummary = new moodle_url('view.php', array('id' => $cm->id, 'export' => 'summary'));
    $excelalldata = new moodle_url('view.php', array('id' => $cm->id, 'export' => 'alldata'));
    echo $OUTPUT->heading(get_string("downloadexcel", "mod_evapares"), 4);
    echo html_writer::start_div('exportbuttons');
    echo $OUTPUT->action_icon($excelsummary, new pix_icon('i/grades', "download"));
    echo get_string("summaryexcel", "mod_evapares");
    echo $OUTPUT->action_icon($excelalldata, new pix_icon('i/grades', "download"));
    echo get_string("alldataexcel", "mod_evapares");
    echo html_writer::end_div();
    evapares_get_teacherview($cm->id, $evapares);
} elseif (has_capability('mod/evapares:myevaluations', $context) && $action == "view") {
    //students view
    if ($mode == 'evaluation') {
        echo $OUTPUT->tabtree(evapares_result_tabs($cmid), get_string('evals', 'mod_evapares'));
        evapares_get_evaluations($cm->id, $cm->instance);
예제 #2
0
if ($action == "view") {
    $viewtable = new html_table();
    $viewtable->data[] = array("Nombre", $evapares->name);
    $scc = "Deshabilitado";
    if ($evapares->scc = 1) {
        $scc = "Habilitado";
    }
    $viewtable->data[] = array("Stop-Start-Continue", $scc);
    $viewtable->data[] = array("Número de evaluaciones", $evapares->total_iterations + 2);
    $viewtable->data[] = array("Tiempo para evaluar", $evapares->n_days . " días");
    $iterations = $DB->get_records("evapares_iterations", array("evapares_id" => $cmid));
    $daysinseconds = 24 * 60 * 60 * (int) $evapares->n_days;
    foreach ($iterations as $iteration) {
        $viewtable->data[] = array($iteration->evaluation_name, "Inicio " . date("H:i - d-m-Y", $iteration->start_date) . " / Fin " . date("H:i - d-m-Y", $daysinseconds + (int) $iteration->start_date));
    }
    $editbutton = new moodle_url("configuration.php", array('action' => "edit", "cmid" => $cmid));
    $url = new moodle_url("/course/view.php", array('id' => $COURSE->id));
}
echo $OUTPUT->header();
if ($action == "edit") {
    echo $OUTPUT->heading("Edición de actividad evaluación de pares");
    $editconfig->display();
}
if ($action == "view") {
    echo $OUTPUT->tabtree(evapares_edit_tabs($cmid), "Configuración");
    echo $OUTPUT->heading("Detalle actividad evaluación de pares");
    echo html_writer::table($viewtable);
    echo $OUTPUT->single_button($editbutton, "Editar");
    echo $OUTPUT->single_button($url, get_string('back_to_course', 'mod_evapares'));
}
echo $OUTPUT->footer();