//Make own submission
    $userid = $USER->id;
    if ($vpl->get_instance()->restrictededitor) {
        $vpl->require_capability(VPL_MANAGE_CAPABILITY);
    }
    $vpl->require_capability(VPL_SUBMIT_CAPABILITY);
    $vpl->network_check();
    $vpl->password_check();
} else {
    //Make other user submission
    $vpl->require_capability(VPL_MANAGE_CAPABILITY);
}
$instance = $vpl->get_instance();
$vpl->print_header(get_string('submission', VPL));
$vpl->print_view_tabs(basename(__FILE__));
$mform = new mod_vpl_submission_form('submission.php', $vpl);
if ($mform->is_cancelled()) {
    vpl_inmediate_redirect(vpl_mod_href('view.php', 'id', $id));
    die;
}
if ($fromform = $mform->get_data()) {
    $raw_POST_size = strlen(file_get_contents("php://input"));
    if ($_SERVER['CONTENT_LENGTH'] != $raw_POST_size) {
        $error = "NOT SAVED (Http POST error: CONTENT_LENGTH expected " . $_SERVER['CONTENT_LENGTH'] . " found {$raw_POST_size})";
        notice($error, vpl_mod_href('forms/submission.php', 'id', $id, 'userid', $userid), $vpl->get_course());
        die;
    }
    $rfn = $vpl->get_required_fgm();
    $minfiles = count($rfn->getFilelist());
    $files = array();
    for ($i = 0; $i < $instance->maxfiles; $i++) {