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.7 -r1.8 --- openacs-4/packages/imsld/tcl/apm-callback-procs.tcl 12 Mar 2008 21:45:11 -0000 1.7 +++ openacs-4/packages/imsld/tcl/apm-callback-procs.tcl 4 Jul 2008 15:29:26 -0000 1.8 @@ -66,3 +66,29 @@ return 1 } + + +ad_proc -public imsld::apm_callback::after_upgrade { + -from_version_name:required + -to_version_name:required +} { + Upgrade script for the IMS-LD package + + @author Derick Leony (derick@inv.it.uc3m.es) + @creation-date 2008-06-16 + + @return + + @error +} { + apm_upgrade_logic \ + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ + -spec { + 1.3d 1.4d { + content::type::attribute::new -content_type imsld_complete_act \ + -attribute_name time_string -datatype string \ + -pretty_name "#imsld.Time_String#" -column_spec "varchar(30)" + } + } +} 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.43 -r1.44 --- openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 25 Apr 2007 10:52:30 -0000 1.43 +++ openacs-4/packages/imsld/tcl/imsld-install-procs.tcl 4 Jul 2008 15:29:26 -0000 1.44 @@ -199,6 +199,7 @@ content::type::new -content_type imsld_complete_act -supertype content_revision -pretty_name "#imsld.Complete_Act#" -pretty_plural "#imsld.Complete_Acts#" -table_name imsld_complete_acts -id_column complete_act_id content::type::attribute::new -content_type imsld_complete_act -attribute_name time_in_seconds -datatype number -pretty_name "#imsld.Time_in_Seconds#" -column_spec "integer" + content::type::attribute::new -content_type imsld_complete_act -attribute_name time_string -datatype string -pretty_name "#imsld.Time_String#" -column_spec "varchar(30)" content::type::attribute::new -content_type imsld_complete_act -attribute_name user_choice_p -datatype string -pretty_name "#imsld.User_Choice#" -column_spec "char(1)" content::type::attribute::new -content_type imsld_complete_act -attribute_name when_last_act_completed_p -datatype string -pretty_name "#imsld.lt_When_Last_Act_Complet#" -column_spec "char(1)" 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 -r1.14 -r1.15 --- openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl 17 Apr 2008 17:18:16 -0000 1.14 +++ openacs-4/packages/imsld/tcl/imsld-instance-procs.tcl 4 Jul 2008 15:29:26 -0000 1.15 @@ -53,6 +53,7 @@ # } # } imsld::instance::instantiate_activity_attributes -run_id $run_id + imsld::instance::schedule_instance_time_limits -run_id $run_id return $run_id } @@ -1067,3 +1068,141 @@ } # LocalWords: type + +ad_proc -public imsld::instance::schedule_instance_time_limits { + -run_id +} { + + + @author Derick Leony (derick@inv.it.uc3m.es) + @creation-date 2008-06-19 + + @param run_id + + @return + + @error +} { + set imsld_id [db_string select_imsld_id { + select ii.item_id + from imsld_imsldsi ii, imsld_runs ir + where ir.run_id = :run_id + and ii.imsld_id = ir.imsld_id + }] + + # method + db_foreach select_method { + select im.item_id, ica.time_string + from imsld_methodsi im, imsld_complete_actsi ica + where im.imsld_id = :imsld_id + and ica.item_id = im.complete_act_id + and ica.time_string != '' + } { + imsld::instance::schedule_complete_time_limit -run_id $run_id -activity_id $item_id -time_string $time_string + } + + # plays + db_foreach select_plays { + select ip.item_id, ica.time_string + from imsld_methodsi im, imsld_playsi ip, imsld_complete_actsi ica + where im.imsld_id = :imsld_id + and ip.method_id = im.item_id + and ica.item_id = ip.complete_act_id + and ica.time_string != '' + } { + imsld::instance::schedule_complete_time_limit -run_id $run_id -activity_id $item_id -time_string $time_string + } + + # acts + db_foreach select_acts { + select ia.item_id, ica.time_string + from imsld_methodsi im, imsld_playsi ip, imsld_actsi ia, imsld_complete_actsi ica + where im.imsld_id = :imsld_id + and ip.method_id = im.item_id + and ia.play_id = ip.item_id + and ica.item_id = ia.complete_act_id + and ica.time_string != '' + } { + imsld::instance::schedule_complete_time_limit -run_id $run_id -activity_id $item_id -time_string $time_string + } + + # learning_activities + db_foreach select_learning_activities { + select ila.item_id, ica.time_string + from imsld_methodsi im, imsld_playsi ip, imsld_actsi ia, imsld_role_partsi irp, + imsld_learning_activitiesi ila, imsld_complete_actsi ica + where im.imsld_id = :imsld_id + and ip.method_id = im.item_id + and ia.play_id = ip.item_id + and irp.act_id = ia.item_id + and ila.item_id = irp.learning_activity_id + and ica.item_id = ila.complete_act_id + and ica.time_string != '' + } { + imsld::instance::schedule_complete_time_limit -run_id $run_id -activity_id $item_id -time_string $time_string + } + + # support_activities + db_foreach select_support_activities { + select isa.item_id, ica.time_string + from imsld_methodsi im, imsld_playsi ip, imsld_actsi ia, imsld_role_partsi irp, + imsld_support_activitiesi isa, imsld_complete_actsi ica + where im.imsld_id = :imsld_id + and ip.method_id = im.item_id + and ia.play_id = ip.item_id + and irp.act_id = ia.item_id + and isa.item_id = irp.support_activity_id + and ica.item_id = isa.complete_act_id + and ica.time_string != '' + } { + imsld::instance::schedule_complete_time_limit -run_id $run_id -activity_id $item_id -time_string $time_string + } + +} + + +ad_proc -public imsld::instance::schedule_complete_time_limit { + -run_id + -activity_id + -time_string +} { + + + @author Derick Leony (derick@inv.it.uc3m.es) + @creation-date 2008-06-19 + + @param run_id + + @return + + @error +} { + + set creation_date [db_string creation_date { + select status_date + from imsld_runs + where run_id = :run_id + }] + regexp {([^\.]+)} $creation_date match creation_date + set creation_time [clock scan $creation_date] + + array set offset [imsld::parse::convert_time_to_list -time $time_string] + + # hack to set a specific date, this will be + # done for years greater than 2000 + if { $offset(years) >= 2000 } { + set time_in_seconds \ + [clock scan "$offset(years)-$offset(months)-$offset(days) $offset(hours):$offset(minutes):$offset(seconds)"] + } else { + # reversing the offset array so it can be used + # the clock scan syntax + foreach {key value} [array get offset] { + set new_offset($value) $key + } + set time_in_seconds [clock scan [array get new_offset] -base $creation_time] + # we can only schedule with a minute-level granularity, so we + # schedule it to the minute after the actual minute instead + set time_in_seconds [expr $time_in_seconds + 60] + } + imsld::schedule_finish -activity_id $activity_id -time $time_in_seconds -store +} Index: openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl 17 Apr 2008 17:18:16 -0000 1.3 +++ openacs-4/packages/imsld/tcl/imsld-monitor-procs.tcl 4 Jul 2008 15:29:26 -0000 1.4 @@ -72,6 +72,7 @@ -dom_doc $dom_doc \ -title $activity_title \ -href "[export_vars -base "activity-frame" -url {activity_id run_id {type "learning"}}]" \ + -onclick "return loadContent('[export_vars -base "activity-frame" -url {activity_id run_id {type "learning"}}]')" \ -run_id $run_id \ -revision_id $activity_id \ -type "activity"] @@ -98,6 +99,7 @@ -dom_doc $dom_doc \ -title $activity_title \ -href "[export_vars -base "activity-frame" -url {activity_id run_id {type "support"}}]" \ + -onclick "return loadContent('[export_vars -base "activity-frame" -url {activity_id run_id {type "support"}}]')" \ -run_id $run_id \ -revision_id $activity_id \ -type "activity"] @@ -123,6 +125,7 @@ -title $activity_title \ -href "[export_vars -base "activity-frame" \ -url {{activity_id "$structure_id"} run_id {type "structure"}}]" \ + -onclick "return loadContent('[export_vars -base "activity-frame" -url {activity_id run_id {type "structure"}}]')" \ -run_id $run_id \ -revision_id $structure_id \ -type "activity"] @@ -210,6 +213,7 @@ -title $activity_title \ -href "[export_vars -base "activity-frame" \ -url {activity_id run_id {type "learning"}}]" \ + -onclick "return loadContent('[export_vars -base "activity-frame" -url {activity_id run_id {type "learning"}}]')" \ -run_id $run_id \ -revision_id $activity_id \ -type "activity"] @@ -231,6 +235,7 @@ -title $activity_title \ -href "[export_vars -base "activity-frame" \ -url {activity_id run_id {type "support"}}]"\ + -onclick "return loadContent('[export_vars -base "activity-frame" -url {activity_id run_id {type "support"}}]')" \ -run_id $run_id \ -revision_id $activity_id \ -type "activity"] @@ -252,6 +257,7 @@ -title $activity_title \ -href "[export_vars -base "activity-frame" \ -url {activity_id run_id {type "structure"}}]" \ + -onclick "return loadContent('[export_vars -base "activity-frame" -url {activity_id run_id {type "structure"}}]')" \ -run_id $run_id \ -revision_id $structure_id \ -type "activity"] @@ -295,7 +301,7 @@ $local_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] $a_node setAttribute href "[export_vars -base "properties-frame" -url {run_id {type "loc"}}]" - $a_node setAttribute target "content" + $a_node setAttribute onclick "return loadContent('[export_vars -base "properties-frame" -url {run_id {type "loc"}}]')" set text [$dom_doc createTextNode "1. [_ imsld.Local_Properties]"] $a_node appendChild $text $local_node appendChild $a_node @@ -308,7 +314,7 @@ $locpers_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] $a_node setAttribute href "[export_vars -base "properties-frame" -url {run_id {type "locpers"}}]" - $a_node setAttribute target "content" + $a_node setAttribute onclick "return loadContent('[export_vars -base "properties-frame" -url {run_id {type "locpers"}}]')" set text [$dom_doc createTextNode "2. [_ imsld.lt_Local-personal_Prop]"] $a_node appendChild $text $locpers_node appendChild $a_node @@ -331,7 +337,7 @@ $role_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] $a_node setAttribute href "[export_vars -base "properties-frame" -url {run_id role_id {type "locrole"}}]" - $a_node setAttribute target "content" + $a_node setAttribute onclick "return loadContent('[export_vars -base "properties-frame" -url {run_id role_id {type "locrole"}}]')" set text [$dom_doc createTextNode "[content::item::get_title -item_id [content::revision::item_id -revision_id $role_id]]"] $a_node appendChild $text $role_node appendChild $a_node @@ -348,7 +354,7 @@ $globpers_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] $a_node setAttribute href "[export_vars -base "properties-frame" -url {run_id {type "globpers"}}]" - $a_node setAttribute target "content" + $a_node setAttribute onclick "return loadContent('[export_vars -base "properties-frame" -url {run_id {type "globpers"}}]')" set text [$dom_doc createTextNode "4. [_ imsld.lt_Global-personal_Pro]"] $a_node appendChild $text $globpers_node appendChild $a_node @@ -361,7 +367,7 @@ $globpers_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] $a_node setAttribute href "[export_vars -base "properties-frame" -url {run_id {type "glob"}}]" - $a_node setAttribute target "content" + $a_node setAttribute onclick "return loadContent('[export_vars -base "properties-frame" -url {run_id {type "glob"}}]')" set text [$dom_doc createTextNode "5. [_ imsld.Global_Properties]"] $a_node appendChild $text $globpers_node appendChild $a_node @@ -473,6 +479,7 @@ } ad_proc -public imsld::monitor::environment_as_ul { + {-activity_id 0} -environment_item_id:required -run_id:required -dom_node:required @@ -534,7 +541,8 @@ foreach environments_list [db_list_of_lists env_nested_associated_items { select cpr.resource_id, cr2.item_id as resource_item_id, - cpr.type as resource_type + cpr.type as resource_type, + cpr.href as resource_href from imsld_cp_resources cpr, imsld_items ii, acs_rels ar, cr_items cr1, cr_items cr2 where ar.object_id_one = cr1.item_id @@ -548,20 +556,41 @@ set resource_id [lindex $environments_list 0] set resource_item_id [lindex $environments_list 1] set resource_type [lindex $environments_list 2] + set resource_href [lindex $environments_list 3] set lo_node [imsld::monitor::link_to_visitors_info \ -dom_doc $dom_doc \ -title $lo_title \ -href "[export_vars -base "activity-frame" \ -url {run_id learning_object_id {type learning_object}}]"\ + -onclick "return loadContent('[export_vars -base "activity-frame" \ + -url {run_id learning_object_id {type learning_object}}]')"\ -run_id $run_id \ -revision_id $learning_object_id \ -item_id $learning_object_item_id \ -type "learning_object"] + set edit_node [$dom_doc createElement a] + $edit_node setAttribute onclick "return editEnvironment(this.parentNode,$run_id,$activity_id,$environment_id,$learning_object_item_id,\'$lo_title\',\'$resource_href\')" + $edit_node setAttribute href "#no" + set text [$dom_doc createTextNode "EDIT"] + $edit_node appendChild $text + $lo_node appendChild [$dom_doc createTextNode " \["] + $lo_node appendChild $edit_node + $lo_node appendChild [$dom_doc createTextNode "]"] + + set del_node [$dom_doc createElement a] + $del_node setAttribute onclick "return loadEnvironment('[export_vars -base environment-edit {run_id activity_id environment_id {item_id $learning_object_item_id}}]')" + $del_node setAttribute href "#no" + set text [$dom_doc createTextNode "DEL"] + $del_node appendChild $text + $lo_node appendChild [$dom_doc createTextNode " \["] + $lo_node appendChild $del_node + $lo_node appendChild [$dom_doc createTextNode "]"] $environment_node appendChild $lo_node } } + } # services @@ -588,12 +617,23 @@ -title $service_title \ -href "[export_vars -base "activity-frame" \ -url {run_id service_id {type service}}]" \ + -onclick "return loadContent('[export_vars -base "activity-frame" \ + -url {run_id service_id {type service}}]')" \ -run_id $run_id \ -revision_id $service_id \ -type "service"] - $environment_node appendChild $service_node + set del_node [$dom_doc createElement a] + $del_node setAttribute onclick "return loadEnvironment('[export_vars -base environment-edit {run_id activity_id environment_id {item_id $service_id}}]')" + $del_node setAttribute href "#no" + set text [$dom_doc createTextNode "DEL"] + $del_node appendChild $text + $service_node appendChild [$dom_doc createTextNode " \["] + $service_node appendChild $del_node + $service_node appendChild [$dom_doc createTextNode "]"] + $environment_node appendChild $service_node + } # environments @@ -610,6 +650,50 @@ -dom_doc $dom_doc } $environment_node_li appendChild $environment_node + + set div_node [$dom_doc createElement div] + set add_node [$dom_doc createElement a] + $add_node setAttribute href "#" + $add_node setAttribute onclick "return addEnvironment(this.parentNode, $environment_id, $run_id, $activity_id)" + set text [$dom_doc createTextNode "Add URL"] + $add_node appendChild $text + $div_node appendChild $add_node + +# set form_node [$dom_doc createElement form] +# $form_node setAttribute action "environment-edit" +# $form_node setAttribute onsubmit "return submitForm(this, 'environment')" + +# if { $activity_id } { +# set input_node [$dom_doc createElement input] +# $input_node setAttribute type "hidden" +# $input_node setAttribute name "activity_id" +# $input_node setAttribute value $activity_id +# $form_node appendChild $input_node +# } + +# set input_node [$dom_doc createElement input] +# $input_node setAttribute type "hidden" +# $input_node setAttribute name "environment_id" +# $input_node setAttribute value $environment_id +# $form_node appendChild $input_node +# set input_node [$dom_doc createElement input] +# $input_node setAttribute type "hidden" +# $input_node setAttribute name "run_id" +# $input_node setAttribute value $run_id +# $form_node appendChild $input_node +# set text [$dom_doc createTextNode "URL:"] +# $form_node appendChild $text +# set input_node [$dom_doc createElement input] +# $input_node setAttribute type "text" +# $input_node setAttribute name "url" +# $form_node appendChild $input_node +# set input_node [$dom_doc createElement input] +# $input_node setAttribute type "submit" +# $input_node setAttribute value "Add" +# $form_node appendChild $input_node + + $environment_node_li appendChild $div_node + $dom_node appendChild $environment_node_li } @@ -633,15 +717,15 @@ }] } { return "" } elseif { [db_0or1row is_learning { - select 1 from imsld_learning_activitiesi where item_id = :activity_item_id + select distinct 1 from imsld_learning_activitiesi where item_id = :activity_item_id }] } { set rel_type imsld_la_env_rel } elseif { [db_0or1row is_support { - select 1 from imsld_support_activitiesi where item_id = :activity_item_id + select distinct 1 from imsld_support_activitiesi where item_id = :activity_item_id }] } { set rel_type imsld_sa_env_rel } elseif { [db_0or1row is_structure { - select 1 from imsld_activity_structuresi where item_id = :activity_item_id + select distinct 1 from imsld_activity_structuresi where item_id = :activity_item_id }] } { set rel_type imsld_as_env_rel } else { @@ -658,6 +742,7 @@ }] foreach environment_item_id $associated_environments_list { imsld::monitor::environment_as_ul -environment_item_id $environment_item_id \ + -activity_id [content::item::get_live_revision -item_id $activity_item_id] \ -run_id $run_id \ -dom_node $dom_node \ -dom_doc $dom_doc @@ -837,13 +922,15 @@ -revision_id:required -type:required -item_id + {-onclick ""} } { @param dom_doc:required @param href:required @param run_id:required @param revision_id:required @param type:required @param item_id + @param onclick
Adds to the given lo_node a link to the number of users visiting the @@ -855,7 +942,9 @@ set a_node [$dom_doc createElement a] $a_node setAttribute href $href - $a_node setAttribute target "content" + if { $onclick ne "" } { + $a_node setAttribute onclick $onclick + } $result appendChild $a_node set text [$dom_doc createTextNode "$title "] Index: openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl,v diff -u -r1.66 -r1.67 --- openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 5 Jun 2008 17:40:03 -0000 1.66 +++ openacs-4/packages/imsld/tcl/imsld-parse-procs.tcl 4 Jul 2008 15:29:26 -0000 1.67 @@ -80,11 +80,59 @@ return $seconds } +ad_proc -public imsld::parse::convert_time_to_list { + -time +} { + Converts the time string (described in the spec) to an "arrayed" list + @param time The time string +} { + set time [string tolower $time] + regsub -all {[^0-9pymdths]} $time "" time + array unset time + set timea(years) 0 + set timea(months) 0 + set timea(days) 0 + set timea(hours) 0 + set timea(minutes) 0 + set timea(seconds) 0 + set t_parsed 0 + set time_length [string length $time] + while { [string length $time] } { + regexp {^([0-9]*)([pymdthms])} $time match amount component + switch $component { + y { + set timea(years) $amount + } + m { + if { !$t_parsed } { + set timea(months) $amount + } else { + set timea(minutes) $amount + } + } + d { + set timea(days) $amount + } + t { + set t_parsed 1 + } + h { + set timea(hours) $amount + } + s { + set timea(seconds) $amount + } + } + regsub ${amount}${component} $time "" time + } + return [array get timea] +} + ad_proc -public imsld::parse::convert_time_to_array { -time:required } { Converts the time from seconds into an array years, months, days, - # hours, minutes, seconds + hours, minutes, seconds @param time The time in seconds } { # seconds in year, month, day, hour, minute and second @@ -100,6 +148,26 @@ return $result } +ad_proc -public imsld::parse::convert_list_to_time { + -time:required +} { + Converts the time a list "years, months, days, hours, minutes, + seconds" to a string + @param time The time in seconds +} { + set time_string "P" + foreach {unit value} $time { + if { $unit eq "hours" } { + append time_string "T" + } + if { $value } { + set cap [string toupper [string range $unit 0 0]] + append time_string "$value$cap" + } + } + return $time_string +} + ad_proc -public imsld::parse::get_URI { -type:required } { @@ -2290,6 +2358,7 @@ set user_choice_p f set complete_act_id "" set time_in_seconds "" + set time_string "" set when_prop_value_is_set_xml "" if { [llength $complete_activity] } { imsld::parse::validate_multiplicity -tree $complete_activity -multiplicity 1 -element_name complete-activity(learning-activity) -equal @@ -2308,6 +2377,7 @@ imsld::parse::validate_multiplicity -tree $time_limit -multiplicity 1 -element_name time-limit(learning-activity) -equal set time_string [imsld::parse::get_element_text -node $time_limit] set time_in_seconds [imsld::parse::convert_time_to_seconds -time $time_string] + set time_string $time_string } # Learning Activity: Complete Activity: When Property Value is Set @@ -2322,6 +2392,7 @@ set when_prop_value_is_set_xml [$temporal_node asXML] } set complete_act_id [imsld::item_revision_new -attributes [list [list time_in_seconds $time_in_seconds] \ + [list time_string $time_string] \ [list user_choice_p $user_choice_p] \ [list when_prop_val_is_set_xml $when_prop_value_is_set_xml]] \ -content_type imsld_complete_act \ @@ -2503,6 +2574,7 @@ set user_choice_p f set complete_act_id "" set time_in_seconds "" + set time_string "" set when_prop_value_is_set_xml "" if { [llength $complete_activity] } { imsld::parse::validate_multiplicity -tree $complete_activity -multiplicity 1 -element_name complete-activity(support-activity) -equal @@ -2521,6 +2593,7 @@ imsld::parse::validate_multiplicity -tree $time_limit -multiplicity 1 -element_name time-limit(support-activity) -equal set time_string [imsld::parse::get_element_text -node $time_limit] set time_in_seconds [imsld::parse::convert_time_to_seconds -time $time_string] + set time_string $time_string } # Support Activity: Complete Activity: When Property Value is Set @@ -2535,6 +2608,7 @@ set when_prop_value_is_set_xml [$temporal_node asXML] } set complete_act_id [imsld::item_revision_new -attributes [list [list time_in_seconds $time_in_seconds] \ + [list time_string $time_string] \ [list user_choice_p $user_choice_p] \ [list when_prop_val_is_set_xml $when_prop_value_is_set_xml]] \ -content_type imsld_complete_act \ @@ -3340,6 +3414,7 @@ set complete_act [$act_node selectNodes "*\[local-name()='complete-act'\]"] set complete_act_id "" set time_in_seconds "" + set time_string "" set when_prop_value_is_set_xml "" set when_condition_true_id "" if { [llength $complete_act] } { @@ -3350,6 +3425,7 @@ imsld::parse::validate_multiplicity -tree $time_limit -multiplicity 1 -element_name time-limit(complete-act) -equal set time_string [imsld::parse::get_element_text -node $time_limit] set time_in_seconds [imsld::parse::convert_time_to_seconds -time $time_string] + set time_string $time_string } # Act: Complete Act: When Property Value is Set set when_prop_value_is_set [$complete_act selectNodes "*\[local-name()='when-property-value-is-set'\]"] @@ -3404,6 +3480,7 @@ if { ![string eq "" $time_in_seconds] || ![string eq "" $when_prop_value_is_set_xml] ||![string eq "" $when_condition_true_id] } { set complete_act_id [imsld::item_revision_new -attributes [list [list time_in_seconds $time_in_seconds] \ + [list time_string $time_string] \ [list when_condition_true_id $when_condition_true_id] \ [list when_prop_val_is_set_xml $when_prop_value_is_set_xml]] \ -content_type imsld_complete_act \ @@ -3583,6 +3660,7 @@ set complete_play [$play_node selectNodes "*\[local-name()='complete-play'\]"] set complete_act_id "" set time_in_seconds "" + set time_string "" set when_last_act_completed_p f set when_prop_value_is_set_xml "" if { [llength $complete_play] } { @@ -3593,6 +3671,7 @@ imsld::parse::validate_multiplicity -tree $time_limit -multiplicity 1 -element_name time-limit(complete-play) -equal set time_string [imsld::parse::get_element_text -node $time_limit] set time_in_seconds [imsld::parse::convert_time_to_seconds -time $time_string] + set time_string $time_string } # Play: Complete Play: When Property Value is Set set when_prop_value_is_set [$complete_play selectNodes "*\[local-name()='when-property-value-is-set'\]"] @@ -3611,6 +3690,7 @@ set when_last_act_completed_p t } set complete_act_id [imsld::item_revision_new -attributes [list [list time_in_seconds $time_in_seconds] \ + [list time_string $time_string] \ [list when_last_act_completed_p $when_last_act_completed_p] \ [list when_prop_val_is_set_xml $when_prop_value_is_set_xml]] \ -content_type imsld_complete_act \ @@ -4307,6 +4387,7 @@ set complete_unit_of_learning [$method selectNodes "*\[local-name()='complete-unit-of-learning'\]"] set complete_act_id "" set time_in_seconds "" + set time_string "" set when_prop_value_is_set_xml "" if { [llength $complete_unit_of_learning] } { imsld::parse::validate_multiplicity -tree $complete_unit_of_learning -multiplicity 1 -element_name complete-unit-of-learning -equal @@ -4317,6 +4398,7 @@ imsld::parse::validate_multiplicity -tree $time_limit -multiplicity 1 -element_name time-limit(complete-unit-of-learning) -equal set time_string [imsld::parse::get_element_text -node $time_limit] set time_in_seconds [imsld::parse::convert_time_to_seconds -time $time_string] + set time_string $time_string } # Method: Complete Unit of Learning: When Property Value is Set set when_prop_value_is_set [$complete_unit_of_learning selectNodes "*\[local-name()='when-property-value-is-set'\]"] @@ -4330,6 +4412,7 @@ set when_prop_value_is_set_xml [$temporal_node asXML] } set complete_act_id [imsld::item_revision_new -attributes [list [list time_in_seconds $time_in_seconds] \ + [list time_string $time_string] \ [list when_prop_val_is_set_xml $when_prop_value_is_set_xml]] \ -content_type imsld_complete_act \ -parent_id $cr_folder_id] 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.101 -r1.102 --- openacs-4/packages/imsld/tcl/imsld-procs.tcl 5 Jun 2008 17:40:03 -0000 1.101 +++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 4 Jul 2008 15:29:26 -0000 1.102 @@ -382,19 +382,18 @@ } ad_proc -public imsld::finish_expired_activity { - -activity_id:required + -activity_id:required } { Expire a given activity (method, play, act or learning/support activity). This is based on imsld::sweep_expired_activities but intended to be faster, callsed on a scheduled way. } { - set imsld_type [content::item::get_content_type \ - -item_id [content::revision::item_id -revision_id $activity_id]] + set imsld_type [content::item::get_content_type -item_id $activity_id] switch $imsld_type { imsld_method { - ns_log notice "imsld::sweep_expired_activities Sweeping methods.." + ns_log notice "imsld::finish_expired_activity Sweeping methods.." # 1. methods if {[db_0or1row possible_expired_method { *SQL* }]} { if { [db_0or1row compre_times { @@ -413,7 +412,7 @@ } imsld_play { - ns_log notice "imsld::sweep_expired_activities Sweeping plays..." + ns_log notice "imsld::finish_expired_activity Sweeping plays..." # 2. plays if {[db_0or1row possible_expired_play { *SQL* }]} { if { [db_0or1row compre_times { @@ -448,7 +447,7 @@ } imsld_act { - ns_log notice "imsld::sweep_expired_activities Sweeping acts..." + ns_log notice "imsld::finish_expired_activity Sweeping acts..." # 3. acts if {[db_0or1row possible_expired_act { *SQL* }]} { if { [db_0or1row compre_times { @@ -484,7 +483,7 @@ } imsld_support_activity { - ns_log notice "imsld::sweep_expired_activities Sweeping support activities..." + ns_log notice "imsld::finish_expired_activity Sweeping support activities..." # 4. support activities if {[db_0or1row referenced_sas { *SQL* }]} { set role_part_id_list [imsld::get_role_part_from_activity -activity_type support -leaf_id $sa_item_id] @@ -538,7 +537,7 @@ } imsld_learning_activity { - ns_log notice "imsld::sweep_expired_activities Sweeping learning activities..." + ns_log notice "imsld::finish_expired_activity Sweeping learning activities..." # 5. learning activities if {[db_0or1row referenced_las { *SQL* }]} { set role_part_id_list [imsld::get_role_part_from_activity -activity_type learning -leaf_id $la_item_id] @@ -558,6 +557,7 @@ }] } { # the act has been expired, let's mark it as finished # set community_id [imsld::community_id_from_manifest_id -manifest_id $manifest_id] + db_foreach user_in_run { *SQL* } { imsld::finish_component_element -imsld_id $imsld_id \ -run_id $run_id \ @@ -622,16 +622,16 @@ set hour [clock format $time -format "%H"] set minute [clock format $time -format "%M"] ad_schedule_proc -thread t -once t -schedule_proc ns_schedule_daily [list $hour $minute] \ - imsld::finish_expired_process -activity_id $activity_id + imsld::finish_expired_activity -activity_id $activity_id } if { $store_p } { set due_date [clock format $time -format "%m-%d-%Y"] db_dml insert_scheduled_complete { - insert into imsld_scheduled_completes - (activity_id, time, due_date) + insert into imsld_scheduled_time_limits + (activity_id, time) values - (:activity_id, :time, :due_date) + (:activity_id, :time) } } } @@ -648,12 +648,14 @@ @error } { - db_foreach { - select item_id, time - from imsld_scheduled_complete - where due_date = current_date() + set initial [clock scan [clock format [clock seconds] -format "%D"]] + set final [clock scan "23 hours 59 minutes 59 seconds" -base $initial] + db_foreach select_time_limits { + select activity_id, time + from imsld_scheduled_time_limits + where time between :initial and :final } { - imsld::schedule_finish -activity_id $item_id -time $time + imsld::schedule_finish -activity_id $activity_id -time $time } } @@ -1057,35 +1059,6 @@ -is_live "t" \ -attributes $attributes \ -package_id $package_id] - set index [lsearch $attributes [list complete_act_id *]] - if { $index > -1} { - set complete_act_id [lindex $attributes $index 1] - set time_in_seconds [db_string select_complete_act { - select ica.time_in_seconds - from imsld_complete_acts ica, cr_revisions cr - where cr.item_id = :complete_act_id - and ica.complete_act_id = cr.revision_id - and content_revision__is_live(cr.revision_id) - } -default ""] - - if {$time_in_seconds ne ""} { - set creation_date [acs_object::get_element -object_id $revision_id -element creation_date_ansi] - array set offset [imsld::parse::convert_time_to_array -time $time_in_seconds] - - - set creation_time [clock scan $creation_date] - - # hack to enable setting a specific date, this will be - # done for years greater than 2000 - if { $offset(year) >= 2000 } { - set time_in_seconds \ - [clock scan "$offset(year)-$offset(month)-$offset(day) $offset(hour):$offset(minute):$offset(second)"] - } else { - set time_in_seconds [expr $creation_time + $time_in_seconds] - } - imsld::schedule_finish -activity_id $item_id -time $time_in_seconds -store - } - } } else { set revision_id [content::revision::new -item_id $item_id \ -title $title \ @@ -1641,7 +1614,7 @@ 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 { run_id }]" + ad_returnredirect "[export_vars -base "[lindex [site_node::get_url_from_object_id -object_id $imsld_package_id] 0]/imsld-divset" -url { run_id }]" } } @@ -2184,7 +2157,6 @@ set a_node [$dom_doc createElement a] $a_node setAttribute href [export_vars -base "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]]imsld/imsld-sendmail" {{send_mail_id $sendmail_id} {run_id $run_id}}] set service_title [$dom_doc createTextNode "$send_mail_title"] - $a_node setAttribute target "content" $a_node appendChild $service_title $send_mail_node_li appendChild $a_node $dom_node appendChild $send_mail_node_li @@ -2202,7 +2174,6 @@ set a_node [$dom_doc createElement a] set file_url [export_vars -base "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]]imsld/monitor-frame" { monitor_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}] - $a_node setAttribute target "content" set service_title [$dom_doc createTextNode "$monitor_service_title"] $a_node appendChild $service_title $monitor_node_li appendChild $a_node @@ -2233,7 +2204,6 @@ -dom_node:required -dom_doc:required {-user_id ""} - {-target ""} } { @param environment_item_id @param run_id @@ -2512,13 +2482,12 @@ set user_id [expr { [string eq $user_id ""] ? [ad_conn user_id] : $user_id }] - set url "activity-frame" if { $div_p } { - append url "-div" + set url "activity-frame" + } else { + set url "imsld-divset" } - ns_log notice "div_p: $div_p, url: $url" - return "[export_vars -base $url -url {activity_id run_id user_id}]" } @@ -2530,9 +2499,7 @@ -dom_node -dom_doc -li_mode:boolean - {-user_id ""} - {-target ""} -} { + {-user_id ""}} { @param resource_item_id @param run_id @option community_id @@ -2565,10 +2532,8 @@ 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 run_id $run_id}]" + $a_node setAttribute target "_blank" $a_node setAttribute title "$object_title" - if { $target ne "" } { - $a_node setAttribute target "$target" - } 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" @@ -2597,6 +2562,7 @@ set file_url "imsld-content-serve" 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 run_id $run_id}]" + $a_node setAttribute target "_blank" $a_node setAttribute title "$file_name" set img_node [$dom_doc createElement img] $img_node setAttribute src "[imsld::object_type_image_path -object_type file-storage]" @@ -2626,6 +2592,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 run_id $run_id}]" + $a_node setAttribute target "_blank" $a_node setAttribute title "$file_name" set img_node [$dom_doc createElement img] $img_node setAttribute src "[imsld::object_type_image_path -object_type file-storage]" @@ -2645,6 +2612,7 @@ db_foreach associated_urls { *SQL* } { 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 run_id}]" + $a_node setAttribute target "_blank" $a_node setAttribute title "$url" set img_node [$dom_doc createElement img] $img_node setAttribute src "[imsld::object_type_image_path -object_type url]" @@ -2729,7 +2697,6 @@ -dom_node -dom_doc {-user_id ""} - {-target ""} } { @param activity_item_id @param run_id @@ -2774,8 +2741,7 @@ imsld::process_environment_as_ul -environment_item_id $environment_item_id \ -run_id $run_id \ -dom_node $dom_node \ - -dom_doc $dom_doc \ - -target $target + -dom_doc $dom_doc } } @@ -2998,6 +2964,7 @@ @return The list of items (resources, feedback, environments, using tdom) associated with the support activity } { set user_id [expr { [string eq "" $user_id] ? [ad_conn user_id] : $user_id }] + if { ![db_0or1row activity_info { *SQL* }] } { # is visible is false do not show anything return @@ -3193,8 +3160,11 @@ $activity_node setAttribute class "liOpen" set b_node [$dom_doc createElement b] set a_node [$dom_doc createElement a] - $a_node setAttribute href "[imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id]" - $a_node setAttribute target "content" + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute href $href + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute onclick "return loadContent('$div')" + set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $b_node appendChild $a_node @@ -3207,8 +3177,11 @@ set activity_node [$dom_doc createElement li] $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - $a_node setAttribute href "[imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id]" - $a_node setAttribute target "content" + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute href $href + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute onclick "return loadContent('$div')" + set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $activity_node appendChild $a_node @@ -3235,6 +3208,7 @@ # show the finish button set input_node [$dom_doc createElement a] $input_node setAttribute href "finish-component-element-${imsld_id}-${run_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-learning.imsld" + $input_node setAttribute onclick "return loadTree(this.href)" $input_node setAttribute class "finish" $input_node setAttribute title "[_ imsld.finish_activity]" set text [$dom_doc createTextNode "[_ imsld.finish]"] @@ -3274,8 +3248,12 @@ $activity_node setAttribute class "liOpen" set b_node [$dom_doc createElement b] set a_node [$dom_doc createElement a] - $a_node setAttribute href "[imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id]" - $a_node setAttribute target "content" + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute href $href + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute onclick "return loadContent('$div')" + + set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $b_node appendChild $a_node @@ -3288,8 +3266,11 @@ set activity_node [$dom_doc createElement li] $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - $a_node setAttribute href "[imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id]" - $a_node setAttribute target "content" + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute href $href + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute onclick "return loadContent('$div')" + set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $activity_node appendChild $a_node @@ -3315,6 +3296,7 @@ # show the finish button set input_node [$dom_doc createElement a] $input_node setAttribute href "finish-component-element-${imsld_id}-${run_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-support.imsld" + $input_node setAttribute onclick "return loadTree(this.href)" $input_node setAttribute class "finish" $input_node setAttribute title "[_ imsld.finish_activity]" set text [$dom_doc createTextNode "[_ imsld.finish]"] @@ -3344,8 +3326,10 @@ set structure_node [$dom_doc createElement li] $structure_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - $a_node setAttribute href "[imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id]" - $a_node setAttribute target "content" + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute href $href + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute onclick "return loadContent('$div');" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $structure_node appendChild $a_node @@ -3354,8 +3338,10 @@ $structure_node setAttribute class "liOpen" set b_node [$dom_doc createElement b] set a_node [$dom_doc createElement a] - $a_node setAttribute href "[imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id]" - $a_node setAttribute target "content" + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute $href + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute onclick "return loadContent('$div');" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $b_node appendChild $a_node @@ -3386,7 +3372,6 @@ } ad_proc -public imsld::generate_activities_tree { - -div:boolean -run_id:required -user_id {-next_activity_id_list ""} @@ -3398,7 +3383,6 @@ @return A list of lists of the activities } { - ns_log notice "div_p @ 1st: $div_p" db_1row imsld_info { select imsld_id from imsld_runs @@ -3455,10 +3439,10 @@ $activity_node setAttribute class "liOpen" set b_node [$dom_doc createElement b] set a_node [$dom_doc createElement a] - set href [imsld::activity_url -div=$div_p -activity_id $activity_id -run_id $run_id -user_id $user_id] + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] $a_node setAttribute href $href - $a_node setAttribute target "content" - $a_node setAttribute onclick "return loadContent('$href')" + $a_node setAttribute onclick "return loadContent('$div')" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $b_node appendChild $a_node @@ -3471,10 +3455,10 @@ set activity_node [$dom_doc createElement li] $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - set href [imsld::activity_url -div=$div_p -activity_id $activity_id -run_id $run_id -user_id $user_id] + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] $a_node setAttribute href $href - $a_node setAttribute target "content" - $a_node setAttribute onclick "return loadContent('$href')" + $a_node setAttribute onclick "return loadContent('$div')" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $activity_node appendChild $a_node @@ -3502,6 +3486,7 @@ # show the finish button set input_node [$dom_doc createElement a] $input_node setAttribute href "finish-component-element-${imsld_id}-${run_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-learning.imsld" + $input_node setAttribute onclick "return loadTree(this.href)" $input_node setAttribute class "finish" $input_node setAttribute title "[_ imsld.finish_activity]" set text [$dom_doc createTextNode "[_ imsld.finish]"] @@ -3539,10 +3524,10 @@ # bold letters set b_node [$dom_doc createElement b] set a_node [$dom_doc createElement a] - set href [imsld::activity_url -div=$div_p -activity_id $activity_id -run_id $run_id -user_id $user_id] + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] $a_node setAttribute href $href - $a_node setAttribute target "content" - $a_node setAttribute onclick "return loadContent('$href')" + $a_node setAttribute onclick "return loadContent('$div')" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $b_node appendChild $a_node @@ -3553,10 +3538,10 @@ } else { # bold letters set a_node [$dom_doc createElement a] - set href [imsld::activity_url -div=$div_p -activity_id $activity_id -run_id $run_id -user_id $user_id] + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] $a_node setAttribute href $href - $a_node setAttribute target "content" - $a_node setAttribute onclick "return loadContent('$href')" + $a_node setAttribute onclick "return loadContent('$div')" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $activity_node appendChild $a_node @@ -3581,6 +3566,7 @@ # show the finish button set input_node [$dom_doc createElement a] $input_node setAttribute href "finish-component-element-${imsld_id}-${run_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-support.imsld" + $input_node setAttribute onclick "return loadTree(this.href)" $input_node setAttribute class "finish" $input_node setAttribute title "[_ imsld.finish_activity]" set text [$dom_doc createTextNode "[_ imsld.finish]"] @@ -3610,10 +3596,10 @@ set structure_node [$dom_doc createElement li] $structure_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - set href [imsld::activity_url -div=$div_p -activity_id $structure_id -run_id $run_id -user_id $user_id] + set href [imsld::activity_url -activity_id $structure_id -run_id $run_id -user_id $user_id] + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] $a_node setAttribute href $href - $a_node setAttribute target "content" - $a_node setAttribute onclick "return loadContent('$href')" + $a_node setAttribute onclick "return loadContent('$div')" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $structure_node appendChild $a_node @@ -3622,10 +3608,10 @@ $structure_node setAttribute class "liOpen" set b_node [$dom_doc createElement b] set a_node [$dom_doc createElement a] - set href [imsld::activity_url -div=$div_p -activity_id $structure_id -run_id $run_id -user_id $user_id] + set href [imsld::activity_url -activity_id $structure_id -run_id $run_id -user_id $user_id] + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] $a_node setAttribute href $href - $a_node setAttribute target "content" - $a_node setAttribute onclick "return loadContent('$href')" + $a_node setAttribute onclick "return loadContent('$div')" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $b_node appendChild $a_node @@ -3652,7 +3638,6 @@ } ad_proc -public imsld::generate_runtime_assigned_activities_tree { - -div:boolean -run_id:required -user_id -dom_node @@ -3709,9 +3694,10 @@ $activity_node setAttribute class "liOpen" set b_node [$dom_doc createElement b] set a_node [$dom_doc createElement a] - set href [imsld::activity_url -div=$div_p -activity_id $activity_id -run_id $run_id -user_id $user_id] + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] $a_node setAttribute href $href - $a_node setAttribute target "content" + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute onclick "return loadContent('$div')" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $b_node appendChild $a_node @@ -3724,9 +3710,11 @@ set activity_node [$dom_doc createElement li] $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - set href [imsld::activity_url -div=$div_p -activity_id $activity_id -run_id $run_id -user_id $user_id] + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] $a_node setAttribute href $href - $a_node setAttribute target "content" + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] + $a_node setAttribute onclick "return loadContent('$div')" + set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $activity_node appendChild $a_node @@ -3754,6 +3742,7 @@ # show the button to finish the activity set input_node [$dom_doc createElement a] $input_node setAttribute href "finish-component-element-${imsld_id}-${run_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-learning.imsld" + $input_node setAttribute onclick "return loadTree(this.href)" $input_node setAttribute class "finish" $input_node setAttribute title "[_ imsld.finish_activity]" set text [$dom_doc createTextNode "[_ imsld.finish]"] @@ -3782,10 +3771,10 @@ $activity_node setAttribute class "liOpen" set b_node [$dom_doc createElement b] set a_node [$dom_doc createElement a] - set href [imsld::activity_url -div=$div_p -activity_id $activity_id -run_id $run_id -user_id $user_id] + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] $a_node setAttribute $href - $a_node setAttribute target "content" - $a_node setAttribute onclick "return loadContent('$href')" + $a_node setAttribute onclick "return loadContent('$div')" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $b_node appendChild $a_node @@ -3798,10 +3787,10 @@ set activity_node [$dom_doc createElement li] $activity_node setAttribute class "liOpen" set a_node [$dom_doc createElement a] - set href [imsld::activity_url -div=$div_p -activity_id $activity_id -run_id $run_id -user_id $user_id] + set href [imsld::activity_url -activity_id $activity_id -run_id $run_id -user_id $user_id] + set div [imsld::activity_url -div -activity_id $activity_id -run_id $run_id -user_id $user_id] $a_node setAttribute $href - $a_node setAttribute target "content" - $a_node setAttribute onclick "return loadContent('$href')" + $a_node setAttribute onclick "return loadContent('$div')" set text [$dom_doc createTextNode "$activity_title"] $a_node appendChild $text $activity_node appendChild $a_node @@ -3828,6 +3817,7 @@ set b_node [$dom_doc createElement b] set input_node [$dom_doc createElement a] $input_node setAttribute href "finish-component-element-${imsld_id}-${run_id}-${play_id}-${act_id}-${role_part_id}-${activity_id}-support.imsld" + $input_node setAttribute onclick "return loadTree(this.href)" $input_node setAttribute class "finish" $input_node setAttribute title "[_ imsld.finish_activity]" set text [$dom_doc createTextNode "[_ imsld.finish]"] 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.40 -r1.41 --- openacs-4/packages/imsld/tcl/imsld-procs.xql 5 Jun 2008 17:40:03 -0000 1.40 +++ openacs-4/packages/imsld/tcl/imsld-procs.xql 4 Jul 2008 15:29:26 -0000 1.41 @@ -56,7 +56,7 @@ and ca.time_in_seconds is not null and ao.object_id = ir.run_id and content_revision__is_live(ii.imsld_id) = 't' - and im.method_id = :activity_id + and im.item_id = :activity_id @@ -142,7 +142,7 @@ and ao.object_id = ir.run_id and content_revision__is_live(ii.imsld_id) = 't' and ii.imsld_id = ir.imsld_id - and ip.play_id = :activity_id + and ip.item_id = :activity_id @@ -195,7 +195,7 @@ and ao.object_id = ir.run_id and content_revision__is_live(ii.imsld_id) = 't' and ii.imsld_id = ir.imsld_id - and ia.act_id = :activity_id + and ia.item_id = :activity_id @@ -224,7 +224,7 @@ where sa.complete_act_id = ca.item_id and content_revision__is_live(ca.complete_act_id) = 't' and ca.time_in_seconds is not null - and sa.activity_id = :activity_id + and sa.item_id = :activity_id @@ -305,7 +305,7 @@ where la.complete_act_id = ca.item_id and content_revision__is_live(ca.complete_act_id) = 't' and ca.time_in_seconds is not null - and la.activity_id = :activity_id + and la.item_id = :activity_id