File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -814,6 +814,7 @@ public function autocomplete_parents($item)
814814 error_log ('Found one incomplete child of ' . $ parent_id . ': ' . $ child . ' is ' . $ this ->items [$ child ]->get_status (), 0 );
815815 }
816816 $ completed = false ;
817+ break ;
817818 }
818819 }
819820 }
@@ -832,7 +833,7 @@ public function autocomplete_parents($item)
832833 }
833834 } else {
834835 if ($ debug ) {
835- error_log ("# $ item is an item doesn't have parents " );
836+ error_log ("# $ item is an item that doesn't have parents " );
836837 }
837838 }
838839 }
Original file line number Diff line number Diff line change @@ -150,6 +150,17 @@ public function __construct(
150150 $ this ->save_on_close = true ;
151151 $ this ->db_id = $ id ;
152152
153+ // Load children list
154+ $ sql = "SELECT id FROM $ items_table WHERE c_id = $ course_id AND lp_id = " .$ this ->lp_id ." AND parent_item_id = $ id " ;
155+ $ res = Database::query ($ sql );
156+ if (Database::num_rows ($ res ) < 1 ) {
157+ // Nothing to do (no children)
158+ } else {
159+ while ($ row = Database::fetch_assoc ($ res )) {
160+ $ this ->children [] = $ row ['id ' ];
161+ }
162+ }
163+
153164 //$this->seriousgame_mode = $this->get_seriousgame_mode();
154165 $ this ->seriousgame_mode = 0 ;
155166
You can’t perform that action at this time.
0 commit comments