$navigation = build_navigation(array(array('name' => $blended->name, 'link' => "../../mod/blended/view.php?a={$blended->id}", 'type' => 'misc'), array('name' => $strscanpage, 'link' => "../../mod/blended/scan.php?a={$blended->id}", 'type' => 'misc'), array('name' => $strjobstatuspage, 'link' => "../../mod/blended/jobstatus.php?a={$blended->id}&jobid={$jobid}&page={$page}", 'type' => 'misc'), array('name' => $strstatusdetails, 'link' => null, 'type' => 'misc')));
    print_header("{$course->shortname}: {$blended->name}: {$strjobstatuspage}", "{$course->shortname}", $navigation, "", "", true, update_module_button($cm->id, $course->id, $blended->name, $strjobstatuspage), navmenu($course, $cm));
}
if ($page == "correction.php") {
    $navigation = build_navigation(array(array('name' => $blended->name, 'link' => "../../mod/blended/view.php?a={$blended->id}", 'type' => 'misc'), array('name' => $strcorrectionpage, 'link' => "../../mod/blended/correction.php?a={$blended->id}", 'type' => 'misc'), array('name' => $strjobstatuspage, 'link' => "../../mod/blended/jobstatus.php?a={$blended->id}&jobid={$jobid}&page={$page}", 'type' => 'misc'), array('name' => $strstatusdetails, 'link' => null, 'type' => 'misc')));
    print_header("{$course->shortname}: {$blended->name}: {$strjobstatuspage}", "{$course->shortname}", $navigation, "", "", true, update_module_button($cm->id, $course->id, $blended->name, $strjobstatuspage), navmenu($course, $cm));
}
print_spacer(20);
print_box(format_text($strtable), 'generalbox', 'intro');
print_spacer(20);
// Print the main part of the page ----------------------------------
print_spacer(20);
if ($page == "scan.php") {
    print_heading(format_string(get_string('scan', 'blended')));
}
if ($page == "correction.php") {
    print_heading(format_string(get_string('correction', 'blended')));
}
//print_box(format_text(get_string('jobstatusdesc', 'blended')), 'generalbox', 'intro');
print_spacer(20);
$message = get_details_message($jobid);
show_details_message($message);
if ($page == "scan.php") {
    $volver = "{$CFG->wwwroot}/mod/blended/scan.php?a={$a}";
}
if ($page == "correction.php") {
    $volver = "{$CFG->wwwroot}/mod/blended/correction.php?a={$a}";
}
print_spacer(100);
print_continue($volver);
print_footer($course);
function show_status_message($jobid, $message, $context, $blended, $page)
{
    $status = array();
    $statusrow["jobid"] = $jobid;
    $statusrow["message"] = $message;
    if (has_capability('mod/blended:viewstatusdetails', $context)) {
        $detalles = 'Detalles';
        $detailslink = "<a href=\"statusdetails.php?page={$page}&a={$blended->id}&jobid={$jobid}\">{$detalles}</a>";
        if (get_details_message($jobid)) {
            $statusrow["details"] = $detailslink;
        } else {
            $statusrow["details"] = "No hay detalles para mostrar";
        }
    } else {
        $statusrow["details"] = "No tiene suficientes permisos para ver los detalles del estado.";
    }
    $status[0] = $statusrow;
    //tabla de resultados
    $table = new stdClass();
    $table->class = 'mytable';
    $table->head = array('Job ID', 'Mensaje de Estado', 'Detalles');
    $align = "left";
    $table->align = array($align, 'center', $align);
    $tablealign = "center";
    $table->tablealign = $tablealign;
    $table->rowclasses = array();
    $table->data = $status;
    print_table($table);
    return;
}