Пример #1
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;
        $instance->evaluate = $fromform->evaluate;
        $instance->evaluateonsubmission = $fromform->evaluate && $fromform->evaluateonsubmission;
        $instance->automaticgrading = $fromform->evaluate && $fromform->automaticgrading;
        if ($DB->update_record(VPL, $instance)) {
            vpl_notice(get_string('optionssaved', VPL));
Пример #2
0
 function display()
 {
     $id = optional_param('update', FALSE, PARAM_INT);
     if ($id) {
         $vpl = new mod_vpl($id);
         $vpl->print_configure_tabs('edit');
         if ($vpl->get_grade_info() !== false) {
             $vpl->get_instance()->visiblegrade = $vpl->get_grade_info()->hidden ? 0 : 1;
         } else {
             $vpl->get_instance()->visiblegrade = false;
         }
         $this->set_data($vpl->get_instance());
     }
     parent::display();
 }