}
}
- // Ratings: Don't let them select an aggregate type without selecting a scale.
- // If the user has selected to use ratings but has not chosen a scale or set max points then the form is
- // invalid. If ratings have been selected then the user must select either a scale or max points.
- // This matches (horrible) logic in data_preprocessing.
- if (isset($data['assessed']) && $data['assessed'] > 0 && empty($data['scale'])) {
- $errors['assessed'] = get_string('scaleselectionrequired', 'rating');
- }
-
// Completion: Don't let them choose automatic completion without turning
// on some conditions. Ignore this check when completion settings are
// locked, as the options are then disabled.
$string['ratings'] = 'Ratings';
$string['rolewarning'] = 'Roles with permission to rate';
$string['rolewarning_help'] = 'To submit ratings users require the moodle/rating:rate capability and any module specific capabilities. Users assigned the following roles should be able to rate items. The list of roles may be amended via the permissions link in the administration block.';
-$string['scaleselectionrequired'] = 'When selecting a ratings aggregate type you must also select to use either a scale or set a maximum points.';
\ No newline at end of file
context: this,
on: {
success: function(id,o) {
- if (typeof o.responseText !== "undefined" &&
- o.responseText !== "" &&
- o.responseText !== this.textarea.get('value')) {
+ if (typeof o.responseText !== "undefined" && o.responseText !== "") {
response_json = JSON.parse(o.responseText);
- if (!response_json.error && response_json.result) {
- Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
- this.recoverText(response_json.result);
- } else {
+ if (response_json.error || typeof response_json.result === 'undefined') {
Y.log('Error occurred recovering draft text: ' + response_json.error, 'debug', LOGNAME_AUTOSAVE);
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
+ } else if (response_json !== this.textarea.get('value')) {
+ Y.log('Autosave text found - recover it.', 'debug', LOGNAME_AUTOSAVE);
+ this.recoverText(response_json.result);
}
this._fireSelectionChanged();
}
global $DB;
$courses = $DB->get_records('course', array('id' => $this->course->id));
-
// Check the overview as the different users.
$this->setUser($this->students[0]);
$overview = array();
}
public function test_print_recent_activity() {
+ // Submitting an assignment generates a notification.
+ $this->preventResetByRollback();
+ $sink = $this->redirectMessages();
+
$this->setUser($this->editingteachers[0]);
$assign = $this->create_instance();
$data = new stdClass();
$this->setUser($this->editingteachers[0]);
$this->expectOutputRegex('/submitted:/');
assign_print_recent_activity($this->course, true, time() - 3600);
+
+ $sink->close();
}
/** Make sure fullname dosn't trigger any warnings when assign_print_recent_activity is triggered. */
public function test_print_recent_activity_fullname() {
+ // Submitting an assignment generates a notification.
+ $this->preventResetByRollback();
+ $sink = $this->redirectMessages();
+
$this->setUser($this->editingteachers[0]);
$assign = $this->create_instance();
$this->expectOutputRegex('/submitted:/');
set_config('fullnamedisplay', 'firstname, lastnamephonetic');
assign_print_recent_activity($this->course, false, time() - 3600);
+
+ $sink->close();
}
public function test_assign_get_recent_mod_activity() {
+ // Submitting an assignment generates a notification.
+ $this->preventResetByRollback();
+ $sink = $this->redirectMessages();
+
$this->setUser($this->editingteachers[0]);
$assign = $this->create_instance();
$assign->get_course_module()->id);
$this->assertEquals("assign", $activities[1]->type);
+ $sink->close();
}
public function test_assign_user_complete() {
$mform =& $this->_form;
- $istool = $this->_customdata->istool;
+ $istool = $this->_customdata && $this->_customdata->istool;
// Add basiclti elements.
$mform->addElement('header', 'setup', get_string('tool_settings', 'lti'));
// Tool Provider name.
+ $strrequired = get_string('required');
$mform->addElement('text', 'lti_registrationname', get_string('registrationname', 'lti'));
$mform->setType('lti_registrationname', PARAM_TEXT);
$mform->addHelpButton('lti_registrationname', 'registrationname', 'lti');
- $mform->addRule('lti_registrationname', null, 'required', null, 'client');
+ $mform->addRule('lti_registrationname', $strrequired, 'required', null, 'client');
// Registration URL.
$mform->addElement('text', 'lti_registrationurl', get_string('registrationurl', 'lti'), array('size' => '64'));
- $mform->setType('lti_registrationurl', PARAM_TEXT);
+ $mform->setType('lti_registrationurl', PARAM_URL);
$mform->addHelpButton('lti_registrationurl', 'registrationurl', 'lti');
+ $mform->addRule('lti_registrationurl', $strrequired, 'required', null, 'client');
// LTI Capabilities.
array_combine($options, $options), $attributes);
$mform->setType('lti_capabilities', PARAM_TEXT);
$mform->addHelpButton('lti_capabilities', 'capabilities', 'lti');
+ $mform->addRule('lti_capabilities', $strrequired, 'required', null, 'client');
// LTI Services.
$mform->addElement('select', 'lti_services', get_string('services', 'lti'), $options, $attributes);
$mform->setType('lti_services', PARAM_TEXT);
$mform->addHelpButton('lti_services', 'services', 'lti');
+ $mform->addRule('lti_services', $strrequired, 'required', null, 'client');
$mform->addElement('hidden', 'toolproxyid');
$mform->setType('toolproxyid', PARAM_INT);
// Add standard buttons, common to all modules.
$this->add_action_buttons();
-
}
/**
$mform->disabledIf('lti_services', null);
}
-
- /**
- * Set up rules for required fields.
- */
- public function required_fields() {
-
- $mform =& $this->_form;
-
- $mform->addRule('lti_registrationurl', null, 'required', null, 'client');
-
- }
-
}
$form->set_data($toolproxy);
if ($toolproxy->state == LTI_TOOL_PROXY_STATE_ACCEPTED) {
$form->disable_fields();
- } else {
- $form->required_fields();
}
- } else {
- $form->required_fields();
}
$form->display();
}
function scorm_view_display ($user, $scorm, $action, $cm) {
- global $CFG, $DB, $OUTPUT;
+ global $CFG, $DB, $PAGE, $OUTPUT, $COURSE;
- if ($scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
+ if ($scorm->scormtype != SCORM_TYPE_LOCAL && $scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
scorm_parse($scorm, false);
}
return $result;
}
- if ($scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
+ if ($scorm->scormtype != SCORM_TYPE_LOCAL && $scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
scorm_parse($scorm, false);
}
$scoes = $DB->get_records_select('scorm_scoes', 'scorm = ? AND '.
defined('MOODLE_INTERNAL') || die();
-$version = 2014101500.00; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2014101700.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
-$release = '2.8beta+ (Build: 20141015)'; // Human-friendly version name
+$release = '2.8beta+ (Build: 20141017)'; // Human-friendly version name
$branch = '28'; // This version's branch.
$maturity = MATURITY_BETA; // This version's maturity level.