Index: openacs-4/packages/lorsm/www/admin/tracking/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/tracking/index.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/lorsm/www/admin/tracking/index.tcl 16 Jan 2008 16:54:45 -0000 1.2 +++ openacs-4/packages/lorsm/www/admin/tracking/index.tcl 17 Nov 2008 13:37:55 -0000 1.3 @@ -1,9 +1,9 @@ # packages/lorsm/www/tracking/index.tcl ad_page_contract { - + Student Tracking Index Page - + @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 2004-05-25 @arch-tag a5b230ee-0fa7-4e48-be1b-eeae323291e7 @@ -32,7 +32,9 @@ template::list::create \ -name student_track \ -multirow student_track \ - -actions [list "[_ lorsm.Summarize]" [export_vars -base ".?group=0" {man_id item_id}] "[_ lorsm.lt_Summarize_all_student]"] \ + -actions [list "[_ lorsm.Summarize]" \ + [export_vars -base ".?group=0" {man_id item_id}] \ + "[_ lorsm.lt_Summarize_all_student]"] \ -key man_id \ -html {width 50%} \ -no_data "[_ lorsm.No_Students]" \ @@ -42,52 +44,51 @@ display_eval {[person::name -person_id $student_name]} link_url_eval {[acs_community_member_url -user_id $student_name]} link_html {title "[_ lorsm.Students_profile]"} - } - start_time { + + } start_time { label "[_ lorsm.Start_Course]" display_eval {[lc_time_fmt $start_time "%x %T"]} html { align center } - } - end_time { + + } end_time { label "[_ lorsm.Exit_Course]" display_eval {[lc_time_fmt $end_time "%x %T"]} html { align center } - } - time_spend { + + } time_spend { label "[_ lorsm.Time_Spent]" - display_eval {[lorsm::dates_calc -start_date [string range $start_time 0 18] -end_date [string range $end_time 0 18]]} + display_eval {[lorsm::dates_calc \ + -start_date [string range $start_time 0 18] \ + -end_date [string range $end_time 0 18]]} html { align center } } } db_multirow -extend { ims_md_id } student_track select_students { - select - user_id as student_name, - start_time, - end_time + select user_id as student_name, start_time, end_time from lorsm_student_track where community_id = :community_id - and course_id = :man_id - and end_time NOTNULL + and course_id = :man_id + and end_time NOTNULL order by start_time desc } { set ims_md_id $man_id } - + template::list::create \ -name object_views \ -multirow object_views \ -elements { title { label "[_ lorsm.Title_1]" - } - viewer_name { + + } viewer_name { label "[_ lorsm.Viewed_By]" - } - views_count { + + } views_count { label "[_ lorsm.Total_Views]" - } - last_viewed { + + } last_viewed { label "[_ lorsm.Last_Viewed_On]" display_eval {[lc_time_fmt $last_viewed "%x %X"]} } @@ -99,20 +100,14 @@ set extra_where "" } - db_multirow -extend {viewer_name} object_views objects_views " - select v.*, - i.item_title as title - from views_views v, - ims_cp_items i, - ims_cp_organizations o - where - i.ims_item_id = v.object_id - and - i.org_id = o.org_id - and - o.man_id = :man_id - $extra_where - " { + db_multirow -extend {viewer_name} object_views objects_views \ + "select v.*, i.item_title as title + from views_views v, ims_cp_items i, ims_cp_organizations o + where i.ims_item_id = v.object_id + and i.org_id = o.org_id + and o.man_id = :man_id + $extra_where" + { set viewer_name [acs_user::get_element -user_id $viewer_id -element name] } @@ -123,7 +118,9 @@ -name student_track \ -multirow student_track \ -key man_id \ - -actions [list "[_ lorsm.Expand]" [export_vars -base ".?group=1" {man_id item_id}] "Expand all students"] \ + -actions [list "[_ lorsm.Expand]" \ + [export_vars -base ".?group=1" {man_id item_id}] \ + "Expand all students"] \ -html {width 50%} \ -no_data "[_ lorsm.No_Students]" \ -elements { @@ -132,28 +129,25 @@ display_eval {[person::name -person_id $student_name]} link_url_eval {[acs_community_member_url -user_id $student_name]} link_html {title "Student's profile"} - } - counter { + + } counter { label "[_ lorsm.Times_Viewed]" html { align center } - } - time_spent { + + } time_spent { label "[_ lorsm.Time_Spent]" html { align center } } } db_multirow -extend { ims_md_id } student_track select_students { - select - user_id as student_name, - count(*) as counter, - sum(end_time - start_time) as time_spent + select user_id as student_name, count(*) as counter, + sum(end_time - start_time) as time_spent from lorsm_student_track where community_id = :community_id - and course_id = :man_id - and end_time NOTNULL + and course_id = :man_id + and end_time NOTNULL group by user_id - } { set ims_md_id $man_id } @@ -164,35 +158,29 @@ -elements { title { label "[_ lorsm.Title_1]" - } - views_count { + + } views_count { label "[_ lorsm.Total_Views]" - } - unique_views { + + } unique_views { label "[_ lorsm.Unique_Views]" - } - last_viewed { + + } last_viewed { label "[_ lorsm.Last_Viewed_On]" } } - + if {$item_id} { set extra_where " and v.object_id = :item_id" } else { set extra_where "" } - db_multirow object_views objects_views "select v.*, - i.item_title as title - from view_aggregates v, - ims_cp_items i, - ims_cp_organizations o - where - i.ims_item_id = v.object_id - and - i.org_id = o.org_id - and - o.man_id = :man_id + db_multirow object_views objects_views \ + "select v.*, i.item_title as title + from view_aggregates v, ims_cp_items i, ims_cp_organizations o + where i.ims_item_id = v.object_id + and i.org_id = o.org_id + and o.man_id = :man_id $extra_where" - }