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.78 -r1.79 --- openacs-4/packages/imsld/tcl/imsld-procs.tcl 19 Jul 2006 13:51:24 -0000 1.78 +++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 19 Jul 2006 15:30:13 -0000 1.79 @@ -3053,7 +3053,17 @@ @author Luis de la Fuente Valent�n (lfuente@it.uc3m.es) } { - return +if {[info exist play_id] & ![info exist imsld_id]} { + set imsld_id [db_string get_imsld_id_from_play { + select iii.imsld_id + from imsld_imsldsi iii, + imsld_methodsi imi, + imsld_plays ip + where ip.method_id=imi.item_id + and imi.imsld_id=iii.item_id + and ip.play_id=:play_id + }] +} return [db_string get_property_id { select ip.property_id from imsld_properties ip, Index: openacs-4/packages/imsld/www/activity-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/activity-frame.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/imsld/www/activity-frame.tcl 22 Jun 2006 10:56:54 -0000 1.8 +++ openacs-4/packages/imsld/www/activity-frame.tcl 19 Jul 2006 15:30:13 -0000 1.9 @@ -68,6 +68,55 @@ set activity_item_id [content::revision::item_id -revision_id $activity_id] imsld::process_activity_as_ul -activity_item_id $activity_item_id -run_id $run_id -dom_doc $doc -dom_node $dom_root + if {![string eq $activity_id ""] } { + db_1row get_table_name { + select + case + when exists (select 1 from imsld_learning_activities where activity_id=:activity_id) + then 'imsld_learning_activities' + when exists (select 1 from imsld_support_activities where activity_id=:activity_id) + then 'imsld_support_activities' + end as table_name + from dual + } + #grant permissions to resources in activity + set resources_list [db_list get_resources_from_activity " + select ar2.object_id_two + from $table_name ila, + acs_rels ar1, + acs_rels ar2 + where activity_id=:activity_id + and ar1.object_id_one=ila.activity_description_id + and ar1.rel_type='imsld_actdesc_item_rel' + and ar1.object_id_two=ar2.object_id_one + and ar2.rel_type='imsld_item_res_rel' + "] + set prerequisites_list [db_list get_prerequisites_list " + select ar2.object_id_two + from acs_rels ar1, + acs_rels ar2, + $table_name tn + where tn.activity_id=:activity_id + and ar1.object_id_one=tn.prerequisite_id + and ar1.rel_type='imsld_preq_item_rel' + and ar1.object_id_two=ar2.object_id_one + and ar2.rel_type='imsld_item_res_rel' + "] + set objectives_list [db_list get_objectives_list " + select ar2.object_id_two + from acs_rels ar1, + acs_rels ar2, + $table_name tn + where tn.activity_id=:activity_id + and ar1.object_id_one=tn.learning_objective_id + and ar1.rel_type='imsld_lo_item_rel' + and ar1.object_id_two=ar2.object_id_one + and ar2.rel_type='imsld_item_res_rel' + "] + set resources_list [concat $resources_list [concat $prerequisites_list $objectives_list]] + imsld::grant_permissions -resources_activities_list $resources_list -user_id $user_id + } + set activities [$dom_root asXML] set page_title {} Index: openacs-4/packages/imsld/www/environment-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/environment-frame.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/imsld/www/environment-frame.tcl 16 May 2006 09:24:35 -0000 1.5 +++ openacs-4/packages/imsld/www/environment-frame.tcl 19 Jul 2006 15:30:13 -0000 1.6 @@ -32,7 +32,6 @@ -run_id $run_id \ -dom_node $environments_node \ -dom_doc $doc - $dom_root appendChild $environments_node_li set environments_node_li [$doc createElement li] Index: openacs-4/packages/imsld/www/imsld-finish-resource.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/imsld-finish-resource.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/imsld/www/imsld-finish-resource.tcl 13 Jul 2006 13:11:44 -0000 1.7 +++ openacs-4/packages/imsld/www/imsld-finish-resource.tcl 19 Jul 2006 15:30:13 -0000 1.8 @@ -20,6 +20,7 @@ and icr.type != 'imsqti_xmlv1p0' limit 1 }] } { + imsld::grant_permissions -resources_activities_list $resource_id -user_id [ad_conn user_id] imsld::finish_resource -resource_id $resource_id -run_id $run_id } if { ![regexp {http://} $file_url] } { Index: openacs-4/packages/imsld/www/imsld-tree.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/imsld-tree.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/imsld/www/imsld-tree.tcl 6 Jun 2006 13:24:46 -0000 1.8 +++ openacs-4/packages/imsld/www/imsld-tree.tcl 19 Jul 2006 15:30:13 -0000 1.9 @@ -24,6 +24,7 @@ set user_message "" set next_activity_id [imsld::get_next_activity_list -run_id $run_id -user_id $user_id] + set remaining_activities [llength [join $next_activity_id]] if {!$remaining_activities} {