Index: openacs-4/packages/dotlrn-lorsm/dotlrn-lorsm.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-lorsm/dotlrn-lorsm.info,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn-lorsm/dotlrn-lorsm.info 25 Sep 2008 08:46:24 -0000 1.6 +++ openacs-4/packages/dotlrn-lorsm/dotlrn-lorsm.info 8 Oct 2008 13:01:05 -0000 1.7 @@ -7,14 +7,14 @@ f t - + Ernie Ghiglione - 2008-09-16 + 2007-04-22 OpenACS - - - + + + Index: openacs-4/packages/lors/lors.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lors.info,v diff -u -r1.12 -r1.13 --- openacs-4/packages/lors/lors.info 25 Sep 2008 08:46:24 -0000 1.12 +++ openacs-4/packages/lors/lors.info 8 Oct 2008 13:01:05 -0000 1.13 @@ -16,8 +16,8 @@ http://www.gnu.org/copyleft/gpl.html 1 - - + + Index: openacs-4/packages/lors/catalog/lors.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/catalog/lors.es_ES.ISO-8859-1.xml,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lors/catalog/lors.es_ES.ISO-8859-1.xml 25 Sep 2008 08:46:24 -0000 1.5 +++ openacs-4/packages/lors/catalog/lors.es_ES.ISO-8859-1.xml 8 Oct 2008 13:01:05 -0000 1.6 @@ -2,7 +2,6 @@ El error fue: - Abajo No puede extraerse Error al insertar carpeta Ahora est� abierto @@ -12,5 +11,4 @@ Error de transacci�n al a�adir metadatos El error fue: El error fue: $errmsg - Arriba Index: openacs-4/packages/lors/lib/course-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/course-new.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/lors/lib/course-new.tcl 25 Sep 2008 08:46:24 -0000 1.4 +++ openacs-4/packages/lors/lib/course-new.tcl 8 Oct 2008 13:01:05 -0000 1.5 @@ -4,6 +4,7 @@ @param package_id (optional) optional package to create the course under, probably lorsm or lors-central @param folder_id root folder to store stuff in @param return_url (defaults to ad_return_url) + @param return_url_base (if you want to redirect to return_url_base?man_id={man_id} use this } # ad_form requires man_id NOT to be set if its new @@ -46,6 +47,9 @@ -identifier [util_text_to_url -text $name] \ -org_folder_id $new_items_parent_id + if {[info exists return_url_base] && $return_url_base ne ""} { + set return_url [export_vars -base $return_url_base {man_id}] + } if {![info exists return_url] || $return_url eq ""} { set return_url [export_vars -base course-structure {man_id}] } Index: openacs-4/packages/lors/lib/course-structure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/course-structure.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/lors/lib/course-structure.adp 25 Sep 2008 08:46:24 -0000 1.7 +++ openacs-4/packages/lors/lib/course-structure.adp 8 Oct 2008 13:01:05 -0000 1.8 @@ -1,5 +1,5 @@ - +
#lorsm.Course_Information# @@ -13,12 +13,13 @@ @course_name;noquote@ (@identifier@) #lorsm.Course_Versions# +
#lors.Rename_Course#
More Info 
- - @extra_admin_html;noquote@ - - - - - - - - - - - - -
- #lorsm.Organizations# -
- -
- +@extra_admin_html;noquote@ +
@orgs_list;noquote@ -
- - + Index: openacs-4/packages/lors/lib/course-structure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/course-structure.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/lors/lib/course-structure.tcl 25 Sep 2008 08:46:24 -0000 1.11 +++ openacs-4/packages/lors/lib/course-structure.tcl 8 Oct 2008 13:01:05 -0000 1.12 @@ -41,32 +41,32 @@ # Course Name if {[empty_string_p $course_name]} { - set course_name "[_ lorsm.No_course_Name]" + set course_name "[_ lorsm.No_course_Name]" } # Version set version [db_string get_versions { } -default 0] if {[string equal $version "0"]} { - set version_msg "[_ lorsm.No_version_Available]" + set version_msg "[_ lorsm.No_version_Available]" } if { ![empty_string_p $fs_package_id] } { - # Folder - set folder [apm_package_url_from_id $fs_package_id]?[export_vars folder_id] - # 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] + # Instance + set instance [apm_package_key_from_id $fs_package_id] } else { - set fs_package_id [site_node_apm_integration::get_child_package_id \ - -package_id [dotlrn_community::get_package_id $community_id] \ - -package_key "file-storage"] - # Instance - set instance [lorsm::get_course_name -manifest_id $man_id] - # Folder -# set root_folder [lorsm::get_root_folder_id] - -# set folder_id [db_string get_folder_id { }] - set folder [apm_package_url_from_id $fs_package_id]?[export_vars folder_id] + set fs_package_id [site_node_apm_integration::get_child_package_id \ + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"] + # Instance + set instance [lorsm::get_course_name -manifest_id $man_id] + # Folder + set root_folder [lorsm::get_root_folder_id] + + set folder_id [db_string get_folder_id { }] + set folder [apm_package_url_from_id $fs_package_id]?[export_vars folder_id] } # Created By @@ -78,7 +78,7 @@ # Check for submanifests if {[db_0or1row submans { }]} { } else { - set submanifests 0 + set submanifests 0 } @@ -90,10 +90,6 @@ append orgs_list "" -append orgs_list " - - -" set pretty_types_map {} if { [apm_package_installed_p assessment] } { @@ -102,7 +98,7 @@ if { [apm_package_installed_p xowiki] } { append pretty_types_map "::xowiki::Page Content" } -template::multirow create blah course_name delete down folder_id fs_package_id hasmetadata href identifierref indent isshared item_id item_title object_id org_id res_identifier type up +template::multirow create items course_name delete down folder_id fs_package_id hasmetadata href identifierref indent isshared item_id item_title object_id org_id res_identifier type up db_multirow organizations organizations { } { } if {[info exists exclude] && [llength $exclude]} { @@ -118,24 +114,21 @@ # We get the indent of the items in this org_id set indent_list [lorsm::get_items_indent -org_id $org_id -exclude $exclude] template::util::list_of_lists_to_array $indent_list indent_array - ns_log notice "BEFORE MULTIROW [template::multirow size blah]" - db_multirow blah blah "" { - if {[info exists indent_array($item_id)]} { - set indent [string repeat "  " [expr {$indent_array($item_id)-1}]] - } else { set indent 1 } + db_multirow items get_items "" { + if {[info exists indent_array($item_id)]} { + set indent [string repeat "  " [expr {$indent_array($item_id)-1}]] + } else { set indent 1 } if {$type eq "webcontent" && ![string equal $identifierref {}]} { - set href "[apm_package_url_from_id_mem $fs_package_id]view/[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/[lorsm::fix_url -url $identifierref]" - } else { - set href "[lors::object_url -url admin -object_id $man_id]" - } - set type [string map $pretty_types_map $type] - set delete [export_vars -base object-delete {item_id return_url}] - set up [export_vars -base reorder-items {item_id {dir up} return_url}] - set down [export_vars -base reorder-items {item_id {dir down} return_url}] - ns_log notice "setting up '${up}' \n setting down '${down}'" + set href "[apm_package_url_from_id_mem $fs_package_id]view/[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/[lorsm::fix_url -url $identifierref]" + } else { + set href "[lors::object_url -url admin -object_id $res_identifier -man_id $man_id]" + } + set type [string map $pretty_types_map $type] + set delete [export_vars -base object-delete {item_id return_url}] + set up [export_vars -base reorder-items {item_id {dir up} return_url}] + set down [export_vars -base reorder-items {item_id {dir down} return_url}] } - ns_log notice "AFTER MULTIROW [template::multirow size blah]" append orgs_list "" @@ -162,31 +155,23 @@ {add_new:text(submit) {label {[_ acs-kernel.common_Add]}}} } - template::list::create \ - -name blah \ - -multirow blah \ - -elements { - item_title { - label "\#lorsm.Item_Name\#" - link_url_col href - } - type { - label "" - } - delete { - label "" - display_template { - delete - } - } - up { - label "" - display_template {Up} - } - down { - label "" - display_template {Down} - } - } +template::list::create \ + -name items \ + -multirow items \ + -elements { + item_title { + label "\#lorsm.Items\#" + link_url_col href + } + type { + label "Type" + } + actions { + label "Actions" + display_template { + Up DownRemove + } + } + } - +set rename_url [export_vars -base course-rename {man_id}] \ No newline at end of file Index: openacs-4/packages/lors/lib/course-structure.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/course-structure.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/lors/lib/course-structure.xql 25 Sep 2008 08:46:24 -0000 1.6 +++ openacs-4/packages/lors/lib/course-structure.xql 8 Oct 2008 13:01:05 -0000 1.7 @@ -103,7 +103,7 @@ - + SELECT '' as delete, Index: openacs-4/packages/lors/tcl/lors-imscp-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-imscp-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/lors/tcl/lors-imscp-procs.tcl 25 Sep 2008 08:46:24 -0000 1.16 +++ openacs-4/packages/lors/tcl/lors-imscp-procs.tcl 8 Oct 2008 13:01:05 -0000 1.17 @@ -320,6 +320,8 @@ if {$delete_all} { # FIXME remove ims metadata + # metadata should have on delete casacade + # To delete a course we need to # remove file storage items @@ -1230,3 +1232,11 @@ return $res_id } +ad_proc -public lors::imscp::item_get_identifier { + -ims_item_id + -man_id +} { + Get indentifier which should help us resolve what object his points to +} { + return [db_string get_indentifier "" -default ""] +} \ No newline at end of file Index: openacs-4/packages/lors/tcl/lors-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/lors/tcl/lors-procs.tcl 25 Sep 2008 08:46:24 -0000 1.9 +++ openacs-4/packages/lors/tcl/lors-procs.tcl 8 Oct 2008 13:01:05 -0000 1.10 @@ -13,7 +13,7 @@ ad_proc -public lors::object_url { -object_id - + {-man_id ""} {-url "view"} } { Generate a URL for an acs_object as a learning object @@ -44,21 +44,28 @@ # FIXME either 1) make this magically work # or 2) find the assessment_id and use # page anchor - db_1row get_assessment_id "select ci.item_id as assessment_id, sort_order from cr_items ci, cr_revisions cr, as_assessment_section_map m where cr.item_id=:object_id and cr.revision_id=m.section_id and ci.latest_revision=assessment_id" + set assessment_id "" + set sort_order "" + db_0or1row get_assessment_id "select ci.item_id as assessment_id, sort_order from cr_items ci, cr_revisions cr, as_assessment_section_map m where cr.item_id=:object_id and cr.revision_id=m.section_id and ci.latest_revision=assessment_id" return [export_vars \ - -base ../../assessment/asm-admin/questions \ - {assessment_id}]\#${sort_order} + -base questions \ + {man_id assessment_id}][ad_decode {$sort_order eq ""} 0 "\#${sort_order}" ""] } "::xowiki::Page" { set url [::xowiki::Package get_url_from_id -item_id $object_id] set page [::xowiki::Package instantiate_page_from_id -item_id $object_id] - if {[catch {set url [[$page set package_id] make_link -privilege public -url $url $page edit ""]} errmsg]} { + if {[catch {set url [[$page set package_id] make_link -privilege public -link $url $page edit ""]} errmsg]} { set url [$page make_link -privilege public -url $url $page edit ""] } return "${url}&return_url=[ad_urlencode [ad_return_url]]" - } + + } + default { + set item_id [content::revision::item_id -revision_id $object_id] + return [export_vars -base "item-add-edit" {man_id item_id {return_url [ad_return_url]}}] + } } } @@ -78,4 +85,4 @@ @param man_id Manifst id for one course } { return [db_list_of_lists get_items ""] -} \ No newline at end of file +} Index: openacs-4/packages/lorsm/lorsm.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lorsm.info,v diff -u -r1.15 -r1.16 --- openacs-4/packages/lorsm/lorsm.info 25 Sep 2008 08:46:24 -0000 1.15 +++ openacs-4/packages/lorsm/lorsm.info 8 Oct 2008 13:01:05 -0000 1.16 @@ -1,13 +1,13 @@ - + LORS Management LORS Management f f - + Ernie Ghiglione Application to manage the services from the Learning Object Repository. 2007-07-17 @@ -16,7 +16,7 @@ - + Index: openacs-4/packages/lorsm/catalog/lorsm.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/catalog/lorsm.en_US.ISO-8859-1.xml,v diff -u -r1.18 -r1.19 --- openacs-4/packages/lorsm/catalog/lorsm.en_US.ISO-8859-1.xml 25 Sep 2008 08:46:24 -0000 1.18 +++ openacs-4/packages/lorsm/catalog/lorsm.en_US.ISO-8859-1.xml 8 Oct 2008 13:01:05 -0000 1.19 @@ -858,6 +858,5 @@ Welcome to LEON Yes You can - Your session has expired. Your Stats: Index: openacs-4/packages/lorsm/catalog/lorsm.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/catalog/lorsm.es_ES.ISO-8859-1.xml,v diff -u -r1.7 -r1.8 --- openacs-4/packages/lorsm/catalog/lorsm.es_ES.ISO-8859-1.xml 25 Sep 2008 08:46:24 -0000 1.7 +++ openacs-4/packages/lorsm/catalog/lorsm.es_ES.ISO-8859-1.xml 8 Oct 2008 13:01:05 -0000 1.8 @@ -32,7 +32,6 @@ Agregar otro T�tulo Agregar Entrada de Cat�logo Agregar Clasificaci�n - A�adir contenido Agregar Contexto Agregar Contribuyente Agregar Contribuyentes @@ -93,7 +92,6 @@ Anotador Activos Cursos Disponibles - Empezar Buscar... Cat�logo: Entradas de Catalogo: @@ -123,7 +121,6 @@ Nombre del Curso: Nombre del Curso Estructura del Curso - Version %version% Cobertura: Cobertura Creado Por: @@ -227,7 +224,6 @@ Localizaci�n: Localizaciones: Salir - LORS Agregar Curso Compatible con IMS/SCORM Agregar Nivel de Agregaci�n Agregar Anotaci�n de Descripci�n de MD @@ -446,8 +442,6 @@ Estilo de presentaci�n Cursos en su Repositorio Descripci�n de Fecha y Hora - Curso completado - Empezar curso Borrando folder temporal... Describe la Contribuci�n Describe el contenido de los Objetos de Aprendizaje @@ -689,7 +683,6 @@ Si derechos reservados u otra restriccion se aplique Si el uso de este recurso requiere pago Con barra de navegaci�n abajo - Mostrar con barra de progreso Estilo Sin �ndice Usted esta apunto de agregar a su clase el curso %course_name% Puede agregar cursos que y� existan en el repositorio @@ -712,7 +705,6 @@ Nombre Nombre: Nombre del cat�logo - Siguiente No No hay contexto Disponible No hay Costo Disponible @@ -857,6 +849,5 @@ Bienvenido a LEON S� Usted puede - Su sesi�n ha expirado Sus estad�sticas Index: openacs-4/packages/lorsm/lib/repository-shared-courses.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lib/repository-shared-courses.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/lorsm/lib/repository-shared-courses.tcl 25 Sep 2008 08:46:24 -0000 1.4 +++ openacs-4/packages/lorsm/lib/repository-shared-courses.tcl 8 Oct 2008 13:01:05 -0000 1.5 @@ -54,6 +54,13 @@ label "[_ lorsm.Creation_Date]" display_eval {[lc_time_fmt $creation_date "%x %X"]} } + add { + label "" + display_eval {[_ lorsm.Add_Course]} + link_url_eval {[export_vars -base $community_url/lorsm/admin/add-shared-course {man_id}]} + link_html {title "[_ lorsm.lt_Add_course_to_my_clas]" class button} + + } admin { label "[_ lorsm.Course_Info]" display_eval {Info/View} Index: openacs-4/packages/lorsm/lib/user-lorsm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lib/user-lorsm.tcl,v diff -u -r1.21 -r1.22 --- openacs-4/packages/lorsm/lib/user-lorsm.tcl 25 Sep 2008 08:46:24 -0000 1.21 +++ openacs-4/packages/lorsm/lib/user-lorsm.tcl 8 Oct 2008 13:01:05 -0000 1.22 @@ -200,16 +200,16 @@ limit 1" ] } { #item has no track for the user #the icon should be the same as per "not yet visited" - append icon "\"Not" + append icon "\"Not" } else { switch -regexp $lesson_status { - null { append icon "\"Not" } - incomplete { append icon "\"Incomplete\"" } - complete { append icon "\"Completed\"" } - failed { append icon "\"Failed\"" } - "not attempted" { append icon "\"Not" } - passed { append icon "\"Passed\"" } - default { append icon " $lesson_status ** \"$lesson_status\""} + null { append icon "\"Not" } + incomplete { append icon "\"Incomplete\"" } + complete { append icon "\"Completed\"" } + failed { append icon "\"Failed\"" } + "not attempted" { append icon "\"Not" } + passed { append icon "\"Passed\"" } + default { append icon " $lesson_status ** \"$lesson_status\""} } } set lesson_status $icon Index: openacs-4/packages/lorsm/tcl/lorsm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 25 Sep 2008 08:46:24 -0000 1.19 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 8 Oct 2008 13:01:05 -0000 1.20 @@ -137,34 +137,41 @@ } ad_proc -public dates_calc { - -start_date:required - -end_date:required + -start_date + -end_date + -seconds } { Returns the number of minutes, hours or dates given a start - and end date. + and end date or a number of seconds. If seconds is specified + date is ignored. @param start_date Starting date @param end_date Ending date @author Ernie Ghiglione (ErnieG@mm.st) } { - - set start [clock scan "$start_date"] - set end [clock scan "$end_date"] - - set difference [expr {$end - $start}] - + if {[info exists seconds]} { + if {$seconds ne ""} { + set difference $seconds + } else { + return "" + } + } else { + set start [clock scan "$start_date"] + set end [clock scan "$end_date"] + set difference [expr {$end - $start}] + } if {$difference >= 0 && $difference < 60} { return "[_ lorsm.difference_seconds]" } elseif {$difference >= 60 && $difference < 3600} { - set tempval [expr {$difference / 60.0}] + set tempval [expr {$difference / 60}] return "[_ lorsm.tempval_minutes]" } elseif {$difference >= 3600 && $difference < 86400} { - set tempval [expr {$difference / 60.0 /60.0 }] + set tempval [expr {$difference / 3600 }] return "[_ lorsm.tempval_hours]" } else { - set tempval [expr {$difference / 60.0 / 60.0 / 24.0}] + set tempval [expr {$difference / 86400}] return "[_ lorsm.tempval_days]" } } @@ -548,7 +555,7 @@ return } - + ns_log notice "lorsm::get_content item_id $item_id" # Get the live revision set revision_id [db_string get_revision ""] @@ -776,4 +783,4 @@ or empty string if it does not } { return [db_string get_custom_page "select live_revision from cr_items, lorsm_custom_pages where page_id=item_id and man_id=:man_id and type=:type" -default ""] -} \ No newline at end of file +} Index: openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl 25 Sep 2008 08:46:24 -0000 1.5 +++ openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl 8 Oct 2008 13:01:05 -0000 1.6 @@ -63,21 +63,29 @@ } { Sets the time when the student leaves the delivery environment - @param track_id Track ID (given when the delivery session opened + @param track_id Track ID given when the delivery session opened @author Ernie Ghiglione (ErnieG@mm.st) } { - + db_transaction { set track_id [db_exec_plsql track_st_exit { - + select lorsm_student_track__exit ( - :track_id - ); - + :track_id + ); + } ] - + if {$track_id ne ""} { + db_0or1row get_track "select * from lorsm_student_track where track_id=:track_id" + if {[ad_conn -connected_p]} { + set package_id [ad_conn package_id] + } else { + set package_id "" + } + callback lorsm::track::update -course_id $course_id -user_id $user_id -package_id $package_id -credit $credit_earned -track_id $track_id -start_time $start_time -end_time $end_time -elapsed_time $elapsed_seconds + } } return $track_id } @@ -88,33 +96,99 @@ } { Checks whether the instance of this course in the specified community is trackable. - + If it is, then it returns 1. Otherwise, 0. @param course_id Course ID (or manifest_id) @param community_id Commuinity ID. @author Ernie Ghiglione (ErnieG@mm.st) } { - + set istrackable [db_string trackable { select istrackable from ims_cp_manifest_class where man_id = :course_id and lorsm_instance_id = :package_id }] - + if {$istrackable == "f"} { return 0 } else { return 1 } + + } + ad_proc -private update_elapsed_seconds { + -track_id + } { + + set last_item_viewed [db_string select_last_item_viewed { + select to_char(v.last_viewed,'YYYY-MM-DD HH24:MI:SS') as last_viewed + from views_views v, + ims_cp_items i, + ims_cp_organizations o, + lorsm_student_track t + where t.track_id = :track_id + and v.viewer_id = t.user_id + and v.object_id = i.ims_item_id + and i.org_id = o.org_id + and o.man_id = t.course_id + order by v.last_viewed desc + limit 1 + } -default ""] + if {$last_item_viewed ne ""} { + set current_seconds [clock seconds] + set last_seconds [clock scan $last_item_viewed] + set elapsed_seconds [expr {$current_seconds - $last_seconds}] + if {$elapsed_seconds > 600} { + set elapsed_seconds 600 + } + db_dml update_elapsed_seconds "update lorsm_student_track set elapsed_seconds = coalesce(elapsed_seconds,0) + :elapsed_seconds where track_id = :track_id" + } } + ad_proc -private get_track_id { + -user_id + -man_id + -community_id + } { + Get an existing tracking id from either a client property + or the database is a session has not been completed but + they have logged out or their session has expired. + } { + set track_id [ad_get_client_property lorsm studenttrack] + ns_log notice "lors::tack::get_track_id client_property '${track_id}'" + if {$track_id eq "" || $track_id eq "0"} { + set track_id [db_string get_track_id {} -default ""] + ns_log notice "lors::tack::get_track_id database '${track_id}'" + } + return $track_id + } + } +ad_proc -callback lorsm::track::exit_course { + -course_id + -user_id + -track_id + -credit + -package_id +} { + Notify listeners that a user has exited a course +} - +ad_proc -callback lorsm::track::update { + -course_id + -user_id + -track_id + -credit + -start_time + -end_time + -elapsed_time + -package_id +} { + Notify listeners that someting interesting happeneed + with this course tracking +} - - - - - + \ No newline at end of file Index: openacs-4/packages/lorsm/www/admin/course-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/course-add-3.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/lorsm/www/admin/course-add-3.tcl 25 Sep 2008 08:46:24 -0000 1.6 +++ openacs-4/packages/lorsm/www/admin/course-add-3.tcl 8 Oct 2008 13:01:05 -0000 1.7 @@ -529,7 +529,7 @@ # to refine the search a bit more. set found_file [lsearch -all -regexp -exact $all_files $tmp_dir/$filename] } - + if {![empty_string_p $found_file]} { set file_id [lindex [lindex $all_files $found_file] 3] set file_rev_id [content::item::get_live_revision -item_id $file_id] Index: openacs-4/packages/lorsm/www/admin/item-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/item-add-edit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lorsm/www/admin/item-add-edit.tcl 25 Sep 2008 08:46:24 -0000 1.3 +++ openacs-4/packages/lorsm/www/admin/item-add-edit.tcl 8 Oct 2008 13:01:06 -0000 1.4 @@ -10,17 +10,17 @@ ad_form -name item -export {man_id type} -form { item_id:key - {title:text {label "acs-content-repository.Title"}} - {content:richtext {label "acs-content-repository.Content"}} + {title:text {label "[_ acs-content-repository.Title]"}} + {content:richtext(richtext) {label "[_ acs-content-repository.Content]"} {html {cols 80 style {width: 100%}}}} } -edit_request { set content [template::util::richtext::create \ [cr_write_content -string -item_id $item_id] \ text/html] - set title [db_string get_title "select item_title from ims_cp_items where ims_item_id=(select live_revision from cr_items where item_id=:item_id)"] + set title [db_string get_title ""] } -new_data { set content [template::util::richtext::get_property text $content] - set org_id [db_string get_org_id "select org_id from ims_cp_organizations where man_id=:man_id"] - set item_folder_id [db_string get_folder_id "select parent_id from cr_items where latest_revision=:org_id"] + set org_id [db_string get_org_id ""] + set item_folder_id [db_string get_folder_id ""] # ad_return_complaint 1 "folder_id '${item_folder_id}'" # TODO i bet we can make a generic webcontent # a subset of lors::itemcp::item_add_from_object @@ -34,15 +34,15 @@ -identifier $item_id \ -title $title \ -parent_item $org_id] - db_dml set_sort_order "update ims_cp_items set sort_order = (select max(sort_order)+1 from ims_cp_items where org_id=:org_id) where ims_item_id = :ims_item_id" + db_dml set_sort_order "" set revision_id [content::item::get_live_revision -item_id $item_id] content::revision::update_content \ -revision_id $revision_id \ -item_id $item_id \ -content $content \ -mime_type text/html \ - -storage_type [db_string get_storage_type "select storage_type from cr_items where item_id=:item_id"] + -storage_type [db_string get_storage_type ""] set res_id [lors::imscp::resource_add \ -identifier $revision_id \ @@ -62,8 +62,8 @@ -item_id $item_id \ -content $content \ -mime_type text/html \ - -storage_type [db_string get_storage_type "select storage_type from cr_items where item_id=:item_id"] - db_dml set_title "update ims_cp_items set item_title=:title where ims_item_id=:ims_item_id" + -storage_type [db_string get_storage_type ""] + db_dml set_title "" } -after_submit { if {[info exists type]} { lorsm::set_custom_page \ Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/admin/item-add-edit.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.tcl 25 Sep 2008 08:46:24 -0000 1.10 +++ openacs-4/packages/lorsm/www/delivery/delivery-progress-bar.tcl 8 Oct 2008 13:01:06 -0000 1.11 @@ -12,17 +12,19 @@ } -errors { } -set track_id [ad_get_client_property lorsm studenttrack] -ns_log notice "DAVEB LORSM BEFORE TRACK_ID='${track_id}'" if {![info exists man_id] || $man_id eq ""} { set man_id [ad_get_client_property lorsm man_id] } if {![info exists item_id]} { set item_id [ad_get_client_property lorsm ims_id] } -ns_log notice "DEBUG:: item_id $item_id" +ns_log notice "delivery progress bar DEBUG:: item_id $item_id" set community_id [dotlrn_community::get_community_id] set user_id [ad_conn user_id] + +set track_id [lorsm::track::get_track_id -user_id $user_id -man_id $man_id -community_id $community_id] + +#ns_log notice "DAVEB LORSM BEFORE TRACK_ID='${track_id}'" set lorsm_url [dotlrn_community::get_community_url $community_id]lorsm/delivery set package_id [site_node::get_element -url $lorsm_url -element package_id] @@ -31,20 +33,6 @@ set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]] set item_list [lorsm::get_item_list $man_id $user_id] - -set last_item_viewed [db_string select_last_item_viewed { - select ims_item_id - from views_views v, - ims_cp_items i, - ims_cp_organizations o - where v.viewer_id = :user_id - and v.object_id = i.ims_item_id - and i.org_id = o.org_id - and o.man_id = :man_id - order by v.last_viewed desc - limit 1 -} -default ""] - set first_item_id [lindex $item_list 0] set first_item_url "" set curr_index [expr [lsearch -exact $item_list $item_id]] @@ -53,6 +41,19 @@ set track_p 1 if {$curr_index < 0} { + set lorsm_return_url [get_referrer] + ad_set_client_property lorsm lorsm_return_url $lorsm_return_url + + if {$track_id ne "" && $track_id ne "0"} { + set last_viewed_item_id [db_string get_last_viewed "select object_id from views_views, lorsm_student_track where viewer_id = :user_id and object_id in ([template::util::tcl_to_sql_list $item_list]) and track_id=:track_id and last_viewed > start_time order by last_viewed desc limit 1" -default ""] + if {$last_viewed_item_id ne ""} { + set item_id $last_viewed_item_id + ad_set_client_property lorsm ims_id $item_id + ad_returnredirect [export_vars -base "${lorsm_url}/record-view" -url {{item_id $item_id} track_id man_id}] + ad_script_abort + } + } + # start course # we want the next_url to be the first item set curr_index -1 @@ -67,6 +68,9 @@ set page_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:item_id" -default ""] } set next_link_text [_ lorsm.Begin] + if {$track_id ne ""} { + set next_link_text [_ lorsm.Continue] + } set track_p 0 } # Student tracking @@ -81,7 +85,12 @@ } elseif {$track_id eq ""} { set track_id 0 } -ns_log notice "DAVEB LORSM AFTER TRACK_ID='${track_id}'" +#ns_log notice "DAVEB LORSM AFTER TRACK_ID='${track_id}'" + +if {$track_id ne "0"} { + lorsm::track::update_elapsed_seconds -track_id $track_id +} + set prev_item_id [lindex $item_list [expr $curr_index - 1]] set next_item_id [lindex $item_list [expr $curr_index + 1]] set prev_url "" @@ -96,33 +105,62 @@ set last_item_p [expr {$curr_index == [expr {[llength $item_list] - 1}]}] if {[string match "*assessment*" $__include] && ![string match "*assessment/lib/session*" $__include]} { set show_next 0 - set header_stuff { - } + template::head::add_css \ + -href "/resources/assessment/crbForms.css" + template::head::add_css \ + -href "/resources/assessment/assessment.css" + set last_item_p 0 } else { if { $next_item_id eq "" } { # check for end page set next_url ${lorsm_url}/end set last_item_p 0 } - set header_stuff "" set show_next 1 } if {$__include eq "/packages/lorsm/lib/end"} { + if {$track_id ne "0"} { +ns_log notice "HEY PROGRESS BAR END GOING TO TRACK $track_id" + lorsm::track::exit -track_id $track_id + } set item_id [lorsm::get_custom_page_ims_item_id -man_id $man_id -type end] if {$item_id ne ""} { ad_set_client_property lorsm ims_id $item_id set __include /packages/lorsm/lib/default set page_title [db_string get_title "select item_title from ims_cp_items where ims_item_id=:item_id" -default ""] } - set next_url [export_vars -base exit {man_id track_id return_url}] + set lorsm_return_url [ad_get_client_property lorsm lorsm_return_url] + if {$lorsm_return_url ne ""} { + set return_url $lorsm_return_url + } + set next_url [export_vars -base exit {man_id track_id return_url}] set last_item_p 1 } - +if {$item_id eq "" && $__include ne "/packages/lorsm/lib/start" && $__include ne "/packages/lorsm/lib/end"} { + ad_returnredirect -message "[_ lorsm.This_course_contains_no_items]" [get_referrer] + ad_script_abort +} set include_content [template::adp_include $__include $__include_vars] regsub -all {} $include_content {} include_content if {$current_title ne ""} { set page_title $current_title -} \ No newline at end of file +} + + +if {[info exists ::js_order]} { + foreach js $::js_order { + template::head::add_script \ + -src $js + } +} + + +template::head::add_style -style \ +".current-item { font-weight: bold; font-size: 1.2em; } +.next-button { margin: 4px; padding-left: 4px; padding-right: 4px; border-top: 2px solid #fff; border-left: 2px solid #fff; border-right: 2px solid #999; border-bottom: 2px solid #999; background-color: #eee;} +.next-button a { text-decoration: none; color: black; font-size: .8em; font-family: sans-serif;}" + + 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.13 -r1.14 --- openacs-4/packages/lorsm/www/delivery/index.tcl 25 Sep 2008 08:46:24 -0000 1.13 +++ openacs-4/packages/lorsm/www/delivery/index.tcl 8 Oct 2008 13:01:06 -0000 1.14 @@ -127,10 +127,13 @@ set start_page [lorsm::get_custom_page_ims_item_id -man_id $man_id -type start] if {$start_page eq "" && [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] + set track_id [lorsm::track::get_track_id -user_id $user_id -man_id $man_id -community_id $community_id] + if {$track_id eq "" || $track_id eq 0} { + set track_id [lorsm::track::new \ + -user_id $user_id \ + -community_id $community_id \ + -course_id $man_id] + } ad_set_client_property lorsm studenttrack $track_id } else { set track_id 0 Index: openacs-4/packages/lorsm/www/delivery/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/index.vuh,v diff -u -r1.11 -r1.12 --- openacs-4/packages/lorsm/www/delivery/index.vuh 25 Sep 2008 08:46:24 -0000 1.11 +++ openacs-4/packages/lorsm/www/delivery/index.vuh 8 Oct 2008 13:01:06 -0000 1.12 @@ -13,7 +13,9 @@ # figure out the next page after we are done with this... set ims_item_id [ad_get_client_property lorsm ims_id] set man_id [ad_get_client_property lorsm man_id] - +if {$man_id eq ""} { + ad_returnredirect -message "[_ lorsm.Session_Expired]" "../" +} set user_id [ad_conn user_id] set enabled_p [db_string enabled_p "select isenabled from ims_cp_manifest_class where man_id=:man_id and community_id=:dotlrn_package_id" -default "f"] Index: openacs-4/packages/lorsm/www/delivery/menu-mk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/menu-mk.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/lorsm/www/delivery/menu-mk.adp 25 Sep 2008 08:46:24 -0000 1.6 +++ openacs-4/packages/lorsm/www/delivery/menu-mk.adp 8 Oct 2008 13:01:06 -0000 1.7 @@ -7,12 +7,6 @@ - -
[_ lorsm.Items]