# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/course/moodleform_mod.php
--- moodle/course/moodleform_mod.php Base (1.68)
+++ moodle/course/moodleform_mod.php Locally Modified (Based On 1.68)
@@ -337,7 +337,8 @@
             }
         }
 
-        if (plugin_supports('mod', $this->_modname, FEATURE_RATE, false)) {
+        $supportsratings = plugin_supports('mod', $this->_modname, FEATURE_RATE, false);
+        if ($supportsratings) {
             require_once($CFG->dirroot.'/rating/lib.php');
             $rm = new rating_manager();
 
@@ -364,6 +365,23 @@
             $mform->disabledIf('assesstimefinish', 'ratingtime');
         }
 
+        if (plugin_supports('mod', $this->_modname, FEATURE_GRADE_HAS_GRADE, false)) {
+            if (!$supportsratings || $this->_features->gradecat) {
+                $mform->addElement('header', 'modstandardgrade', get_string('grade'));
+            }
+
+            //if supports grade and grades arent being handled via ratings
+            if (!$supportsratings) {
+                $mform->addElement('modgrade', 'grade', get_string('grade'));
+                $mform->setDefault('grade', 100);
+            }
+
+            if ($this->_features->gradecat) {
+                $categories = grade_get_categories_menu($COURSE->id, $this->_outcomesused);
+                $mform->addElement('select', 'gradecat', get_string('gradecategory', 'grades'), $categories);
+            }
+        }
+
         $mform->addElement('header', 'modstandardelshdr', get_string('modstandardels', 'form'));
         if ($this->_features->groups) {
             $options = array(NOGROUPS       => get_string('groupsnone'),
@@ -610,23 +628,6 @@
         $mform->setType('return', PARAM_BOOL);
     }
 
-    public function coursemodule_grading_elements() {
-        global $COURSE;
-        $mform =& $this->_form;
-
-        if (plugin_supports('mod', $this->_modname, FEATURE_GRADE_HAS_GRADE, false)) {
-            $mform->addElement('header', 'modstandardgrade', get_string('grade'));
-
-            $mform->addElement('modgrade', 'grade', get_string('grade'));
-            $mform->setDefault('grade', 100);
-
-            if ($this->_features->gradecat) {
-                $categories = grade_get_categories_menu($COURSE->id, $this->_outcomesused);
-                $mform->addElement('select', 'gradecat', get_string('gradecategory', 'grades'), $categories);
-            }
-        }
-    }
-
     function add_intro_editor($required=false, $customlabel=null) {
         if (!$this->_features->introeditor) {
             // intro editor not supported in this module
Index: moodle/mod/assignment/mod_form.php
--- moodle/mod/assignment/mod_form.php Base (1.20)
+++ moodle/mod/assignment/mod_form.php Locally Modified (Based On 1.20)
@@ -58,8 +58,6 @@
         $mform->addElement('select', 'preventlate', get_string('preventlate', 'assignment'), $ynoptions);
         $mform->setDefault('preventlate', 0);
 
-        $this->coursemodule_grading_elements();
-
         $typetitle = get_string('type'.$type, 'assignment');
 
         // hack to support pluggable assignment type titles
