Ejemplo n.º 1
0
        $merge = isset($mform->get_data()->merge) ? false : true;
        // Inverted as question in form was inverted
        $nocache = rand(1, 999999);
        // File is ok, process
        // Setup de directorios temporales
        $tempdir = emarking_get_temp_dir_path($emarking->id);
        emarking_initialize_directory($tempdir, true);
        // Gets file hash
        $newfile = emarking_get_path_from_hash($tempdir, $file->get_pathnamehash(), '', true);
        // Display confirmation page before moving to process
        echo $OUTPUT->header();
        echo $OUTPUT->heading(get_string('confirmprocess', 'mod_emarking'));
        echo $OUTPUT->tabtree(emarking_tabs($context, $cm, $emarking), "uploadanswers");
        echo $OUTPUT->box_start('generalbox');
        // If the user confirms it goes to process.php
        $confirmurl = new moodle_url('/mod/emarking/print/processanswers.php', array('merge' => $merge, 'file' => $file->get_pathnamehash(), 'emarkingid' => $emarking->id));
        // Message changes if it will be merged
        $confirmessage = $merge ? 'confirmprocessfilemerge' : 'confirmprocessfile';
        // Show confirmation buttons
        echo $OUTPUT->confirm(get_string($confirmessage, 'mod_emarking', array('file' => $file->get_filename(), 'assignment' => $emarking->name)), $confirmurl, $urlemarking);
        echo $OUTPUT->box_end();
        echo $OUTPUT->footer();
        die;
    }
}
// Display form for uploading zip file
echo $OUTPUT->header();
echo $OUTPUT->heading($emarking->name);
echo $OUTPUT->tabtree(emarking_tabs($context, $cm, $emarking), "uploadanswers");
$mform->display();
echo $OUTPUT->footer();