Index: openacs-4/packages/lorsm/templates/lorsm-no-index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/templates/lorsm-no-index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/templates/lorsm-no-index.tcl 22 Apr 2005 09:10:55 -0000 1.2 +++ openacs-4/packages/lorsm/templates/lorsm-no-index.tcl 26 Apr 2005 08:56:24 -0000 1.3 @@ -2,6 +2,7 @@ # The detected content type is "content_revision". lorsm::get_content content_revision +set user_id [ad_conn user_id] if { [info exists content(item_id)] } { if { ![string equal -length 4 "text" $content(mime_type)] } { @@ -38,7 +39,6 @@ and i.org_id = o.org_id }] } { # record view - set user_id [ad_conn user_id] set item_list [lorsm::get_item_list $man_id $user_id] set litem_list [llength $item_list] @@ -63,10 +63,38 @@ set viewed_item_id [lindex $item_list [expr [lsearch -exact $item_list $viewed_item_id] - 1]] } lorsm::record_view $viewed_item_id $man_id + + # Student tracking + set package_id [ad_conn package_id] + set community_id [dotlrn_community::get_community_id] + + if {[lorsm::track::istrackable -course_id $man_id -package_id $package_id]} { + + set track_id [lorsm::track::new \ + -user_id $user_id \ + -community_id $community_id \ + -course_id $man_id] + lorsm::track::exit -track_id $track_id + } + + # refresh the page every 300 seconds so we can have an estimate of the time when the user viewed the course for the last time + if { ![regsub -nocase {<\/head>} $text { + + + } text] } { + regsub -nocase {} $text { + + + + + } text + } } # parent window regsub -all -nocase {target=[^ |^>]+} $text {target="_parent"} text + + } ad_return_template