+
" + +# Is this a Blackboard6 package? +set isBB [lors::imscp::bb6::isBlackboard6 -tmp_dir $tmp_dir] + +if {$isBB == 1} { + ns_write "Blackboard6 Content Packaging Course.
Modifying package to be IMS CP compliant..." + ns_write "" + +} + + +ns_write "
Cleaning up unused application and folders..." + lors::imscp::bb6::clean_items -tmp_dir $tmp_dir -file "imsmanifest.xml" + ns_write "Done!" + ns_write "
Renaming content types according to IMS CP specification..." + lors::imscp::bb6::extract_html -tmp_dir $tmp_dir -file "imsmanifest.xml" + ns_write "Done!Starting File Processing...
" + + db_transaction { ## adds folder to the CR @@ -59,17 +88,51 @@ set new_parent_id [lors::cr::add_folder -parent_id $parent_id -folder_name $cr_dir] - # Display progress bar - ad_progress_bar_begin \ - -title "Uploading course..." \ - -message_1 "Uploading and processing your course, please wait ..." \ - -message_2 "We will continue automatically when processing is complete." + # PERMISSIONS FOR FILE-STORAGE + # Before we go about anything else, lets just set permissions straight. + # Disable folder permissions inheritance + permission::toggle_inherit -object_id $new_parent_id + # Set read permissions for community/class dotlrn_member_rel - ns_write "Initiating Updating log...
" + set community_id [dotlrn_community::get_community_id] + set party_id_member [db_string party_id {select segment_id from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_member_rel'}] + + permission::grant -party_id $party_id_member -object_id $new_parent_id -privilege read + + # Set read permissions for community/class dotlrn_admin_rel + + set party_id_admin [db_string party_id {select segment_id from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_admin_rel'}] + + permission::grant -party_id $party_id_admin -object_id $new_parent_id -privilege read + + # Set read permissions for *all* other professors within .LRN + # (so they can see the content) + + set party_id_professor [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_professor_profile_rel'}] + + permission::grant -party_id $party_id_professor -object_id $new_parent_id -privilege read + + # Set read permissions for *all* other admins within .LRN + # (so they can see the content) + + set party_id_admins [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_admin_profile_rel'}] + + permission::grant -party_id $party_id_admins -object_id $new_parent_id -privilege read + + + + + set filesx [lors::cr::add_files -parent_id $new_parent_id -indb_p $indb_p -files [lors::cr::has_files -fs_dir $fs_dir]] set all_files [concat $all_files $filesx] @@ -106,7 +169,7 @@ #For display purposes ns_write "Processing file(s):" foreach file $files { - ns_write " [string trimleft $file $tmp_dir]...OK" # @@ -227,8 +290,59 @@ -hasmetadata $man_hasmetadata \ -isscorm $man_isscorm \ -folder_id $new_parent_id \ - -fs_package_id $fs_package_id] + -fs_package_id $fs_package_id \ + -community_id $community_id] + + ns_write "Granting permissions $course_name Manifest...
" + ns_write " [regsub $tmp_dir $file {}]...OK
" } ns_write "
" + + # PERMISSIONS FOR MANIFEST and learning objects + + # set up in the same way as permissions for the file storage + # objects. As we want to maintain consistency btw the + # learnining objects and their content + + # Disable folder permissions inheritance + permission::toggle_inherit -object_id $man_id + + # Set read permissions for community/class dotlrn_member_rel + + set community_id [dotlrn_community::get_community_id] + + set party_id_member [db_string party_id {select segment_id from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_member_rel'}] + + permission::grant -party_id $party_id_member -object_id $man_id -privilege read + + # Set read permissions for community/class dotlrn_admin_rel + + set party_id_admin [db_string party_id {select segment_id from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_admin_rel'}] + + permission::grant -party_id $party_id_admin -object_id $man_id -privilege read + + # Set read permissions for *all* other professors within .LRN + # (so they can see the content) + + set party_id_professor [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_professor_profile_rel'}] + + permission::grant -party_id $party_id_professor -object_id $man_id -privilege read + + # Set read permissions for *all* other admins within .LRN + # (so they can see the content) + + set party_id_admins [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_admin_profile_rel'}] + + permission::grant -party_id $party_id_admins -object_id $man_id -privilege read + + + # Done with Manifest and learning object Permissions + + ns_write "Adding $course_name Manifest...
" if {$man_hasmetadata == 1} { @@ -298,13 +412,6 @@ set resourcex [$resources child all resource] - -########## REMOVE DEBUGGING PURPOSE ONLY #### - set f_handler [open /tmp/add.txt w+] - puts -nonewline $f_handler $add - close $f_handler -########## REMOVE DEBUGGING PURPOSE ONLY #### - if { ![empty_string_p $resourcex] } { set res_list [list] @@ -316,8 +423,21 @@ set res_hasmetadata [lors::imsmd::hasMetadata $resource] set res_files [lors::imsmd::getResource -node $resource -att files] set res_scormtype [lors::imsmd::getAtt $resource adlcp:scormtype] - +### Addition to showcase integration with Assessment + +# if {$res_type == "ims-qti-package"} { + +# set res_href [ims_qti_register_assessment $tmp_dir/$res_href] + + +# } + + +## End integration showcase + + + set resource_id [lors::imscp::resource_add \ -man_id $man_id \ -identifier $res_identifier \ @@ -372,13 +492,7 @@ #ns_write "no page" } -########## REMOVE DEBUGGING PURPOSE ONLY #### - set f_handler [open /tmp/res_list.txt w+] - puts -nonewline $f_handler $res_list - close $f_handler -########## REMOVE DEBUGGING PURPOSE ONLY #### - # Here's where we link items and resources. Take into # account that a resources can have 1 to many items @@ -411,21 +525,7 @@ ns_write "Now we are almost done...
" -# set all_files [lindex $all_files 0] -# ns_write -# ns_write - - -########## REMOVE DEBUGGING PURPOSE ONLY #### - set f_handler [open /tmp/all_files.txt w+] - puts -nonewline $f_handler $all_files - close $f_handler - set f_handler [open /tmp/l_files.txt w+] - puts -nonewline $f_handler $l_files - close $f_handler -########## REMOVE DEBUGGING PURPOSE ONLY #### - foreach file $l_files { set filename [lindex $file 0] Index: openacs-4/packages/lorsm/www/course-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/course-add.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/course-add.adp 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/course-add.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -2,8 +2,29 @@Upload an IMS/SCORM Content Package Course @context;noquote@ - -We have detected the root folder for @folder_name;noquote@ and we will import your course in this folder.
- -- + +
Index: openacs-4/packages/lorsm/www/course-structure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/course-structure.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/course-structure.adp 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/course-structure.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -4,30 +4,30 @@+ + +Shared Courses in the Repository
++ ++ +++You can add courses already existing in the repository +
+ + + +Add your own course
++ ++ +++We have detected the root folder for @folder_name;noquote@ and we will import your course in this folder.
++ -+
Course Information - + Course Name: @course_name;noquote@ - + Version: @version;noquote@ - + Metadata?: @@ -40,15 +40,15 @@ - + Identifier: -+ @identifier@ - + Is SCORM?: - + Storage Folder: -+ @instance@ - + Created By: -+ @created_by@ - -+ Date: -+ @creation_date;noquote@ - + + + +Submanifests: -+ @submanifests@ + + ++ Status: + ++ ++ Enabled + ++ Disabled + ++ Change +++ + ++ Trackable: + ++ ++ Yes + ++ No + ++ Change +++ + Is shared? + ++ ++ Shared + ++ Not Shared + ++ Change ++Organizations Index: openacs-4/packages/lorsm/www/course-structure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/course-structure.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/course-structure.tcl 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/course-structure.tcl 4 Sep 2004 14:51:21 -0000 1.2 @@ -15,6 +15,8 @@ } -errors { } +set package_id [ad_conn package_id] + ad_proc -public getFolderKey { {-object_id:required} } { @@ -31,6 +33,7 @@ set context [list "Course Structure"] set title "Course Structure" + if {[db_0or1row manifest " select cp.man_id, @@ -48,14 +51,19 @@ end as isscorm, cp.fs_package_id, cp.folder_id, + cp.isshared, acs.creation_user, acs.creation_date, - acs.context_id + acs.context_id, + cpmc.isenabled, + cpmc.istrackable from - ims_cp_manifests cp, acs_objects acs + ims_cp_manifests cp, acs_objects acs, ims_cp_manifest_class cpmc where cp.man_id = acs.object_id and cp.man_id = :man_id + and cp.man_id = cpmc.man_id + and cpmc.lorsm_instance_id = :package_id and cp.parent_man_id = 0"]} { # Sets the variable for display. @@ -105,7 +113,7 @@ } -append orgs_list " " +append orgs_list "
" append orgs_list "
" +set enabler_url [export_vars -base enabler {man_id}] +set tracker_url [export_vars -base tracker {man_id}] +set sharer_url [export_vars -base sharer {man_id folder_id return_url}] - - Index: openacs-4/packages/lorsm/www/edit-content.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/edit-content.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/edit-content.tcl 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,48 @@ +# packages/lorsm/www/edit-content.tcl + +ad_page_contract { + + Online content editor for LORSm + + Uses htmlarea to edit html/txt file-storage + content + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-07-06 + @arch-tag: 6f57a7d1-7032-44e4-b333-6a7fb74ae30b + @cvs-id $Id: edit-content.tcl,v 1.1 2004/09/04 14:51:21 ernieg Exp $ +} { + folder_id:integer + fs_package_id:integer + identifierref + return_url +} -properties { +} -validate { +} -errors { +} + +set user_id [ad_conn user_id] + +set folder [db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}] +set fs_root_folder [db_string sql {select file_storage__get_root_folder(:fs_package_id)}] +set identifierref [lorsm::fix_url -url $identifierref] +set pather $folder/$identifierref + +# in some case, the resource is defined with a / that conflicts with +# our existing / creating a double //. Therefore we use a regsub to +# get rid of it +regsub -all {//} $pather {/} pather + + +set file_id [db_string sql {select content_item__get_id(:pather, :fs_root_folder, 'f')}] + +# check for permissions +# By default, only the creator has admin access to content + +permission::require_write_permission -object_id $file_id -creation_user $user_id + +#ns_write "folder $folder\n pather: $pather \n file_id: $file_id" +#ad_script_abort + +ad_returnredirect [export_vars -base [apm_package_url_from_id $fs_package_id]file-content-edit {file_id return_url}] + Index: openacs-4/packages/lorsm/www/enabler.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/enabler.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/enabler.adp 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,5 @@ +Organization Metadata? @@ -129,25 +137,36 @@ } { - append orgs_list "$org_title $hasmetadata " + append orgs_list " $org_title $hasmetadata " set indent [expr $indent +1] set missing_text "Nothing here" - + set return_url [export_vars -base [ns_conn url] man_id] set table_extra_html { width="100%" } + + set table_extra_vars {return_url} set table_def { - { title "" "no_sort" " $indent[if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href $item_title}] " } - { metadata "" "no_sort" "[if {$hasmetadata == \"f\"} {set hasmetadata \"\"} else {set hasmetadata \"Metadata\"}] " } + { title "Item Name" "no_sort" "$indent[if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href $item_title}] " } + { Edit "Edit?" "no_sort" "[if {![empty_string_p $identifierref]} {set href \"Edit \"}]"} + { metadata "Metadata?" "no_sort" "[if {$hasmetadata == \"f\"} {set hasmetadata \"No\"} else {set hasmetadata \"Metadata\"}] " } + { type "Type" "no_sort" "$type " } + { shared "Is Shared?" "no_sort" "[if {$isshared == false} {set ret \"No\"}] " } } - set table_item [ad_table -Tmissing_text $missing_text -Ttable_extra_html $table_extra_html blah { + set table_item [ad_table -Tmissing_text $missing_text -Textra_vars $table_extra_vars -Theader_row_extra "style=\"background-color: #e0e0e0; font-weight: bold;\" class=\"list-header\"" -Ttable_extra_html $table_extra_html blah { SELECT o.object_id, - repeat(' ', (tree_level(tree_sortkey) - :indent)* 5) as indent, + repeat(' ', (tree_level(tree_sortkey) - :indent)* 3) as indent, i.item_id, i.title as item_title, i.hasmetadata, i.org_id, + case + when i.isshared = 'f' then ( + 'false' + ) + else 'true' + end as isshared, case when i.identifierref <> '' then ( SELECT @@ -162,6 +181,20 @@ ) else '' end as identifierref, + case + when i.identifierref <> '' then ( + SELECT + res.type + FROM + ims_cp_items_to_resources i2r, + ims_cp_resources res + WHERE + i2r.res_id = res.res_id + AND + i2r.item_id = i.item_id +) + else '' + end as type, m.fs_package_id, m.folder_id, m.course_name @@ -192,6 +225,7 @@ append orgs_list "+ @title@ +@context@ + +Index: openacs-4/packages/lorsm/www/enabler.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/enabler.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/enabler.tcl 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,67 @@ +# packages/lorsm/www/enabler.tcl + +ad_page_contract { + + enable/disable courses for a class + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-05-19 + @arch-tag ebea2a9b-b6d6-4083-83c5-58686ba9e201 + @cvs-id $Id: enabler.tcl,v 1.1 2004/09/04 14:51:21 ernieg Exp $ +} { + man_id:integer,notnull +} -properties { +} -validate { +} -errors { +} + +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] + +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id [ad_conn user_id] \ + -community_id $community_id ] + + + +set title "Set Course Trackable" +set context [list "Set Course Status"] + +ad_form -name enabler \ + -export {package_id} \ + -form { + {man_id:key} + {project:text(inform) + {label "Course Name:"} + {value {[lorsm::get_course_name -manifest_id $man_id]}} + } + {isenabled:text(inform) + {label "Current Status:"} + } + {enable:text(radio) + {label Status?} + {options {{"Enable" t} {"Disable" f}}} + } + } -select_query { + select + case when isenabled = 't' then 'Enabled' + else 'Disabled' + end as isenabled + from ims_cp_manifest_class + where man_id = :man_id and + lorsm_instance_id = :package_id + } -edit_data { + db_dml do_update " + update ims_cp_manifest_class + set isenabled = :enable + where man_id = :man_id and + lorsm_instance_id = :package_id" + } -after_submit { + ad_returnredirect [site_node::get_url_from_object_id -object_id package_id] + ad_script_abort + } + + + + + Index: openacs-4/packages/lorsm/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/index.adp 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/index.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -1,15 +1,14 @@ + @title@ +@context@ -- -- Add a Course --
- +Courses
+Courses in your Repository
++ Index: openacs-4/packages/lorsm/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/index.tcl 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/index.tcl 4 Sep 2004 14:51:21 -0000 1.2 @@ -1,3 +1,5 @@ +# packages/lorsm/www/index.tcl + ad_page_contract { Learning Object Repository Management Index page @@ -8,6 +10,10 @@ } { } +set title "Manage Courses in Repository" +set context [list "Manage Courses"] + + set package_id [ad_conn package_id] set community_id [dotlrn_community::get_community_id] @@ -16,37 +22,49 @@ -community_id $community_id ] +set actions [list] + +if {$admin_p} { + lappend actions "Add Course" [export_vars -base "course-add"] "Add a IMS/SCORM Compliant Course" + lappend actions "Search Learning Objects" [export_vars -base "/search"] "Search for Learninng Objects in the Repository" + lappend actions "Available Courses" [export_vars -base "shared/"] "View Available Courses in the Repository" +} + template::list::create \ -name d_courses \ -multirow d_courses \ -html {width 50%} \ + -actions $actions \ -key man_id \ -no_data "No Courses" \ -elements { course_name { - label "Course Name" + label "Available Courses" display_col course_name link_url_eval {delivery/?[export_vars man_id]} link_html {title "Access Course"} } - course_structure { - label "Course Structure" - display_eval {\[view\]} - link_url_eval {course-structure?[export_vars man_id]} - link_html {title "Course Structure"} - html { align center } - } hasmetadata { label "Metadata?" link_url_eval {md/?[export_vars ims_md_id]} - link_html {title "See metadata"} + link_html {title "See metadata" } html { align center } } isscorm { label "SCORM?" html { align center } } + isenabled { + label "Status" + html { align center } + } + istrackable { + label "Tracking?" + link_url_eval {tracking/?[export_vars man_id]} + link_html {title "Track Student's Progress" class button} + html { align center } + } creation_user { label "Owner" display_eval {[person::name -person_id $creation_user]} @@ -59,12 +77,20 @@ export { label "Export" display_eval {\[zip\]} - link_url_eval {export/?[export_vars folder_id]} + link_url_eval {[export_vars -base export folder_id]} link_html {title "Export as IMS Content Package"} html { align center } } + admin { + label "Admin Course" + display_eval {Admin} + link_url_eval {[export_vars -base course-structure man_id]} + link_html {title "Admin Course" class button} + html { align center } + } } + db_multirow -extend { ims_md_id } d_courses select_d_courses { select cp.man_id, @@ -83,13 +109,25 @@ cp.folder_id, acs.creation_user, acs.creation_date, - acs.context_id + acs.context_id, + case + when cpmc.isenabled = 't' then 'Enabled' + else 'Disabled' + end as isenabled, + case + when cpmc.istrackable = 't' then 'Yes' + else 'No' + end as istrackable + from - ims_cp_manifests cp, acs_objects acs + ims_cp_manifests cp, acs_objects acs, ims_cp_manifest_class cpmc where cp.man_id = acs.object_id and - acs.context_id = :package_id + cp.man_id = cpmc.man_id + and + cpmc.community_id = :community_id + order by acs.creation_date desc } { set ims_md_id $man_id } Index: openacs-4/packages/lorsm/www/sharer.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/sharer.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/sharer.adp 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,5 @@ ++ @title@ +@context@ + +Index: openacs-4/packages/lorsm/www/sharer.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/sharer.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/sharer.tcl 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,94 @@ +# packages/lorsm/www/sharer.tcl + +ad_page_contract { + + Enable sharing of courses, organizations and learning objects + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-07-09 + @arch-tag: 0d48cf78-3d5d-4a39-b2e0-2f090bfbecb8 + @cvs-id $Id: sharer.tcl,v 1.1 2004/09/04 14:51:21 ernieg Exp $ +} { + man_id:integer + folder_id:integer + return_url +} -properties { +} -validate { +} -errors { +} + +set user_id [ad_conn user_id] + +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] + +# check admin permisssion for the community +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id $user_id \ + -community_id $community_id ] + +# check write permisssion for the learning object/manifest +permission::require_write_permission -object_id $man_id -creation_user $user_id + + +set title "Share Course/Learning Object" +set context [list "Share Course/Learning Object"] + +ad_form -name sharer \ + -export {return_url folder_id} \ + -form { + {man_id:key} + {project:text(inform) + {label "Course Name:"} + {value {[lorsm::get_course_name -manifest_id $man_id]}} + } + {isshared:text(inform) + {label "Current Status:"} + } + {share:text(radio) + {label Status?} + {options {{"Shared" t} {"Not Shared" f}}} + } + } -select_query { + select + case when isshared = 't' then 'Shared' + else 'Not Shared' + end as isshared + from ims_cp_manifests + where man_id = :man_id + } -edit_data { + db_transaction { + db_dml do_update { + update ims_cp_manifests + set isshared = :share + where man_id = :man_id } + + if {$share == "t"} { + + set party_id_students [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_student_profile_rel'}] + + permission::grant -party_id $party_id_students -object_id $man_id -privilege read + permission::grant -party_id $party_id_students -object_id $folder_id -privilege read + + + } else { + + set party_id_students [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_student_profile_rel'}] + + permission::revoke -party_id $party_id_students -object_id $man_id -privilege read + permission::revoke -party_id $party_id_students -object_id $folder_id -privilege read + + } + } + } -after_submit { + ad_returnredirect $return_url + + } + + + + + + Index: openacs-4/packages/lorsm/www/tracker.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/tracker.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/tracker.adp 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,7 @@ + + @title@ +@context@ + ++ + Index: openacs-4/packages/lorsm/www/tracker.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/tracker.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/tracker.tcl 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,67 @@ +# packages/lorsm/www/tracker.tcl + +ad_page_contract { + + set a course for a class to be trackable + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-05-25 + @arch-tag 07ceb832-2053-4579-bec2-76708522707a + @cvs-id $Id: tracker.tcl,v 1.1 2004/09/04 14:51:21 ernieg Exp $ +} { + man_id:integer,notnull +} -properties { +} -validate { +} -errors { +} + +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] + +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id [ad_conn user_id] \ + -community_id $community_id ] + + + +set title "Set Course Track Options" +set context [list "Set Course Options"] + +ad_form -name tracker \ + -export {package_id} \ + -form { + {man_id:key} + {project:text(inform) + {label "Course Name:"} + {value {[lorsm::get_course_name -manifest_id $man_id]}} + } + {istrackable:text(inform) + {label "Current Status:"} + } + {enable:text(radio) + {label Status?} + {options {{"Trackable?" t} {"No, Thanks" f}}} + } + } -select_query { + select + case when istrackable = 't' then 'Yes' + else 'No' + end as istrackable + from ims_cp_manifest_class + where man_id = :man_id and + lorsm_instance_id = :package_id + } -edit_data { + db_dml do_update " + update ims_cp_manifest_class + set istrackable = :enable + where man_id = :man_id and + lorsm_instance_id = :package_id" + } -after_submit { + ad_returnredirect [site_node::get_url_from_object_id -object_id package_id] + ad_script_abort + } + + + + + Index: openacs-4/packages/lorsm/www/delivery/body.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/body.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/delivery/body.adp 22 Apr 2004 03:58:12 -0000 1.1 +++ openacs-4/packages/lorsm/www/delivery/body.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -1,27 +1,24 @@ - - - + + + - - - - - - + Welcome to @course_name@
+- - - - - - - - - -
-Welcome to LEON
- -
Course Delivery System for LORS -Click on the Course Index items to start your @course_name@ course.
- - + Your Stats: +
+ You have seen this course x number of times and have covered @viewed_percent@ % of the content. + ++ ++ The last page you viewed was: @last_page_viewed;noquote@ +
+ Click on menu to the left to view course materials. Index: openacs-4/packages/lorsm/www/delivery/body.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/body.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/delivery/body.tcl 22 Apr 2004 03:58:12 -0000 1.1 +++ openacs-4/packages/lorsm/www/delivery/body.tcl 4 Sep 2004 14:51:21 -0000 1.2 @@ -9,9 +9,58 @@ @arch-tag a20dffe3-6d54-4ece-858c-4529e82c163b @cvs-id $Id$ } { - course_name:notnull + man_id:notnull } -properties { } -validate { } -errors { } +set user_id [ad_conn user_id] +db_0or1row get_last_viewed { + select item_id as imsitem_id, coalesce(acs_object__name(object_id),'Item '||object_id) as last_page_viewed + from views v, + ims_cp_items i, + ims_cp_organizations o + where v.viewer_id = :user_id + and v.object_id = i.item_id + and i.org_id = o.org_id + and o.man_id = :man_id + order by v.last_viewed desc + limit 1 +} + +set all_items [db_list get_total_items { + select i.item_id + from ims_cp_items i, + ims_cp_organizations o + where o.man_id = :man_id + and i.org_id = o.org_id +}] +set total_item_count [llength $all_items] +set viewed_items [db_list get_viewed_items " + select v.object_id + from views v + where v.viewer_id = :user_id + and v.object_id in ([join $all_items ,]) + "] +set viewed_item_count [llength $viewed_items] +set viewed_percent [lc_numeric [expr [expr $viewed_item_count * 1.00] / $total_item_count * 100] "%.2f"] + +# Get the course name +if {[db_0or1row manifest " + select + cp.course_name, + cp.fs_package_id + from + ims_cp_manifests cp + where + 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" + } +} else { + set course_name "No Course Name" +} \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery/exit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/exit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/exit.tcl 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,26 @@ +# packages/lorsm/www/delivery/exit.tcl + +ad_page_contract { + + Student tracking exit + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-05-25 + @arch-tag 04aa013e-2a53-45eb-825d-d576ea35cd14 + @cvs-id $Id: exit.tcl,v 1.1 2004/09/04 14:51:21 ernieg Exp $ +} { + track_id:integer + return_url +} -properties { +} -validate { +} -errors { +} + +# stamps the time when leaving the delivery environment + +if {$track_id != 0} { + lorsm::track::exit -track_id $track_id +} + +# redirects +ad_returnredirect $return_url Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/delivery/footer.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/delivery/header.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/delivery/header.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lorsm/www/delivery/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/delivery/index.adp 22 Apr 2004 03:58:12 -0000 1.1 +++ openacs-4/packages/lorsm/www/delivery/index.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -1,20 +1,8 @@ -
-@course_name@ - -