Skip to content

Commit

Permalink
MDL-17810: Fix to stop you making activities depend on themselves
Browse files Browse the repository at this point in the history
  • Loading branch information
sam_marshall committed Apr 2, 2009
1 parent d8413bf commit d030fa7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion course/moodleform_mod.php
Expand Up @@ -405,6 +405,12 @@ function standard_coursemodule_elements($features=null, $modname=null){
$items=grade_item::fetch_all(array('courseid'=>$COURSE->id));
$items=$items ? $items : array();
foreach($items as $id=>$item) {
// Do not include grades for current item
if (!empty($this->_cm) && $this->_cm->instance == $item->iteminstance
&& $this->_cm->modname == $item->itemmodule
&& $item->itemtype == 'mod') {
continue;
}
$gradeoptions[$id]=$item->get_name();
}
asort($gradeoptions);
Expand Down Expand Up @@ -442,7 +448,10 @@ function standard_coursemodule_elements($features=null, $modname=null){
$completionoptions=array();
$modinfo=get_fast_modinfo($COURSE);
foreach($modinfo->cms as $id=>$cm) {
if($cm->completion) {
// Add each course-module if it:
// (a) has completion turned on
// (b) is not the same as current course-module
if ($cm->completion && (empty($this->_cm) || $this->_cm->id != $id)) {
$completionoptions[$id]=$cm->name;
}
}
Expand Down

0 comments on commit d030fa7

Please sign in to comment.