Index: openacs-4/packages/imsld/sql/postgresql/imsld-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/imsld/sql/postgresql/imsld-create.sql 21 Sep 2005 14:39:55 -0000 1.4 +++ openacs-4/packages/imsld/sql/postgresql/imsld-create.sql 27 Sep 2005 11:05:08 -0000 1.5 @@ -537,7 +537,8 @@ references cr_items, --imsld_time_limits on_completion_id integer constraint imsld_plays_oncomp_fk - references cr_items --imsld_on_completion + references cr_items, --imsld_on_completion + sort_order integer ); create index imsld_plays_meth_id_idx on imsld_plays(method_id); @@ -566,7 +567,8 @@ identifier varchar(100), on_completion_id integer constraint imsld_acts_oncomp_fk - references cr_items --imsld_on_completion + references cr_items, --imsld_on_completion + sort_order integer ); create index imsld_acts_play_id_idx on imsld_acts(play_id); @@ -603,7 +605,8 @@ references cr_items, --imsld_activity_structures environment_id integer constraint imsld_rp_envid_fk - references cr_items --imsld_environments + references cr_items, --imsld_environments + sort_order integer ); create index imsld_rp_act_id_idx on imsld_role_parts(act_id); @@ -649,4 +652,6 @@ Feedback are items that are mapped to this table with the imsld_feedback_rel.'; -\i imsld-cp-create.sql \ No newline at end of file +\i imsld-cp-create.sql + +\i imsld-status-create.sql \ No newline at end of file Index: openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql 19 Sep 2005 17:20:14 -0000 1.3 +++ openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql 27 Sep 2005 11:05:08 -0000 1.4 @@ -49,4 +49,6 @@ drop table imsld_on_completion cascade; -\i imsld-cp-drop.sql \ No newline at end of file +\i imsld-cp-drop.sql + +\i imsld-status-drop.sql \ No newline at end of file Index: openacs-4/packages/imsld/sql/postgresql/imsld-status-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/Attic/imsld-status-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/sql/postgresql/imsld-status-create.sql 27 Sep 2005 11:05:08 -0000 1.1 @@ -0,0 +1,29 @@ +-- +-- IMS-LD Status Data Model. +-- Theese tables are used to determine the status of the learner, staff or any other "IMS-LD object" +-- inside the unit of learning. +-- +-- @author jopez@inv.it.uc3m.es +-- @creation-date sept-2005 +-- + +create table imsld_status_learner ( + role_part_id integer + constraint imsld_stat_rp_fk + references imsld_role_parts + not null, + user_id integer + constraint imsld_stat_user_fk + references users + not null +); + +create index imsld_stat_rp_idx on imsld_status_learner(role_part_id); +create index imsld_stat_user_idx on imsld_status_learner(user_id); + +comment on table imsld_status_learner is ' +This table holds the status of each learner in the unit of learning. +Each entry in this table says that the learner referenced by user_id has already COMPLETED the role part referenced by role_part_id, so if we want to know what role part is the next one for any learner, we just have to see the las completed role part which is the one stored in this table.'; + + + Index: openacs-4/packages/imsld/sql/postgresql/imsld-status-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/Attic/imsld-status-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/sql/postgresql/imsld-status-drop.sql 27 Sep 2005 11:05:08 -0000 1.1 @@ -0,0 +1,9 @@ +-- +-- IMS-LD Status Data Model Drop +-- +-- @author jopez@inv.it.uc3m.es +-- @creation-date sept-2005 +-- + +drop table imsld_status_learner; + Index: openacs-4/packages/imsld/tcl/imsld-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-install-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 22 Sep 2005 10:53:42 -0000 1.5 +++ openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 27 Sep 2005 11:05:10 -0000 1.6 @@ -170,6 +170,7 @@ content::type::attribute::new -content_type imsld_play -attribute_name when_last_act_completed_p -datatype string -pretty_name "<#_ When Last Act Completed? #>" -column_spec "char(1)" content::type::attribute::new -content_type imsld_play -attribute_name time_limit_id -datatype number -pretty_name "<#_ Time Limit Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_play -attribute_name on_completion_id -datatype number -pretty_name "<#_ On Completion Identifier #>" -column_spec "integer" + content::type::attribute::new -content_type imsld_play -attribute_name sort_order -datatype number -pretty_name "<#_ Sort Order #>" -column_spec "integer" # acts content::type::new -content_type imsld_act -supertype content_revision -pretty_name "<#_ IMS-LD Act #>" -pretty_plural "<#_ IMS-LD Acts #>" -table_name imsld_acts -id_column act_id @@ -178,6 +179,7 @@ content::type::attribute::new -content_type imsld_act -attribute_name time_limit_id -datatype number -pretty_name "<#_ Time Limit Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_act -attribute_name identifier -datatype string -pretty_name "<#_ Identifier #>" -column_spec "varchar(100)" content::type::attribute::new -content_type imsld_act -attribute_name on_completion_id -datatype number -pretty_name "<#_ On Completion Identifier #>" -column_spec "integer" + content::type::attribute::new -content_type imsld_act -attribute_name sort_order -datatype number -pretty_name "<#_ Sort Order #>" -column_spec "integer" # role parts content::type::new -content_type imsld_role_part -supertype content_revision -pretty_name "<#_ IMS-LD Role Part #>" -pretty_plural "<#_ IMS-LD Role Parts #>" -table_name imsld_role_parts -id_column role_part_id @@ -189,6 +191,7 @@ content::type::attribute::new -content_type imsld_role_part -attribute_name support_activity_id -datatype number -pretty_name "<#_ Support Activity Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_role_part -attribute_name activity_structure_id -datatype number -pretty_name "<#_ Activity Structure Identifier #>" -column_spec "integer" content::type::attribute::new -content_type imsld_role_part -attribute_name environment_id -datatype number -pretty_name "<#_ Environment Identifier #>" -column_spec "integer" + content::type::attribute::new -content_type imsld_role_part -attribute_name sort_order -datatype number -pretty_name "<#_ Sort Order #>" -column_spec "integer" # time limits content::type::new -content_type imsld_time_limit -supertype content_revision -pretty_name "<#_ IMS-LD Time Limit #>" -pretty_plural "<#_ IMS-LD Time Limits #>" -table_name imsld_time_limits -id_column time_limit_id @@ -508,12 +511,14 @@ content::type::attribute::delete -content_type imsld_play -attribute_name when_last_act_completed_p content::type::attribute::delete -content_type imsld_play -attribute_name time_limit_id content::type::attribute::delete -content_type imsld_play -attribute_name on_completion_id + content::type::attribute::delete -content_type imsld_play -attribute_name sort_order # acts content::type::attribute::delete -content_type imsld_act -attribute_name play_id content::type::attribute::delete -content_type imsld_act -attribute_name time_limit_id content::type::attribute::delete -content_type imsld_act -attribute_name identifier content::type::attribute::delete -content_type imsld_act -attribute_name on_completion_id + content::type::attribute::delete -content_type imsld_act -attribute_name sort_order # role parts content::type::attribute::delete -content_type imsld_role_part -attribute_name act_id @@ -523,6 +528,7 @@ content::type::attribute::delete -content_type imsld_role_part -attribute_name support_activity_id content::type::attribute::delete -content_type imsld_role_part -attribute_name activity_structure_id content::type::attribute::delete -content_type imsld_role_part -attribute_name environment_id + content::type::attribute::delete -content_type imsld_role_part -attribute_name sort_order # time limits content::type::attribute::delete -content_type imsld_time_limit -attribute_name time_in_seconds Index: openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 22 Sep 2005 10:53:42 -0000 1.6 +++ openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 27 Sep 2005 11:05:10 -0000 1.7 @@ -406,11 +406,14 @@ set folder_name "manifest_${manifest_id}" # checks for write permission on the parent folder - ad_require_permission $root_folder_id write - + if { ![empty_string_p $root_folder_id] } { + ad_require_permission $root_folder_id write + } + # create the root cr dir + set fs_folder_id [imsld::cr::folder_new -parent_id $root_folder_id -folder_name $folder_name -folder_label $folder_label] - + # PERMISSIONS FOR FILE-STORAGE # Before we go about anything else, lets just set permissions straight. @@ -1205,7 +1208,11 @@ set learning_object [$environment_node child all imsld:learning-object] set learning_object_id "" if { [llength $learning_object] } { - imsld::parse::validate_multiplicity -tree $learning_object -multiplicity 1 -element_name "learning-object(environment $identifier %)" -equal + if { [llength $learning_object] > 1 } { + set learning_object [lindex $learning_object 0] + global warnings + append warnings "
  • <#_ Warning: More than one learning object in environment % $identifier %. Just one used (the first one) #>
  • " + } set learning_object_list [imsld::parse::parse_and_create_learning_object -learning_object_node $learning_object \ -manifest_id $manifest_id \ -manifest $manifest \ @@ -1744,12 +1751,78 @@ and content_revision__is_live(activity_id) = 't' and component_id = :component_id }] } { - # error, referenced learning activity does not exist - return [list 0 "<#_ Referenced learning activity (% $learning_activity_ref %) in activity structure % $identifier % does not exist. comp $component_id #>"] + # may be the reference is wrong, search in the support activityes before returning an error + if { ![db_0or1row get_learning_support_activity_id { + select item_id as activity_id + from imsld_support_activitiesi + where identifier = :learning_activity_ref + and content_revision__is_live(activity_id) = 't' + and component_id = :component_id + }] } { + # ok, last try: searching in the rest of activity structures... + if { [db_0or1row get_struct_id { + select item_id as refrenced_struct_id + from imsld_activity_structuresi + where identifier = :learning_activity_ref + and content_revision__is_live(structure_id) = 't' + and component_id = :component_id + }] } { + # warning message + global warnings + append warnings "
  • <#_ Referenced support activity % $learning_activity_ref % is actually an activity structure!. #>
  • " + # do the mappings + relation_add imsld_as_as_rel $activity_structure_id $refrenced_struct_id + } else { + # search in the manifest ... + set organizations [$manifest child all imscp:organizations] + if { ![llength $organizations] } { + set organizations [$manifest child all organizations] + } + set activity_structures [[[[$organizations child all imsld:learning-design] child all imsld:components] child all imsld:activities] child all imsld:activity-structure] + + set found_p 0 + foreach referenced_activity_structure $activity_structures { + set referenced_identifier [string tolower [imsld::parse::get_attribute -node $referenced_activity_structure -attr_name identifier]] + if { [string eq $learning_activity_ref $referenced_identifier] } { + set found_p 1 + set referenced_structure_node $referenced_activity_structure + } + } + if { $found_p } { + # ok, let's create the activity structure + set activity_structure_ref_list [imsld::parse::parse_and_create_activity_structure -activity_node $referenced_structure_node \ + -component_id $component_id \ + -manifest_id $manifest_id \ + -manifest $manifest \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir] + + set activity_structure_ref_id [lindex $activity_structure_ref_list 0] + if { !$activity_structure_ref_id } { + # there is an error, abort and return the list with the error + return $activity_structure_ref_list + } + # warning message + global warnings + append warnings "
  • <#_ Referenced learning activity % $learning_activity_ref % is actually an activity structure!. #>
  • " + # finally, do the mappings + relation_add imsld_as_as_rel $activity_structure_id $activity_structure_ref_id + } else { + # error, referenced learning activity does not exist + return [list 0 "<#_ Referenced learning activity (% $learning_activity_ref %) in activity structure % $identifier % does not exist. comp $component_id #>"] + } + } + } else { + # warning message + global warnings + append warnings "
  • <#_ Referenced learning activity % $learning_activity_ref % is actually a support activity. #>
  • " + # map support activity with activity structure + relation_add imsld_as_sa_rel $activity_structure_id $activity_id + } + } else { + # map learning activity with activity structure + relation_add imsld_as_la_rel $activity_structure_id $activity_id } - - # map learning activity with activity structure - relation_add imsld_as_la_rel $activity_structure_id $activity_id } } @@ -1769,12 +1842,78 @@ and content_revision__is_live(activity_id) ='t' and component_id = :component_id }] } { - # error, referenced support activity does not exist - return [list 0 "<#_ Referenced support activity (% %support_activity_ref %) in activity structure % $identifier % does not exist. #>"] + # may be the reference is wrong, search in the support activityes before returning an error + if { ![db_0or1row get_support_learning_activity_id { + select item_id as activity_id + from imsld_learning_activitiesi + where identifier = :support_activity_ref + and content_revision__is_live(activity_id) = 't' + and component_id = :component_id + }] } { + # ok, last try: searching in the rest of activity structures... + if { [db_0or1row get_struct_id { + select item_id as refrenced_struct_id + from imsld_activity_structuresi + where identifier = :support_activity_ref + and content_revision__is_live(structure_id) = 't' + and component_id = :component_id + }] } { + # warning message + global warnings + append warnings "
  • <#_ Referenced support activity % $support_activity_ref % is actually an activity structure!. #>
  • " + # do the mappings + relation_add imsld_as_as_rel $activity_structure_id $refrenced_struct_id + } else { + # search in the manifest ... + set organizations [$manifest child all imscp:organizations] + if { ![llength $organizations] } { + set organizations [$manifest child all organizations] + } + set activity_structures [[[[$organizations child all imsld:learning-design] child all imsld:components] child all imsld:activities] child all imsld:activity-structure] + + set found_p 0 + foreach referenced_activity_structure $activity_structures { + set referenced_identifier [string tolower [imsld::parse::get_attribute -node $referenced_activity_structure -attr_name identifier]] + if { [string eq $support_activity_ref $referenced_identifier] } { + set found_p 1 + set referenced_structure_node $referenced_activity_structure + } + } + if { $found_p } { + # ok, let's create the activity structure + set activity_structure_ref_list [imsld::parse::parse_and_create_activity_structure -activity_node $referenced_structure_node \ + -component_id $component_id \ + -manifest_id $manifest_id \ + -manifest $manifest \ + -parent_id $parent_id \ + -tmp_dir $tmp_dir] + + set activity_structure_ref_id [lindex $activity_structure_ref_list 0] + if { !$activity_structure_ref_id } { + # there is an error, abort and return the list with the error + return $activity_structure_ref_list + } + # warning message + global warnings + append warnings "
  • <#_ Referenced support activity % $support_activity_ref % is actually an activity structure!. #>
  • " + # finally, do the mappings + relation_add imsld_as_as_rel $activity_structure_id $activity_structure_ref_id + } else { + # error, referenced support activity does not exist + return [list 0 "<#_ Referenced support activity (% $support_activity_ref %) in activity structure % $identifier % does not exist. #>"] + } + } + } else { + # warning message + global warnings + append warnings "
  • <#_ Referenced support activity % $support_activity_ref % is actually a learning activity. #>
  • " + # map the learning activity with activity structure + relation_add imsld_as_la_rel $activity_structure_id $activity_id + } + } else { + # map support activity with activity structure + relation_add imsld_as_sa_rel $activity_structure_id $activity_id } - - # map support activity with activity structure - relation_add imsld_as_sa_rel $activity_structure_id $activity_id } } @@ -1799,7 +1938,7 @@ # case one, just do the mappings relation_add imsld_as_as_rel $activity_structure_id $refrenced_struct_id } else { - # case two, first verify that the referenced activity structure exists + # case two, first verify that the referenced activity structure exists set organizations [$manifest child all imscp:organizations] if { ![llength $organizations] } { set organizations [$manifest child all organizations] @@ -1848,6 +1987,7 @@ -manifest_id -parent_id -tmp_dir + -sort_order } { Parse a role part and stores all the information in the database. @@ -1859,6 +1999,7 @@ @param manifest_id Manifest ID or the manifest being parsed @param parent_id Parent folder ID @param tmp_dir Temporary directory where the files were exctracted + @param sort_order } { # get the info of the role part and create it set identifier [string tolower [imsld::parse::get_attribute -node $role_part_node -attr_name identifier]] @@ -1901,6 +2042,9 @@ # Role Part: Learning Activities set learning_activity_id "" + set support_activity_id "" + set activity_structure_id "" + set learning_activity_ref [$role_part_node child all imsld:learning-activity-ref] if { [llength $learning_activity_ref] } { imsld::parse::validate_multiplicity -tree $learning_activity_ref -multiplicity 1 -element_name learning-activity-ref(role-part) -equal @@ -1914,13 +2058,38 @@ and content_revision__is_live(la.activity_id) = 't' and la.component_id = :component_id }] } { - # error, referenced learning activity does not exist - return [list 0 "<#_ Referenced learning activity (% $learning_activity_ref_ref %) in role part % $identifier % does not exist. #>"] + # may be the reference is wrong, search in the support activityes before returning an error + if { ![db_0or1row get_learning_support_activity_id { + select item_id as support_activity_id + from imsld_support_activitiesi + where identifier = :learning_activity_ref_ref + and content_revision__is_live(activity_id) = 't' + and component_id = :component_id + }] } { + # may be the reference is wrong, search in the activity structures before returning an error + if { ![db_0or1row get_learning_activity_struct_id { + select item_id as activity_structure_id + from imsld_activity_structuresi + where identifier = :learning_activity_ref_ref + and content_revision__is_live(structure_id) = 't' + and component_id = :component_id + }] } { + # error, referenced learning activity does not exist + return [list 0 "<#_ Referenced learning activity (% $learning_activity_ref_ref %) in role part % $identifier % does not exist. #>"] + } else { + # warning message + global warnings + append warnings "
  • <#_ Referenced learning activity % $learning_activity_ref_ref % in role part % $identifier % is actually an activity structure. #>
  • " + } + } else { + # warning message + global warnings + append warnings "
  • <#_ Referenced learning activity % $learning_activity_ref_ref % in role part % $identifier % is actually a support activity. #>
  • " + } } } # Role Part: Support Activities - set support_activity_id "" set support_activity_ref [$role_part_node child all imsld:support-activity-ref] if { [llength $support_activity_ref] } { imsld::parse::validate_multiplicity -tree $support_activity_ref -multiplicity 1 -element_name support-activity-ref(role-part) -equal @@ -1934,16 +2103,41 @@ and content_revision__is_live(sa.activity_id) = 't' and sa.component_id = :component_id }] } { - # error, referenced support activity does not exist - return [list 0 "<#_ Referenced support activity (% $support_activity_ref_ref %) in role part % $identifier % does not exist. #>"] + # may be the reference is wrong, search in the learning activities before returning an error + if { ![db_0or1row get_support_learning_activity_id { + select item_id as learning_activity_id + from imsld_learning_activitiesi + where identifier = :support_activity_ref_ref + and content_revision__is_live(activity_id) = 't' + and component_id = :component_id + }] } { + # may be the reference is wrong, search in the activity structures before returning an error + if { ![db_0or1row get_support_activity_struct_id { + select item_id as activity_structure_id + from imsld_activity_structuresi + where identifier = :support_activity_ref_ref + and content_revision__is_live(structure_id) = 't' + and component_id = :component_id + }] } { + # error, referenced support activity does not exist + return [list 0 "<#_ Referenced support activity (% $support_activity_ref_ref %) in role part % $identifier % does not exist. #>"] + } else { + # warning message + global warnings + append warnings "
  • <#_ Referenced support activity % $support_activity_ref_ref % in role part % $identifier % is actually an activity structure. #>
  • " + } + } else { + # warning message + global warnings + append warnings "
  • <#_ Referenced support activity % $support_activity_ref % in role part % $identifier % is actually a learning activity. #>
  • " + } } } # TO-DO: Role Part: Units of Learning # Role Part: Activity Structures set activity_structure_ref [$role_part_node child all imsld:activity-structure-ref] - set activity_structure_id "" if { [llength $activity_structure_ref] } { imsld::parse::validate_multiplicity -tree $activity_structure_ref -multiplicity 1 -element_name activity-structure-ref(role-part) -equal # the activity structures have already been parsed by now, so the referenced activity structure has to be in the database. @@ -1956,8 +2150,34 @@ and content_revision__is_live(ias.structure_id) = 't' and ias.component_id = :component_id }] } { - # error, referenced activity structure does not exist - return [list 0 "<#_ Referenced activity structure (% $activity_structure_ref_ref %) in role part % $identifier % does not exist. #>"] + # may be the reference is wrong, search in the learning activities before returning an error + if { ![db_0or1row get_struct_learning_activity_id { + select item_id as learning_activity_id + from imsld_learning_activitiesi + where identifier = :activity_structure_ref_ref + and content_revision__is_live(activity_id) = 't' + and component_id = :component_id + }] } { + # may be the reference is wrong, search in the support activities before returning an error + if { ![db_0or1row get_struct_support_activity_id { + select item_id as support_activity_id + from imsld_support_activitiesi + where identifier = :activity_structure_ref_ref + and content_revision__is_live(activity_id) = 't' + and component_id = :component_id + }] } { + # error, referenced activity structure does not exist + return [list 0 "<#_ Referenced activity structure (% $activity_structure_ref_ref %) in role part % $identifier % does not exist. #>"] + } else { + # warning message + global warnings + append warnings "
  • <#_ Referenced activity structure % $activity_structure_ref_ref % in role part % $identifier % is actually an support activity. #>
  • " + } + } else { + # warning message + global warnings + append warnings "
  • <#_ Referenced activity structure % $activity_structure_ref_ref % in role part % $identifier % is actually a learning activity. #>
  • " + } } } @@ -1987,7 +2207,8 @@ [list learning_activity_id $learning_activity_id] \ [list support_activity_id $support_activity_id] \ [list activity_structure_id $activity_structure_id] \ - [list environment_id $environment_id]] \ + [list environment_id $environment_id] \ + [list sort_order $sort_order]] \ -content_type imsld_role_part \ -title $title \ -parent_id $parent_id] @@ -2002,6 +2223,7 @@ -manifest_id -parent_id -tmp_dir + -sort_order } { Parse a act and stores all the information in the database. @@ -2013,6 +2235,7 @@ @param manifest_id Manifest ID or the manifest being parsed @param parent_id Parent folder ID @param tmp_dir Temporary directory where the files were exctracted + @param sort_order } { upvar files_struct_list files_struct_list @@ -2069,26 +2292,30 @@ set act_id [imsld::item_revision_new -attributes [list [list play_id $play_id] \ [list identifier $identifier] \ [list time_limit_id $time_limit_id] \ - [list on_completion_id $on_completion_id]] \ + [list on_completion_id $on_completion_id] \ + [list sort_order $sort_order]] \ -content_type imsld_act \ -parent_id $parent_id \ -title $title] # Act: Role Parts set role_parts [$act_node child all imsld:role-part] imsld::parse::validate_multiplicity -tree $role_parts -multiplicity 1 -element_name role-parts -greather_than + set count 1 foreach role_part $role_parts { set role_part_list [imsld::parse::parse_and_create_role_part -act_id $act_id \ -role_part_node $role_part \ -manifest $manifest \ -manifest_id $manifest_id \ -parent_id $parent_id \ - -tmp_dir $tmp_dir] + -tmp_dir $tmp_dir \ + -sort_order $count] set role_part_id [lindex $role_part_list 0] if { !$role_part_id } { # an error happened, abort and return the list whit the error return $role_part_list } + incr count } # Act: Complete Act: When role part comleted @@ -2125,6 +2352,7 @@ -manifest_id -parent_id -tmp_dir + -sort_order } { Parse a play and stores all the information in the database. @@ -2136,6 +2364,7 @@ @param manifest_id Manifest ID or the manifest being parsed @param parent_id Parent folder ID @param tmp_dir Temporary directory where the files were exctracted + @param sort_order } { upvar files_struct_list files_struct_list @@ -2201,14 +2430,16 @@ [list identifier $identifier] \ [list when_last_act_completed_p $when_last_act_completed_p] \ [list time_limit_id $time_limit_id] \ - [list on_completion_id $on_completion_id]] \ + [list on_completion_id $on_completion_id] \ + [list sort_order $sort_order]] \ -content_type imsld_play \ -title $title \ -parent_id $parent_id] # Play: Acts set acts [$play_node child all imsld:act] imsld::parse::validate_multiplicity -tree $acts -multiplicity 1 -element_name acts -greather_than + set count 1 foreach act $acts { set act_identifier [string tolower [imsld::parse::get_attribute -node $act -attr_name identifier]] set act_title [imsld::parse::get_title -node $act -prefix imsld] @@ -2217,12 +2448,14 @@ -manifest $manifest \ -manifest_id $manifest_id \ -parent_id $parent_id \ - -tmp_dir $tmp_dir] + -tmp_dir $tmp_dir \ + -sort_order $count] set act_id [lindex $act_list 0] if { !$act_id } { # an error happened, abort and return the list whit the error return $act_list } + incr count } return $play_id @@ -2236,14 +2469,16 @@ } { Parse a XML IMS LD file and store all the information found in the database, such as the manifest, the organization, the imsld with its components, method, activities, etc. - Returns the new manifest_id created if there was no errors. Otherwise it returns 0. + Returns a list with the new manifest_id and the warnings, if thera are any, and if there was no errors. Otherwise it returns 0 and the error. @param xmlfile The file to parse. This file must be compliant with the IMS LD spec @param manifest_id The manifest_id that is being created @option community_id community_id of the community where the manifest and its contents will be created. Default value is @param tmp_dir tmp dir where the files were extracted to } { set community_id [expr { [empty_string_p $community_id] ? [dotlrn_community::get_community_id] : $community_id }] + global warnings + set warnings "" # get the files structure set files_struct_list [imsld::parse::get_files_structure -tmp_dir $tmp_dir] @@ -2263,6 +2498,7 @@ set folders_list [imsld::parse::initialize_folders -community_id $community_id \ -manifest_id $manifest_id \ -manifest_identifier $manifest_identifier] + set fs_folder_id [lindex $folders_list 0] set cr_folder_id [lindex $folders_list 1] @@ -2276,6 +2512,7 @@ -version $manifest_version \ -parent_id $cr_folder_id] + # organizaiton set organizations [$manifest child all imscp:organizations] if { ![llength $organizations] } { @@ -2533,17 +2770,20 @@ set plays [$method child all imsld:play] imsld::parse::validate_multiplicity -tree $plays -multiplicity 1 -element_name plays -greather_than + set count 1 foreach play $plays { set play_list [imsld::parse::parse_and_create_play -method_id $method_id \ -play_node $play \ -manifest $manifest \ -manifest_id $manifest_id \ -parent_id $cr_folder_id \ - -tmp_dir $tmp_dir] + -tmp_dir $tmp_dir \ + -sort_order $count] if { ![lindex $play_list 0] } { # an error happened, abort and return the list whit the error return $play_list } + incr count } # Method: Complete Method: When play comleted @@ -2569,7 +2809,11 @@ } } - return [list $manifest_id {}] + global warnings + if { ![empty_string_p $warnings] } { + set warnings "<#_
    Warnings: #>" + } + return [list $manifest_id "$warnings"] } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/imsld/tcl/imsld-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/imsld/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/index.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/www/index.adp 19 Sep 2005 17:20:15 -0000 1.2 +++ openacs-4/packages/imsld/www/index.adp 27 Sep 2005 11:05:10 -0000 1.3 @@ -3,4 +3,4 @@ @context;noquote@ index -@mensaje@ ;;;; @lista@ \ No newline at end of file +@mensaje@ ;;;; @lista@ --- \ No newline at end of file Index: openacs-4/packages/imsld/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/www/index.tcl 19 Sep 2005 17:20:15 -0000 1.2 +++ openacs-4/packages/imsld/www/index.tcl 27 Sep 2005 11:05:10 -0000 1.3 @@ -6,6 +6,9 @@ ad_proc beta {} {} { + global sms + set sms "JA! vemonos los pies : " + upvar lista lista set compy $lista lappend lista [list c d] @@ -20,13 +23,20 @@ ad_proc teta {} {} { upvar lista lista + global sms + append sms sipuesdostres + + set variabfle $sms + set stypmy $lista lappend lista [list z z j] + lappend lista $sms } set lista [list a b] beta + if { 1==2 } { set mensaje "crear" Index: openacs-4/packages/imsld/www/admin/imsld-new-3.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/Attic/imsld-new-3.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/imsld-new-3.adp 5 Aug 2005 15:25:33 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/imsld-new-3.adp 27 Sep 2005 11:05:11 -0000 1.2 @@ -2,4 +2,4 @@ titulin contextin -success +success @warnings;noquote@ Index: openacs-4/packages/imsld/www/admin/imsld-new-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/Attic/imsld-new-3.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/imsld/www/admin/imsld-new-3.tcl 21 Sep 2005 14:39:56 -0000 1.4 +++ openacs-4/packages/imsld/www/admin/imsld-new-3.tcl 27 Sep 2005 11:05:11 -0000 1.5 @@ -34,7 +34,7 @@ set manifest_list [imsld::parse::parse_and_create_imsld_manifest -xmlfile $tmp_dir/imsmanifest.xml \ -manifest_id $manifest_id \ -tmp_dir $tmp_dir \ - -community_id 2040] + -community_id 2142] set manifest_id [lindex $manifest_list 0] @@ -44,6 +44,7 @@ ad_script_abort } +set warnings [lindex $manifest_list 1] # delete the tmpdir imsld::parse::remove_dir -dir $tmp_dir