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

Fixed displayed name when editing own submission copied from student

parent 726fb801
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,7 @@ $id = required_param('id', PARAM_INT); ...@@ -33,6 +33,7 @@ $id = required_param('id', PARAM_INT);
$userid = optional_param('userid', false, PARAM_INT); $userid = optional_param('userid', false, PARAM_INT);
$copy = optional_param('privatecopy', false, PARAM_INT); $copy = optional_param('privatecopy', false, PARAM_INT);
$subid = optional_param( 'submissionid', false, PARAM_INT ); $subid = optional_param( 'submissionid', false, PARAM_INT );
global $USER, $DB, $OUTPUT;
$vpl = new mod_vpl($id); $vpl = new mod_vpl($id);
$pageparms = array('id' => $id); $pageparms = array('id' => $id);
if ($userid && ! $copy) { if ($userid && ! $copy) {
...@@ -86,8 +87,8 @@ $options ['evaluate'] = ($instance->evaluate || $manager); ...@@ -86,8 +87,8 @@ $options ['evaluate'] = ($instance->evaluate || $manager);
$options ['example'] = true && $instance->example; $options ['example'] = true && $instance->example;
$options ['comments'] = ! $options ['example']; $options ['comments'] = ! $options ['example'];
$options ['description'] = $vpl->get_fulldescription_with_basedon(); $options ['description'] = $vpl->get_fulldescription_with_basedon();
$options ['username'] = $vpl->fullname($DB->get_record( 'user', array ( 'id' => $userid ) ), false);
$linkuserid = $copy ? $USER->id : $userid; $linkuserid = $copy ? $USER->id : $userid;
$options ['username'] = $vpl->fullname($DB->get_record( 'user', array ( 'id' => $linkuserid ) ), false);
$ajaxurl = "edit.json.php?id={$id}&userid={$linkuserid}"; $ajaxurl = "edit.json.php?id={$id}&userid={$linkuserid}";
if ( $subid && $lastsub ) { if ( $subid && $lastsub ) {
$ajaxurl .= "&subid={$lastsub->id}"; $ajaxurl .= "&subid={$lastsub->id}";
...@@ -112,8 +113,8 @@ if ( $subid ) { ...@@ -112,8 +113,8 @@ if ( $subid ) {
$reqfgm = $vpl->get_fgm('required'); $reqfgm = $vpl->get_fgm('required');
$options ['resetfiles'] = ($reqfgm->is_populated() && ! $instance->example); $options ['resetfiles'] = ($reqfgm->is_populated() && ! $instance->example);
$corfgm = $vpl->get_fgm('corrected'); $corfgm = $vpl->get_fgm('corrected');
$options ['correctedfiles'] = ($corfgm->is_populated() && ! $instance->example && $manager && user_has_role_assignment($USER->id,3)); $options ['correctedfiles'] = ($corfgm->is_populated() && ! $instance->example && $manager && user_has_role_assignment($USER->id,3));
$options ['maxfiles'] = intval($instance->maxfiles); $options ['maxfiles'] = intval($instance->maxfiles);
$reqfilelist = $reqfgm->getFileList(); $reqfilelist = $reqfgm->getFileList();
$options ['minfiles'] = count( $reqfilelist ); $options ['minfiles'] = count( $reqfilelist );
......
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