Merge branch 'MDL-71234-master' of git://github.com/HuongNV13/moodle
This commit is contained in:
@@ -854,6 +854,10 @@ class manager {
|
||||
// the format filename => version. The version value needs to
|
||||
// be increased if the tour has been updated.
|
||||
$shippedtours = [
|
||||
'311_activity_information_activity_page_student.json' => 1,
|
||||
'311_activity_information_activity_page_teacher.json' => 1,
|
||||
'311_activity_information_course_page_student.json' => 1,
|
||||
'311_activity_information_course_page_teacher.json' => 1
|
||||
];
|
||||
|
||||
// These are tours that we used to ship but don't ship any longer.
|
||||
|
||||
@@ -76,5 +76,12 @@ function xmldb_tool_usertours_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2021052501, 'tool', 'usertours');
|
||||
}
|
||||
|
||||
if ($oldversion < 2021052507) {
|
||||
// Updating shipped tours.
|
||||
manager::update_shipped_tours();
|
||||
|
||||
upgrade_plugin_savepoint(true, 2021052507, 'tool', 'usertours');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"Activity information in activity page (Student)","description":"A tour of the activity information for Student display on the activity page","pathmatch":"\/mod\/%\/view.php%","enabled":"1","sortorder":"0","configdata":"{\"placement\":\"bottom\",\"orphan\":\"0\",\"backdrop\":\"1\",\"reflex\":\"0\",\"filtervalues\":{\"accessdate\":{\"filter_accessdate\":\"tool_usertours_accountcreation\",\"filter_accessdate_range\":0,\"filter_accessdate_enabled\":\"0\"},\"category\":[],\"course\":[],\"courseformat\":[],\"role\":[\"student\"],\"theme\":[],\"cssselector\":[\"[data-region=activity-information]\"]},\"majorupdatetime\":1620110287,\"shipped_tour\":true,\"shipped_filename\":\"311_activity_information_activity_page_student.json\",\"shipped_version\":1}","version":"2021052507","steps":[{"title":"New: Activity information","content":"Activity dates plus what to do to complete the activity are shown on the activity page.","targettype":"0","targetvalue":"[data-region=activity-information]","sortorder":"0","configdata":"{}"}]}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"Activity information in activity page (Teacher)","description":"A tour of the activity information for Teacher display on the activity page","pathmatch":"\/mod\/%\/view.php%","enabled":"1","sortorder":"1","configdata":"{\"placement\":\"bottom\",\"orphan\":\"0\",\"backdrop\":\"1\",\"reflex\":\"0\",\"filtervalues\":{\"accessdate\":{\"filter_accessdate\":\"tool_usertours_accountcreation\",\"filter_accessdate_range\":0,\"filter_accessdate_enabled\":\"0\"},\"category\":[],\"course\":[],\"courseformat\":[],\"role\":[\"manager\",\"teacher\",\"editingteacher\"],\"theme\":[],\"cssselector\":[\"[data-region=activity-information]\"]},\"majorupdatetime\":1620110287,\"shipped_tour\":true,\"shipped_filename\":\"311_activity_information_activity_page_teacher.json\",\"shipped_version\":1}","version":"2021052507","steps":[{"title":"New: Activity information","content":"Activity dates and completion conditions are now displayed for students on each activity page (and optionally on the course page).\r\n\r\nFor activities requiring students to manually mark an activity as completed, a 'Mark as done' button is shown on the activity page.","targettype":"0","targetvalue":"[data-region=activity-information]","sortorder":"0","configdata":"{}"}]}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"Activity information in course homepage (Student)","description":"A tour of the activity information for Student display on the course homepage","pathmatch":"\/course\/view.php%","enabled":"1","sortorder":"2","configdata":"{\"placement\":\"bottom\",\"orphan\":\"0\",\"backdrop\":\"1\",\"reflex\":\"0\",\"filtervalues\":{\"accessdate\":{\"filter_accessdate\":\"tool_usertours_accountcreation\",\"filter_accessdate_range\":0,\"filter_accessdate_enabled\":\"0\"},\"category\":[],\"course\":[],\"courseformat\":[],\"role\":[\"student\"],\"theme\":[],\"cssselector\":[\"[data-region=activity-information]\"]},\"majorupdatetime\":1620109487,\"shipped_tour\":true,\"shipped_filename\":\"311_activity_information_course_page_student.json\",\"shipped_version\":1}","version":"2021052507","steps":[{"title":"New: Activity information","content":"Activity dates and\/or what to do to complete the activity are displayed on the course page.","targettype":"0","targetvalue":"[data-region=activity-information]","sortorder":"0","configdata":"{}"}]}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"Activity information in course homepage (Teacher)","description":"A tour of the activity information for Teacher display on the course homepage","pathmatch":"\/course\/view.php%","enabled":"1","sortorder":"3","configdata":"{\"placement\":\"bottom\",\"orphan\":\"0\",\"backdrop\":\"1\",\"reflex\":\"0\",\"filtervalues\":{\"accessdate\":{\"filter_accessdate\":\"tool_usertours_accountcreation\",\"filter_accessdate_range\":0,\"filter_accessdate_enabled\":\"0\"},\"category\":[],\"course\":[],\"courseformat\":[],\"role\":[\"manager\",\"teacher\",\"editingteacher\"],\"theme\":[],\"cssselector\":[\"[data-region=activity-information]\"]},\"majorupdatetime\":1620109487,\"shipped_tour\":true,\"shipped_filename\":\"311_activity_information_course_page_teacher.json\",\"shipped_version\":1}","version":"2021052507","steps":[{"title":"New: Activity information","content":"New course settings 'Show completion conditions' and 'Show activity dates' enable you to choose whether activity completion conditions (if set) and\/or dates are displayed for students on the course page.","targettype":"0","targetvalue":"[data-region=activity-information]","sortorder":"0","configdata":"{}"}]}
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2021052502; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2021052507; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2021052500; // Requires this Moodle version.
|
||||
$plugin->component = 'tool_usertours'; // Full name of the plugin (used for diagnostics).
|
||||
|
||||
@@ -86,7 +86,6 @@ class cm_format implements renderable, templatable {
|
||||
// Fetch completion details.
|
||||
$showcompletionconditions = $course->showcompletionconditions == COMPLETION_SHOW_CONDITIONS;
|
||||
$completiondetails = cm_completion_details::get_instance($mod, $USER->id, $showcompletionconditions);
|
||||
$ismanualcompletion = $completiondetails->has_completion() && !$completiondetails->is_automatic();
|
||||
|
||||
// Fetch activity dates.
|
||||
$activitydates = [];
|
||||
@@ -95,11 +94,14 @@ class cm_format implements renderable, templatable {
|
||||
}
|
||||
|
||||
$activityinfodata = null;
|
||||
// Show the activity information if:
|
||||
// - The course's showcompletionconditions setting is enabled; or
|
||||
// - The activity tracks completion manually; or
|
||||
// - There are activity dates to be shown.
|
||||
if ($showcompletionconditions || $ismanualcompletion || $activitydates) {
|
||||
// - There are activity dates to be shown; or
|
||||
// - Completion info needs to be displayed
|
||||
// * The activity tracks completion; AND
|
||||
// * The showcompletionconditions setting is enabled OR an activity that tracks manual completion needs the manual
|
||||
// completion button to be displayed on the course homepage.
|
||||
$showcompletioninfo = $completiondetails->has_completion() && ($showcompletionconditions ||
|
||||
(!$completiondetails->is_automatic() && $completiondetails->show_manual_completion()));
|
||||
if ($showcompletioninfo || !empty($activitydates)) {
|
||||
$activityinfo = new activity_information($mod, $completiondetails, $activitydates);
|
||||
$activityinfodata = $activityinfo->export_for_template($output);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user