Index: openacs-4/packages/scorm-core/sql/postgresql/scorm-datamodel-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/scorm-core/sql/postgresql/scorm-datamodel-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/scorm-core/sql/postgresql/scorm-datamodel-create.sql 14 May 2010 23:29:59 -0000 1.3 +++ openacs-4/packages/scorm-core/sql/postgresql/scorm-datamodel-create.sql 18 May 2010 23:11:43 -0000 1.4 @@ -279,11 +279,16 @@ select children.child from cp_tree parent, cp_tree children where children.child between parent.child+1 and parent.rgt + and children.cp_package_id = (the course id) order by children.child To restrict the query to the immediate children, add and children.parent = parent.child + + The restriction by course id is necessary because we do not guarantee that the + nodes for a course are numbered consecutively (they will not be after a course + is edited). '; create table cp_suspend (