Index: openacs-4/packages/imsld/sql/postgresql/imsld-level-b-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-level-b-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/sql/postgresql/imsld-level-b-create.sql 30 Jan 2006 19:31:05 -0000 1.1 +++ openacs-4/packages/imsld/sql/postgresql/imsld-level-b-create.sql 17 Mar 2006 15:02:03 -0000 1.2 @@ -33,7 +33,7 @@ create index imsld_prop_comp_idx on imsld_properties(component_id); comment on table imsld_properties is ' -Properties are introduced in the level B of the IMS-LD spec, and are stored in this table (the definition, because the instantiantion for each user/role is stored in other table). +Properties are introduced in the level B of the IMS-LD spec, and are stored in this table (the definition, because the instantiantion for each user/role is stored in the imsld_property_instanced table). The global definitions of the globpers and global property types are stored in the same row of the table (in this case the existing_href field is not null)'; Index: openacs-4/packages/imsld/tcl/imsld-cp-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-cp-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/imsld/tcl/imsld-cp-procs.tcl 9 Dec 2005 12:01:31 -0000 1.4 +++ openacs-4/packages/imsld/tcl/imsld-cp-procs.tcl 17 Mar 2006 15:02:03 -0000 1.5 @@ -45,7 +45,7 @@ set creation_ip [expr { [empty_string_p $creation_ip] ? [ad_conn peeraddr] : $creation_ip }] set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] - set prent_manifest_id [expr { [empty_string_p $parent_manifest_id] ? 0 : $parent_manifest_id }] + set parent_manifest_id [expr { [empty_string_p $parent_manifest_id] ? 0 : $parent_manifest_id }] set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] set content_type imsld_cp_manifest Index: openacs-4/packages/imsld/tcl/imsld-cr-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-cr-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/imsld/tcl/imsld-cr-procs.tcl 1 Feb 2006 12:31:32 -0000 1.5 +++ openacs-4/packages/imsld/tcl/imsld-cr-procs.tcl 17 Mar 2006 15:02:03 -0000 1.6 @@ -85,7 +85,7 @@ set creation_date [expr { [empty_string_p $creation_date] ? [dt_sysdate] : $creation_date }] set package_id [expr { [empty_string_p $package_id] ? [ad_conn package_id] : $package_id }] set item_id [expr { [empty_string_p $item_id] ? [db_nextval "acs_object_id_seq"] : $item_id }] - + set content_type imsld_cp_file set item_name "${item_id}_imsld_cp_file" set title [expr { [empty_string_p $title] ? $item_name : $title }] Index: openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl 4 Oct 2005 13:45:40 -0000 1.3 +++ openacs-4/packages/imsld/tcl/imsld-fs-procs.tcl 17 Mar 2006 15:02:03 -0000 1.4 @@ -110,7 +110,7 @@ if { !$database_p } { set storage_type file } else { - set storabe_tupe lob + set storage_type lob } set file_id [imsld::cr::file_new -file_name $file_name \ -path_to_file $path_to_file \ 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.35 -r1.36 --- openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 13 Mar 2006 17:43:59 -0000 1.35 +++ openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 17 Mar 2006 15:02:03 -0000 1.36 @@ -643,7 +643,7 @@ # look for the resource in the manifest and add it to the CR set resources [$manifest child all imscp:resources] if { ![llength $resources] } { - set imsld [$manifest child all resources] + set resources [$manifest child all resources] } # there must be at least one reource for the learning objective @@ -1937,12 +1937,8 @@ -parent_id $parent_id] # environment: learning object - set learning_object [$environment_node child all imsld:learning-object] - if { [llength $learning_object] } { - if { [llength $learning_object] > 1 } { - set learning_object [lindex $learning_object 0] - append warnings "
  • [_ imsld.lt_Warning_More_than_one]
  • " - } + set learning_objects [$environment_node child all imsld:learning-object] + foreach learning_object $learning_objects { set learning_object_list [imsld::parse::parse_and_create_learning_object -learning_object_node $learning_object \ -environment_id $environment_id \ -manifest_id $manifest_id \ @@ -1958,22 +1954,15 @@ } # environment: service - set service [$environment_node child all imsld:service] - set service_id "" - if { [llength $service] } { - if { [llength $$service] > 1 } { - set service [lindex $service 0] - append warnings "
  • [_ imsld.lt_More_than_one_service]
  • " - } - imsld::parse::validate_multiplicity -tree $service -multiplicity 1 -element_name service(environment) -equal + set services [$environment_node child all imsld:service] + foreach service $services { set service_list [imsld::parse::parse_and_create_service -service_node $service \ -environment_id $environment_id \ -manifest_id $manifest_id \ -manifest $manifest \ -parent_id $parent_id \ -tmp_dir $tmp_dir] - set service_id [lindex $service_list 0] - if { !$service_id } { + if { ![lindex $service_list 0] } { # there is an error, abort and return the list with the error return $service_list } Index: openacs-4/packages/imsld/tcl/imsld-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.tcl,v diff -u -r1.40 -r1.41 --- openacs-4/packages/imsld/tcl/imsld-procs.tcl 13 Mar 2006 17:43:59 -0000 1.40 +++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 17 Mar 2006 15:02:04 -0000 1.41 @@ -914,7 +914,7 @@ {-environment_list ""} -imsld_id -role_part_id - {-structures_names ""} + {-structures_info ""} } { @return The next learning or support activity (and the type) in the activity structure. 0 if there are none (which should never happen), the next activity type and the list of the structure names of the activity structures in the path of the returned activity } { @@ -947,12 +947,13 @@ ) } - lappend structures_names [db_string get_structure_name { + set structures_info [concat $structures_info [db_list_of_lists get_structure_info { select - coalesce(title,identifier) as structure_name + coalesce(title,identifier) as structure_name, + item_id from imsld_activity_structuresi where structure_id = :activity_structure_id - }] + }]] } # get referenced activities @@ -1014,13 +1015,13 @@ } if { [string eq $next_activity_type structure] } { - set next_activity_list [imsld::structure_next_activity -activity_structure_id $next_activity_id -environment_list $environment_list -imsld_id $imsld_id -role_part_id $role_part_id -structures_names $structures_names] + set next_activity_list [imsld::structure_next_activity -activity_structure_id $next_activity_id -environment_list $environment_list -imsld_id $imsld_id -role_part_id $role_part_id -structures_info $structures_info] set next_activity_id [lindex $next_activity_list 0] set next_activity_type [lindex $next_activity_list 1] set environment_list [concat $environment_list [lindex $next_activity_list 2]] - set structures_names [lindex $next_activity_list 3] + set structures_info [lindex $next_activity_list 3] } - return [list $next_activity_id $next_activity_type $environment_list $structures_names] + return [list $next_activity_id $next_activity_type $environment_list $structures_info] } ad_proc -public imsld::structure_finished_p { @@ -1316,14 +1317,17 @@ } set environment_learning_objects_list [list] - if { [db_0or1row get_learning_object_info { + foreach learning_objects_list [db_list_of_lists get_learning_object_info { select item_id as learning_object_item_id, learning_object_id, identifier from imsld_learning_objectsi where environment_id = :environment_item_id and content_revision__is_live(learning_object_id) = 't' - }] } { + }] { + set learning_object_item_id [lindex $learning_objects_list 0] + set learning_object_id [lindex $learning_objects_list 1] + set identifier [lindex $learning_objects_list 2] # learning object item. get the files associated set linear_item_list [db_list_of_lists item_linear_list { *SQL* }] foreach imsld_item_id $linear_item_list { @@ -1335,42 +1339,36 @@ lappend resource_item_list $resource_item_id } set one_learning_object_list [imsld::process_resource -resource_item_id $resource_item_id] - if { [string eq "" $one_learning_object_list] } { - lappend environment_learning_objects_list "[_ imsld.lt_li_desc_no_file_assoc]" - } else { + if { ![string eq "" $one_learning_object_list] } { if { [string eq "t" $resource_mode] } { set environment_learning_objects_list [concat $environment_learning_objects_list \ [list $one_learning_object_list] \ $resource_item_list ] } else { - if { ![string eq "" $environment_learning_objects_list] } { - set environment_learning_objects_list [concat $environment_learning_objects_list \ - [list $one_learning_object_list]] - } else { - set environment_learning_objects_list $one_learning_object_list - } + set environment_learning_objects_list [concat $environment_learning_objects_list \ + [list $one_learning_object_list]] } } } } } # services set environment_services_list [list] - if { [db_0or1row get_service_info { + foreach services_list [db_list_of_lists get_service_info { select service_id, item_id as service_item_id, identifier, service_type from imsld_servicesi where environment_id = :environment_item_id and content_revision__is_live(service_id) = 't' - }] } { - if { [string eq "" $environment_services_list] } { - set environment_services_list [imsld::process_service -service_item_id $service_item_id -resource_mode $resource_mode] - } else { - set environment_services_list [concat $environment_services_list \ - [imsld::process_service -service_item_id $service_item_id -resource_mode $resource_mode]] - } + }] { + set service_id [lindex $environment_services_list 0] + set service_item_id [lindex $environment_services_list 1] + set identifier [lindex $environment_services_list 2] + set service_type [lindex $environment_services_list 3] + set environment_services_list [concat $environment_services_list \ + [list [imsld::process_service -service_item_id $service_item_id -resource_mode $resource_mode]]] } set nested_environment_list [list] @@ -1379,11 +1377,13 @@ set one_nested_environment_list [imsld::process_environment -environment_item_id $nested_environment_item_id] # the title is stored in [lindex $one_nested_environment_list 0], but is not returned for displaying porpouses set nested_environment_list [concat $nested_environment_list \ - [list [lindex $one_nested_environment_list 1] \ - [lindex $one_nested_environment_list 2] \ - [lindex $one_nested_environment_list 3]]] + [lindex $one_nested_environment_list 1] \ + [lindex $one_nested_environment_list 2] \ + [lindex $one_nested_environment_list 3]] + regsub -all "{}" $nested_environment_list "" nested_environment_list } - return [list $environment_title $environment_learning_objects_list $environment_services_list $nested_environment_list] + set return_list [list $environment_title $environment_learning_objects_list $environment_services_list $nested_environment_list] + return $return_list } ad_proc -public imsld::process_learning_objective { @@ -1956,7 +1956,7 @@ set associated_environments_list [db_list sa_associated_environments { *SQL* }] foreach environment_item_id $associated_environments_list { if { [llength $environments_list] } { - set environments_list [concat [list $environments_list] \ + set environments_list [concat $environments_list \ [list [imsld::process_environment -environment_item_id $environment_item_id -resource_mode $resource_mode]]] } else { set environments_list [imsld::process_environment -environment_item_id $environment_item_id -resource_mode $resource_mode] @@ -1967,7 +1967,6 @@ set environments_ids [concat [lindex [lindex $environments_list 1] [expr [llength [lindex $environments_list 1] ] - 1 ]] \ [lindex [lindex $environments_list 2] [expr [llength [lindex $environments_list 2] ] - 1 ]]] } - return $environments_list } @@ -2391,14 +2390,13 @@ } set structure_envs [imsld::process_activity_structure -structure_item_id $structure_item_id] set environments "" - foreach structure_list $structure_envs { - if { [llength [lindex $structure_list 0]] } { - append environments "[lindex $structure_list 0]
    " - append environments "[join [lindex $structure_list 1] " "] " - append environments "[join [lindex $structure_list 2] " "] " - append environments "[join [lindex $structure_list 3] " "]
    " - } + if { [llength $structure_envs] } { + append environments "[lindex $structure_envs 0]
    " } + append environments "[join [lindex $structure_envs 1] " "] " + append environments "[join [lindex $structure_envs 2] " "] " + append environments "[join [lindex $structure_envs 3] " "]
    " + if { [string eq $status "started"] } { set structure_title "
    [string repeat "(" $tab_structures]$activity_title
    " set stat "" @@ -2485,40 +2483,18 @@ # 2. if it is an activity structure we have verify which activities are already completed and return the next # activity in the activity structure, handling the case when the next activity is also an activity structure - db_1row get_role_part_activity { - select case - when learning_activity_id is not null - then 'learning' - when support_activity_id is not null - then 'support' - when activity_structure_id is not null - then 'structure' - else 'none' - end as activity_type, - case - when learning_activity_id is not null - then content_item__get_live_revision(learning_activity_id) - when support_activity_id is not null - then content_item__get_live_revision(support_activity_id) - when activity_structure_id is not null - then content_item__get_live_revision(activity_structure_id) - else content_item__get_live_revision(environment_id) - end as activity_id, - environment_id as rp_environment_item_id - from imsld_role_parts - where role_part_id = :role_part_id - } + db_1row get_role_part_activity { *SQL* } # environments set environment_list [list] - set environments "" # get the environments associated to the role_part if { ![string eq "" $rp_environment_item_id] } { set environment_list [concat [list $environment_list] [imsld::process_environment -environment_item_id $rp_environment_item_id]] } # activity structure if { [string eq $activity_type structure] } { + # activity structure. we have to look for the next learning or support activity set activity_list [imsld::structure_next_activity -activity_structure_id $activity_id -imsld_id $imsld_id -role_part_id $role_part_id -environment_list $environment_list] set activity_id [lindex $activity_list 0] @@ -2529,11 +2505,23 @@ set environment_list [lindex $activity_list 2] } # flush the structures names in the path of the next activity - set structures_names [lindex $activity_list 3] - foreach structure_name $structures_names { + set structures_info [lindex $activity_list 3] + foreach marked_structure $structures_info { + # environments + set structure_name [lindex $marked_structure 0] + set structure_item_id [lindex $marked_structure 1] + set structure_envs [imsld::process_activity_structure -structure_item_id $structure_item_id] + set environments "" + if { [llength $structure_envs] } { + append environments "[lindex $structure_envs 0]
    " + } + append environments "[join [lindex $structure_envs 1] " "] " + append environments "[join [lindex $structure_envs 2] " "] " + append environments "[join [lindex $structure_envs 3] " "]
    " + template::multirow append imsld_multirow {} \ {} \ - {} \ + $environments \ "
    [string repeat ( $tab_structures]$structure_name
    " \ {} \ {} @@ -2542,6 +2530,7 @@ } set environments "" + if { [llength $environment_list] } { foreach environment $environment_list { append environments "[lindex $environment 0]
    " Index: openacs-4/packages/imsld/tcl/imsld-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.xql,v diff -u -r1.12 -r1.13 --- openacs-4/packages/imsld/tcl/imsld-procs.xql 13 Mar 2006 17:43:59 -0000 1.12 +++ openacs-4/packages/imsld/tcl/imsld-procs.xql 17 Mar 2006 15:02:04 -0000 1.13 @@ -1724,6 +1724,7 @@ then content_item__get_live_revision(activity_structure_id) else content_item__get_live_revision(environment_id) end as activity_id, + coalesce(learning_activity_id,support_activity_id,activity_structure_id) as activity_item_id, environment_id as rp_environment_item_id from imsld_role_parts where role_part_id = :role_part_id