コード例 #1
0
        $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));
        } else {
            vpl_error(get_string('optionsnotsaved', VPL));
コード例 #2
0
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// VPL for Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with VPL for Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * Download execution files in ZIP format
 *
 * @package mod_vpl
 * @copyright 2012 Juan Carlos Rodríguez-del-Pino
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @author Juan Carlos Rodríguez-del-Pino <*****@*****.**>
 */
require_once dirname(__FILE__) . '/../../../config.php';
require_once dirname(__FILE__) . '/../locallib.php';
require_once dirname(__FILE__) . '/../vpl.class.php';
try {
    require_login();
    $id = required_param('id', PARAM_INT);
    $vpl = new mod_vpl($id);
    $vpl->require_capability(VPL_MANAGE_CAPABILITY);
    $filegroup = $vpl->get_execution_fgm();
    $filegroup->download_files($vpl->get_printable_name());
    die;
} catch (Exception $e) {
}