diff --git a/forms/coursesettings.php b/forms/coursesettings.php deleted file mode 100644 index 94387ecdb83fdff0c820e22135d1c3f2083cfc73..0000000000000000000000000000000000000000 --- a/forms/coursesettings.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php -// This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/ -// -// VPL for Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// 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/>. - -/** - * Execution options form - * - * @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 <jcrodriguez@dis.ulpgc.es> - */ - -require_once(dirname(__FILE__).'/../../../config.php'); -require_once(dirname(__FILE__).'/../locallib.php'); -require_once(dirname(__FILE__).'/../vpl.class.php'); -require_once($CFG->libdir.'/formslib.php'); - -class mod_vpl_coursesettings_form extends moodleform { - protected $vpl; - public function __construct($page, $vpl) { - $this->vpl = $vpl; - parent::__construct( $page ); - } - protected function definition() { - $mform = & $this->_form; - $id = $this->vpl->get_course_module()->id; - $mform->addElement( 'hidden', 'id', $id ); - $mform->setType( 'id', PARAM_INT ); - $mform->addElement( 'selectyesno', 'useracetheme', get_string( 'useracetheme', VPL ) ); - $mform->setDefault( 'useracetheme', false ); - $mform->addHelpButton('useracetheme', 'useracetheme', VPL); - $mform->addElement( 'selectyesno', 'studentaccessprevious', get_string( 'studentaccessprevious', VPL ) ); - $mform->setDefault( 'studentaccessprevious', false ); - $mform->addHelpButton('studentaccessprevious', 'studentaccessprevious', VPL); - $mform->addElement( 'selectyesno', 'gradebookshortfeedback', get_string( 'gradebookshortfeedback', VPL ) ); - $mform->setDefault( 'gradebookshortfeedback', false ); - $mform->addHelpButton('gradebookshortfeedback', 'gradebookshortfeedback', VPL); - $mform->addElement( 'selectyesno', 'hidesubmissionform', get_string( 'hidesubmissionform', VPL ) ); - $mform->setDefault( 'hidesubmissionform', false ); - $mform->addHelpButton('hidesubmissionform', 'hidesubmissionform', VPL); - $mform->addElement( 'selectyesno', 'notimelimit', get_string( 'notimelimit', VPL ) ); - $mform->setDefault( 'notimelimit', false ); - $mform->addHelpButton('notimelimit', 'notimelimit', VPL); - $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/coursesttings.php', array ( 'id' => $id ) ); -$vpl->require_capability( VPL_MANAGE_CAPABILITY ); -$course = $vpl->get_course(); -$PAGE->navbar->add( get_string( 'coursesttings', VPL ) ); -// Display page. -echo $OUTPUT->header(); -echo $OUTPUT->heading( get_string( 'coursesttings', VPL ) ); - -$course = $vpl->get_course(); -$mform = new mod_vpl_coursesettings_form( 'coursesttings.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->runscript = $fromform->runscript; - $instance->debugscript = $fromform->debugscript; - $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 ( $vpl->update() ) { - vpl_notice( get_string( 'optionssaved', VPL ) ); - } else { - vpl_notice( get_string( 'optionsnotsaved', VPL ), 'error' ); - } - } -} -\mod_vpl\event\vpl_execution_options_viewed::log( $vpl ); -$mform->display(); -$vpl->print_footer(); diff --git a/forms/executionfiles.json.php b/forms/executionfiles.json.php deleted file mode 100644 index 91f6dc97fe1115cb1e7ed45ac78ba5120d02c57b..0000000000000000000000000000000000000000 --- a/forms/executionfiles.json.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -// This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/ -// -// VPL for Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// 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/>. - -/** - * Processes AJAX to edit execution files - * - * @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 <jcrodriguez@dis.ulpgc.es> - */ - -define( 'AJAX_SCRIPT', true ); - -require(__DIR__ . '/../../../config.php'); - -$outcome = new stdClass(); -$outcome->success = true; -$outcome->response = new stdClass(); -$outcome->error = ''; -try { - require_once(dirname( __FILE__ ) . '/../locallib.php'); - require_once(dirname( __FILE__ ) . '/../vpl.class.php'); - require_once(dirname( __FILE__ ) . '/edit.class.php'); - if (! isloggedin()) { - throw new Exception( get_string( 'loggedinnot' ) ); - } - $id = required_param( 'id', PARAM_INT ); // Course id. - $action = required_param( 'action', PARAM_ALPHANUMEXT ); - $vpl = new mod_vpl( $id ); - // TODO use or not sesskey "require_sesskey();". - require_login( $vpl->get_course(), false ); - $vpl->require_capability( VPL_MANAGE_CAPABILITY ); - $PAGE->set_url( new moodle_url( '/mod/vpl/forms/executionfiles.json.php', array ( - 'id' => $id, - 'action' => $action - ) ) ); - echo $OUTPUT->header(); // Send headers. - $actiondata = json_decode( file_get_contents( 'php://input' ) ); - switch ($action) { - case 'save' : - $postfiles = mod_vpl_edit::filesfromide($actiondata->files); - $fgm = $vpl->get_fgm('execution'); - $fgm->deleteallfiles(); - $fgm->addallfiles($postfiles); - $vpl->update(); - break; - case 'load' : - $fgm = $vpl->get_fgm('execution'); - $outcome->response->files = mod_vpl_edit::filestoide( $fgm->getallfiles() ); - break; - case 'run' : - case 'debug' : - case 'evaluate' : - $outcome->response = mod_vpl_edit::execute( $vpl, $USER->id, $action, $actiondata ); - break; - case 'retrieve' : - $outcome->response = mod_vpl_edit::retrieve_result( $vpl, $USER->id ); - break; - case 'cancel' : - $outcome->response = mod_vpl_edit::cancel( $vpl, $userid ); - break; - case 'getjails' : - $outcome->response->servers = vpl_jailserver_manager::get_https_server_list( $vpl->get_instance()->jailservers ); - break; - default : - throw new Exception( 'ajax action error: ' + $action); - } -} catch ( Exception $e ) { - $outcome->success = false; - $outcome->error = $e->getMessage(); -} -echo json_encode( $outcome ); -die(); diff --git a/forms/executionfiles.php b/forms/executionfiles.php deleted file mode 100644 index 0f2bfb24efd556134d48d5ac8b989e0a28276ea9..0000000000000000000000000000000000000000 --- a/forms/executionfiles.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -// This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/ -// -// VPL for Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// 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/>. -/** - * Edit execution files - * - * @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 <jcrodriguez@dis.ulpgc.es> - */ -require_once(dirname( __FILE__ ) . '/../../../config.php'); -require_once(dirname( __FILE__ ) . '/../locallib.php'); -require_once(dirname( __FILE__ ) . '/../vpl.class.php'); -require_once(dirname( __FILE__ ) . '/../editor/editor_utility.php'); -require_login(); -$id = required_param( 'id', PARAM_INT ); -$vpl = new mod_vpl( $id ); -$instance = $vpl->get_instance(); -$vpl->prepare_page( 'forms/executionfiles.php', array ( 'id' => $id ) ); -$vpl->require_capability( VPL_MANAGE_CAPABILITY ); -$fgp = $vpl->get_fgm('execution'); -$options = Array (); -$options ['restrictededitor'] = false; -$options ['save'] = true; -$options ['run'] = true; -$options ['debug'] = true; -$options ['evaluate'] = true; -$options ['ajaxurl'] = "executionfiles.json.php?id={$id}&action="; -$options ['download'] = "../views/downloadexecutionfiles.php?id={$id}"; -$options ['resetfiles'] = false; -$options ['minfiles'] = 0; -$options ['maxfiles'] = 1000; -$options ['saved'] = true; -$options ['minfiles'] = $fgp->get_numstaticfiles(); -session_write_close(); -vpl_editor_util::generate_requires($options); -$vpl->print_header( get_string( 'executionfiles', VPL ) ); -$vpl->print_heading_with_help( 'executionfiles' ); -echo $OUTPUT->box_start(); -vpl_editor_util::print_tag(); -echo $OUTPUT->box_end(); -$vpl->print_footer_simple(); \ No newline at end of file diff --git a/forms/requiredfiles.php b/forms/requiredfiles.php deleted file mode 100644 index 0e13ca7bb8c78f53ce4318890e3a6946b885fabb..0000000000000000000000000000000000000000 --- a/forms/requiredfiles.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -// This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/ -// -// VPL for Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// 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/>. - -/** - * Edit required file - * - * @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 <jcrodriguez@dis.ulpgc.es> - */ - -require_once(dirname(__FILE__). '/../../../config.php'); -require_once(dirname(__FILE__). '/../locallib.php'); -require_once(dirname(__FILE__). '/../vpl.class.php'); -require_once(dirname( __FILE__ ). '/edit.class.php'); -require_once(dirname(__FILE__). '/../editor/editor_utility.php'); - -require_login(); -$id = required_param( 'id', PARAM_INT ); - -$vpl = new mod_vpl( $id ); -$instance = $vpl->get_instance(); -$vpl->prepare_page( 'forms/requiredfiles.php', array ( 'id' => $id ) ); -$vpl->require_capability( VPL_MANAGE_CAPABILITY ); - -$options = Array (); -$options ['restrictededitor'] = false; -$options ['save'] = true; -$options ['run'] = false; -$options ['debug'] = false; -$options ['evaluate'] = false; -$options ['ajaxurl'] = "requiredfiles.json.php?id={$id}&action="; -$options ['download'] = "../views/downloadrequiredfiles.php?id={$id}"; -$options ['resetfiles'] = false; -$options ['minfiles'] = 0; -$options ['maxfiles'] = 1000; -$options ['saved'] = true; - -vpl_editor_util::generate_requires($options); - -$vpl->print_header( get_string( 'requestedfiles', VPL ) ); -$vpl->print_heading_with_help( 'requestedfiles' ); - -session_write_close(); -echo $OUTPUT->box_start(); -vpl_editor_util::print_tag(); -echo $OUTPUT->box_end(); -$vpl->print_footer_simple(); diff --git a/views/downloadexecutionfiles.php b/views/downloadexecutionfiles.php deleted file mode 100644 index ea0db50141bdcfdc895fbc08499e02181c13b7c0..0000000000000000000000000000000000000000 --- a/views/downloadexecutionfiles.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -// This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/ -// -// VPL for Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// 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 - * - * @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 <jcrodriguez@dis.ulpgc.es> - */ - -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 ) { - vpl_redirect(´´, $e->getMessage(), 'error' ); -} diff --git a/views/downloadrequiredfiles.php b/views/downloadrequiredfiles.php deleted file mode 100644 index dfaa282cb83a5780523c1c552ca515a163401747..0000000000000000000000000000000000000000 --- a/views/downloadrequiredfiles.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -// This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/ -// -// VPL for Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// 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 required 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 <jcrodriguez@dis.ulpgc.es> - */ -require_once dirname(__FILE__).'/../../../config.php'; -require_once dirname(__FILE__).'/../locallib.php'; -require_once dirname(__FILE__).'/../vpl.class.php'; -require_login(); -$id = required_param('id',PARAM_INT); -$vpl = new mod_vpl($id); -$vpl->password_check(); -$vpl->network_check(); -if(!$vpl->is_visible()){ - notice(get_string('notavailable')); -} -$filegroup=$vpl->get_fgm("required"); -$filegroup->download_files($vpl->get_printable_name()); -die; \ No newline at end of file diff --git a/vpl.class.php b/vpl.class.php index 50e30c44327bc7c5710d44aac9143e89eeb620af..17e8b3f0bceaccac2335d6e538f34831d8d55bbd 100644 --- a/vpl.class.php +++ b/vpl.class.php @@ -314,21 +314,21 @@ class mod_vpl { * @param $files array * of required files */ - public function set_files($type,$files) { + public function set_files($type, $files) { file_group_process::write_list( $this->get_files_filename($type), $files ); } /** * - * @return object file group manager for required files + * @return file_group_process file group manager for specified files */ public function get_fgm($type) { if (! isset($this->fgm[$type])) { - if ($type=='execution') { - $this->fgm[$type] = new file_group_execution( $this->get_files_filename($type) + if ($type == 'execution') { + $this->fgm[$type] = new file_group_execution( $this->get_files_filename($type) , $this->get_files_directory($type) ); } else { - $this->fgm[$type] = new file_group_process( $this->get_files_filename($type) + $this->fgm[$type] = new file_group_process( $this->get_files_filename($type) , $this->get_files_directory($type) , $this->instance->maxfiles ); } @@ -336,27 +336,6 @@ class mod_vpl { return $this->fgm[$type]; } - // FIXME check and remove function. - public function set_initial_file($name, $files) { - $filelist = ''; - $basepath = $this->get_submission_directory(); - foreach ($files as $file) { - $name = basename( $file ['name'] ); - if ($name > '') { - if ($filelist > '') { - $filelist .= "\n"; - } - $filelist .= $name; - $fp = vpl_fopen( $basepath . $name ); - fwrite( $fp, $file ['data'] ); - fclose( $fp ); - } - } - $fp = vpl_fopen( $this->get_submissionfilelistname() ); - fwrite( $fp, $filelist ); - fclose( $fp ); - } - /** * get instance name with groupping name if available * @@ -477,11 +456,12 @@ class mod_vpl { protected function get_password_md5() { return md5( $this->instance->id . (sesskey()) ); } + /** * Get is use as base **/ - function is_use_as_base(){ - return ($this->instance->usableasbase?true:false); + public function is_use_as_base() { + return $this->instance->usableasbase == 1; } @@ -828,13 +808,11 @@ class mod_vpl { } else { $field = 'userid'; } + $id = $this->get_instance()->id; $query = "SELECT $field, COUNT(*) as submissions FROM {vpl_submissions}"; - $query .= ' WHERE {vpl_submissions}.vpl=?'; + $query .= " WHERE {vpl_submissions}.vpl=$id"; $query .= " GROUP BY {vpl_submissions}.$field"; - $parms = array ( - $this->get_instance()->id - ); - return $DB->get_records_sql( $query, $parms ); + return $DB->get_records_sql( $query ); } /** @@ -1424,69 +1402,6 @@ class mod_vpl { self::$headerisout = true; } - /** - * Create tabs to view_description/submit/view_submission/edit - * - * @param string $path to get the active tab - * - */ - public function print_configure_tabs($path) { - global $CFG, $PAGE; - $active = basename($path); - $strbasic = get_string('basic', VPL); - $strfulldescription = get_string('fulldescription', VPL); - $strtestcases = get_string('testcases', VPL); - $strexecutionoptions = get_string('executionoptions', VPL); - $menustrexecutionoptions = get_string('menuexecutionoptions', VPL); - $strrequestedfiles = get_string('requestedfiles', VPL); - $stradvanced = get_string('advanced', VPL); - $strexecution = get_string('execution', VPL); - $tabs = array(); - $tabs[] = new tabobject('edit', vpl_abs_href('/course/modedit.php', 'update', $this->cm->id), $strbasic, $strbasic); - $urltestcasesfile = vpl_mod_href('forms/testcasesfile.php', 'id', $this->cm->id, 'edit', 3); - $tabs[] = new tabobject('testcasesfile.php', $urltestcasesfile, $strtestcases, $strtestcases); - $urlexecutionoptions = vpl_mod_href('forms/executionoptions.php', 'id', $this->cm->id); - $tabs[] = new tabobject('executionoptions.php', $urlexecutionoptions, $menustrexecutionoptions, $strexecutionoptions); - $urlrequestedfiles = vpl_mod_href('forms/requestedfiles.php', 'id', $this->cm->id); - $tabs[] = new tabobject('requiredfiles.php', $urlrequestedfiles, $strrequestedfiles, $strrequestedfiles); - if ($active == 'executionfiles.php' || $active == 'executionlimits.php' - || $active == 'executionkeepfiles.php' || $active == 'variations.php' - || $active == 'local_jail_servers.php' || $active == 'checkjailservers.php') { - $urlexecutionfiles = VPL_mod_href('forms/executionfiles.php', 'id', $this->cm->id); - $tabs[] = new tabobject($active, $urlexecutionfiles, $stradvanced, $stradvanced); - $strexecutionlimits = get_string('maxresourcelimits', VPL); - $strexecutionfiles = get_string('executionfiles', VPL); - $menustrexecutionfiles = get_string('menuexecutionfiles', VPL); - $menustrexecutionlimits = get_string('menuresourcelimits', VPL); - $strvariations = get_string('variations', VPL); - $strexecutionkeepfiles = get_string('keepfiles', VPL); - $strexecutionlimits = get_string('maxresourcelimits', VPL); - $strcheckjails = get_string('check_jail_servers', VPL); - $strsetjails = get_string('local_jail_servers', VPL); - $menustrexecutionkeepfiles = get_string('menukeepfiles', VPL); - $menustrcheckjails = get_string('menucheck_jail_servers', VPL); - $menustrsetjails = get_string('menulocal_jail_servers', VPL); - $subtabs = array(); - $urlexecutionfiles = VPL_mod_href('forms/executionfiles.php', 'id', $this->cm->id); - $subtabs[] = new tabobject('executionfiles.php', $urlexecutionfiles, $menustrexecutionfiles, $strexecutionfiles); - $urlexecutionlimits = VPL_mod_href('forms/executionlimits.php', 'id', $this->cm->id); - $subtabs[] = new tabobject('executionlimits.php', $urlexecutionlimits, $menustrexecutionlimits, $strexecutionlimits); - $urlexecutionkeepfiles = VPL_mod_href('forms/executionkeepfiles.php', 'id', $this->cm->id); - $subtabs[] = new tabobject('executionkeepfiles.php', $urlexecutionkeepfiles, - $menustrexecutionkeepfiles, $strexecutionkeepfiles); - $urlvariations = VPL_mod_href('forms/variations.php', 'id', $this->cm->id); - $subtabs[] = new tabobject('variations.php', $urlvariations, $strvariations, $strvariations); - $urlcheckjailservers = VPL_mod_href('views/checkjailservers.php', 'id', $this->cm->id); - $subtabs[] = new tabobject('checkjailservers.php', $urlcheckjailservers, $menustrcheckjails, $strcheckjails); - if ($this->has_capability(VPL_SETJAILS_CAPABILITY)) { - $urllocaljailservers = VPL_mod_href('forms/local_jail_servers.php', 'id', $this->cm->id); - $subtabs[] = new tabobject('local_jail_servers.php', $urllocaljailservers, $menustrsetjails, $strsetjails); - } - } else { - $tabs[] = new tabobject('executionfiles.php', $urlexecutionfiles, $stradvanced, $stradvanced); - } - } - /** * Create tabs to view_description/submit/view_submission/edit * @@ -1602,7 +1517,7 @@ class mod_vpl { } $tabs [] = vpl_create_tabobject( 'edit.php', $href, 'edit'); } - if (! $example) { + if (! $example && $submiter && $this->is_submit_able()) { $href = vpl_mod_href( 'forms/submissionview.php', 'id', $cmid, 'userid', $userid ); $tabs [] = vpl_create_tabobject( 'submissionview.php', $href, 'submissionview'); if ($grader && $this->get_grade() != 0 && $subinstance @@ -1613,7 +1528,7 @@ class mod_vpl { $text = get_string( 'grade' ); $tabs [] = vpl_create_tabobject( 'gradesubmission.php', $href, 'grade', 'moodle' ); } - if ($subinstance /*&& ($grader || $similarity|| $this->instance->allowshowprevious)*/) { + if ($subinstance /*&& ($grader || $similarity|| $this->instance->allowshowprevious)*/) { $strlistprevoiussubmissions = get_string( 'previoussubmissionslist', VPL ); $href = vpl_mod_href( 'views/previoussubmissionslist.php', 'id', $cmid, 'userid', $userid ); $tabs [] = vpl_create_tabobject( 'previoussubmissionslist.php', $href, 'previoussubmissionslist' ); @@ -1750,8 +1665,7 @@ class mod_vpl { $needcomma = true; } $link = ' (<a href="'; - // $link .= vpl_mod_href( 'views/downloadfiles.php', 'id', $this->get_course_module()->id ,'type','required'); - $link .= vpl_mod_href( 'views/downloadrequiredfiles.php', 'id', $this->get_course_module()->id ); + $link .= vpl_mod_href( 'views/downloadfiles.php', 'id', $this->get_course_module()->id, 'type', 'required'); $link .= '">'; $link .= get_string( 'download', VPL ); $link .= '</a>)';