$string['commentcontextmenu'] = 'Comment context menu';
$string['couldnotsavepage'] = 'Could not save page {$a}';
$string['currentstamp'] = 'Stamp';
+$string['default'] = 'Enabled by default';
+$string['default_help'] = 'If set, this feedback method will be enabled by default for all new assignments.';
$string['deleteannotation'] = 'Delete annotation';
$string['deletecomment'] = 'Delete comment';
$string['deletefeedback'] = 'Delete feedback PDF';
}
/**
- * Automatically enable or disable editpdf feedback plugin based on
- * whether the ghostscript path is set correctly.
+ * Determine if ghostscript is available and working.
*
* @return bool
*/
- public function is_enabled() {
+ public function is_available() {
if ($this->enabledcache === null) {
$testpath = assignfeedback_editpdf\pdf::test_gs_path(false);
$this->enabledcache = ($testpath->status == assignfeedback_editpdf\pdf::GSPATH_OK);
return $this->enabledcache;
}
/**
- * Automatically hide the setting for the editpdf feedback plugin.
+ * Prevent enabling this plugin if ghostscript is not available.
*
* @return bool false
*/
public function is_configurable() {
- return false;
+ return $this->is_available();
}
/**
defined('MOODLE_INTERNAL') || die();
+// Enabled by default.
+$settings->add(new admin_setting_configcheckbox('assignfeedback_editpdf/default',
+ new lang_string('default', 'assignfeedback_editpdf'),
+ new lang_string('default_help', 'assignfeedback_editpdf'), 1));
+
// Stamp files setting.
$name = 'assignfeedback_editpdf/stamps';
$title = get_string('stamps','assignfeedback_editpdf');