Skip to content

Commit

Permalink
MDL-26535 workshop: new capability to control the anonymity of publis…
Browse files Browse the repository at this point in the history
…hed submissions

Re-using 'mod/workshop:viewauthornames' would not be a happy option here
because teacher would have to change local overrides every time when
they were closing or re-opening the workshop (if they wanted anonymous
assessment but non-anonymous hall of fame).
  • Loading branch information
mudrd8mz committed Mar 4, 2011
1 parent 757bade commit e13d02f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions mod/workshop/db/access.php
Expand Up @@ -170,6 +170,18 @@
)
),

// Ability to view the authors of published submissions.
'mod/workshop:viewauthorpublished' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),

// Ability to always view the assessments of other users' work and the calculated grades, regardless the phase.
// Applies to the user's group only or - if the user is allowed to access all groups - applies to any assessment
'mod/workshop:viewallassessments' => array(
Expand Down
1 change: 1 addition & 0 deletions mod/workshop/lang/en/workshop.php
Expand Up @@ -254,6 +254,7 @@
$string['workshop:viewallassessments'] = 'View all assessments';
$string['workshop:viewallsubmissions'] = 'View all submissions';
$string['workshop:viewauthornames'] = 'View author names';
$string['workshop:viewauthorpublished'] = 'View authors of published submissions';
$string['workshop:viewpublishedsubmissions'] = 'View published submissions';
$string['workshop:viewreviewernames'] = 'View reviewer names';
$string['yoursubmission'] = 'Your submission';
2 changes: 1 addition & 1 deletion mod/workshop/version.php
Expand Up @@ -29,6 +29,6 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2011021100;
$module->version = 2011030400;
$module->requires = 2011020900; // Requires this Moodle version
//$module->cron = 60;
3 changes: 2 additions & 1 deletion mod/workshop/view.php
Expand Up @@ -492,11 +492,12 @@
print_collapsible_region_end();
}
if (has_capability('mod/workshop:viewpublishedsubmissions', $workshop->context)) {
$shownames = has_capability('mod/workshop:viewauthorpublished', $workshop->context);
if ($submissions = $workshop->get_published_submissions()) {
print_collapsible_region_start('', 'workshop-viewlet-publicsubmissions', get_string('publishedsubmissions', 'workshop'));
foreach ($submissions as $submission) {
echo $output->box_start('generalbox submission-summary');
echo $output->render($workshop->prepare_submission_summary($submission, true));
echo $output->render($workshop->prepare_submission_summary($submission, $shownames));
echo $output->box_end();
}
print_collapsible_region_end();
Expand Down

0 comments on commit e13d02f

Please sign in to comment.