Skip to content

Commit

Permalink
Merge branch 'MDL-26567' of git://github.com/timhunt/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Sep 20, 2011
2 parents ed9e0cb + 71c4154 commit 0e89333
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 4 additions & 2 deletions course/moodleform_mod.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,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;
case FEATURE_SHOW_DESCRIPTION: return true;

Expand Down
11 changes: 8 additions & 3 deletions mod/quiz/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ protected 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 @@ -289,9 +297,6 @@ protected 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 (isset($this->current->grade)) {
$needwarning = $this->current->grade === 0;
} else {
Expand Down

0 comments on commit 0e89333

Please sign in to comment.