Index: openacs-4/packages/lorsm/www/delivery/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/delivery/index.tcl 22 Apr 2004 03:58:12 -0000 1.1 +++ openacs-4/packages/lorsm/www/delivery/index.tcl 4 Sep 2004 14:51:21 -0000 1.2 @@ -1,67 +1,57 @@ -# packages/lorsm/www/delivery/index.tcl +# packages/lorsm/www/delivery4/index.tcl ad_page_contract { - Course Delivery Based on IMS Content Packaging Structure + New index file using new tree menu - @author Ernie Ghiglione (ErnieG@mm.st) - @creation-date 2004-04-09 - @arch-tag cfea182c-c686-4bee-be61-ec73f3d3a10f + @author Roel Canicula (roelmc@info.com.ph) + @creation-date 2004-08-07 + @arch-tag: 64f3397b-4558-4298-a995-fc63e472f2a1 @cvs-id $Id$ } { - man_id:integer,notnull + man_id:integer,notnull + ims_id:integer,notnull,optional } -properties { } -validate { } -errors { } + +if { [info exists ims_id] } { + set item_id $ims_id + + set body_url [export_vars -base "record-view" -url {item_id man_id}] +} + +# Get the course name if {[db_0or1row manifest " select - cp.man_id, cp.course_name, - cp.identifier, - cp.version, - text 'Yes' as hello, - case - when hasmetadata = 't' then 'Yes' - else 'No' - end as man_metadata, - case - when isscorm = 't' then 'Yes' - else 'No' - end as isscorm, - cp.fs_package_id, - cp.folder_id, - acs.creation_user, - acs.creation_date, - acs.context_id + cp.fs_package_id from - ims_cp_manifests cp, acs_objects acs + ims_cp_manifests cp where - cp.man_id = acs.object_id - and cp.man_id = :man_id + cp.man_id = :man_id and cp.parent_man_id = 0"]} { - # Course Name if {[empty_string_p $course_name]} { - set course_name "No course Name" + set course_name "No Course Name" } - - # Version - if {[empty_string_p $version]} { - set version "No version Available" - } - - # Instance - set instance [apm_package_key_from_id $fs_package_id] - - # Folder - set folder [apm_package_url_from_id $fs_package_id]?[export_vars folder_id] - } else { - - set display 0 - + set course_name "No Course Name" } +# Student tracking +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] +set user_id [ad_conn user_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] +} else { + set track_id 0 +}