Skip to content

Commit

Permalink
MDL-69004 core: Encourage admins to enable user feedback
Browse files Browse the repository at this point in the history
As part of this commit, the default for the user feedback feature
has changed to disable.
  • Loading branch information
rezaies committed Jun 11, 2020
1 parent 71a34a0 commit 06bbbbf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
5 changes: 4 additions & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,9 @@
// Check if moodle campaign content setting is enabled or not.
$showcampaigncontent = !isset($CFG->showcampaigncontent) || $CFG->showcampaigncontent;

// Encourage admins to enable the user feedback feature if it is not enabled already.
$showfeedbackencouragement = empty($CFG->enableuserfeedback);

admin_externalpage_setup('adminnotifications');

$output = $PAGE->get_renderer('core', 'admin');
Expand All @@ -910,4 +913,4 @@
$maintenancemode, $availableupdates, $availableupdatesfetch, $buggyiconvnomb,
$registered, $cachewarnings, $eventshandlers, $themedesignermode, $devlibdir,
$mobileconfigured, $overridetossl, $invalidforgottenpasswordurl, $croninfrequent,
$showcampaigncontent);
$showcampaigncontent, $showfeedbackencouragement);
21 changes: 20 additions & 1 deletion admin/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ public function upgrade_confirm_abort_install_page(array $abortable, moodle_url
* @param bool $invalidforgottenpasswordurl Whether the forgotten password URL does not link to a valid URL.
* @param bool $croninfrequent If true, warn that cron hasn't run in the past few minutes
* @param bool $showcampaigncontent Whether the campaign content should be visible or not.
* @param bool $showfeedbackencouragement Whether the feedback encouragement content should be displayed or not.
*
* @return string HTML to output.
*/
Expand All @@ -291,7 +292,7 @@ public function admin_notifications_page($maturity, $insecuredataroot, $errorsdi
$buggyiconvnomb, $registered, array $cachewarnings = array(), $eventshandlers = 0,
$themedesignermode = false, $devlibdir = false, $mobileconfigured = false,
$overridetossl = false, $invalidforgottenpasswordurl = false, $croninfrequent = false,
$showcampaigncontent = false) {
$showcampaigncontent = false, bool $showfeedbackencouragement = false) {

global $CFG;
$output = '';
Expand All @@ -315,6 +316,7 @@ public function admin_notifications_page($maturity, $insecuredataroot, $errorsdi
$output .= $this->registration_warning($registered);
$output .= $this->mobile_configuration_warning($mobileconfigured);
$output .= $this->forgotten_password_url_warning($invalidforgottenpasswordurl);
$output .= $this->userfeedback_encouragement($showfeedbackencouragement);
$output .= $this->campaign_content($showcampaigncontent);

//////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -2178,4 +2180,21 @@ public function moodleorg_registration_message() {

return $this->output->box($out);
}

/**
* Display message about benefits of enabling the user feedback feature.
*
* @param bool $showfeedbackencouragement Whether the encouragement content should be displayed or not
* @return string
*/
protected function userfeedback_encouragement(bool $showfeedbackencouragement): string {
$output = '';

if ($showfeedbackencouragement) {
$settingslink = new moodle_url('/admin/settings.php', ['section' => 'userfeedback']);
$output .= $this->warning(get_string('userfeedbackencouragement', 'admin', $settingslink->out()), 'info');
}

return $output;
}
}
2 changes: 1 addition & 1 deletion admin/settings/userfeedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

$userfeedback->add(new admin_setting_configcheckbox('enableuserfeedback',
new lang_string('enableuserfeedback', 'admin'),
new lang_string('enableuserfeedback_desc', 'admin'), 1, 1, 0));
new lang_string('enableuserfeedback_desc', 'admin'), 0, 1, 0));

$options = [
core_userfeedback::REMIND_AFTER_UPGRADE => new lang_string('userfeedbackafterupgrade', 'admin'),
Expand Down
5 changes: 4 additions & 1 deletion lang/en/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
$string['enablestats'] = 'Enable statistics';
$string['enabletrusttext'] = 'Enable trusted content';
$string['enableuserfeedback'] = 'Enable feedback about Moodle';
$string['enableuserfeedback_desc'] = 'If enabled, a \'Give feedback\' link is displayed in a Dashboard alert and in the footer for users to give feedback about the Moodle LMS to Moodle HQ. The Dashboard alert also has a \'Remind me later\' option.';
$string['enableuserfeedback_desc'] = 'If enabled, a \'Give feedback about this software\' link is displayed in the footer for users to give feedback about the Moodle software to Moodle HQ. If the \'Next feedback reminder\' option is set, the user is also shown a reminder on the Dashboard at the specified interval. Setting \'Next feedback reminder\' to \'Never\' disables the Dashboard reminder, while leaving the \'Give feedback\' link in the footer.';
$string['enablewebservices'] = 'Enable web services';
$string['enablewsdocumentation'] = 'Web services documentation';
$string['enrolinstancedefaults'] = 'Enrolment instance defaults';
Expand Down Expand Up @@ -1416,6 +1416,9 @@
$string['userbulk'] = 'Bulk user actions';
$string['userbulkdownload'] = 'Export users as';
$string['userfeedbackafterupgrade'] = 'After every major upgrade';
$string['userfeedbackencouragement'] = '<p>Moodle 3.9 includes a new feature that gives users the option to provide feedback about the Moodle software to Moodle HQ via an external survey site hosted by Moodle HQ. No user-identifying information is forwarded to the survey site.</p>
<p>Moodle HQ strives to be open and transparent about its data collection practices. Thus, we want to make sure that you are aware and in control of this functionality.</p>
<p>Feedback from users will greatly assist Moodle HQ in improving the Moodle software. To enable this feature, please go to <a href="{$a}">Feedback settings</a>.</p>';
$string['userfeedbacknextreminder'] = 'Next feedback reminder';
$string['userfeedbacknextreminder_desc'] = 'When should we ask the user to give feedback again?';
$string['userfeedbackperiodically'] = 'Periodically';
Expand Down

0 comments on commit 06bbbbf

Please sign in to comment.