mirror of
https://github.com/moodle/moodle.git
synced 2025-07-13 18:36:34 +02:00
Workshop: published submissions are available at the end of the activity
This commit is contained in:
@ -161,6 +161,7 @@ $string['phasesetup'] = 'Setup phase';
|
|||||||
$string['phasesubmission'] = 'Submission phase';
|
$string['phasesubmission'] = 'Submission phase';
|
||||||
$string['prepareexamples'] = 'Prepare example submissions';
|
$string['prepareexamples'] = 'Prepare example submissions';
|
||||||
$string['previewassessmentform'] = 'Preview';
|
$string['previewassessmentform'] = 'Preview';
|
||||||
|
$string['publishedsubmissions'] = 'Published submissions';
|
||||||
$string['publishsubmission'] = 'Publish submission';
|
$string['publishsubmission'] = 'Publish submission';
|
||||||
$string['publishsubmission_help'] = 'Published submissions are available to the others when the workshop is closed.';
|
$string['publishsubmission_help'] = 'Published submissions are available to the others when the workshop is closed.';
|
||||||
$string['reassess'] = 'Re-assess';
|
$string['reassess'] = 'Re-assess';
|
||||||
|
@ -556,6 +556,26 @@ class workshop {
|
|||||||
return $DB->get_record_sql($sql, $params);
|
return $DB->get_record_sql($sql, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns published submissions with their authors data
|
||||||
|
*
|
||||||
|
* @return array of stdclass
|
||||||
|
*/
|
||||||
|
public function get_published_submissions($orderby='finalgrade DESC') {
|
||||||
|
global $DB;
|
||||||
|
|
||||||
|
$sql = "SELECT s.id, s.authorid, s.timecreated, s.timemodified,
|
||||||
|
s.title, s.grade, s.gradeover, COALESCE(s.gradeover,s.grade) AS finalgrade,
|
||||||
|
u.lastname AS authorlastname, u.firstname AS authorfirstname, u.id AS authorid,
|
||||||
|
u.picture AS authorpicture, u.imagealt AS authorimagealt
|
||||||
|
FROM {workshop_submissions} s
|
||||||
|
INNER JOIN {user} u ON (s.authorid = u.id)
|
||||||
|
WHERE s.example = 0 AND s.workshopid = :workshopid AND s.published = 1
|
||||||
|
ORDER BY $orderby";
|
||||||
|
$params = array('workshopid' => $this->id);
|
||||||
|
return $DB->get_records_sql($sql, $params);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns full record of the given example submission
|
* Returns full record of the given example submission
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
.path-mod-workshop .collapsibleregioncaption {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 120%;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Submission - one line summary display
|
* Submission - one line summary display
|
||||||
*/
|
*/
|
||||||
|
@ -360,6 +360,17 @@ case workshop::PHASE_EVALUATION:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case workshop::PHASE_CLOSED:
|
case workshop::PHASE_CLOSED:
|
||||||
|
if (has_capability('mod/workshop:viewpublishedsubmissions', $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->submission_summary($submission, true);
|
||||||
|
echo $output->box_end();
|
||||||
|
}
|
||||||
|
print_collapsible_region_end();
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user