function __construct($show = false)
 {
     if (self::$globalid == 0) {
         echo vpl_include_jsfile('hideshow.js');
     }
     $this->id = self::$globalid;
     $this->show = $show;
     self::$globalid++;
 }
        $mform->addElement('selectyesno', 'evaluate', get_string('evaluate', VPL));
        $mform->setDefault('evaluate', 1);
        $mform->addElement('selectyesno', 'evaluateonsubmission', get_string('evaluateonsubmission', VPL));
        $mform->setDefault('evaluateonsubmission', 1);
        $mform->disabledIf('evaluateonsubmission', 'evaluate', 'eq', 0);
        $mform->addElement('selectyesno', 'automaticgrading', get_string('automaticgrading', VPL));
        $mform->setDefault('automaticgrading', 1);
        $mform->disabledIf('automaticgrading', 'evaluate', 'eq', 0);
        $mform->addElement('submit', 'saveoptions', get_string('saveoptions', VPL));
    }
}
require_login();
$id = required_param('id', PARAM_INT);
$vpl = new mod_vpl($id);
$vpl->prepare_page('forms/executionoptions.php', array('id' => $id));
vpl_include_jsfile('hideshow.js');
$vpl->require_capability(VPL_MANAGE_CAPABILITY);
//Display page
$vpl->print_header(get_string('execution', VPL));
$vpl->print_heading_with_help('executionoptions');
$vpl->print_configure_tabs(basename(__FILE__));
$course = $vpl->get_course();
$fgp = $vpl->get_execution_fgm();
$mform = new mod_vpl_executionoptions_form('executionoptions.php', $vpl);
if ($fromform = $mform->get_data()) {
    if (isset($fromform->saveoptions)) {
        $instance = $vpl->get_instance();
        \mod_vpl\event\vpl_execution_options_updated::log($vpl);
        $instance->basedon = $fromform->basedon;
        $instance->run = $fromform->run;
        $instance->debug = $fromform->debug;
require_once dirname(__FILE__) . '/grade_form.php';
require_once dirname(__FILE__) . '/../vpl.class.php';
require_once dirname(__FILE__) . '/../vpl_submission.class.php';
function vpl_grade_header($vpl, $inpopup)
{
    if ($inpopup) {
        $vpl->print_header_simple();
    } else {
        $vpl->print_header(get_string('grade'));
        $vpl->print_view_tabs(basename(__FILE__));
    }
}
require_login();
vpl_include_jsfile('grade.js', false);
vpl_include_jsfile('hide_footer.js', false);
vpl_include_jsfile('updatesublist.js', false);
$PAGE->requires->css(new moodle_url('/mod/vpl/css/sh.css'));
$PAGE->requires->css(new moodle_url('/mod/vpl/editor/VPLIDE.css'));
$id = required_param('id', PARAM_INT);
$userid = required_param('userid', PARAM_INT);
$vpl = new mod_vpl($id);
$vpl->prepare_page('forms/gradesubmission.php', array('id' => $id, 'userid' => $userid));
$jscript = '';
$inpopup = optional_param('inpopup', 0, PARAM_INT);
$vpl->require_capability(VPL_GRADE_CAPABILITY);
//Read records
$submissionid = optional_param('submissionid', FALSE, PARAM_INT);
if ($submissionid) {
    $subinstance = $DB->get_record('vpl_submissions', array('id' => $submissionid));
} else {
    $subinstance = $vpl->last_user_submission($userid);