Index: openacs-4/packages/lorsm/www/admin/tracking-rte/toc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking-rte/toc.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/admin/tracking-rte/toc.tcl 31 Dec 2006 00:36:09 -0000 1.1
+++ openacs-4/packages/lorsm/www/admin/tracking-rte/toc.tcl 17 Nov 2008 13:37:55 -0000 1.2
@@ -1,16 +1,16 @@
# packages/lorsm/www/delivery/toc.tcl
ad_page_contract {
-
+
Course Delivery Table of Content
-
+
@author Ernie Ghiglione (ErnieG@mm.st)
@creation-date 2004-04-09
@arch-tag 553390f0-450e-48db-99f0-c5dcb17978b8
@cvs-id $Id$
} {
- man_id:integer,notnull
- user_id:integer,notnull
+ man_id:integer,notnull
+ user_id:integer,notnull
} -properties {
} -validate {
} -errors {
@@ -29,134 +29,103 @@
set community_id [dotlrn_community::get_community_id]
set fs_local_package_id [site_node_apm_integration::get_child_package_id \
- -package_id [dotlrn_community::get_package_id $community_id] \
- -package_key "file-storage"\
- ]
-set track_id [lorsm::track::istrackable -course_id $man_id -package_id $package_id]
+ -package_id [dotlrn_community::get_package_id $community_id] \
+ -package_key "file-storage"]
+set track_id [lorsm::track::istrackable \
+ -course_id $man_id \
+ -package_id $package_id]
+
set extra_vars fs_local_package_id
db_foreach organizations {
- select
- org.org_id,
- org.org_title as org_title,
- org.hasmetadata,
- tree_level(o.tree_sortkey) as indent
- from
- ims_cp_organizations org, acs_objects o
- where
- org.org_id = o.object_id
- and
- man_id = :man_id
- order by
- org_id
+ select org.org_id, org.org_title as org_title, org.hasmetadata,
+ tree_level(o.tree_sortkey) as indent
+ from ims_cp_organizations org, acs_objects o
+ where org.org_id = o.object_id
+ and man_id = :man_id
+ order by org_id
} {
set indent [expr $indent +1]
set missing_text "[_ lorsm.Nothing_here]"
set table_extra_html { width="100%" }
# the table_def isn't quite neat as I'd like to, but it does the job for a
- # simple indexing for delivery.
+ # simple indexing for delivery.
# set table_def {
-# { title "" "no_sort" "
Item: $item_id $indent [if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href \"AAA $item_title\"}] | " }
+# { title "" "no_sort" "Item: $item_id $indent [if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href \"AAA $item_title\"}] | " }
# }
- append orgs_list ""
- append orgs_list "Organization: $org_title ($org_id) | "
+ append orgs_list ""
+ append orgs_list "Organization: $org_title ($org_id)
+ | "
-db_foreach organization_item {
- SELECT
- o.object_id,
- repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent,
- i.item_id,
- i.item_title as item_title,
- i.hasmetadata,
- i.item_id as identifierref,
- i.type,
- i.org_id,
- m.fs_package_id,
- m.folder_id,
- m.course_name
- FROM
- acs_objects o, ims_cp_items i, ims_cp_manifests m
- WHERE
- o.object_type = 'ims_item'
- AND
- i.org_id = :org_id
- AND
- o.object_id = i.item_id
- AND
- m.man_id = :man_id
- ORDER BY
- object_id, tree_sortkey
-} {
+ db_foreach organization_item {
+ select o.object_id,
+ repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent,
+ i.item_id, i.item_title as item_title, i.hasmetadata,
+ i.item_id as identifierref,
+ i.type, i.org_id, m.fs_package_id, m.folder_id, m.course_name
+ from acs_objects o, ims_cp_items i, ims_cp_manifests m
+ where o.object_type = 'ims_item'
+ and i.org_id = :org_id
+ and o.object_id = i.item_id
+ and m.man_id = :man_id
+ order by object_id, tree_sortkey
+ } {
+ if { [empty_string_p $identifierref] } {
+ set table_item "Item: $item_id $indent AAA $item_title"
+ } else {
+ set table_item " | Item: $item_id $indent [string trim $item_title]"
+ }
+ # set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]]
+ #set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]]
+ append orgs_list [string trim $table_item]
+ set item_table ""
- if { [empty_string_p $identifierref] } {
- set table_item " | Item: $item_id $indent AAA $item_title"
- } else {
- set table_item " | Item: $item_id $indent [string trim $item_title]"
- }
-# set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]]
- #set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html $table_def]]
+ db_foreach student_activity {
+ select *
+ from lorsm_student_track lorsm, lorsm_cmi_core cmi, ims_cp_manifests manif, ims_cp_items imsitems
+ where lorsm.community_id=:community_id
+ and lorsm.track_id=cmi.track_id
+ and lorsm.course_id=:man_id
+ and manif.man_id=:man_id
+ and cmi.man_id=:man_id
+ and cmi.item_id=:identifierref
+ and user_id=:user_id
+ and imsitems.ims_item_id=cmi.item_id
+ order by cmi.track_id asc
+ } {
+ set cut_start_time [string range $start_time 0 18]
+ set total_total_time [expr $total_time+$session_time]
+ set edit_url [export_vars -base "drill-student-singletrack" {track_id}]
+ set drill_url [export_vars -base "drill-student-singletrack" {track_id}]
- append orgs_list [string trim $table_item]
+ append item_table " | "
+ append item_table "$score_raw | "
+ append item_table " $lesson_status | "
+ append item_table " $total_total_time \" | "
+ append item_table " $cut_start_time | "
+ append item_table " $track_id | "
+ append item_table ""
-
+ }
- set item_table ""
+ if { [empty_string_p $item_table] } {
+ append orgs_list ": No scorm data
"
+ append orgs_list ""
-db_foreach student_activity {
- select *
- from
- lorsm_student_track lorsm, lorsm_cmi_core cmi, ims_cp_manifests manif, ims_cp_items imsitems
- where
- lorsm.community_id=:community_id
- and
- lorsm.track_id=cmi.track_id
- and
- lorsm.course_id=:man_id
- and
- manif.man_id=:man_id
- and
- cmi.man_id=:man_id
- and
- cmi.item_id=:identifierref
- and
- user_id=:user_id
- and
- imsitems.ims_item_id=cmi.item_id
- order by
- cmi.track_id asc
- } {
- set cut_start_time [string range $start_time 0 18]
- set total_total_time [expr $total_time+$session_time]
- set edit_url [export_vars -base "drill-student-singletrack" {track_id}]
- set drill_url [export_vars -base "drill-student-singletrack" {track_id}]
-
- append item_table ""
- append item_table "$score_raw | "
- append item_table " $lesson_status | "
- append item_table " $total_total_time \" | "
- append item_table " $cut_start_time | "
- append item_table " $track_id | "
- append item_table ""
-
+ } else {
+ append orgs_list " | | "
+ append orgs_list ""
+ append orgs_list "score | status | total time |
+ first visit | detail sessions | "
+ append orgs_list $item_table
+ append orgs_list " | "
+ }
+ }
+ append orgs_list " |
"
}
- if { [empty_string_p $item_table] } {
- append orgs_list ": No scorm data
"
- append orgs_list ""
- } else {
- append orgs_list " | | "
- append orgs_list ""
- append orgs_list "score | status | total time | first visit | detail sessions | "
- append orgs_list $item_table
- append orgs_list " | "
-
- }
-
-}
-append orgs_list " |
"
-
-}