Index: openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml,v diff -u -r1.19 -r1.20 --- openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 20 Apr 2006 08:50:52 -0000 1.19 +++ openacs-4/packages/imsld/catalog/imsld.en_US.ISO-8859-1.xml 16 May 2006 09:24:34 -0000 1.20 @@ -5,6 +5,7 @@ Act Identifier Activity Structures Acts in play %count% + Admin IMS LD Caluclate Identifier Calulate Identifier Class @@ -15,9 +16,14 @@ Confirm: New IMS-LD Context info Create New? + create new run + Creating default Run... Creating new IMS-LD... + Creation Date Data Type Delete IMS LD + Delete Run + Deleted Description Else Identifier Error parsing file @@ -81,7 +87,8 @@ IMS-LD Time Limits IMS-LD ZIP File IMS-LDs - IMS LD Name + IMS Learning Designs + Unit of Learning Name Information Initial Value Is shared? @@ -108,6 +115,7 @@ Environment Identifier Error creating folder Error deleting IMS LD + Error deleting Run %run_id% Error parsing manifest. Expression Identifier Expression One Identifier @@ -188,6 +196,8 @@ Referenced support activity (%support_activity_ref_ref%) in role part %identifie% does not exist. Referenced support activity %support_activity_ref_ref% in role part %identifier% is actually an activity structure. Referenced support activity %support_activity_ref% in role part %identifier% is actually a learning activity. + Service type %service_type% not implemented + Sorry, that service type (%service_type%) hasn't been implemented yet. Support Activity Identifier The file %filex_href% was not created, it wasn't found in the manifest The referenced play in 'when play completed' in the method does not exist @@ -213,6 +223,7 @@ There was an error creating the folder. Aborting. There was an error creating the tmp_dir to unzip the file. There was an error deleting the IMS LD $imsld_id. This is the error: <pre>%errmsg%</pre> + There was an error deleting the Run %run_id%. This is what the database said: <pre> %errmsg%</pre> There was an error generating the tmp_dir to unzip the file. There was an error parsing the manifest. Please correct it and try again. <br /><code>%errmsg%</code> There was an error trying to delete the dir %dir%. @@ -228,14 +239,16 @@ When Last Act Completed? When Property Value is Set Identifier Mail Data - Make it live + (make it live) + Manage Members Manager Identifier Manifest Identifier Match Persons? Material Max Persons Method Identifier Min Persons + &nbsp;&nbsp;&nbsp;done New IMS-LD information found in the imsmanifest.xml file. Nothing to do. No IMS LD @@ -262,6 +275,8 @@ Restriction Type Role Identifier Role Type + Run (IMS-LD) Name + Runs Self send-mail service Sendmail Identifier Index: openacs-4/packages/imsld/lib/imsld-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/imsld-chunk.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/imsld/lib/imsld-chunk.adp 19 Apr 2006 16:29:19 -0000 1.7 +++ openacs-4/packages/imsld/lib/imsld-chunk.adp 16 May 2006 09:24:35 -0000 1.8 @@ -1,2 +1,2 @@ -
+
Index: openacs-4/packages/imsld/lib/imsld-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/imsld-chunk.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/imsld/lib/imsld-chunk.tcl 19 Apr 2006 16:29:19 -0000 1.7 +++ openacs-4/packages/imsld/lib/imsld-chunk.tcl 16 May 2006 09:24:35 -0000 1.8 @@ -6,46 +6,49 @@ set imsld_url "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]" template::list::create \ - -name imslds \ - -multirow imslds \ - -key imsld_id \ + -name imsld_runs \ + -multirow imsld_runs \ + -key run_id \ -elements { imsld_title { label "[_ imsld.IMS_LD_Name]" orderby_asc {imsld_title asc} orderby_desc {imsld_title desc} - display_template {@imslds.imsld_title@} + display_template {@imsld_runs.imsld_title@} } creation_date { - label "Creation Date" + label "[_ imsld.Creation_Date]" orderby_asc {creation_date asc} orderby_desc {creation_date desc} } } \ -orderby { default_value imsld_title } -set orderby [template::list::orderby_clause -orderby -name imslds] +set orderby [template::list::orderby_clause -orderby -name imsld_runs] if {[string equal $orderby ""]} { set orderby " order by imsld_title asc" } set cr_root_folder_id [imsld::cr::get_root_folder -community_id $community_id] -db_multirow imslds get_manifests " - select imsld.imsld_id, +db_multirow imsld_runs get_manifests " + select run.run_id, coalesce(imsld.title, imsld.identifier) as imsld_title, - to_char(imsld.creation_date,'MM/DD/YYYY HH24:MI') as creation_date - from cr_items cr1, cr_items cr2, cr_items cr3, cr_items cr4, - imsld_cp_manifests icm, imsld_cp_organizations ico, imsld_imsldsi imsld - where cr1.live_revision = icm.manifest_id + to_char(ao.creation_date,'MM/DD/YYYY HH24:MI') as creation_date + from cr_items cr1, cr_items cr2, cr_items cr3, cr_items cr4, acs_objects ao, + imsld_runs run, imsld_cp_manifests icm, imsld_cp_organizations ico, imsld_imsldsi imsld + where run.imsld_id = imsld.imsld_id + and ao.object_id = run.run_id + and cr1.live_revision = icm.manifest_id and cr1.parent_id = cr4.item_id and cr4.parent_id = :cr_root_folder_id and ico.manifest_id = cr1.item_id and imsld.organization_id = cr2.item_id and cr2.live_revision = ico.organization_id and cr3.live_revision = imsld.imsld_id + and run.status = 'active' $orderby " {} 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.14 -r1.15 --- openacs-4/packages/imsld/sql/postgresql/imsld-create.sql 30 Mar 2006 09:47:01 -0000 1.14 +++ openacs-4/packages/imsld/sql/postgresql/imsld-create.sql 16 May 2006 09:24:35 -0000 1.15 @@ -9,4 +9,5 @@ \i imsld-cp-create.sql \i imsld-level-b-create.sql \i imsld-production-delivery-create.sql +\i imsld-production-delivery-package-create.sql \i imsld-tree-create.sql 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.8 -r1.9 --- openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql 29 Mar 2006 15:55:24 -0000 1.8 +++ openacs-4/packages/imsld/sql/postgresql/imsld-drop.sql 16 May 2006 09:24:35 -0000 1.9 @@ -13,4 +13,6 @@ \i imsld-production-delivery-drop.sql +\i imsld-production-delivery-package-drop.sql + \i imsld-level-b-drop.sql \ No newline at end of file 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.3 -r1.4 --- openacs-4/packages/imsld/sql/postgresql/imsld-level-b-create.sql 29 Mar 2006 15:55:24 -0000 1.3 +++ openacs-4/packages/imsld/sql/postgresql/imsld-level-b-create.sql 16 May 2006 09:24:35 -0000 1.4 @@ -6,36 +6,36 @@ -- create table imsld_properties ( - property_id integer - constraint imsld_pro_id_fk - references cr_revisions - on delete cascade - constraint imsld_pro_id_pk - primary key, - component_id integer - constraint imsld_pro_comp_fk - references cr_items --imsld_components - not null, - identifier varchar(100) - not null, - type varchar(20) - check (type in ('loc','locpers','locrole','globpers','global')), - datatype varchar(20) - check (datatype in ('boolean','integer','real','string','file','uri','datetime','duration','text','other')), - initial_value varchar(4000), - role_id integer - constraint imsld_pro_rid_fk - references cr_items, --imsld_roles - existing_href varchar(2000), - uri varchar(2000) + property_id integer + constraint imsld_pro_id_fk + references cr_revisions + on delete cascade + constraint imsld_pro_id_pk + primary key, + component_id integer + constraint imsld_pro_comp_fk + references cr_items --imsld_components + not null, + identifier varchar(100) + not null, + type varchar(20) + check (type in ('loc','locpers','locrole','globpers','global')), + datatype varchar(20) + check (datatype in ('boolean','integer','real','string','file','uri','datetime','duration','text','other')), + initial_value varchar(4000), + role_id integer + constraint imsld_pro_rid_fk + references cr_items, --imsld_roles + existing_href varchar(2000), --the href of the existing properties + uri varchar(2000) --for global_definition elements: the uri ); 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 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)'; +The global definitions of the globpers and global property types are stored in this table also, because they share all but one fields.'; create table imsld_property_groups ( property_group_id integer @@ -297,9 +297,3 @@ --This then model consists in three types: show, hide (elements refered by ref_id and ref_type -- to know what table are we refering to) or change property value, with the respective reference to the property and value to be changed.'; - - - - - - Index: openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-create.sql 29 Mar 2006 15:55:24 -0000 1.1 +++ openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-create.sql 16 May 2006 09:24:35 -0000 1.2 @@ -7,43 +7,66 @@ -- @creation-date sept-2005 -- +create table imsld_runs ( + run_id integer + constraint imsld_run_fk + references acs_objects + on delete cascade + constraint imsld_run_pk + primary key, + imsld_id integer + constraint imsld_run_imsld_id_fk + references imsld_imslds + not null, + status varchar(15) +); + +create index imsld_run_imsld_idx on imsld_runs(imsld_id); + +comment on table imsld_runs is ' +This table holds the runs of a UoL as suggested in the specification. In this case a run is just an identifier mapped to the UoL, and the users, roles, properties and status will be mapped to the run_id, allowing multiple instances of the same UoL.'; + create table imsld_status_user ( - imsld_id integer - constraint imsld_stat_imsldid_fk - references imsld_imslds - not null, - play_id integer - constraint imsld_stat_pl_fk - references imsld_plays, - act_id integer - constraint imsld_stat_act_fk - references imsld_acts, - role_part_id integer - constraint imsld_stat_rp_fk - references imsld_role_parts, - related_id integer - constraint imsld_stat_aid_fk - references cr_revisions -- reference to a learning_activity OR support_activity OR - not null, -- activity_structure OR environment OR role_part OR act OR play - user_id integer - constraint imsld_stat_user_fk - references users - not null, - role_id integer - constraint imsld_stat_role_fk - references cr_revisions, -- imsld_roles (not implemented, add not null then) - type varchar(20) - check (type in ('learning','support','structure','act','role-part','play','method','resource')), - status_date timestamptz - default current_timestamp - not null, - status varchar(20) - check (status in ('started','finished')), + imsld_id integer + constraint imsld_stat_imsldid_fk + references imsld_imslds + not null, + run_id integer + constraint imsld_stat_rn_fk + references imsld_runs, + play_id integer + constraint imsld_stat_pl_fk + references imsld_plays, + act_id integer + constraint imsld_stat_act_fk + references imsld_acts, + role_part_id integer + constraint imsld_stat_rp_fk + references imsld_role_parts, + related_id integer + constraint imsld_stat_aid_fk + references cr_revisions -- reference to a learning_activity OR support_activity OR + not null, -- activity_structure OR environment OR role_part OR act OR play + user_id integer + constraint imsld_stat_user_fk + references users + not null, + role_id integer + constraint imsld_stat_role_fk + references cr_revisions, -- imsld_roles (not implemented, add not null then) + type varchar(20) + check (type in ('learning','support','structure','act','role-part','play','method','resource')), + status_date timestamptz + default current_timestamp + not null, + status varchar(20) + check (status in ('started','finished')), constraint imsld_status_un - unique (related_id,user_id,status) + unique (run_id,related_id,user_id,status) ); create index imsld_stat_imsld_idx on imsld_status_user(imsld_id); +create index imsld_stat_run_idx on imsld_status_user(run_id); create index imsld_stat_rp_idx on imsld_status_user(role_part_id); create index imsld_stat_comp_idx on imsld_status_user(related_id); create index imsld_stat_user_idx on imsld_status_user(user_id); @@ -54,23 +77,54 @@ create table imsld_property_instances ( instance_id integer - constraint imsld_pin_fk - references cr_revisions - on delete cascade constraint imsld_pin_pk primary key, property_id integer constraint imsld_pin_pro_fk - references imsld_properties --since this table will only be used during run time, and because - not null, --of performance issues, the reference is directly to the imsld_properties table + references imsld_properties -- since this table will only be used during run time, and because + not null, -- of performance issues, the reference is directly to the imsld_properties table. + identifier varchar(100) -- the same identifier that the corresponding propert (cache) + not null, party_id integer - references parties, --for the property of type loc, locpers, locrole orpst globpers + references parties, -- for the property of type loc, locpers, locrole orpst globpers + run_id integer + constraint imsld_pin_rn_fk + references imsld_runs, value varchar(4000) ); create index imsld_prop_pin_pro_idx on imsld_property_instances(property_id); create index imsld_prop_pin_party_idx on imsld_property_instances(party_id); +create index imsld_prop_pin_run_idx on imsld_property_instances(run_id); comment on table imsld_property_instances is ' This table holds the property instance values of the unit of learning. The property may refer to a role (role instance, which is a group) or a single user, using the party_id field.'; + +create table imsld_attribute_instances ( + instance_id integer + constraint imsld_attri_pk + primary key, + owner_id integer + constraint imsld_atri_own_fk + references cr_revisions, -- learning or support acctivity, item, play, learning object or service + type varchar(10) -- isvissible or class + check (type in ('isvisible','class')), + name varchar(100), -- for instance, for the class attribute we need to know the class name + run_id integer + constraint imsld_pin_rn_fk + references imsld_runs, + is_visible_p char(1) + check (is_visible_p in ('t','f')) +); + +create index imsld_attri_own_idx on imsld_attribute_instances(owner_id); +create index imsld_attri_run_idx on imsld_attribute_instances(run_id); + +comment on table imsld_attribute_instances is ' +This table holds the attribute instances for those attributes like isvisible or class (by the +moment only used to indicate if the activity, play or whatever is visible or not) +which scope is the current run. So every time a run is created, those attributes can be +initializated according to the initial parsed values from the manifest, not being affected +by a previous run.'; + Index: openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-drop.sql 29 Mar 2006 15:55:24 -0000 1.1 +++ openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-drop.sql 16 May 2006 09:24:35 -0000 1.2 @@ -5,5 +5,10 @@ -- @creation-date sept-2005 -- +drop table imsld_runs cascade; + drop table imsld_status_user cascade; +drop table imsld_property_instances cascade; + +drop table imsld_attribute_instances cascade; \ No newline at end of file Index: openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-package-create.sql 16 May 2006 09:24:35 -0000 1.1 @@ -0,0 +1,206 @@ +-- P/pgLSQL packages for the production deivery datamodel +-- +-- @author jopez@inv.it.uc3m.es +-- @creation-date Abr 2006 + +select acs_object_type__create_type ( + 'imsld_run', --object type + 'IMS-LD Run', --pretty name + 'IMS-LD Runss', --pretty prural + 'acs_object', --supertype + 'imsld_runs', --table_name + 'run_id', --id_column + null, --package_name + 'f', --abstract_p + null, --type_extension_table + null --name_method +); + +insert into acs_object_type_tables + (object_type, table_name, id_column) + values + ('imsld_run', 'imsld_runs', 'run_id'); + +select acs_attribute__create_attribute ( + 'imsld_run', --object_type + 'imsld_id', --oattribute_name + 'integer', --datatype + 'IMS-LD id', --pretty_name + 'IMS-LD ids', --pretty_plural + 'imsld_runs', --table_name + 'imsld_id', --column_name + null, --default_value + 1, --min_n_values + 1, --max_n_values + null, --sort_order + 'type_specific', --storage + 'f' --static_p +); + +select acs_attribute__create_attribute ( + 'imsld_run', --object_type + 'status', --oattribute_name + 'string', --datatype + 'Status', --pretty_name + 'Status', --pretty_plural + 'imsld_runs', --table_name + 'status', --column_name + null, --default_value + 1, --min_n_values + 1, --max_n_values + null, --sort_order + 'type_specific', --storage + 'f' --static_p +); + +select define_function_args('imsld_run__new','run_id,imsld_id,status,object_type,creation_date,creatrion_user,creation_ip,context_id,title'); +create or replace function imsld_run__new ( + integer, -- run_id + integer, -- imsld_id + varchar, -- status + varchar, -- object_type + timestamptz, -- creation_date + integer, -- creation_user + varchar, -- creation_ip + integer, -- context_id + varchar -- title +) +returns integer as ' +declare + p_run_id alias for $1; -- default null, + p_imsld_id alias for $2; + p_status alias for $3; + p_object_type alias for $4; -- default ''imsld_run'' + p_creation_date alias for $5; -- default now() + p_creation_user alias for $6; -- default null + p_creation_ip alias for $7; -- default null + p_context_id alias for $8; -- default null + p_title alias for $9; -- default null + + v_run_id integer; + v_object_type varchar; + +begin + if p_object_type is null then + v_object_type := ''imsld_run''; + else + v_object_type := p_object_type; + end if; + + -- Instantiate the ACS Object super type + v_run_id := acs_object__new( + p_run_id, + v_object_type, + p_creation_date, + p_creation_user, + p_creation_ip, + p_context_id, + ''t'', + p_title, + null + ); + + insert into imsld_runs (run_id, imsld_id, status) + values (v_run_id, p_imsld_id, p_status); + + return v_run_id; +end; +' language 'plpgsql'; + +create or replace function imsld_run__del (integer) +returns integer as ' +declare + p_run_id alias for $1; +begin + perform acs_object__delete(p_run_id); + + return 0; +end;' language 'plpgsql'; + +select define_function_args('imsld_property_instance__new','instance_id,property_id,identifier,party_id,run_id,value'); +create or replace function imsld_property_instance__new ( + integer, -- instance_id + integer, -- property_id + varchar, -- identifier + integer, -- party_id + integer, -- run_id + varchar -- value +) +returns integer as ' +declare + p_property_instance_id alias for $1; -- default null + p_property_id alias for $2; + p_identifier alias for $3; + p_party_id alias for $4; -- default null + p_run_id alias for $5; + p_value alias for $6; -- default '''' + + v_property_instance_id integer; + +begin + + select acs_object_id_seq.nextval + into v_property_instance_id from dual; + + insert into imsld_property_instances (instance_id, property_id, identifier, party_id, run_id, value) + values (v_property_instance_id, p_property_id, p_identifier, p_party_id, p_run_id, p_value); + + + return v_property_instance_id; +end; +' language 'plpgsql'; + +create or replace function imsld_property_instance__del (integer) +returns integer as ' +declare + p_property_instance_id alias for $1; +begin + delete from imsld_property_instances + where instance_id = p_property_instance_id; + + return 0; +end;' language 'plpgsql'; + +select define_function_args('imsld_attribute_instance__new','instance_id,owner_id,type,name,run_id,is_visible_p'); +create or replace function imsld_attribute_instance__new ( + integer, -- instance_id + integer, -- owner_id + varchar, -- type + varchar, -- name + integer, -- run_id + varchar -- is_visible_p +) +returns integer as ' +declare + p_instance_id alias for $1; -- default null + p_owner_id alias for $2; + p_type alias for $3; + p_name alias for $4; + p_run_id alias for $5; + p_is_visible_p alias for $6; + + v_attribute_instance_id integer; + +begin + + select acs_object_id_seq.nextval + into v_attribute_instance_id from dual; + + insert into imsld_attribute_instances (instance_id, owner_id, type, name, run_id, is_visible_p) + values (v_attribute_instance_id, p_owner_id, p_type, p_name, p_run_id, p_is_visible_p); + + return v_attribute_instance_id; +end; +' language 'plpgsql'; + +create or replace function imsld_attribute_instance__del (integer) +returns integer as ' +declare + p_instance_id alias for $1; +begin + delete from imsld_attribute_instances + where instance_id = p_instance_id; + + return 0; +end;' language 'plpgsql'; + Index: openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/sql/postgresql/imsld-production-delivery-package-drop.sql 16 May 2006 09:24:35 -0000 1.1 @@ -0,0 +1,28 @@ +-- P/pgLSQL packages for the production deivery datamodel +-- +-- @author jopez@inv.it.uc3m.es +-- @creation-date May 2006 + +delete from acs_objects where object_type = 'imsld_run'; + +select acs_object_type__drop_type('imsld_run','f'); + +delete from acs_rels where rel_type = 'imsld_run_users_group_rel'; + +select acs_rel_type__drop_type('imsld_run_users_group_rel','t'); + +select acs_object_type__drop_type('imsld_run_users_group_rel','f'); + +drop function imsld_run__new (integer, integer, varchar, varchar, timestamptz, integer, varchar, integer, varchar); + +drop function imsld_run__del (integer); + +drop function imsld_property_instance__new (integer, integer, integer, integer, varchar); + +drop function imsld_property_instance__del (integer); + +drop function imsld_attribute_instance__new (integer, integer, varchar, varchar, integer, varchar); + +drop function imsld_attribute_instance__del (integer); + + Index: openacs-4/packages/imsld/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/apm-callback-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/imsld/tcl/apm-callback-procs.tcl 30 Mar 2006 15:48:39 -0000 1.4 +++ openacs-4/packages/imsld/tcl/apm-callback-procs.tcl 16 May 2006 09:24:35 -0000 1.5 @@ -23,8 +23,8 @@ imsld::install::create_group_types - # create default relationships with non IMSLD objects - imsld::install::init_rels2 + # create default relationships with non IMS-LD objects + imsld::install::init_ext_rels return 1 } @@ -35,6 +35,7 @@ } { # clean rels imsld::uninstall::delete_rels + imsld::uninstall::delete_ext_rels # clean the cr imsld::uninstall::empty_content_repository 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.21 -r1.22 --- openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 4 Apr 2006 17:07:59 -0000 1.21 +++ openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 16 May 2006 09:24:35 -0000 1.22 @@ -339,30 +339,41 @@ ### IMS-LD Production and Delivery - # properties instances - content::type::new -content_type imsld_property_instance -supertype content_revision -pretty_name "#imsld.Property_Instance#" -pretty_plural "#imsld.Property_Instances#" -table_name imsld_property_instances -id_column instance_id +# # properties instances +# content::type::new -content_type imsld_property_instance -supertype content_revision -pretty_name "#imsld.Property_Instance#" -pretty_plural "#imsld.Property_Instances#" -table_name imsld_property_instances -id_column instance_id - content::type::attribute::new -content_type imsld_property_instance -attribute_name property_id -datatype number -pretty_name "#imsld.Property_Identifier# " -column_spec "integer" - content::type::attribute::new -content_type imsld_property_instance -attribute_name party_id -datatype number -pretty_name "#imsld.Party_Identifier#" -column_spec "integer" - content::type::attribute::new -content_type imsld_property_instance -attribute_name value -datatype string -pretty_name "#imsld.Value#" -column_spec "varchar(4000)" +# content::type::attribute::new -content_type imsld_property_instance -attribute_name property_id -datatype number -pretty_name "#imsld.Property_Identifier# " -column_spec "integer" +# content::type::attribute::new -content_type imsld_property_instance -attribute_name party_id -datatype number -pretty_name "#imsld.Party_Identifier#" -column_spec "integer" +# content::type::attribute::new -content_type imsld_property_instance -attribute_name value -datatype string -pretty_name "#imsld.Value#" -column_spec "varchar(4000)" } + ad_proc -public imsld::install::create_group_types { } { - create groups needed to manage imsld-roles + create groups needed to manage imsld functionallity } { - group_type::new -group_type imsld_role_group -supertype group "Role defined by IMS-LD" "Roles defined by IMS-LD" - + group_type::new -group_type imsld_role_group -supertype group "Role defined by IMS-LD" "Roles defined by IMS-LD" + + # the table name for the new group is badly taken from the group_type, that's why we named it imsld_run_users_group + group_type::new -group_type imsld_run_users_group -supertype group "IMS-LD Run Group" "IMS-LD Run Groups" + attribute::add -min_n_values 0 -max_n_values 0 imsld_run_users_group integer "run_id" "Run ids" + # FIX ME (there is no way to add attributes to the rels without creating the whole plsql code) + package_recreate_hierarchy imsld_run_users_group } -ad_proc -public imsld::install::init_rels2 { +ad_proc -public imsld::install::init_ext_rels { } { create default rels between imsld items and acs objects } { # ims-ld roles - oacs groups rel_types::new imsld_role_group_rel "ims-ld role - imsld_role_group" "ims-ld roles - imsld_role_groups" \ content_item 0 {} \ imsld_role_group 0 {} + + # ims-ld run - oacs users + rel_types::new imsld_run_users_group_rel "ims_ld_run_group - acs_users" "ims_ld_run_group - acs_users" \ + imsld_run_users_group 0 {} \ + party 0 {} } @@ -553,6 +564,14 @@ imsld::rel_type_delete -rel_type imsld_on_comp_change_pv_rel } +ad_proc -public imsld::uninstall::delete_ext_rels { +} { + Delete default rels between imsld and non IMS-LD objects +} { + imsld::rel_type_delete -rel_type imsld_role_group_rel + imsld::rel_type_delete -rel_type imsld_res_files_rel +} + ad_proc -public imsld::uninstall::empty_content_repository { } { Deletes content types and attributes @@ -606,11 +625,6 @@ content::type::attribute::delete -content_type imsld_when_condition_true -attribute_name role_id content::type::attribute::delete -content_type imsld_when_condition_true -attribute_name expression_id - # exressions, conditions and calculate - content::type::attribute::delete -content_type imsld_expression -attribute_name imsld_id - content::type::attribute::delete -content_type imsld_expression -attribute_name xml_piece - - # # conditions # content::type::attribute::delete -content_type imsld_condition -attribute_name method_id # content::type::attribute::delete -content_type imsld_condition -attribute_name if_id @@ -814,6 +828,14 @@ content::type::attribute::delete -content_type imsld_cp_file -attribute_name file_name content::type::attribute::delete -content_type imsld_cp_file -attribute_name href + ### IMS-LD Production and Delivery + + # imsld runs attributes + foreach attribute_list [package_object_attribute_list imsld_run] { + set attribute_id [lindex $attribute_list 0] + attribute::delete $attribute_id + } + ### Content Types ### IMS-LD Level B Index: openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl 16 May 2006 09:24:35 -0000 1.1 @@ -0,0 +1,476 @@ +# /packages/imsld/tcl/imsld-instance-procs.tcl + +ad_library { + Procedures in the imsld::instance namespace. + + @creation-date Abr 2006 + @author jopez@inv.it.uc3m.es + @cvs-id $Id: imsld-instance-procs.tcl,v 1.1 2006/05/16 09:24:35 josee Exp $ +} + +namespace eval imsld {} +namespace eval imsld::instance {} + +ad_proc -public imsld::instance::instantiate_imsld { + -imsld_id:required + {-community_id ""} +} { + @param imsld_id the imsld_id to instantiate + @option community_id the community to which the imsld will be instantiated into + + @return the run_id created + + Instantiates an imsld, i.e. creates the run. + If community_id is given, the run is created for that community (the users associated to the run are the users of the community) +} { + # 1. create the run + set run_id [package_exec_plsql -var_list [list [list run_id ""] [list imsld_id $imsld_id] [list status "active"]] imsld_run new] + + # 2. create the run group + set group_run_id [package_instantiate_object -creation_user [ad_conn user_id] -creation_ip [ad_conn peeraddr] -package_name imsld_run_users_group -start_with "group" -var_list [list [list group_id ""] [list group_name "IMS-LD Run Group ($run_id)"] [list run_id $run_id]] imsld_run_users_group] + + # 3. if community_id is not empty, assign the community users to the run + if { ![string eq $community_id ""] } { + foreach user [dotlrn_community::list_users $community_id] { + set user_id [ns_set get $user user_id] + relation_add imsld_run_users_group_rel $group_run_id $user_id + } + } + imsld::instance::instantiate_properties -run_id $run_id + imsld::instance::instantiate_activity_attributes -run_id $run_id + return $run_id +} + +ad_proc -public imsld::instance::instantiate_properties { + -run_id:required +} { + @param run_id The run_id we are instantiating + + Instantiates the properties for a given run_id. +} { + # There are 5 property types + # 1. loc-proerty: same value for every user in the run + # 2. locpers-property: different value for every user in the run + # 3. locrole-property: same value for every user in the same rol during the run + # 4. globpers-property: different value for every user (run and ims-ld independent) + # 5. glob-property: one value independent from the run, ims-ld, user or role + + db_1row context_info { + select ic.item_id as component_item_id, + ii.imsld_id, + rug.group_id as run_group_id + from imsld_componentsi ic, imsld_imsldsi ii, imsld_runs ir, imsld_run_users_group_ext rug + where ic.imsld_id = ii.item_id + and content_revision__is_live(ii.imsld_id) = 't' + and ii.imsld_id = ir.imsld_id + and rug.run_id = ir.run_id + and ir.run_id = :run_id + } + + # 1. loc-property: We create only one entry in the imsld_property_instances table for each property of this type + db_foreach loc_property { + select property_id, + identifier, + datatype, + initial_value + from imsld_properties + where component_id = :component_item_id + and type = 'loc' + } { + if { ![db_0or1row loc_already_instantiated_p { + select 1 + from imsld_property_instances + where property_id = :property_id + and run_id = :run_id + }] } { + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list property_id $property_id] [list identifier $identifier] [list party_id ""] [list run_id $run_id] [list value $initial_value]] imsld_property_instance new] + } + } + + # 2. locpers-property: Instantiate the property for each user assigned to the run + foreach property_list [db_list_of_lists locpers_property { + select property_id, + identifier, + datatype, + initial_value + from imsld_properties + where component_id = :component_item_id + and type = 'locpers' + }] { + set property_id [lindex $property_list 0] + set identifier [lindex $property_list 1] + set datatype [lindex $property_list 2] + set initial_value [lindex $property_list 3] + db_foreach user_in_run { + select ar.object_id_two as party_id + from acs_rels ar + where ar.object_id_one = :run_group_id + and ar.rel_type = 'imsld_run_users_group_rel' + } { + if { ![db_0or1row locrole_already_instantiated_p { + select 1 + from imsld_property_instances + where property_id = :property_id + and party_id = :party_id + and run_id = :run_id + }] } { + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list property_id $property_id] [list identifier $identifier] [list party_id $party_id] [list run_id $run_id] [list value $initial_value]] imsld_property_instance new] + } + } + } + + # 3. locrole-property: Instantiate the property for each role associated to the run +# db_foreach locrole_property { +# select property_id, +# identifier, +# datatype, +# initial_value +# from imsld_properties +# where component_id = :component_item_id +# and type = 'locrole' +# } { +# db_foreach roles_in_run { +# select role_id as party_id from roles where run_id = :run_id ???? +# } { +# set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list property_id $property_id] [list identifier $identifier] [list party_id $party_id] [list run_id $run_id] [list value $initial_value]] imsld_property_instance new] +# } +# } + + # 4. globpers-property: Special case. The table imsld_property_instances must hold only one entrance for these properties. + # Besides, if existng href exists, the value of the property is taken from the URI. Otherwise, if + # global definition is not empty, then the property is defined. + # The global definition is stored in the same row of the property_id, so the initial_value of + # the global_definition is in fact the initial_value of the property + foreach property_list [db_list_of_lists globpers_property { + select property_id, + identifier, + datatype, + initial_value, + existing_href, + uri + from imsld_properties + where component_id = :component_item_id + and type = 'globpers' + }] { + set property_id [lindex $property_list 0] + set identifier [lindex $property_list 1] + set datatype [lindex $property_list 2] + set initial_value [lindex $property_list 3] + set existing_href [lindex $property_list 4] + set uri [lindex $property_list 5] + db_foreach user_in_run { + select ar.object_id_two as party_id + from acs_rels ar + where ar.object_id_one = :run_group_id + and ar.rel_type = 'imsld_run_users_group_rel' + } { + if { ![db_0or1row already_instantiated_p { + select 1 + from imsld_property_instances + where identifier = :identifier + and party_id = :party_id + }] } { + # not instantiated... is it already defined (existing href)? or must we use the one of the global definition? + if { ![string eq $existing_href ""] } { + # it is already defined + # NOTE: there must be a better way to deal with this, but by the moment we treat the href as the property value + set initial_value $existing_href + } + # TODO: the property must be somehow instantiated in the given URI also + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list property_id $property_id] [list identifier $identifier] [list party_id $party_id] [list run_id $run_id] [list value $initial_value]] imsld_property_instance new] + } + } + } + + # 5. glob-property: Special case, just like the one above but with the difference that the checking + # is not done for all the users + db_foreach global_property { + select property_id, + identifier, + datatype, + initial_value, + existing_href, + uri + from imsld_properties + where component_id = :component_item_id + and type = 'global' + } { + if { ![db_0or1row already_instantiated_p { + select 1 + from imsld_property_instances + where identifier = :identifier + }] } { + # not instantiated... is it already defined (existing href)? or must we use the one of the global definition? + if { ![string eq $existing_href ""] } { + # it is already defined + # NOTE: there must be a better way to deal with this, but by the moment we treat the href as the property value + set initial_value $existing_href + } + # TODO: the property must be somehow instantiated in the given URI also + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list property_id $property_id] [list identifier $identifier] [list party_id ""] [list run_id $run_id] [list value $initial_value]] imsld_property_instance new] + } + } + + return +} + +ad_proc -public imsld::instance::instantiate_activity_attributes { + -run_id:required +} { + @param run_id The run_id we are instantiating + + There are some attributes (like isvisible or the class global attributes) which are not properties but + have to be instantiated because the context of those attributes is the context of the run. So anytime a run + is created, those attributes must be initialized according to the values parsed from the manifest, and not + from the possible changed values of a previous run. +} { + db_1row context_info { + + select ic.item_id as component_item_id, + ii.imsld_id, + ii.learning_objective_id as imsld_learning_objective_id, + ii.prerequisite_id as imsld_prerequisite_id, + ii.item_id as run_imsld_item_id, + rug.group_id as run_group_id + from imsld_componentsi ic, imsld_imsldsi ii, imsld_runs ir, imsld_run_users_group_ext rug + where ic.imsld_id = ii.item_id + and content_revision__is_live(ii.imsld_id) = 't' + and ii.imsld_id = ir.imsld_id + and rug.run_id = ir.run_id + and ir.run_id = :run_id + } + + # 1.1. items --> learning objectives, prerequisites, roles, learning objects, activity description, information(activity structures) + + # 1.1.1 learning objectives items + set linear_item_list [db_list item_in_imsld_loi { + select ii.imsld_item_id + from acs_rels ar, imsld_itemsi ii, imsld_learning_objectivesi lo + where ar.object_id_one = lo.item_id + and ar.object_id_two = ii.item_id + and lo.learning_objective_id = :imsld_learning_objective_id + }] + + set linear_item_list [concat $linear_item_list [db_list item_in_activity_loi { + select ii.imsld_item_id + from acs_rels ar, imsld_itemsi ii, imsld_learning_activities ia, imsld_learning_objectivesi lo + where ar.object_id_one = lo.item_id + and ar.object_id_two = ii.item_id + and ia.learning_objective_id = lo.item_id + and ia.component_id = :component_item_id + }]] + + # 1.1.2. prerequisites + set linear_item_list [concat $linear_item_list [db_list item_in_imsld_pre { + select ii.imsld_item_id + from acs_rels ar, imsld_itemsi ii, imsld_prerequisitesi pre + where ar.object_id_one = pre.item_id + and ar.object_id_two = ii.item_id + and pre.prerequisite_id = :imsld_prerequisite_id + }]] + + set linear_item_list [concat $linear_item_list [db_list item_in_activity_pre { + select ii.imsld_item_id + from acs_rels ar, imsld_itemsi ii, imsld_learning_activities ia, imsld_prerequisitesi pre + where ar.object_id_one = pre.item_id + and ar.object_id_two = ii.item_id + and ia.prerequisite_id = pre.item_id + and ia.component_id = :component_item_id + }]] + + # 1.1.3. roles + set linear_item_list [concat $linear_item_list [db_list item_in_role { + select ii.imsld_item_id + from acs_rels ar, imsld_itemsi ii, imsld_rolesi ir + where ar.object_id_one = ir.item_id + and ar.object_id_two = ii.item_id + and ir.component_id = :component_item_id + }]] + + # 1.1.4. learning objects + set linear_item_list [concat $linear_item_list [db_list item_in_lo { + select ii.imsld_item_id + from acs_rels ar, imsld_itemsi ii, imsld_learning_objectsi lo, imsld_environmentsi env + where ar.object_id_one = lo.item_id + and ar.object_id_two = ii.item_id + and lo.environment_id = env.item_id + and env.component_id = :component_item_id + }]] + + # 1.1.5. activity description (learning activities) + set linear_item_list [concat $linear_item_list [db_list item_in_la_desc { + select ii.imsld_item_id + from acs_rels ar, imsld_itemsi ii, imsld_learning_activitiesi la, imsld_activity_descsi ad + where ar.object_id_one = ad.item_id + and ar.object_id_two = ii.item_id + and la.activity_description_id = ad.item_id + and la.component_id = :component_item_id + }]] + + # 1.1.5. activity description (support activities) + set linear_item_list [concat $linear_item_list [db_list item_in_sa_desc { + select ii.imsld_item_id + from acs_rels ar, imsld_itemsi ii, imsld_support_activitiesi sa, imsld_activity_descsi ad + where ar.object_id_one = ad.item_id + and ar.object_id_two = ii.item_id + and sa.activity_description_id = ad.item_id + and sa.component_id = :component_item_id + }]] + + # 1.1.6. information(activity structures) + set linear_item_list [concat $linear_item_list [db_list item_in_as_info { + select ii.imsld_item_id + from acs_rels ar, imsld_itemsi ii, imsld_activity_structuresi ast + where ar.object_id_one = ast.item_id + and ar.object_id_two = ii.item_id + and ast.component_id = :component_item_id + }]] + + foreach imsld_item_id $linear_item_list { + db_foreach nested_associated_items { + select ii.imsld_item_id, ii.item_id, + coalesce(ii.is_visible_p, 't') as is_visible_p + from imsld_itemsi ii + where (imsld_tree_sortkey between tree_left((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) + and tree_right((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) + or ii.imsld_item_id = :imsld_item_id) + } { + if { ![db_0or1row already_instantiated_p { + select 1 + from imsld_attribute_instances + where owner_id = :imsld_item_id + and run_id = :run_id + and type = 'isvisible' + }] } { + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $imsld_item_id] [list type "isvisible"] [list name ""] [list run_id $run_id] [list is_visible_p $is_visible_p]] imsld_attribute_instance new] + } + } + } + + # 1.2. learning activities + db_foreach learning_activity { + select la.activity_id, + coalesce(la.is_visible_p, 't') as is_visible_p + from imsld_learning_activities la + where la.component_id = :component_item_id + } { + if { ![db_0or1row already_instantiated_p { + select 1 + from imsld_attribute_instances + where owner_id = :activity_id + and run_id = :run_id + and type = 'isvisible' + }] } { + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $activity_id] [list type "isvisible"] [list name ""] [list run_id $run_id] [list is_visible_p $is_visible_p]] imsld_attribute_instance new] + } + } + + # 1.3. support activities + db_foreach support_activity { + select sa.activity_id, + coalesce(sa.is_visible_p, 't') as is_visible_p + from imsld_support_activities sa + where sa.component_id = :component_item_id + } { + if { ![db_0or1row already_instantiated_p { + select 1 + from imsld_attribute_instances + where owner_id = :activity_id + and run_id = :run_id + and type = 'isvisible' + }] } { + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $activity_id] [list type "isvisible"] [list name ""] [list run_id $run_id] [list is_visible_p $is_visible_p]] imsld_attribute_instance new] + } + } + + # 1.4. learning object (environment) + db_foreach learning_object { + select lo.learning_object_id, + coalesce(lo.is_visible_p, 't') as is_visible_p, + class + from imsld_learning_objects lo, imsld_environmentsi env + where lo.environment_id = env.item_id + and env.component_id = :component_item_id + } { + if { ![db_0or1row already_instantiated_p { + select 1 + from imsld_attribute_instances + where owner_id = :learning_object_id + and run_id = :run_id + and type = 'isvisible' + }] } { + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $learning_object_id] [list type "isvisible"] [list name ""] [list run_id $run_id] [list is_visible_p $is_visible_p]] imsld_attribute_instance new] + } + if { ![string eq "" $class] && ![db_0or1row already_instantiated_p { + select 1 + from imsld_attribute_instances + where run_id = :run_id + and type = 'class' + and name = :class + }] } { + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id ""] [list type "class"] [list name $class] [list run_id $run_id] [list is_visible_p "t"]] imsld_attribute_instance new] + } + } + + # 1.5. service (enviroment) + db_foreach service { + select serv.service_id, + coalesce(serv.is_visible_p, 't') as is_visible_p, + class + from imsld_services serv, imsld_environmentsi env + where serv.environment_id = env.item_id + and env.component_id = :component_item_id + } { + if { ![db_0or1row already_instantiated_p { + select 1 + from imsld_attribute_instances + where owner_id = :service_id + and run_id = :run_id + and type = 'isvisible' + }] } { + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $service_id] [list type "isvisible"] [list name ""] [list run_id $run_id] [list is_visible_p $is_visible_p]] imsld_attribute_instance new] + } + if { ![string eq "" $class] && ![db_0or1row already_instantiated_p { + select 1 + from imsld_attribute_instances + where run_id = :run_id + and type = 'class' + and name = :class + }] } { + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id ""] [list type "class"] [list name $class] [list run_id $run_id] [list is_visible_p "t"]] imsld_attribute_instance new] + } + } + + # 1.6. play + db_foreach play { + select play.play_id, + coalesce(play.is_visible_p, 't') as is_visible_p + from imsld_plays play, imsld_methodsi im + where play.method_id = im.item_id + and im.imsld_id = :run_imsld_item_id + } { + if { ![db_0or1row already_instantiated_p { + select 1 + from imsld_attribute_instances + where owner_id = :play_id + and run_id = :run_id + and type = 'isvisible' + }] } { + set instance_id [package_exec_plsql -var_list [list [list instance_id ""] [list owner_id $play_id] [list type "isvisible"] [list name ""] [list run_id $run_id] [list is_visible_p $is_visible_p]] imsld_attribute_instance new] + } + } + + return +} + +ad_proc -public imsld::instance::delete_imsld_instance { + -run_id:required +} { + @param run_id the run_id to delete + + @return 1 if successful, 0 otherwise + +} { + return [package_exec_plsql -var_list [list [list run_id $run_id]] imsld_run del] +} + 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.61 -r1.62 --- openacs-4/packages/imsld/tcl/imsld-procs.tcl 24 Apr 2006 11:08:16 -0000 1.61 +++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 16 May 2006 09:24:35 -0000 1.62 @@ -174,6 +174,7 @@ and app.member_state = 'approved' } { imsld::mark_method_finished -imsld_id $imsld_id \ + -run_id $run_id \ -method_id $method_id \ -user_id $user_id } @@ -215,6 +216,7 @@ and app.member_state = 'approved' } { imsld::mark_play_finished -imsld_id $imsld_id \ + -run_id $run_id \ -play_id $play_id \ -user_id $user_id } @@ -259,6 +261,7 @@ and app.member_state = 'approved' } { imsld::mark_act_finished -imsld_id $imsld_id \ + -run_id $run_id \ -play_id $play_id \ -act_id $act_id \ -user_id $user_id @@ -313,6 +316,7 @@ and app.member_state = 'approved' } { imsld::finish_component_element -imsld_id $imsld_id \ + -run_id $run_id \ -play_id $play_id \ -act_id $act_id \ -role_part_id $role_part_id \ @@ -371,6 +375,7 @@ and app.member_state = 'approved' } { imsld::finish_component_element -imsld_id $imsld_id \ + -run_id $run_id \ -play_id $play_id \ -act_id $act_id \ -role_part_id $role_part_id \ @@ -387,14 +392,15 @@ ad_proc -public imsld::mark_role_part_finished { -role_part_id:required -imsld_id:required + -run_id:required -play_id:required -act_id:required {-user_id ""} } { mark the role_part as finished, as well as all the referenced activities } { set user_id [expr { [string eq "" $user_id] ? [ad_conn user_id] : $user_id }] - if { [imsld::role_part_finished_p -role_part_id $role_part_id -user_id $user_id] } { + if { [imsld::role_part_finished_p -run_id $run_id -role_part_id $role_part_id -user_id $user_id] } { return } db_1row role_part_info { @@ -424,6 +430,7 @@ if { ![string eq $type "none"] } { imsld::finish_component_element -imsld_id $imsld_id \ + -run_id $run_id \ -play_id $play_id \ -act_id $act_id \ -role_part_id $role_part_id \ @@ -448,13 +455,14 @@ ad_proc -public imsld::mark_act_finished { -act_id:required -imsld_id:required + -run_id:required -play_id:required {-user_id ""} } { mark the act as finished, as well as all the referenced role_parts } { set user_id [expr { [string eq "" $user_id] ? [ad_conn user_id] : $user_id }] - if { [imsld::act_finished_p -act_id $act_id -user_id $user_id] } { + if { [imsld::act_finished_p -run_id $run_id -act_id $act_id -user_id $user_id] } { return } db_1row act_info { @@ -477,19 +485,21 @@ -act_id $act_id \ -play_id $play_id \ -imsld_id $imsld_id \ + -run_id $run_id \ -user_id $user_id } } ad_proc -public imsld::mark_play_finished { -play_id:required -imsld_id:required + -run_id:required {-user_id ""} } { mark the play as finished. In this case there's only need to mark the play finished and not doing anything with the referenced acts, role_parts, etc. } { set user_id [expr { [string eq "" $user_id] ? [ad_conn user_id] : $user_id }] - if { [imsld::play_finished_p -play_id $play_id -user_id $user_id] } { + if { [imsld::play_finished_p -run_id $run_id -play_id $play_id -user_id $user_id] } { return } db_dml insert_play { *SQL* } @@ -504,18 +514,20 @@ imsld::mark_act_finished -act_id $act_id \ -play_id $play_id \ -imsld_id $imsld_id \ + -run_id $run_id \ -user_id $user_id } } ad_proc -public imsld::mark_imsld_finished { -imsld_id:required + -run_id:required {-user_id ""} } { mark the unit of learning as finished } { set user_id [expr { [string eq "" $user_id] ? [ad_conn user_id] : $user_id }] - if { [imsld::imsld_finished_p -imsld_id $imsld_id -user_id $user_id] } { + if { [imsld::imsld_finished_p -imsld_id $imsld_id -run_id $run_id -user_id $user_id] } { return } db_dml insert_uol { *SQL* } @@ -530,19 +542,21 @@ set play_id [lindex $referenced_play 0] imsld::mark_play_finished -play_id $play_id \ -imsld_id $imsld_id \ + -run_id $run_id \ -user_id $user_id } } ad_proc -public imsld::mark_method_finished { -imsld_id:required + -run_id:required -method_id:required {-user_id ""} } { mark the method as finished } { set user_id [expr { [string eq "" $user_id] ? [ad_conn user_id] : $user_id }] - if { [imsld::method_finished_p -method_id $method_id -user_id $user_id] } { + if { [imsld::method_finished_p -run_id $run_id -method_id $method_id -user_id $user_id] } { return } db_dml insert_method { *SQL* } @@ -556,6 +570,7 @@ set play_id [lindex $referenced_play 0] imsld::mark_play_finished -play_id $play_id \ -imsld_id $imsld_id \ + -run_id $run_id \ -user_id $user_id } } @@ -671,6 +686,7 @@ ad_proc -public imsld::finish_component_element { -imsld_id + -run_id {-play_id ""} {-act_id ""} {-role_part_id ""} @@ -679,7 +695,8 @@ -code_call:boolean {-user_id ""} } { - @option imsld_id + @param imsld_id + @param run_id @option play_id @option act_id @option role_part_id @@ -696,7 +713,7 @@ if { !$code_call_p } { # get the url to parse it and get the info set url [ns_conn url] - regexp {finish-component-element-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([a-z]+).imsld$} $url match imsld_id play_id act_id role_part_id element_id type + regexp {finish-component-element-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([a-z]+).imsld$} $url match imsld_id run_id play_id act_id role_part_id element_id type } # now that we have the necessary info, mark the finished element completed and return db_dml insert_element_entry { *SQL* } @@ -756,6 +773,7 @@ # if { $scturcture_finished_p || (![string eq $number_to_select ""] && ($total_completed >= $number_to_select)) } {} if { $scturcture_finished_p } { imsld::finish_component_element -imsld_id $imsld_id \ + -run_id $run_id \ -role_part_id $role_part_id \ -element_id $structure_id \ -type structure \ @@ -771,9 +789,10 @@ # 2. let's see if the finished role_part triggers the ending of the act which references it. # 3. let's see if the finished act triggers the ending the play which references it # 4. let's see if the finished play triggers the ending of the method which references it. - if { [imsld::role_part_finished_p -role_part_id $role_part_id -user_id $user_id] && ![db_0or1row already_marked_p { *SQL* }] } { + if { [imsld::role_part_finished_p -run_id $run_id -role_part_id $role_part_id -user_id $user_id] && ![db_0or1row already_marked_p { *SQL* }] } { # case number 1 imsld::finish_component_element -imsld_id $imsld_id \ + -run_id $run_id \ -play_id $play_id \ -act_id $act_id \ -role_part_id $role_part_id \ @@ -812,7 +831,7 @@ and ar.rel_type = 'imsld_act_rp_completed_rel' and content_revision__is_live(rp.role_part_id) = 't' } { - if { ![imsld::role_part_finished_p -role_part_id $role_part_id -user_id $user_id] } { + if { ![imsld::role_part_finished_p -run_id $run_id -role_part_id $role_part_id -user_id $user_id] } { set completed_act_p 0 } } if_no_rows { @@ -827,7 +846,7 @@ where irp.act_id = :act_item_id and content_revision__is_live(irp.role_part_id) = 't' } { - if { ![imsld::role_part_finished_p -role_part_id $role_part_id -user_id $user_id] } { + if { ![imsld::role_part_finished_p -run_id $run_id -role_part_id $role_part_id -user_id $user_id] } { set completed_act_p 0 } } @@ -838,6 +857,7 @@ imsld::mark_act_finished -act_id $act_id \ -play_id $play_id \ -imsld_id $imsld_id \ + -run_id $run_id \ -user_id $user_id set completed_play_p 1 @@ -848,14 +868,15 @@ and ip.item_id = ia.play_id and content_revision__is_live(ia.act_id) = 't' } { - if { ![imsld::act_finished_p -act_id $act_id -user_id $user_id] } { + if { ![imsld::act_finished_p -run_id $run_id -act_id $act_id -user_id $user_id] } { set completed_play_p 0 } } if { $completed_play_p } { # case number 3 imsld::mark_play_finished -play_id $play_id \ -imsld_id $imsld_id \ + -run_id $run_id \ -user_id $user_id set completed_unit_of_learning_p 1 @@ -868,7 +889,7 @@ and ar.rel_type = 'imsld_mp_completed_rel' and content_revision__is_live(ip.play_id) = 't' } { - if { ![imsld::play_finished_p -play_id $play_id -user_id $user_id] } { + if { ![imsld::play_finished_p -run_id $run_id -play_id $play_id -user_id $user_id] } { set completed_unit_of_learning_p 0 } } if_no_rows { @@ -883,15 +904,15 @@ where ip.method_id = :method_item_id and content_revision__is_live(ip.play_id) = 't' } { - if { ![imsld::play_finished_p -play_id $play_id -user_id $user_id] } { + if { ![imsld::play_finished_p -run_id $run_id -play_id $play_id -user_id $user_id] } { set completed_unit_of_learning_p 0 } } } if { $completed_unit_of_learning_p } { # case number 4 - imsld::mark_imsld_finished -imsld_id $imsld_id -user_id $user_id + imsld::mark_imsld_finished -imsld_id $imsld_id -run_id $run_id -user_id $user_id } } } @@ -901,14 +922,15 @@ set imsld_package_id [site_node_apm_integration::get_child_package_id \ -package_id [dotlrn_community::get_package_id $community_id] \ -package_key "[imsld::package_key]"] - ad_returnredirect "[export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]/imsld-tree" -url { imsld_id }]" + ad_returnredirect "[export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]/imsld-tree" -url { run_id }]" } } ad_proc -public imsld::structure_next_activity { -activity_structure_id:required {-environment_list ""} -imsld_id + -run_id -role_part_id {-structures_info ""} } { @@ -921,10 +943,14 @@ # mark structure started if { ![db_0or1row already_marked { select 1 from imsld_status_user - where imsld_id = :imsld_id and user_id = :user_id and related_id = :activity_structure_id and status = 'started' + where run_id = :run_id + and user_id = :user_id + and related_id = :activity_structure_id + and status = 'started' }] } { db_dml mark_structure_started { insert into imsld_status_user (imsld_id, + run_id, role_part_id, related_id, user_id, @@ -933,13 +959,14 @@ status) ( select :imsld_id, + :run_id, :role_part_id, :activity_structure_id, :user_id, 'structure', now(), 'started' - where not exists (select 1 from imsld_status_user where imsld_id = :imsld_id and user_id = :user_id and related_id = :activity_structure_id and status = 'started') + where not exists (select 1 from imsld_status_user where run_id = :run_id and user_id = :user_id and related_id = :activity_structure_id and status = 'started') ) } @@ -1011,7 +1038,7 @@ } 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_info $structures_info] + set next_activity_list [imsld::structure_next_activity -activity_structure_id $next_activity_id -environment_list $environment_list -imsld_id $imsld_id -run_id $run_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]] @@ -1022,9 +1049,11 @@ ad_proc -public imsld::structure_finished_p { -structure_id:required + -run_id {-user_id ""} } { @param structure_id + @param run_id @option user_id @return 0 if the any activity referenced from the activity structure hasn't been finished. 1 otherwise @@ -1049,7 +1078,10 @@ # is the activity finished ? if { ![db_0or1row completed_p { select 1 from imsld_status_user - where related_id = content_item__get_live_revision(:object_id_two) and user_id = :user_id and status = 'finished' + where related_id = content_item__get_live_revision(:object_id_two) + and user_id = :user_id + and status = 'finished' + and run_id = :run_id }] } { set all_completed 0 } @@ -1065,11 +1097,14 @@ # is the activity finished ? if { ![db_0or1row completed_p { select 1 from imsld_status_user - where related_id = :structure_id and user_id = :user_id and status = 'finished' + where related_id = :structure_id + and user_id = :user_id + and status = 'finished' + and run_id = :run_id }] } { set all_completed 0 } - if { ![imsld::structure_finished_p -structure_id $structure_id -user_id $user_id] } { + if { ![imsld::structure_finished_p -run_id $run_id -structure_id $structure_id -user_id $user_id] } { set all_completed 0 } } @@ -1080,9 +1115,12 @@ ad_proc -public imsld::role_part_finished_p { -role_part_id:required + -run_id:required {-user_id ""} } { @param role_part_id Role Part identifier + @param run_id + @option user_id @return 0 if the role part hasn't been finished. 1 otherwise } { @@ -1114,6 +1152,7 @@ select count(*) from imsld_status_user where completed_id = content_item__get_live_revision(:learning_activity_id) and user_id = :user_id + and run_id = :run_id }] } { return 1 } @@ -1123,6 +1162,7 @@ select count(*) from imsld_status_user where completed_id = content_item__get_live_revision(:support_activity_id) and user_id = :user_id + and run_id = :run_id }] } { return 1 } @@ -1133,7 +1173,7 @@ from imsld_activity_structuresi where item_id = :activity_structure_id } - return [imsld::structure_finished_p -structure_id $structure_id -user_id $user_id] + return [imsld::structure_finished_p -run_id $run_id -structure_id $structure_id -user_id $user_id] } none { return 1 @@ -1144,9 +1184,12 @@ ad_proc -public imsld::act_finished_p { -act_id:required + -run_id:required {-user_id ""} } { @param act_id + @param run_id + @oprion user_id @return 0 if the at hasn't been finished. 1 otherwise } { @@ -1156,9 +1199,12 @@ ad_proc -public imsld::play_finished_p { -play_id:required + -run_id:required {-user_id ""} } { @param play_id + @param run_id + @option user_id @return 0 if the play hasn't been finished. 1 otherwise } { @@ -1168,14 +1214,18 @@ from imsld_status_user where completed_id = :play_id and user_id = :user_id + and run_id = :run_id }] } ad_proc -public imsld::method_finished_p { -method_id:required + -run_id:required {-user_id ""} } { @param method_id + @param run_id + @oprion user_id @return 0 if the method hasn't been finished. 1 otherwise } { @@ -1185,14 +1235,18 @@ from imsld_status_user where completed_id = :method_id and user_id = :user_id + and run_id = :run_id }] } ad_proc -public imsld::imsld_finished_p { -imsld_id:required + -run_id:required {-user_id ""} } { @param imsld_id + @param run_id + @option user_id @return 0 if the imsld hasn't been finished. 1 otherwise } { @@ -1202,16 +1256,40 @@ from imsld_status_user where completed_id = :imsld_id and user_id = :user_id + and run_id = :run_id }] } +ad_proc -public imsld::class_visible_p { + -run_id:required + -owner_id:required + -class_name:required +} { + @param run_id + @param owner_id + @param class_name + + @return 1 if the class of the owner_id is currently visible in the run, 0 otherwise. +} { + return [expr ![db_0or1row class_visible_p { + select 1 + from imsld_attribute_instances + where run_id = :run_id + and type = 'class' + and name = :class_name + and is_visible_p = 'f' + }]] +} + ad_proc -public imsld::process_service_as_ul { -service_item_id:required + -run_id:required {-resource_mode "f"} -dom_node -dom_doc } { @param service_item_id + @param run_id @option resource_mode @param dom_node @param dom_doc @@ -1221,16 +1299,17 @@ set services_list [list] # get service info - db_1row service_info { + if { ![db_0or1row service_info { select serv.service_id, serv.identifier, - serv.class, - serv.is_visible_p, serv.service_type, serv.title as service_title - from imsld_servicesi serv + from imsld_servicesi serv where serv.item_id = :service_item_id and content_revision__is_live(serv.service_id) = 't' + }] } { + # not visible, return + return } switch $service_type { @@ -1263,6 +1342,7 @@ lappend resource_item_list $resource_item_id } imsld::process_resource_as_ul -resource_item_id $resource_item_id \ + -run_id $run_id \ -dom_node $dom_node \ -dom_doc $dom_doc @@ -1375,7 +1455,7 @@ } default { - ad_return_error "send-mail serivce not implemented yet" "Sorry, that service type ($service_type) hasn't been implemented yet. But be patience, we are working on it =)" + ad_return_error "[_ imsld.lt_Service_type_service_]" "[_ imsld.lt_Sorry_that_service_ty]" ad_script_abort } } @@ -1389,11 +1469,13 @@ ad_proc -public imsld::process_environment_as_ul { -environment_item_id:required + -run_id:required {-resource_mode "f"} -dom_node:required -dom_doc:required } { @param environment_item_id + @param run_id @option resource_mode @param dom_node @param dom_doc @@ -1423,16 +1505,25 @@ select item_id as learning_object_item_id, learning_object_id, identifier, - coalesce(title,identifier) as lo_title - from imsld_learning_objectsi + coalesce(title,identifier) as lo_title, + class + from imsld_learning_objectsi, imsld_attribute_instances attr where environment_id = :environment_item_id and content_revision__is_live(learning_object_id) = 't' + and attr.owner_id = learning_object_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' order by creation_date }] { 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] set lo_title [lindex $learning_objects_list 3] + set class_name [lindex $learning_objects_list 4] + if { ![imsld::class_visible_p -run_id $run_id -owner_id $learning_object_id -class_name $class_name] } { + continue + } # learning object item. get the files associated set linear_item_list [db_list_of_lists item_linear_list { select ii.imsld_item_id @@ -1448,7 +1539,7 @@ select cpr.resource_id, cr2.item_id as resource_item_id, cpr.type as resource_type - from imsld_cp_resources cpr, imsld_items ii, + from imsld_cp_resources cpr, imsld_items ii, imsld_attribute_instances attr, acs_rels ar, cr_items cr1, cr_items cr2 where ar.object_id_one = cr1.item_id and ar.object_id_two = cr2.item_id @@ -1457,6 +1548,10 @@ and (imsld_tree_sortkey between tree_left((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) and tree_right((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) or ii.imsld_item_id = :imsld_item_id) + and attr.owner_id = ii.imsld_item_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' }] { set resource_id [lindex $environments_list 0] set resource_item_id [lindex $environments_list 1] @@ -1465,6 +1560,7 @@ lappend resource_item_list $resource_item_id } set one_learning_object_list [imsld::process_resource_as_ul -resource_item_id $resource_item_id \ + -run_id $run_id \ -dom_node $environment_node \ -dom_doc $dom_doc \ -li_mode] @@ -1494,18 +1590,29 @@ item_id as service_item_id, identifier, service_type, - title as service_title - from imsld_servicesi + title as service_title, + class + from imsld_servicesi, imsld_attribute_instances attr where environment_id = :environment_item_id and content_revision__is_live(service_id) = 't' + and attr.owner_id = service_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' }] { set service_id [lindex $services_list 0] set service_item_id [lindex $services_list 1] set identifier [lindex $services_list 2] set service_type [lindex $services_list 3] set service_title [lindex $services_list 4] + set class_name [lindex $services_list 5] + if { ![imsld::class_visible_p -run_id $run_id -owner_id $service_id -class_name $class_name] } { + continue + } + set environment_services_list [concat $environment_services_list \ [list [imsld::process_service_as_ul -service_item_id $service_item_id \ + -run_id $run_id \ -resource_mode $resource_mode \ -dom_node $environment_node \ -dom_doc $dom_doc]]] @@ -1527,6 +1634,7 @@ and ar.rel_type = 'imsld_env_env_rel' }] { set one_nested_environment_list [imsld::process_environment_as_ul -environment_item_id $nested_environment_item_id \ + -run_id $run_id \ -resource_mode $resource_mode \ -dom_node $environment_node \ -dom_doc $dom_doc] @@ -1638,12 +1746,14 @@ } ad_proc -public imsld::process_learning_objective_as_ul { + -run_id:required {-imsld_item_id ""} {-activity_item_id ""} {-resource_mode "f"} -dom_node -dom_doc } { + @param run_id @option imsld_item_id @option activity_item_id @option resource_mode @@ -1696,20 +1806,25 @@ select cpr.resource_id, cpr.item_id as resource_item_id, cpr.type as resource_type - from imsld_cp_resourcesi cpr, imsld_itemsi ii, + from imsld_cp_resourcesi cpr, imsld_itemsi ii, imsld_attribute_instances attr, acs_rels ar where ar.object_id_one = ii.item_id and ar.object_id_two = cpr.item_id and content_revision__is_live(cpr.resource_id) = 't' and (imsld_tree_sortkey between tree_left((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) and tree_right((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) or ii.imsld_item_id = :imsld_item_id) + and attr.owner_id = ii.imsld_item_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' } { if { [string eq "t" $resource_mode] } { lappend resource_item_list $resource_item_id } # add the associated files as items of the html list imsld::process_resource_as_ul -resource_item_id $resource_item_id \ + -run_id $run_id \ -dom_doc $dom_doc \ -dom_node $dom_node } if_no_rows { @@ -1815,12 +1930,14 @@ } ad_proc -public imsld::process_prerequisite_as_ul { + -run_id:required {-imsld_item_id ""} {-activity_item_id ""} {-resource_mode "f"} -dom_node -dom_doc } { + @param run_id @option imsld_item_id @option activity_item_id @option resource_mode @@ -1873,20 +1990,25 @@ select cpr.resource_id, cpr.item_id as resource_item_id, cpr.type as resource_type - from imsld_cp_resourcesi cpr, imsld_itemsi ii, + from imsld_cp_resourcesi cpr, imsld_itemsi ii, imsld_attribute_instances attr, acs_rels ar where ar.object_id_one = ii.item_id and ar.object_id_two = cpr.item_id and content_revision__is_live(cpr.resource_id) = 't' and (imsld_tree_sortkey between tree_left((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) and tree_right((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) or ii.imsld_item_id = :imsld_item_id) + and attr.owner_id = ii.imsld_item_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' } { if { [string eq "t" $resource_mode] } { lappend resource_item_list $resource_item_id } # add the associated files as items of the html list set one_prerequisite_ul [imsld::process_resource_as_ul -resource_item_id $resource_item_id \ + -run_id $run_id \ -dom_doc $dom_doc \ -dom_node $dom_node] } if_no_rows { @@ -1991,10 +2113,12 @@ } ad_proc -public imsld::process_feedback_as_ul { + -run_id:required {-on_completion_item_id ""} -dom_node -dom_doc } { + @param run_id @option on_completion_item_id @param dom_node @param dom_doc @@ -2024,16 +2148,21 @@ select cpr.resource_id, cpr.item_id as resource_item_id, cpr.type as resource_type - from imsld_cp_resourcesi cpr, imsld_itemsi ii, + from imsld_cp_resourcesi cpr, imsld_itemsi ii, imsld_attribute_instances attr, acs_rels ar where ar.object_id_one = ii.item_id and ar.object_id_two = cpr.item_id and content_revision__is_live(cpr.resource_id) = 't' and (imsld_tree_sortkey between tree_left((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) and tree_right((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) or ii.imsld_item_id = :imsld_item_id) + and attr.owner_id = ii.imsld_item_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' } { imsld::process_resource_as_ul -resource_item_id $resource_item_id \ + -run_id $run_id \ -dom_node $dom_node \ -dom_doc $dom_doc } @@ -2100,12 +2229,14 @@ ad_proc -public imsld::process_resource_as_ul { -resource_item_id + -run_id {-community_id ""} -dom_node -dom_doc -li_mode:boolean } { @param resource_item_id + @param run_id @option community_id @param dom_node @param dom_doc @@ -2151,7 +2282,7 @@ set file_url [acs_sc::invoke -contract FtsContentProvider -operation url -impl $object_type -call_args [list $acs_object_id]] set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]imsld-finish-resource" {file_url $file_url resource_item_id $resource_item_id}]" + $a_node setAttribute href "[export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]imsld-finish-resource" {file_url $file_url resource_item_id $resource_item_id run_id $run_id}]" set img_node [$dom_doc createElement img] $img_node setAttribute src "[imsld::object_type_image_path -object_type $object_type]" $img_node setAttribute border "0" @@ -2197,7 +2328,7 @@ }] set file_url "[apm_package_url_from_id $fs_package_id]view/${file_url}" set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]imsld-finish-resource" {file_url $file_url resource_item_id $resource_item_id}]" + $a_node setAttribute href "[export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]imsld-finish-resource" {file_url $file_url resource_item_id $resource_item_id run_id $run_id}]" set img_node [$dom_doc createElement img] $img_node setAttribute src "[imsld::object_type_image_path -object_type file-storage]" $img_node setAttribute border "0" @@ -2221,7 +2352,7 @@ } { set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]imsld-finish-resource" { {file_url "[export_vars -base $url]"} resource_item_id}]" + $a_node setAttribute href "[export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]imsld-finish-resource" { {file_url "[export_vars -base $url]"} resource_item_id run_id}]" set img_node [$dom_doc createElement img] $img_node setAttribute src "[imsld::object_type_image_path -object_type url]" $img_node setAttribute border "0" @@ -2329,11 +2460,13 @@ ad_proc -public imsld::process_activity_as_ul { -activity_item_id:required + -run_id:required -dom_node:required -dom_doc {-resource_mode "f"} } { @param activity_item_id + @param run_id @option resource_mode default f @param dom_node @param dom_doc @@ -2353,13 +2486,15 @@ select 1 from imsld_learning_activitiesi where item_id = :activity_item_id }] } { imsld::process_learning_activity_as_ul -activity_item_id $activity_item_id \ + -run_id $run_id \ -resource_mode $resource_mode \ -dom_node $dom_node \ -dom_doc $dom_doc } elseif { [db_0or1row is_support { select 1 from imsld_support_activitiesi where item_id = :activity_item_id }] } { imsld::process_support_activity_as_ul -activity_item_id $activity_item_id \ + -run_id $run_id \ -resource_mode $resource_mode \ -dom_node $dom_node \ -dom_doc $dom_doc @@ -2368,6 +2503,7 @@ select 1 from imsld_activity_structuresi where item_id = :activity_item_id }] } { imsld::process_activity_structure_as_ul -structure_item_id $activity_item_id \ + -run_id $run_id \ -resource_mode $resource_mode \ -dom_node $dom_node \ -dom_doc $dom_doc @@ -2378,11 +2514,13 @@ ad_proc -public imsld::process_activity_environments_as_ul { -activity_item_id:required + -run_id:required {-resource_mode "f"} -dom_node -dom_doc } { @param activity_item_id + @param run_id @param rel_type @option resource_mode default f @param dom_node @@ -2422,18 +2560,21 @@ }] foreach environment_item_id $associated_environments_list { imsld::process_environment_as_ul -environment_item_id $environment_item_id \ + -run_id $run_id \ -dom_node $dom_node \ -dom_doc $dom_doc } } ad_proc -public imsld::process_imsld_as_ul { -imsld_item_id:required + -run_id:required {-resource_mode "f"} -dom_node -dom_doc } { @param imsld_item_id + @param run_id @option resource_mode default f @return The html list (using tdom) of the resources associated to the given imsld_id (objectives and prerequisites). @@ -2458,6 +2599,7 @@ # add the prerequisite files as items of the list set prerequisites_list [imsld::process_prerequisite_as_ul -imsld_item_id $imsld_item_id \ + -run_id $run_id \ -resource_mode $resource_mode \ -dom_node $prerequisites_node \ -dom_doc $dom_doc] @@ -2476,6 +2618,7 @@ # add the prerequisite files as items of the list set objectives_list [imsld::process_learning_objective_as_ul -imsld_item_id $imsld_item_id \ + -run_id $run_id \ -resource_mode $resource_mode \ -dom_node $objectives_node \ -dom_doc $dom_doc] @@ -2490,11 +2633,13 @@ ad_proc -public imsld::process_learning_activity_as_ul { -activity_item_id:required + -run_id:required {-resource_mode "f"} -dom_node -dom_doc } { @param activity_item_id + @param run_id @option resource_mode default f @param dom_node @param dom_doc @@ -2503,15 +2648,22 @@ @return The list (activity_name, list of associated urls, using tdom) of the activity in the IMS-LD. } { set user_id [ad_conn user_id] - db_1row activity_info { + if { ![db_0or1row activity_info { select on_completion_id as on_completion_item_id, prerequisite_id as prerequisite_item_id, learning_objective_id as learning_objective_item_id, activity_id, title as activity_title - from imsld_learning_activitiesi + from imsld_learning_activitiesi, imsld_attribute_instances attr where item_id = :activity_item_id and content_revision__is_live(activity_id) = 't' + and attr.owner_id = activity_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' + }] } { + # is visible is false, do not show anything + return } # get the items associated with the activity @@ -2539,14 +2691,18 @@ select cpr.resource_id, cpr.item_id as resource_item_id, cpr.type as resource_type - from imsld_cp_resourcesi cpr, imsld_itemsi ii, + from imsld_cp_resourcesi cpr, imsld_itemsi ii, imsld_attribute_instances attr, acs_rels ar where ar.object_id_one = ii.item_id and ar.object_id_two = cpr.item_id and content_revision__is_live(cpr.resource_id) = 't' and (imsld_tree_sortkey between tree_left((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) and tree_right((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) or ii.imsld_item_id = :imsld_item_id) + and attr.owner_id = ii.imsld_item_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' }] { set resource_id [lindex $la_items_list 0] set resource_item_id [lindex $la_items_list 1] @@ -2556,6 +2712,7 @@ } imsld::process_resource_as_ul -resource_item_id $resource_item_id \ + -run_id $run_id \ -dom_doc $dom_doc \ -dom_node $description_node @@ -2577,6 +2734,7 @@ # add the prerequisite files as items of the list set prerequisites_list [imsld::process_prerequisite_as_ul -activity_item_id $activity_item_id \ + -run_id $run_id \ -resource_mode $resource_mode \ -dom_node $prerequisites_node \ -dom_doc $dom_doc] @@ -2595,6 +2753,7 @@ # add the prerequisite files as items of the list set objectives_list [imsld::process_learning_objective_as_ul -activity_item_id $activity_item_id \ + -run_id $run_id \ -resource_mode $resource_mode \ -dom_node $objectives_node \ -dom_doc $dom_doc] @@ -2614,11 +2773,13 @@ from imsld_status_user where user_id = :user_id and related_id = :activity_id + and run_id = :run_id }] } { if { ![string eq "" $on_completion_item_id] } { # the feedback is not processed to ckeck if all the activity resources have been finished # so we don't need to store the result imsld::process_feedback_as_ul -on_completion_item_id $on_completion_item_id \ + -run_id $run_id \ -dom_doc $dom_doc \ -dom_node $feedback_node $dom_node appendChild $feedback_node @@ -2638,9 +2799,9 @@ foreach environment_item_id $associated_environments_list { if { [llength $environments_list] } { set environments_list [concat [list $environments_list] \ - [list [imsld::process_environment_as_ul -environment_item_id $environment_item_id -resource_mode $resource_mode]]] + [list [imsld::process_environment_as_ul -environment_item_id $environment_item_id -resource_mode $resource_mode -run_id $run_id]]] } else { - set environments_list [imsld::process_environment_as_ul -environment_item_id $environment_item_id -resource_mode $resource_mode] + set environments_list [imsld::process_environment_as_ul -environment_item_id $environment_item_id -resource_mode $resource_mode -run_id $run_id] } } @@ -2776,23 +2937,33 @@ ad_proc -public imsld::process_support_activity_as_ul { -activity_item_id:required + -run_id:required {-resource_mode "f"} -dom_node -dom_doc } { @param activity_item_id + @param run_id @option resource_mode @param dom_node @param dom_doc @return The list of items (resources, feedback, environments, using tdom) associated with the support activity } { - db_1row activity_info { + if { ![db_0or1row activity_info { select on_completion_id as on_completion_item_id, - activity_id - from imsld_support_activitiesi + activity_id, + attr.is_visible_p + from imsld_support_activitiesi, imsld_attribute_instances attr where item_id = :activity_item_id and content_revision__is_live(activity_id) = 't' + and attr.owner_id = activity_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' + }] } { + # is visible is false do not show anything + return } # get the items associated with the activity @@ -2819,14 +2990,18 @@ select cpr.resource_id, cpr.item_id as resource_item_id, cpr.type as resource_type - from imsld_cp_resourcesi cpr, imsld_itemsi ii, + from imsld_cp_resourcesi cpr, imsld_itemsi ii, imsld_attribute_instances attr, acs_rels ar where ar.object_id_one = ii.item_id and ar.object_id_two = cpr.item_id and content_revision__is_live(cpr.resource_id) = 't' and (imsld_tree_sortkey between tree_left((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) and tree_right((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) or ii.imsld_item_id = :imsld_item_id) + and attr.owner_id = ii.imsld_item_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' }] { set resource_id [lindex $sa_items_list 0] set resource_item_id [lindex $sa_items_list 1] @@ -2836,6 +3011,7 @@ } imsld::process_resource_as_ul -resource_item_id $resource_item_id \ + -run_id $run_id \ -dom_doc $dom_doc \ -dom_node $description_node @@ -2858,11 +3034,13 @@ from imsld_status_user where user_id = :user_id and related_id = :activity_id + and run_id = :run_id }] } { if { ![string eq "" $on_completion_item_id] } { # the feedback is not processed to ckeck if all the activity resources have been finished # so we don't need to store the result imsld::process_feedback_as_ul -on_completion_item_id $on_completion_item_id \ + -run_id $run_id \ -dom_doc $dom_doc \ -dom_node $feedback_node $dom_node appendChild $feedback_node @@ -2882,9 +3060,9 @@ foreach environment_item_id $associated_environments_list { if { [llength $environments_list] } { set environments_list [concat [list $environments_list] \ - [list [imsld::process_environment_as_ul -environment_item_id $environment_item_id -resource_mode $resource_mode]]] + [list [imsld::process_environment_as_ul -environment_item_id $environment_item_id -run_id $run_id -resource_mode $resource_mode]]] } else { - set environments_list [imsld::process_environment_as_ul -environment_item_id $environment_item_id -resource_mode $resource_mode] + set environments_list [imsld::process_environment_as_ul -environment_item_id $environment_item_id -run_id $run_id -resource_mode $resource_mode] } } @@ -3003,11 +3181,13 @@ ad_proc -public imsld::process_activity_structure_as_ul { -structure_item_id:required + -run_id:required {-resource_mode "f"} -dom_node -dom_doc } { @param structure_item_id + @param run_id @option resource_mode @param dom_node @param dom_doc @@ -3038,14 +3218,18 @@ select cpr.resource_id, cpr.item_id as resource_item_id, cpr.type as resource_type - from imsld_cp_resourcesi cpr, imsld_itemsi ii, + from imsld_cp_resourcesi cpr, imsld_itemsi ii, imsld_attribute_instances attr, acs_rels ar where ar.object_id_one = ii.item_id and ar.object_id_two = cpr.item_id and content_revision__is_live(cpr.resource_id) = 't' and (imsld_tree_sortkey between tree_left((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) and tree_right((select imsld_tree_sortkey from imsld_items where imsld_item_id = :imsld_item_id)) or ii.imsld_item_id = :imsld_item_id) + and attr.owner_id = ii.imsld_item_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' }] { set resource_id [lindex $la_items_list 0] set resource_item_id [lindex $la_items_list 1] @@ -3055,6 +3239,7 @@ } imsld::process_resource_as_ul -resource_item_id $resource_item_id \ + -run_id $run_id \ -dom_doc $dom_doc \ -dom_node $info_node } @@ -3095,6 +3280,7 @@ ad_proc -public imsld::generate_structure_activities_list { -imsld_id + -run_id -structure_item_id -user_id -role_part_id @@ -3105,6 +3291,7 @@ -dom_doc } { @param imsld_id + @param run_id @param structure_item_id @param user_id @param role_part_id @@ -3140,7 +3327,7 @@ $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id}]" + $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id}]" $a_node setAttribute target "content" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text @@ -3153,7 +3340,7 @@ set input_node [$dom_doc createElement input] $input_node setAttribute type "checkbox" $input_node setAttribute style "vertical-align: bottom;" - $input_node setAttribute onclick "window.location=\"finish-component-element-${imsld_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-learning.imsld\"" + $input_node setAttribute onclick "window.location=\"finish-component-element-${imsld_id}-${run_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-learning.imsld\"" $activity_node appendChild $input_node } else { set input_node [$dom_doc createElement input] @@ -3181,7 +3368,7 @@ set activity_node [$dom_doc createElement li] $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id}]" + $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id}]" $a_node setAttribute target "content" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text @@ -3194,7 +3381,7 @@ set input_node [$dom_doc createElement input] $input_node setAttribute type "checkbox" $input_node setAttribute style "vertical-align: bottom;" - $input_node setAttribute onclick "window.location=\"finish-component-element-${imsld_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-support.imsld\"" + $input_node setAttribute onclick "window.location=\"finish-component-element-${imsld_id}-${run_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-support.imsld\"" $activity_node appendChild $input_node } else { set input_node [$dom_doc createElement input] @@ -3222,13 +3409,14 @@ set structure_node [$dom_doc createElement li] $structure_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {{activity_id $structure_id}}]" + $a_node setAttribute href "[export_vars -base "activity-frame" -url {{activity_id $structure_id} run_id}]" $a_node setAttribute target "content" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $structure_node appendChild $a_node set nested_activities_list [imsld::generate_structure_activities_list -imsld_id $imsld_id \ + -run_id $run_id \ -structure_item_id $structure_item_id \ -user_id $user_id \ -next_activity_id_list $next_activity_id_list \ @@ -3251,17 +3439,22 @@ } ad_proc -public imsld::generate_activities_tree { - -imsld_id:required + -run_id:required -user_id {-next_activity_id_list ""} -dom_node -dom_doc } { - @param imsld_id + @param run_id @param user_id @return A list of lists of the activities } { + db_1row imsld_info { + select imsld_id + from imsld_runs + where run_id = :run_id + } # start with the role parts foreach role_part_list [db_list_of_lists referenced_role_parts { *SQL* }] { set type [lindex $role_part_list 0] @@ -3274,13 +3467,16 @@ # add the learning activity to the tree db_1row get_learning_activity_info { *SQL* } set completed_activity_p [db_0or1row already_completed { - select 1 from imsld_status_user where related_id = :activity_id and user_id = :user_id + select 1 from imsld_status_user + where related_id = :activity_id + and user_id = :user_id + and run_id = :run_id }] if { $completed_activity_p || [lsearch -exact $next_activity_id_list $activity_id] != -1 && ([string eq $complete_act_id ""] || [string eq $is_visible_p "t"]) } { set activity_node [$dom_doc createElement li] $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id}]" + $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id}]" $a_node setAttribute target "content" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text @@ -3293,7 +3489,7 @@ set input_node [$dom_doc createElement input] $input_node setAttribute type "checkbox" $input_node setAttribute style "vertical-align: bottom;" - $input_node setAttribute onclick "window.location=\"finish-component-element-${imsld_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-learning.imsld\"" + $input_node setAttribute onclick "window.location=\"finish-component-element-${imsld_id}-${run_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-learning.imsld\"" $activity_node appendChild $input_node } else { set input_node [$dom_doc createElement input] @@ -3310,13 +3506,16 @@ # add the support activity to the tree db_1row get_support_activity_info { *SQL* } set completed_activity_p [db_0or1row already_completed { - select 1 from imsld_status_user where related_id = :activity_id and user_id = :user_id + select 1 from imsld_status_user + where related_id = :activity_id + and user_id = :user_id + and run_id = :run_id }] if { $completed_activity_p || [lsearch -exact $next_activity_id_list $activity_id] != -1 && ([string eq $complete_act_id ""] || [string eq $is_visible_p "t"]) } { set activity_node [$dom_doc createElement li] $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id}]" + $a_node setAttribute href "[export_vars -base "activity-frame" -url {activity_id run_id}]" $a_node setAttribute target "content" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text @@ -3329,7 +3528,7 @@ set input_node [$dom_doc createElement input] $input_node setAttribute type "checkbox" $input_node setAttribute style "vertical-align: bottom;" - $input_node setAttribute onclick "window.location=\"finish-component-element-${imsld_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-support.imsld\"" + $input_node setAttribute onclick "window.location=\"finish-component-element-${imsld_id}-${run_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-support.imsld\"" $activity_node appendChild $input_node } else { set input_node [$dom_doc createElement input] @@ -3359,12 +3558,13 @@ set structure_node [$dom_doc createElement li] $structure_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - $a_node setAttribute href "[export_vars -base "activity-frame" -url {{activity_id $structure_id}}]" + $a_node setAttribute href "[export_vars -base "activity-frame" -url {{activity_id $structure_id} run_id}]" $a_node setAttribute target "content" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $structure_node appendChild $a_node set nested_list [imsld::generate_structure_activities_list -imsld_id $imsld_id \ + -run_id $run_id \ -structure_item_id $structure_item_id \ -user_id $user_id \ -next_activity_id_list $next_activity_id_list \ @@ -3382,421 +3582,22 @@ } } -ad_proc -public imsld::next_activity { - -imsld_item_id:required - {-user_id ""} - {-community_id ""} - -return_url - imsld_multirow -} { - @param imsld_item_id - @option user_id default [ad_conn user_id] - @option community_id - @param return_url url to return in the action links - - @return The list (activity_name, list of associated urls) of the next activity for the user in the IMS-LD. -} { - template::multirow create imsld_multirow prerequisites \ - objectives \ - environments \ - activities \ - feedbacks \ - status - - # environments - set environments_titles "" - set environments_files "" - - # variable which controls the number of tabs for the activity structures - set tab_structures 1 - - db_1row get_ismld_info { - select imsld_id - from imsld_imsldsi - where item_id = :imsld_item_id - and content_revision__is_live(imsld_id) = 't' - } - set user_id [expr { [string eq "" $user_id] ? [ad_conn user_id] : $user_id }] - - # global prerequisites and learning objectives - set prerequisites_list_temp [imsld::process_prerequisite -imsld_item_id $imsld_item_id -resource_mode "t"] - set prerequisites_list [list [lindex $prerequisites_list_temp 0] [lindex $prerequisites_list_temp 1]] - set prerequisites_list_ids [lindex $prerequisites_list_temp 2] - - set prerequisites "" - if { [llength $prerequisites_list] } { - set prerequisites "[lindex $prerequisites_list 0]" - append prerequisites "[join [lindex $prerequisites_list 1] " "]" - } - - set objectives_list_temp [imsld::process_learning_objective -imsld_item_id $imsld_item_id -resource_mode "t"] - set objectives_list [list [lindex $objectives_list_temp 0] [lindex $objectives_list_temp 1]] - set objectives_list_ids [lindex $objectives_list_temp 2] - - set objectives "" - if { [llength $objectives_list] } { - set objectives "[lindex $objectives_list 0]" - append objectives "[join [lindex $objectives_list 1] " "]" - } - if { [string length "${prerequisites}${objectives}"] } { - template::multirow append imsld_multirow $prerequisites $objectives {} {} {} {} - imsld::grant_permissions -resources_activities_list [join [list $prerequisites_list_ids $objectives_list_ids]] -user_id $user_id - } - - if { ![db_string get_last_entry { *SQL* }] } { - # special case: the user has no entry, the ims-ld hasn't started yet for that user - set first_p 1 - db_1row get_first_role_part { *SQL* } - } else { - # get the completed activities in order to display them - # save the last one (the last role_part_id of THE LAST completed activity) because we will use it latter - - # JOPEZ: needed to split the db_foreach from the body because of db pools - foreach marked_activity [db_list_of_lists marked_activity { *SQL* }] { - set related_id [lindex $marked_activity 0] - set role_part_id [lindex $marked_activity 1] - set type [lindex $marked_activity 2] - set sort_order [lindex $marked_activity 3] - set act_id [lindex $marked_activity 4] - set status [lindex $marked_activity 5] - # environments - set environment_list [list] - set environments "" - switch $type { - learning { - if { [string eq $status "finished"] } { - db_1row get_learning_activity_info { - select coalesce(title,identifier) as activity_title, - item_id as activity_item_id - from imsld_learning_activitiesi - where activity_id = :completed_id - } - set activities_list [imsld::process_learning_activity -activity_item_id $activity_item_id] - - set prerequisites "" - if { [llength [lindex $activities_list 0]] } { - set prerequisites "[lindex [lindex $activities_list 0] 0]
" - append prerequisites "[join [lindex [lindex $activities_list 0] 1] " "]" - } - set objectives "" - if { [llength [lindex $activities_list 1]] } { - set objectives "[lindex [lindex $activities_list 1] 0]
" - append objectives "[join [lindex [lindex $activities_list 1] 1] " "]" - } - if { [llength [lindex $activities_list 2]] } { - set environments "[lindex [lindex $activities_list 2] 0]
" - append environments "[join [lindex [lindex $activities_list 2] 1] " "] " - append environments "[join [lindex [lindex $activities_list 2] 2] " "] " - append environments "[join [lindex [lindex $activities_list 2] 3] " "]" - } - - set activities "
$activity_title
[join [lindex $activities_list 3] " "]" - - set feedbacks "" - if { [llength [lindex $activities_list 4]] } { - set feedbacks "[lindex [lindex $activities_list 4] 0]
" - append feedbacks "[join [lindex [lindex $activities_list 4] 1] " "]" - } - - set resources_activities_list [imsld::process_learning_activity -activity_item_id $activity_item_id -resource_mode "t"] - foreach resource_activity [join $resources_activities_list] { - - - #assessment must have an extra feedback item - if {[db_0or1row is_assessment {} ] } { - db_1row get_as_site_node {} - set as_feedback_url "[site_node::get_url -node_id $node_id][export_vars -base sessions {assessment_id $assessment_id}]" - set as_feedback_link "\"$as_feedback_url\"" - append feedbacks $as_feedback_link - } - } - - template::multirow append imsld_multirow $prerequisites \ - $objectives \ - $environments \ - $activities \ - $feedbacks \ - "" - } - } - support { - if { [string eq $status "finished"] } { - db_1row get_support_activity_info_from_isa { - select coalesce(title,identifier) as activity_title, - item_id as activity_item_id - from imsld_support_activitiesi - where activity_id = :completed_id - } - set activities_list [imsld::process_support_activity -activity_item_id $activity_item_id] - - if { [llength [lindex $activities_list 0]] } { - set environments "[lindex [lindex $activities_list 0] 0]
" - append environments "[join [lindex [lindex $activities_list 0] 1] " "] " - append environments "[join [lindex [lindex $activities_list 0] 2] " "] " - append environments "[join [lindex [lindex $activities_list 0] 3] " "] " - } - - set activities "
$activity_title
[join [lindex $activities_list 1] " "]" - - set feedbacks "" - if { [llength [lindex $activities_list 2]] } { - set feedbacks "[lindex [lindex $activities_list 2] 0]
" - append feedbacks "[join [lindex [lindex $activities_list 2] 1] " "]" - } - template::multirow append imsld_multirow {} \ - {} \ - $environments \ - $activities \ - $feedbacks \ - "" - } - } - structure { - db_1row get_support_activity_info_from_ias { - select coalesce(title,identifier) as activity_title, - item_id as structure_item_id - from imsld_activity_structuresi - where structure_id = :completed_id - } - 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] " "]
" - - if { [string eq $status "started"] } { - set structure_title "
[string repeat "(" $tab_structures]$activity_title
" - set stat "" - incr tab_structures - } else { - incr tab_structures -1 - set structure_title "
$activity_title[string repeat ")" $tab_structures]
" - } - template::multirow append imsld_multirow {} {} $environments $structure_title {} {} - } - } - } - - # the last completed is now stored in completed_id, let's find out the next role_part_id that the user has to work on. - # Procedure (knowing that the info of the last role_part are stored in the last iteration vars): - # 0. check if all the activities referenced by the current role_part_id are finished - # 0.1 if all of them are not finished yet, skip this section and preserve the last role_part_id, otherwise, continue - # 1. get the next role_part from imsld_role_parts according to sort_number, first - # search in the current act_id, then in the current play_id, then in the next play_id and so on... - # 1.1 if there are no more role_parts then this is the last one - # 1.2 if we find a "next role_part", it will be treated latter, we just have to set the next role_part_id var - - if { [imsld::role_part_finished_p -role_part_id $role_part_id -user_id $user_id] } { - # search in the current act_id - if { ![db_0or1row search_current_act { - select role_part_id - from imsld_role_parts - where sort_order = :sort_order + 1 - and act_id = :act_id - }] } { - # get current act_id's sort_order and search in the next act in the current play_id - db_1row get_current_play_id { - select ip.item_id as play_item_id, - ip.play_id, - ia.sort_order as act_sort_order - from imsld_playsi ip, imsld_acts ia, cr_items cr - where ip.item_id = ia.play_id - and ia.act_id = cr.live_revision - and cr.item_id = :act_id - } - if { ![db_0or1row search_current_play { - select rp.role_part_id - from imsld_role_parts rp, imsld_actsi ia - where ia.play_id = :play_item_id - and ia.sort_order = :act_sort_order + 1 - and rp.act_id = ia.item_id - and content_revision__is_live(rp.role_part_id) = 't' - and content_revision__is_live(ia.act_id) = 't' - and rp.sort_order = (select min(irp2.sort_order) from imsld_role_parts irp2 where irp2.act_id = rp.act_id) - }] } { - # get the current play_id's sort_order and sarch in the next play in the current method_id - db_1row get_current_method { - select im.item_id as method_item_id, - ip.sort_order as play_sort_order - from imsld_methodsi im, imsld_plays ip - where im.item_id = ip.method_id - and ip.play_id = :play_id - } - if { ![db_0or1row search_current_method { - select rp.role_part_id - from imsld_role_parts rp, imsld_actsi ia, imsld_playsi ip - where ip.method_id = :method_item_id - and ia.play_id = ip.item_id - and rp.act_id = ia.item_id - and ip.sort_order = :play_sort_order + 1 - and content_revision__is_live(rp.role_part_id) = 't' - and content_revision__is_live(ia.act_id) = 't' - and content_revision__is_live(ip.play_id) = 't' - and ia.sort_order = (select min(ia2.sort_order) from imsld_acts ia2 where ia2.play_id = ip.item_id) - and rp.sort_order = (select min(irp2.sort_order) from imsld_role_parts irp2 where irp2.act_id = ia.item_id) - }] } { - # there is no more to search, we reached the end of the unit of learning - template::multirow append imsld_multirow {} {} {} {} {} "[_ imsld.lt_Learning_Unit_finishe]" - return [template::multirow size imsld_multirow] - } - } - } - } - } - - # find the next activity referenced by the role_part - # (learning_activity, support_activity, activity_structure) - # 1. if it is a learning or support activity, no problem, find the associated files and return the lists - # 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 { *SQL* } - - # environments - set environment_list [list] - # 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] - set activity_type [lindex $activity_list 1] - if { [llength $environment_list] } { - set environment_list [concat [list $environment_list] [lindex $activity_list 2]] - } else { - set environment_list [lindex $activity_list 2] - } - # flush the structures names in the path of the next activity - 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
" \ - {} \ - {} - incr tab_structures - } - } - - set environments "" - - if { [llength $environment_list] } { - foreach environment $environment_list { - append environments "[lindex $environment 0]
" - append environments "[join [lindex $environment 1] " "] " - append environments "[join [lindex $environment 2] " "] " - append environments "[join [lindex $environment 3] " "]
" - } - } - # learning activity - if { [string eq $activity_type learning] } { - db_1row learning_activity { *SQL* } - set activities_list [imsld::process_learning_activity -activity_item_id $activity_item_id] - - set resources_activities_list [imsld::process_learning_activity -activity_item_id $activity_item_id -resource_mode "t"] - - #grant permissions for newly appeared resources - imsld::grant_permissions -resources_activities_list $resources_activities_list -user_id $user_id - - set prerequisites "" - if { [llength [lindex $activities_list 0]] } { - set prerequisites "[lindex [lindex $activities_list 0] 0]
" - append prerequisites "[join [lindex [lindex $activities_list 0] 1] " "]" - } - set objectives "" - if { [llength [lindex $activities_list 1]] } { - set objectives "[lindex [lindex $activities_list 1] 0]
" - append objectives "[join [lindex [lindex $activities_list 1] 1] " "]" - } - if { [llength [lindex $activities_list 2]] } { - set environments "[lindex [lindex $activities_list 2] 0]
" - append environments "[join [lindex [lindex $activities_list 2] 1] " "] " - append environments "[join [lindex [lindex $activities_list 2] 2] " "] " - append environments "[join [lindex [lindex $activities_list 2] 3] " "]" - } - set files "" - set activities "
$activity_title
[join [lindex $activities_list 3] " "]" - if { ![llength [lindex $activities_list 3]] } { - set status "finish" - } else { - set status "" - } - - template::multirow append imsld_multirow $prerequisites \ - $objectives \ - $environments \ - $activities \ - {} \ - $status - } - - # support activity - if { [string eq $activity_type support] } { - db_1row support_activity { *SQL* } - set activities_list [imsld::process_support_activity -activity_item_id $activity_item_id] - - if { [llength [lindex $activities_list 0]] } { - set environments "[lindex [lindex $activities_list 0] 0]
" - append environments "[join [lindex [lindex $activities_list 0] 1] " "] " - append environments "[join [lindex [lindex $activities_list 0] 2] " "] " - append environments "[join [lindex [lindex $activities_list 0] 3] " "]" - regsub -all {
  • [ ]*
  • } $environments "" environments - } - - set activities "
    $activity_title
    [join [lindex $activities_list 1] " "]" - if { ![llength [lindex $activities_list 1]] } { - set status "finish" - } else { - set status "" - } - - template::multirow append imsld_multirow {} \ - {} \ - $environments \ - $activities \ - {} \ - $status - } - # first parameter: activity name - return [template::multirow size imsld_multirow] -} - ad_proc -public imsld::get_next_activity_list { - -imsld_item_id:required + -run_id:required {-user_id ""} } { @param imsld_item_id + @param run_id @option user_id default [ad_conn user_id] @return The list of next activity_ids of each role_part and play in the IMS-LD. } { # get the imsld info db_1row get_ismld_info { - select imsld_id - from imsld_imsldsi - where item_id = :imsld_item_id - and content_revision__is_live(imsld_id) = 't' + select ii.imsld_id, ii.item_id as imsld_item_id + from imsld_imsldsi ii, imsld_runs run + where ii.imsld_id = run.imsld_id + and run.run_id = :run_id } set user_id [expr { [string eq "" $user_id] ? [ad_conn user_id] : $user_id }] set next_act_item_id_list [list] @@ -3822,6 +3623,7 @@ stat.act_id from imsld_status_user stat where stat.user_id = :user_id + and run_id = :run_id and stat.play_id = :play_id and stat.type in ('learning','support','structure') order by stat.status_date desc @@ -3836,7 +3638,7 @@ }] continue } - if { ![imsld::act_finished_p -act_id $act_id -user_id $user_id] } { + if { ![imsld::act_finished_p -run_id $run_id -act_id $act_id -user_id $user_id] } { # if the act hasn't been completed, this is the next act of the play lappend next_act_item_id_list [content::revision::item_id -revision_id $act_id] continue @@ -3900,7 +3702,7 @@ # 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 $next_activity_id -imsld_id $imsld_id -role_part_id $role_part_id] + set activity_list [imsld::structure_next_activity -activity_structure_id $next_activity_id -imsld_id $imsld_id -run_id $run_id -role_part_id $role_part_id] set next_activity_id [lindex $activity_list 0] } lappend next_activity_id_list $next_activity_id @@ -4111,6 +3913,7 @@ ad_proc -public imsld::finish_resource { -resource_id + -run_id } {

    Tag a resource as finished into an activity. Return true if success, false otherwise

    @@ -4168,6 +3971,7 @@ where icr.item_id = :res_id and icr.resource_id = stat.completed_id and user_id = :user_id + and run_id = :run_id }] } { # if the resource is not in the imsld_status_user, then the resource is not finished set all_finished_p 0 @@ -4180,6 +3984,7 @@ if { $all_finished_p && ![db_0or1row already_finished { *SQL* }] } { foreach role_part_id $role_part_id_list { imsld::finish_component_element -imsld_id $imsld_id \ + -run_id $run_id \ -role_part_id $role_part_id \ -element_id $activity_id \ -type $activity_type\ @@ -4217,4 +4022,4 @@ } } ad_register_proc GET /finish-component-element* imsld::finish_component_element -ad_register_proc POST /finish-component-element* imsld::finish_component_element +ad_register_proc POST /finish-component-elementx* imsld::finish_component_element 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.19 -r1.20 --- openacs-4/packages/imsld/tcl/imsld-procs.xql 19 Apr 2006 16:29:20 -0000 1.19 +++ openacs-4/packages/imsld/tcl/imsld-procs.xql 16 May 2006 09:24:35 -0000 1.20 @@ -193,6 +193,7 @@ insert into imsld_status_user (imsld_id, + run_id, play_id, act_id, related_id, @@ -202,14 +203,15 @@ status) ( select :imsld_id, + :run_id, :play_id, :act_id, :role_part_id, :user_id, 'act', now(), 'finished' - where not exists (select 1 from imsld_status_user where imsld_id = :imsld_id and user_id = :user_id and related_id = :role_part_id and status = 'finished') + where not exists (select 1 from imsld_status_user where run_id = :run_id and user_id = :user_id and related_id = :role_part_id and status = 'finished') ) @@ -276,6 +278,7 @@ insert into imsld_status_user (imsld_id, + run_id, play_id, related_id, user_id, @@ -284,13 +287,14 @@ status) ( select :imsld_id, + :run_id, :play_id, :act_id, :user_id, 'act', now(), 'finished' - where not exists (select 1 from imsld_status_user where imsld_id = :imsld_id and user_id = :user_id and related_id = :act_id and status = 'finished') + where not exists (select 1 from imsld_status_user where run_id = :run_id and user_id = :user_id and related_id = :act_id and status = 'finished') ) @@ -312,19 +316,21 @@ insert into imsld_status_user (imsld_id, + run_id, related_id, user_id, type, status_date, status) ( select :imsld_id, + :run_id, :play_id, :user_id, 'play', now(), 'finished' - where not exists (select 1 from imsld_status_user where imsld_id = :imsld_id and user_id = :user_id and related_id = :play_id and status = 'finished') + where not exists (select 1 from imsld_status_user where run_id = :run_id and user_id = :user_id and related_id = :play_id and status = 'finished') ) @@ -346,19 +352,21 @@ insert into imsld_status_user (imsld_id, + run_id, related_id, user_id, type, status_date, status) ( select :imsld_id, + :run_id, :imsld_id, :user_id, 'play', now(), 'finished' - where not exists (select 1 from imsld_status_user where imsld_id = :imsld_id and user_id = :user_id and related_id = :imsld_id and status = 'finished') + where not exists (select 1 from imsld_status_user where run_id = :run_id and user_id = :user_id and related_id = :imsld_id and status = 'finished') ) @@ -380,19 +388,21 @@ insert into imsld_status_user (imsld_id, + run_id, related_id, user_id, type, status_date, status) ( select :imsld_id, + :run_id, :method_id, :user_id, 'method', now(), 'finished' - where not exists (select 1 from imsld_status_user where imsld_id = :imsld_id and user_id = :user_id and related_id = :method_id and status = 'finished') + where not exists (select 1 from imsld_status_user where run_id = :run_id and user_id = :user_id and related_id = :method_id and status = 'finished') ) @@ -466,6 +476,7 @@ insert into imsld_status_user ( imsld_id, + run_id, play_id, act_id, role_part_id, @@ -477,6 +488,7 @@ ) ( select :imsld_id, + :run_id, :play_id, :act_id, :role_part_id, @@ -485,7 +497,7 @@ :type, now(), 'finished' - where not exists (select 1 from imsld_status_user where imsld_id = :imsld_id and user_id = :user_id and related_id = :element_id and status = 'finished') + where not exists (select 1 from imsld_status_user where run_id = :run_id and user_id = :user_id and related_id = :element_id and status = 'finished') ) @@ -523,14 +535,19 @@ where related_id = :activity_id and user_id = :user_id and status = 'finished' + and run_id = :run_id -select 1 from imsld_status_user where related_id = :role_part_id and user_id = :user_id and status = 'finished' + select 1 from imsld_status_user + where related_id = :role_part_id + and user_id = :user_id + and status = 'finished' + and run_id = :run_id @@ -652,6 +669,7 @@ where related_id = :learning_activity_id and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -674,7 +692,8 @@ from imsld_status_user where related_id = :support_activity_id and user_id = :user_id - and status = 'finished' + and status = 'finished' + and run_id = :run_id @@ -700,6 +719,7 @@ where related_id = :structure_id and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -711,6 +731,7 @@ where related_id = :role_part_id and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -742,6 +763,7 @@ where related_id = content_item__get_live_revision(:learning_activity_id) and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -752,6 +774,7 @@ where related_id = content_item__get_live_revision(:support_activity_id) and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -762,6 +785,7 @@ where related_id = content_item__get_live_revision(:activity_structure_id) and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -773,6 +797,7 @@ where related_id = :act_id and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -784,6 +809,7 @@ where related_id = :play_id and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -795,6 +821,7 @@ where related_id = :method_id and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -806,6 +833,7 @@ where related_id = :imsld_id and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -1397,7 +1425,10 @@ select 1 from imsld_status_user - where related_id = :activity_id and user_id = :user_id and status = 'finished' + where related_id = :activity_id + and user_id = :user_id + and status = 'finished' + and run_id = :run_id @@ -1435,7 +1466,10 @@ select 1 from imsld_status_user - where related_id = :structure_id and user_id = :user_id and status = 'started' + where related_id = :structure_id + and user_id = :user_id + and status = 'started' + and run_id = :run_id @@ -1456,14 +1490,18 @@ rp.role_part_id, ia.act_id, ip.play_id - from imsld_role_partsi rp, imsld_actsi ia, imsld_playsi ip, imsld_imsldsi ii, + from imsld_role_partsi rp, imsld_actsi ia, imsld_playsi ip, imsld_imsldsi ii, imsld_attribute_instances attr, imsld_methodsi im where rp.act_id = ia.item_id and ia.play_id = ip.item_id and ip.method_id = im.item_id and im.imsld_id = ii.item_id and ii.imsld_id = :imsld_id and content_revision__is_live(rp.role_part_id) = 't' + and attr.owner_id = ip.play_id + and attr.run_id = :run_id + and attr.type = 'isvisible' + and attr.is_visible_p = 't' order by ip.sort_order, ia.sort_order, rp.sort_order @@ -1514,7 +1552,10 @@ select 1 from imsld_status_user - where related_id = :activity_id and user_id = :user_id and status = 'started' + where related_id = :activity_id + and user_id = :user_id + and status = 'started' + and run_id = :run_id @@ -1557,7 +1598,7 @@ select count(*) from imsld_status_user where user_id = :user_id - and imsld_id = :imsld_id + and run_id = :run_id and type in ('learning','support','structure') @@ -1593,7 +1634,7 @@ rp.act_id, stat.status from imsld_status_user stat, imsld_role_parts rp - where stat.imsld_id = :imsld_id + where stat.run_id = :run_id and stat.user_id = :user_id and stat.role_part_id = rp.role_part_id and stat.type in ('learning','support','structure') @@ -1767,6 +1808,7 @@ where related_id = :activity_id and user_id = :user_id and status = 'finished' + and run_id = :run_id @@ -2061,6 +2103,7 @@ insert into imsld_status_user ( imsld_id, + run_id, related_id, user_id, type, @@ -2069,12 +2112,13 @@ ) ( select :imsld_id, + :run_id, :resource_id, :user_id, 'resource', now(), 'finished' - where not exists (select 1 from imsld_status_user where imsld_id = :imsld_id and user_id = :user_id and related_id = :resource_id and status = 'finished') + where not exists (select 1 from imsld_status_user where run_id = :run_id and user_id = :user_id and related_id = :resource_id and status = 'finished') ) @@ -2089,12 +2133,17 @@ and icr.resource_id = stat.related_id and user_id = :user_id and status = 'finished' + and run_id = :run_id - select 1 from imsld_status_user where related_id = :activity_id and user_id = :user_id and status = 'finished' + select 1 from imsld_status_user + where related_id = :activity_id + and user_id = :user_id + and status = 'finished' + and run_id = :run_id @@ -2105,6 +2154,7 @@ from imsld_status_user where related_id = :resource_id and status = 'finished' + and run_id = :run_id 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.4 -r1.5 --- openacs-4/packages/imsld/www/activity-frame.tcl 5 Apr 2006 18:39:57 -0000 1.4 +++ openacs-4/packages/imsld/www/activity-frame.tcl 16 May 2006 09:24:35 -0000 1.5 @@ -5,6 +5,7 @@ @author Eduardo P�rez Ureta @creation-date 2006-03-03 } -query { + run_id:integer,notnull activity_id:integer,notnull } @@ -15,7 +16,7 @@ $dom_root setAttribute class "tabber" set activity_item_id [content::revision::item_id -revision_id $activity_id] -imsld::process_activity_as_ul -activity_item_id $activity_item_id -dom_doc $doc -dom_node $dom_root +imsld::process_activity_as_ul -activity_item_id $activity_item_id -run_id $run_id -dom_doc $doc -dom_node $dom_root set activities [$dom_root asXML] 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.4 -r1.5 --- openacs-4/packages/imsld/www/environment-frame.tcl 6 Apr 2006 14:25:02 -0000 1.4 +++ openacs-4/packages/imsld/www/environment-frame.tcl 16 May 2006 09:24:35 -0000 1.5 @@ -6,6 +6,7 @@ @creation-date 2006-03-03 } -query { activity_id:integer,notnull + run_id:integer,notnull } set user_id [ad_conn user_id] @@ -19,15 +20,18 @@ $environments_node_li appendChild $text set environments_node [$doc createElement ul] $environments_node setAttribute class "mktree" +$environments_node setAttribute style "white-space: nowrap;" + # FIX-ME: if the ul is empty, the browser shows the ul incorrectly set text [$doc createTextNode ""] $environments_node appendChild $text set activity_item_id [content::revision::item_id -revision_id $activity_id] imsld::process_activity_environments_as_ul -activity_item_id $activity_item_id \ - -dom_node $environments_node \ - -dom_doc $doc + -run_id $run_id \ + -dom_node $environments_node \ + -dom_doc $doc $dom_root appendChild $environments_node_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.4 -r1.5 --- openacs-4/packages/imsld/www/imsld-finish-resource.tcl 22 Feb 2006 16:09:39 -0000 1.4 +++ openacs-4/packages/imsld/www/imsld-finish-resource.tcl 16 May 2006 09:24:35 -0000 1.5 @@ -4,6 +4,7 @@ } { file_url resource_item_id + run_id } # fedback nor assessment has to be marked as finished @@ -17,7 +18,7 @@ and icr.type != 'imsqti_xmlv1p0' limit 1 }] } { - imsld::finish_resource -resource_id $resource_id + imsld::finish_resource -resource_id $resource_id -run_id $run_id } ad_returnredirect $file_url Index: openacs-4/packages/imsld/www/imsld-frameset.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/Attic/imsld-frameset.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/imsld/www/imsld-frameset.adp 4 Apr 2006 10:27:53 -0000 1.4 +++ openacs-4/packages/imsld/www/imsld-frameset.adp 16 May 2006 09:24:35 -0000 1.5 @@ -7,7 +7,7 @@ - + Index: openacs-4/packages/imsld/www/imsld-frameset.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/Attic/imsld-frameset.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/imsld-frameset.tcl 22 Mar 2006 15:02:01 -0000 1.1 +++ openacs-4/packages/imsld/www/imsld-frameset.tcl 16 May 2006 09:24:35 -0000 1.2 @@ -8,7 +8,7 @@ @creation-date 2006-03-21 @cvs-id $Id$ } { - imsld_id:integer,notnull + run_id:integer,notnull } -properties { } -validate { } -errors { 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.6 -r1.7 --- openacs-4/packages/imsld/www/imsld-tree.tcl 24 Apr 2006 11:04:14 -0000 1.6 +++ openacs-4/packages/imsld/www/imsld-tree.tcl 16 May 2006 09:24:35 -0000 1.7 @@ -2,7 +2,7 @@ @author jopez@inv.it.uc3m.es @creation-date Mar 2006 } { - imsld_id:integer,notnull + run_id:integer,notnull } # initialize variables @@ -16,11 +16,12 @@ select imsld.item_id as imsld_item_id, imsld.imsld_id, coalesce(imsld.title, imsld.identifier) as imsld_title - from imsld_imsldsi imsld - where imsld.imsld_id = :imsld_id + from imsld_imsldsi imsld, imsld_runs run + where imsld.imsld_id = run.imsld_id + and run.run_id = :run_id } -set next_activity_id [imsld::get_next_activity_list -imsld_item_id $imsld_item_id -user_id $user_id] +set next_activity_id [imsld::get_next_activity_list -run_id $run_id -user_id $user_id] dom createDocument ul doc set dom_root [$doc documentElement] @@ -35,7 +36,7 @@ set activities_node [$doc createElement ul] -imsld::generate_activities_tree -imsld_id $imsld_id \ +imsld::generate_activities_tree -run_id $run_id \ -user_id $user_id \ -next_activity_id_list $next_activity_id \ -dom_node $activities_node \ Index: openacs-4/packages/imsld/www/admin/imsld-admin-roles.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-admin-roles.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/imsld-admin-roles.tcl 30 Mar 2006 16:01:46 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/imsld-admin-roles.tcl 16 May 2006 09:24:35 -0000 1.2 @@ -8,14 +8,21 @@ } { role:optional {group_instance 0} - imsld_id + run_id members_list:optional } +db_1row get_imsld_info { + select imsld_id + from imsld_runs + where run_id = :run_id +} + #get roles list set roles_list [imsld::roles::get_list_of_roles -imsld_id $imsld_id] set roles_list_names [imsld::roles::get_roles_names -roles_list $roles_list] + set lista [list] lappend lista [list "Select a role..." 0] @@ -24,7 +31,7 @@ lappend lista $lista_item } -ad_form -name choose_role -action imsld-admin-roles -export {imsld_id} -form { +ad_form -name choose_role -action imsld-admin-roles -export {imsld_id run_id} -form { {role:integer(select) {label "Select a role"} {options "$lista"} } Index: openacs-4/packages/imsld/www/admin/imsld-create-instance.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-create-instance.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/imsld-create-instance.tcl 30 Mar 2006 16:01:46 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/imsld-create-instance.tcl 16 May 2006 09:24:36 -0000 1.2 @@ -9,13 +9,14 @@ {user_id:multiple "0"} role imsld_id + run_id parent_group_id:optional } db_1row get_imsld_role_info {} set number_of_groups [llength [db_list get_related_groups {}]] -set return_url [export_vars -base imsld-admin-roles {{role $role} {imsld_id $imsld_id} }] +set return_url [export_vars -base imsld-admin-roles {{role $role} {imsld_id $imsld_id} {run_id $run_id}}] if { !([string eq $number_of_groups "0"] || [string eq $create_new_p "t"] ) } { @@ -27,10 +28,10 @@ if {[info exist parent_group_id] } { set new_instance [imsld::roles::create_instance -role_id $role -parent_group_id $parent_group_id] - ad_returnredirect [export_vars -base imsld-admin-roles {{role $role} {imsld_id $imsld_id} {group_instance $new_instance}}] + ad_returnredirect [export_vars -base imsld-admin-roles {{role $role} {imsld_id $imsld_id} {run_id $run_id} {group_instance $new_instance}}] } elseif { ![db_0or1row has_role_parent_p {}] } { set new_instance [imsld::roles::create_instance -role_id $role] - ad_returnredirect [export_vars -base imsld-admin-roles {{role $role} {imsld_id $imsld_id} {group_instance $new_instance}}] + ad_returnredirect [export_vars -base imsld-admin-roles {{role $role} {imsld_id $imsld_id} {run_id $run_id} {group_instance $new_instance}}] } else { set flag on template::list::create \ @@ -43,7 +44,7 @@ } } db_multirow -extend {link_to} possible_parents get_possible_parents_list {} { - set link_to [export_vars -base imsld-create-instance {role imsld_id {parent_group_id $parent_id}}] + set link_to [export_vars -base imsld-create-instance {role imsld_id run_id {parent_group_id $parent_id}}] } } Index: openacs-4/packages/imsld/www/admin/imsld-delete-instance.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-delete-instance.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/imsld-delete-instance.tcl 30 Mar 2006 16:01:46 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/imsld-delete-instance.tcl 16 May 2006 09:24:36 -0000 1.2 @@ -9,10 +9,11 @@ role imsld_id group_id + run_id } db_1row get_rel_id {} relation_remove $rel_id imsld::roles::delete_instance -group_id $group_id -ad_returnredirect [export_vars -base imsld-admin-roles {{role $role} {imsld_id $imsld_id} {group_instance 0}}] +ad_returnredirect [export_vars -base imsld-admin-roles {{role $role} {imsld_id $imsld_id} {group_instance 0} {run_id $run_id}}] Index: openacs-4/packages/imsld/www/admin/imsld-groups.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-groups.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/imsld-groups.tcl 30 Mar 2006 16:01:46 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/imsld-groups.tcl 16 May 2006 09:24:36 -0000 1.2 @@ -7,6 +7,7 @@ @creation-date Mar 2006 } { imsld_id + run_id {group_instance 0} role:optional } @@ -15,7 +16,7 @@ lappend lista $lista_aux - set actions [list "Create new" [export_vars -base imsld-create-instance {imsld_id role}] "Create a new group"] +set actions [list "Create new" [export_vars -base imsld-create-instance {imsld_id run_id role lista}] "Create a new group"] template::list::create \ -name role_groups \ @@ -35,10 +36,9 @@ db_multirow -extend { manage_roles delete } role_groups get_groups_list {} { - set manage_roles [export_vars -base imsld-admin-roles {imsld_id role {group_instance $group_id}}] - set delete "\"Delete\"" + set manage_roles [export_vars -base imsld-admin-roles {imsld_id run_id role {group_instance $group_id}}] + set delete "\"Delete\"" } - Index: openacs-4/packages/imsld/www/admin/imsld-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-new-2.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/imsld/www/admin/imsld-new-2.tcl 30 Mar 2006 16:01:46 -0000 1.8 +++ openacs-4/packages/imsld/www/admin/imsld-new-2.tcl 16 May 2006 09:24:36 -0000 1.9 @@ -51,15 +51,23 @@ set warnings "[lindex $manifest_list 1]" +# get imsld_id +set imsld_id [db_list get_imslds_from_manifest {}] + +# NOTE: by now we create one default run for each new ims-ld +ns_write "[_ imsld.Creating_default_Run]" +set run_id [imsld::instance::instantiate_imsld -imsld_id $imsld_id -community_id $community_id] +ns_write "[_ imsld.nbspnbspnbspdone]" +ns_sleep 2 + if { ![string eq "" $warnings] } { ns_write "[_ imsld.lt_br__Warnings_ul_warni]" ns_sleep 5 } ns_write "" -#get imslds ang jump to admin members page -set imsld_id [db_list get_imslds_from_manifest {}] -ad_progress_bar_end -url [export_vars -base imsld-admin-roles {imsld_id}] +# go to the roles admin page... +ad_progress_bar_end -url [export_vars -base imsld-admin-roles {run_id}] Index: openacs-4/packages/imsld/www/admin/imsld-role-add-members.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-role-add-members.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/imsld-role-add-members.tcl 30 Mar 2006 16:01:46 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/imsld-role-add-members.tcl 16 May 2006 09:24:36 -0000 1.2 @@ -11,6 +11,7 @@ group_instance role imsld_id + run_id } #only set required variables @@ -22,7 +23,7 @@ } } - ad_returnredirect [export_vars -base imsld-admin-roles {imsld_id role group_instance members_list}] + ad_returnredirect [export_vars -base imsld-admin-roles {imsld_id run_id role group_instance members_list}] Index: openacs-4/packages/imsld/www/admin/imsld-role-confirm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-role-confirm.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/www/admin/imsld-role-confirm.tcl 24 Apr 2006 09:40:20 -0000 1.3 +++ openacs-4/packages/imsld/www/admin/imsld-role-confirm.tcl 16 May 2006 09:24:36 -0000 1.4 @@ -10,6 +10,7 @@ group_instance role imsld_id + run_id } #check conditions and set the database @@ -19,8 +20,8 @@ set min_persons [lindex $role_info 1] set match_persons_p [lindex $role_info 3] -set return_url [export_vars -base imsld-admin-roles {role imsld_id group_instance members_list}] -set return_url2 [export_vars -base imsld-admin-roles {role imsld_id group_instance}] +set return_url [export_vars -base imsld-admin-roles {role imsld_id run_id group_instance members_list}] +set return_url2 [export_vars -base imsld-admin-roles {role imsld_id run_id group_instance}] if {![string eq "-1" [lsearch $members_list 0]] } { Index: openacs-4/packages/imsld/www/admin/imsld-role-members.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-role-members.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/www/admin/imsld-role-members.tcl 24 Apr 2006 09:40:20 -0000 1.3 +++ openacs-4/packages/imsld/www/admin/imsld-role-members.tcl 16 May 2006 09:24:36 -0000 1.4 @@ -9,6 +9,7 @@ role:optional {group_instance 0} imsld_id + run_id members_list:optional } @@ -62,12 +63,12 @@ set create_instance_url imsld-create-instance set bulk_actions "{Create new instance} $create_instance_url {Create a new instance of a role}" set bulk_actions_not "{Create new instance} $create_instance_url {Create a new instance of a role}" - set bulk_action_export_vars "{imsld_id} {role}" + set bulk_action_export_vars "{imsld_id} {role} {run_id}" } else { set bulk_actions "{<------} {imsld-role-remove-members} {Remove selected members from the group}" set bulk_actions_not "{------->} {imsld-role-add-members} {Add selected members to the group}" - set bulk_action_export_vars "{group_instance} {role} {imsld_id} {members_list}" + set bulk_action_export_vars "{group_instance} {role} {imsld_id} {run_id} {members_list}" } @@ -109,4 +110,4 @@ db_multirow asign_members get_users_list {} db_multirow asign_not_members get_not_users_list {} -ad_form -name confirm -action imsld-role-confirm -export {imsld_id role group_instance members_list} +ad_form -name confirm -action imsld-role-confirm -export {imsld_id run_id role group_instance members_list} Index: openacs-4/packages/imsld/www/admin/imsld-role-members.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-role-members.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/www/admin/imsld-role-members.xql 24 Apr 2006 09:40:20 -0000 1.3 +++ openacs-4/packages/imsld/www/admin/imsld-role-members.xql 16 May 2006 09:24:36 -0000 1.4 @@ -23,11 +23,13 @@ select aua.user_id from acs_users_all aua, - dotlrn_member_rels_approved dmra + acs_rels ar, + imsld_run_users_group_ext r_map where aua.user_id > 0 - and not (aua.user_id in ([join $members_list ","])) - and aua.user_id=dmra.user_id - and dmra.community_id=:community_id + and aua.user_id not in ([join $members_list ","]) + and aua.user_id=ar.object_id_two + and ar.object_id_one = r_map.group_id + and r_map.run_id = :run_id Index: openacs-4/packages/imsld/www/admin/imsld-role-remove-members.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/imsld-role-remove-members.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/imsld-role-remove-members.tcl 30 Mar 2006 16:01:46 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/imsld-role-remove-members.tcl 16 May 2006 09:24:36 -0000 1.2 @@ -11,7 +11,7 @@ group_instance role imsld_id - + run_id } #only set required variables set temp_list [list] @@ -22,7 +22,7 @@ lappend temp_list $member } } - ad_returnredirect [export_vars -base imsld-admin-roles {imsld_id role group_instance {members_list $temp_list}}] + ad_returnredirect [export_vars -base imsld-admin-roles {imsld_id run_id role group_instance {members_list $temp_list}}] Index: openacs-4/packages/imsld/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/index.adp 25 Nov 2005 13:55:24 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/index.adp 16 May 2006 09:24:36 -0000 1.2 @@ -4,4 +4,9 @@

    +

    #imsld.IMS-LDs_1#

    + +

    #imsld.Runs#

    +
    + Index: openacs-4/packages/imsld/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/index.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/imsld/www/admin/index.tcl 30 Mar 2006 16:01:46 -0000 1.5 +++ openacs-4/packages/imsld/www/admin/index.tcl 16 May 2006 09:24:36 -0000 1.6 @@ -7,20 +7,33 @@ } { {return_url "index"} {set_imsld_id_live ""} + {set_run_id_live ""} + {run_imsld_id ""} + {run_orderby ""} + {imsld_orderby ""} } -properties { upload_file context:onevalue } +set community_id [dotlrn_community::get_community_id] + +# check action... if { ![string eq "" $set_imsld_id_live] } { content::item::set_live_revision -revision_id [content::item::get_best_revision -item_id $set_imsld_id_live] } +if { ![string eq "" $set_run_id_live] } { + db_dml make_run_live { *SQL* } +} +if { ![string eq "" $run_imsld_id] } { + imsld::instance::instantiate_imsld -imsld_id $run_imsld_id -community_id $community_id +} set package_id [ad_conn package_id] permission::require_permission -object_id $package_id -privilege create -set page_title "Admin IMS LD" -set context [list "Admin IMS LD"] +set page_title "[_ imsld.Admin_IMS_LD]" +set context [list "[_ imsld.Admin_IMS_LD]"] set user_id [ad_conn user_id] set manifest_id [db_nextval acs_object_id_seq] @@ -33,60 +46,98 @@ {manifest_id:integer {widget hidden} {value $manifest_id}} } - template::list::create \ -name imslds \ -multirow imslds \ -key imsld_id \ + -orderby_name imsld_orderby \ + -orderby { default_value imsld_title } \ -elements { imsld_title { label "[_ imsld.IMS_LD_Name]" orderby_asc {imsld_title asc} orderby_desc {imsld_title desc} } + creation_date { + label "[_ imsld.Creation_Date]" + orderby_asc {creation_date asc} + orderby_desc {creation_date desc} + } + create_run { + label {} + display_template {@imslds.create_run;noquote@} + } delete { label {} sub_class narrow display_template {@imslds.delete_template;noquote@} link_html { title "[_ imsld.Delete_IMS_LD]" } } - manage { - label {} - display_template {@imslds.manage;noquote@} - } } -set orderby [template::list::orderby_clause -orderby -name imslds] +set imsld_orderby [template::list::orderby_clause -orderby -name imslds] -if {[string equal $orderby ""]} { - set orderby " order by imsld_title asc" -} - -set community_id [dotlrn_community::get_community_id] set cr_root_folder_id [imsld::cr::get_root_folder -community_id $community_id] -db_multirow -extend { delete_template manage} imslds get_imslds { - select imsld.imsld_id, - coalesce(imsld.title, imsld.identifier) as imsld_title, - cr3.item_id, - cr3.live_revision - from cr_items cr1, cr_items cr2, cr_items cr3, cr_items cr4, - imsld_cp_manifests icm, imsld_cp_organizations ico, imsld_imsldsi imsld - where cr1.live_revision = icm.manifest_id - and cr1.parent_id = cr4.item_id - and cr4.parent_id = :cr_root_folder_id - and ico.manifest_id = cr1.item_id - and imsld.organization_id = cr2.item_id - and cr2.live_revision = ico.organization_id - and cr3.item_id = imsld.item_id -} { +db_multirow -extend { delete_template create_run } imslds get_imslds { *SQL* } { if { [empty_string_p $live_revision] } { - set delete_template "Deleted [_ imsld.Make_it_live]" - set manage none + set delete_template "[_ imsld.Deleted] [_ imsld.Make_it_live]" + set create_run "" } else { set delete_template "" - set manage "Manage Members" - + set create_run " [_ imsld.create_new_run] " } } + +set imsld_package_id [site_node_apm_integration::get_child_package_id \ + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "[imsld::package_key]"] +set imsld_url "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]" + +template::list::create \ + -name imsld_runs \ + -multirow imsld_runs \ + -key run_id \ + -elements { + imsld_title { + label "[_ imsld.Run_IMS-LD_Name]" + orderby_asc {imsld_title asc} + orderby_desc {imsld_title desc} + display_template {@imsld_runs.imsld_title@} + } + creation_date { + label "[_ imsld.Creation_Date]" + orderby_asc {creation_date asc} + orderby_desc {creation_date desc} + } + manage { + label "" + display_template {@imsld_runs.manage;noquote@} + } + delete { + label {} + sub_class narrow + display_template {@imsld_runs.delete_template;noquote@} + link_html { title "[_ imsld.Delete_Run]" } + } + } \ + -orderby_name run_orderby \ + -orderby { default_value creation_date desc } + + +set run_orderby [template::list::orderby_clause -orderby -name imsld_runs] + +set cr_root_folder_id [imsld::cr::get_root_folder -community_id $community_id] + +db_multirow -extend { manage delete_template } imsld_runs get_runs { *SQL* } { + + if { [string eq $status "deleted"] } { + set delete_template "[_ imsld.Deleted] [_ imsld.Make_it_live]" + set manage "" + } else { + set delete_template "" + set create_run " [_ imsld.create_new_run] " + set manage "[_ imsld.Manage_Members]" + } +} Index: openacs-4/packages/imsld/www/admin/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/index.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/imsld/www/admin/index.xql 1 Feb 2006 11:38:23 -0000 1.1 +++ openacs-4/packages/imsld/www/admin/index.xql 16 May 2006 09:24:36 -0000 1.2 @@ -6,8 +6,9 @@ select imsld.imsld_id, coalesce(imsld.title, imsld.identifier) as imsld_title, cr3.item_id, - cr3.live_revision - from cr_items cr1, cr_items cr2, cr_items cr3, cr_items cr4, + cr3.live_revision, + to_char(ao.creation_date,'MM/DD/YYYY HH24:MI') as creation_date + from cr_items cr1, cr_items cr2, cr_items cr3, cr_items cr4, acs_objects ao, imsld_cp_manifests icm, imsld_cp_organizations ico, imsld_imsldsi imsld where cr1.live_revision = icm.manifest_id and cr1.parent_id = cr4.item_id @@ -16,8 +17,44 @@ and imsld.organization_id = cr2.item_id and cr2.live_revision = ico.organization_id and cr3.item_id = imsld.item_id + and cr3.item_id = ao.object_id + $imsld_orderby + + + + + select run.run_id, + run.status, + coalesce(imsld.title, imsld.identifier) as imsld_title, + to_char(ao.creation_date,'MM/DD/YYYY HH24:MI') as creation_date + from cr_items cr1, cr_items cr2, cr_items cr3, cr_items cr4, acs_objects ao, + imsld_runs run, imsld_cp_manifests icm, imsld_cp_organizations ico, imsld_imsldsi imsld + where run.imsld_id = imsld.imsld_id + and ao.object_id = run.run_id + and cr1.live_revision = icm.manifest_id + and cr1.parent_id = cr4.item_id + and cr4.parent_id = :cr_root_folder_id + and ico.manifest_id = cr1.item_id + and imsld.organization_id = cr2.item_id + and cr2.live_revision = ico.organization_id + and cr3.live_revision = imsld.imsld_id + $run_orderby + + + + + + + + update imsld_runs + set status = 'active' + where run_id = :set_run_id_live + + + + Index: openacs-4/packages/imsld/www/admin/run-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/run-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/admin/run-delete.tcl 16 May 2006 09:24:36 -0000 1.1 @@ -0,0 +1,28 @@ +# /packages/imsld/www/admin/run-delete.tcl + +ad_page_contract { + Deletes imsld + + @author jopez@inv.it.uc3m.es + @creation-date May 2006 + @cvs-id $Id: run-delete.tcl,v 1.1 2006/05/16 09:24:36 josee Exp $ +} { + run_id:integer,notnull + return_url +} + +db_transaction { + + db_dml delete_run { + update imsld_runs + set status = 'deleted' + where run_id = :run_id + } +} on_error { + ad_return_error "[_ imsld.lt_Error_deleting_Run_ru]" "[_ imsld.lt_There_was_an_error_de_1]" + ad_script_abort +} + +db_release_unused_handles + +ad_returnredirect $return_url Index: openacs-4/packages/imsld/www/admin/run-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/run-delete.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/admin/run-delete.xql 16 May 2006 09:24:36 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + + + update imsld_runs + set status = 'deleted' + where run_id = :run_id + + + + + +