Skip to content
Snippets Groups Projects
Commit 9994b49c authored by Astor Bizard's avatar Astor Bizard :dog2:
Browse files

Now supports basedon mechanism with VPLs on which user doesnt have rights.

parent 82932b2c
No related branches found
No related tags found
1 merge request!1Dev: Submissions list rework, webservices and bugfixes
......@@ -109,6 +109,12 @@ class mod_vpl_executionoptions_form extends moodleform {
}
asort( $basedonlist );
$basedonlist [0] = get_string( 'select' );
if (!in_array($instance->basedon, array_keys($basedonlist))) {
$basedonvpl = new mod_vpl(null, $instance->basedon);
$basedonlist[$instance->basedon] = $basedonvpl->get_printable_name();
$warning = '<i class="icon fa fa-warning text-warning fa-fw" title="' . get_string('basedonwarning', VPL) . '"></i>';
$strbasedon .= '<span class="float-sm-right">' . $warning . '</span>';
}
$mform->addElement( 'select', 'basedon', $strbasedon, $basedonlist );
$mform->setDefault( 'basedon', $instance->basedon );
......@@ -167,7 +173,7 @@ if ($fromform = $mform->get_data()) {
$instance->evaluateonsubmission = $fromform->evaluate && $fromform->evaluateonsubmission;
$instance->automaticgrading = $fromform->evaluate && $fromform->automaticgrading;
if ( $vpl->update() ) {
vpl_notice( get_string( 'optionssaved', VPL ) );
vpl_redirect( vpl_mod_href('view.php', 'id', $id), get_string( 'optionssaved', VPL ), 'success' );
} else {
vpl_notice( get_string( 'optionsnotsaved', VPL ), 'error' );
}
......
......@@ -34,6 +34,9 @@ $string ['automaticgrading'] = 'Automatic grade';
$string ['averageperiods'] = 'Average periods {$a}';
$string ['averagetime'] = 'Average time {$a}';
$string ['basedon'] = 'Based on';
$string ['basedonwarning'] = 'It seems you do not have the rights on the VPL this VPL is based on.
The based on mechanism will still work.
However, please note that if you change it, you will not be able to change it back to its current state.';
$string ['basic'] = 'Basic';
$string ['binaryfile'] = 'Binary File';
$string ['browserupdate'] = 'Please update your browser to the last version<br />or use another that supports Websocket.';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment