Skip to content

Commit

Permalink
MDL-26567 no grade category option on the quiz settings form.
Browse files Browse the repository at this point in the history
Also, refine the standard_grading_coursemodule_elements method to add a
help string.

AMOS BEGIN
 CPY [gradecategory,grades],[gradecategoryonmodform,grades]
AMOS END
  • Loading branch information
timhunt committed Sep 20, 2011
1 parent 3df2ab8 commit b9bed21
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
6 changes: 4 additions & 2 deletions course/moodleform_mod.php
Expand Up @@ -654,8 +654,10 @@ public function standard_grading_coursemodule_elements() {
}

if ($this->_features->gradecat) {
$categories = grade_get_categories_menu($COURSE->id, $this->_outcomesused);
$mform->addElement('select', 'gradecat', get_string('gradecategory', 'grades'), $categories);
$mform->addElement('select', 'gradecat',
get_string('gradecategoryonmodform', 'grades'),
grade_get_categories_menu($COURSE->id, $this->_outcomesused));
$mform->addHelpButton('gradecat', 'gradecategoryonmodform', 'grades');
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion lang/en/grades.php
Expand Up @@ -219,7 +219,8 @@
$string['gradeboundary_help'] = 'This setting determines the minimum percentage over which grades will be assigned the grade letter.';
$string['gradecategories'] = 'Grade categories';
$string['gradecategory'] = 'Grade category';
$string['gradecategoryhelp'] = 'Grade category help';
$string['gradecategoryonmodform'] = 'Grade category';
$string['gradecategoryonmodform_help'] = 'This setting controls the category in which this activity\'s grades are placed in the gradebook.';
$string['gradecategorysettings'] = 'Grade category settings';
$string['gradedisplay'] = 'Grade display';
$string['gradedisplaytype'] = 'Grade display type';
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/lib.php
Expand Up @@ -1622,7 +1622,7 @@ function quiz_supports($feature) {
case FEATURE_MOD_INTRO: return true;
case FEATURE_COMPLETION_TRACKS_VIEWS: return true;
case FEATURE_GRADE_HAS_GRADE: return true;
case FEATURE_GRADE_OUTCOMES: return true;
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;

default: return null;
Expand Down
10 changes: 8 additions & 2 deletions mod/quiz/mod_form.php
Expand Up @@ -86,6 +86,14 @@ function definition() {
$mform->setDefault('grademethod', $quizconfig->grademethod);
$mform->disabledIf('grademethod', 'attempts', 'eq', 1);

//-------------------------------------------------------------------------------
// Grade settings
$this->standard_grading_coursemodule_elements();

$mform->removeElement('grade');
$mform->addElement('hidden', 'grade', $quizconfig->maximumgrade);
$mform->setType('grade', PARAM_NUMBER);

//-------------------------------------------------------------------------------
$mform->addElement('header', 'layouthdr', get_string('layout', 'quiz'));

Expand Down Expand Up @@ -281,8 +289,6 @@ function definition() {
$mform->addElement('header', 'overallfeedbackhdr', get_string('overallfeedback', 'quiz'));
$mform->addHelpButton('overallfeedbackhdr', 'overallfeedback', 'quiz');

$mform->addElement('hidden', 'grade', $quizconfig->maximumgrade);
$mform->setType('grade', PARAM_RAW);
if (empty($this->_cm)) {
$needwarning = $quizconfig->maximumgrade == 0;
} else {
Expand Down

0 comments on commit b9bed21

Please sign in to comment.