Skip to content

Commit

Permalink
MDL-35421 Display the conclusion when the workshop is closed
Browse files Browse the repository at this point in the history
There is a new task implemented for the teachers so they are expected to
provide the conclusion at the end of the assessment phase.
  • Loading branch information
mudrd8mz committed Nov 1, 2012
1 parent 5a49f82 commit 4c61fcd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions mod/workshop/lang/en/workshop.php
Expand Up @@ -259,6 +259,7 @@
$string['taskassesspeers'] = 'Assess peers';
$string['taskassesspeersdetails'] = 'total: {$a->total}<br />pending: {$a->todo}';
$string['taskassessself'] = 'Assess yourself';
$string['taskconclusion'] = 'Provide a conclusion of the activity';
$string['taskinstructauthors'] = 'Provide instructions for submission';
$string['taskinstructreviewers'] = 'Provide instructions for assessment';
$string['taskintro'] = 'Set the workshop introduction';
Expand Down
19 changes: 19 additions & 0 deletions mod/workshop/locallib.php
Expand Up @@ -149,6 +149,12 @@ class workshop {
/** @var bool automatically switch to the assessment phase after the submissions deadline */
public $phaseswitchassessment;

/** @var string conclusion text to be displayed at the end of the activity */
public $conclusion;

/** @var int format of the conclusion text */
public $conclusionformat;

/**
* @var workshop_strategy grading strategy instance
* Do not use directly, get the instance using {@link workshop::grading_strategy_instance()}
Expand Down Expand Up @@ -2800,6 +2806,19 @@ public function __construct(workshop $workshop, $userid) {
$task->completed = 'info';
$phase->tasks['evaluateinfo'] = $task;
}

if (has_capability('moodle/course:manageactivities', $workshop->context, $userid)) {
$task = new stdclass();
$task->title = get_string('taskconclusion', 'workshop');
$task->link = $workshop->updatemod_url();
if (trim($workshop->conclusion)) {
$task->completed = true;
} elseif ($workshop->phase >= workshop::PHASE_EVALUATION) {
$task->completed = false;
}
$phase->tasks['conclusion'] = $task;
}

$this->phases[workshop::PHASE_EVALUATION] = $phase;

//---------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions mod/workshop/view.php
Expand Up @@ -512,6 +512,13 @@
}
break;
case workshop::PHASE_CLOSED:
if (trim($workshop->conclusion)) {
$conclusion = file_rewrite_pluginfile_urls($workshop->conclusion, 'pluginfile.php', $workshop->context->id,
'mod_workshop', 'conclusion', 0, workshop::instruction_editors_options($workshop->context));
print_collapsible_region_start('', 'workshop-viewlet-conclusion', get_string('conclusion', 'workshop'));
echo $output->box(format_text($conclusion, $workshop->conclusionformat, array('overflowdiv'=>true)), array('generalbox', 'conclusion'));
print_collapsible_region_end();
}
if (has_capability('mod/workshop:viewallassessments', $PAGE->context)) {
$perpage = get_user_preferences('workshop_perpage', 10);
$groupid = groups_get_activity_group($workshop->cm, true);
Expand Down

0 comments on commit 4c61fcd

Please sign in to comment.