Index: openacs-4/packages/ae-portlet/ae-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/ae-portlet.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/ae-portlet.info 9 Jun 2005 05:54:35 -0000 1.1
@@ -0,0 +1,26 @@
+
+
+
+
+ Anon Eval Portlet
+ Anon Evals Portlets
+ f
+ t
+
+
+ Anny Flores
+ 2004-06-12
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/ae-portlet/catalog/ae-portlet.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/catalog/ae-portlet.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/catalog/ae-portlet.en_US.ISO-8859-1.xml 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,7 @@
+
+
+
+ Course Evaluation Admin
+ There should be only one instance of Anon Eval for admin purpose
+ Results
+
Index: openacs-4/packages/ae-portlet/tcl/ae-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/tcl/ae-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/tcl/ae-portlet-procs.tcl 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,352 @@
+ad_library {
+
+ Procedures to support the ae portlets
+
+
+ @author Anny Flores (annyflores@viaro.net)
+ @author Viaro Networks (www.viaro.net)
+
+}
+
+namespace eval ae_portlet {}
+namespace eval ae_admin_portlet {}
+
+
+#
+# ae namespace
+#
+
+ad_proc -private ae_portlet::get_my_name {
+} {
+ return "ae_portlet"
+}
+
+
+
+ad_proc -private ae_portlet::my_package_key {
+} {
+ return "ae-portlet"
+}
+
+ad_proc -public ae_portlet::get_pretty_name {
+} {
+ return "#anon-eval.Anon_Eval#"
+}
+
+
+
+ad_proc -public ae_portlet::link {
+} {
+ return ""
+}
+
+
+
+ad_proc -public ae_portlet::add_self_to_page {
+ {-portal_id:required}
+ {-package_id:required}
+ {-param_action:required}
+ {-force_region ""}
+ {-page_name "" }
+} {
+ Adds a ae PE to the given portal.
+
+ @param portal_id The page to add self to
+ @param package_id The community with the folder
+
+ @return element_id The new element's id
+} {
+ return [portal::add_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -value $package_id \
+ -force_region $force_region \
+ -page_name $page_name \
+ -pretty_name [get_pretty_name] \
+ -param_action $param_action
+ ]
+}
+
+
+
+ad_proc -public ae_portlet::remove_self_from_page {
+ {-portal_id:required}
+ {-package_id:required}
+} {
+ Removes a ae PE from the given page or the package_id of the
+ ae package from the portlet if there are others remaining
+
+ @param portal_id The page to remove self from
+ @param package_id
+} {
+ portal::remove_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -value $package_id
+}
+
+
+
+ad_proc -public ae_portlet::show {
+ cf
+} {
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "ae-portlet"
+}
+
+#
+# ae admin namespace
+#
+
+ad_proc -private ae_admin_portlet::get_my_name {} {
+ return "ae_admin_portlet"
+}
+
+
+ad_proc -public ae_admin_portlet::get_pretty_name {} {
+ return "#anon-eval.Anon_Eval_Administration#"
+}
+
+
+
+ad_proc -private ae_admin_portlet::my_package_key {} {
+ return "ae-portlet"
+}
+
+
+
+ad_proc -public ae_admin_portlet::link {} {
+ return ""
+}
+
+
+
+ad_proc -public ae_admin_portlet::add_self_to_page {
+ {-portal_id:required}
+ {-page_name ""}
+ {-package_id:required}
+} {
+ Adds a ae admin PE to the given portal
+
+ @param portal_id The page to add self to
+ @param package_id The package_id of the ae package
+
+ @return element_id The new element's id
+} {
+ return [portal::add_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -key package_id \
+ -value $package_id
+ ]
+}
+
+ad_proc -public ae_admin_portlet::remove_self_from_page {
+ {-portal_id:required}
+} {
+ Removes a ae admin PE from the given page
+} {
+ portal::remove_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+}
+
+
+ad_proc -public ae_admin_portlet::show {
+ cf
+} {
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "ae-admin-portlet"
+}
+
+ad_proc -private ae_portlet::after_install {} {
+ Create the datasources needed by the ae portlet.
+} {
+
+ db_transaction {
+ set ds_id [portal::datasource::new \
+ -name "ae_portlet" \
+ -description "Anon Eval Portlet"]
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p t \
+ -key shadeable_p \
+ -value t
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p t \
+ -key hideable_p \
+ -value t
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p t \
+ -key user_editable_p \
+ -value f
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p t \
+ -key shaded_p \
+ -value f
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p t \
+ -key link_hideable_p \
+ -value f
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p f \
+ -key package_id \
+ -value ""
+
+ register_portal_datasource_impl
+
+ }
+}
+
+ad_proc -private ae_portlet::register_portal_datasource_impl {} {
+ Create the service contracts needed by the ae portlet.
+} {
+ set spec {
+ name "ae_portlet"
+ contract_name "portal_datasource"
+ owner "ae-portlet"
+ aliases {
+ GetMyName ae_portlet::get_my_name
+ GetPrettyName ae_portlet::get_pretty_name
+ Link ae_portlet::link
+ AddSelfToPage ae_portlet::add_self_to_page
+ Show ae_portlet::show
+ Edit ae_portlet::edit
+ RemoveSelfFromPage ae_portlet::remove_self_from_page
+ }
+ }
+
+ acs_sc::impl::new_from_spec -spec $spec
+}
+
+ad_proc -private ae_admin_portlet::after_install {} {
+ Create the datasources needed by the ae portlet.
+} {
+
+ db_transaction {
+ set ds_id [portal::datasource::new \
+ -name "ae_admin_portlet" \
+ -description "Ae Admin Portlet"]
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p t \
+ -key shadeable_p \
+ -value f
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p t \
+ -key hideable_p \
+ -value f
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p t \
+ -key user_editable_p \
+ -value f
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p t \
+ -key shaded_p \
+ -value f
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p t \
+ -key link_hideable_p \
+ -value t
+
+ portal::datasource::set_def_param \
+ -datasource_id $ds_id \
+ -config_required_p t \
+ -configured_p f \
+ -key package_id \
+ -value ""
+
+ register_portal_datasource_impl
+ }
+
+}
+
+
+
+ad_proc -private ae_admin_portlet::register_portal_datasource_impl {} {
+ Create the service contracts needed by the ae admin portlet.
+} {
+ set spec {
+ name "ae_admin_portlet"
+ contract_name "portal_datasource"
+ owner "ae-portlet"
+ aliases {
+ GetMyName ae_admin_portlet::get_my_name
+ GetPrettyName ae_admin_portlet::get_pretty_name
+ Link ae_admin_portlet::link
+ AddSelfToPage ae_admin_portlet::add_self_to_page
+ Show ae_admin_portlet::show
+ Edit ae_admin_portlet::edit
+ RemoveSelfFromPage ae_admin_portlet::remove_self_from_page
+ }
+ }
+
+ acs_sc::impl::new_from_spec -spec $spec
+}
+
+ad_proc -private ae_portlet::uninstall {} {
+ Ae Portlet package uninstall proc
+} {
+ unregister_implementations
+ set ds_id [portal::get_datasource_id ae_portlet]
+ db_exec_plsql delete_aes_ds { *SQL* }
+}
+
+ad_proc -private ae_admin_portlet::uninstall {} {
+ Ae Portlet package uninstall proc
+} {
+ unregister_implementations
+ set ds_id [portal::get_datasource_id ae_admin_portlet]
+ db_exec_plsql delete_admin_ds { *SQL* }
+}
+
+ad_proc -private ae_portlet::unregister_implementations {} {
+ Unregister service contract implementations
+} {
+ acs_sc::impl::delete \
+ -contract_name "portal_datasource" \
+ -impl_name "ae_portlet"
+}
+
+ad_proc -private ae_admin_portlet::unregister_implementations {} {
+ Unregister service contract implementations
+} {
+ acs_sc::impl::delete \
+ -contract_name "portal_datasource" \
+ -impl_name "ae_admin_portlet"
+}
Index: openacs-4/packages/ae-portlet/tcl/apm-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/tcl/apm-callback-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/tcl/apm-callback-procs.tcl 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,30 @@
+ad_library {
+ Procedures for initializing service contracts etc. for the
+ anon-eval portlet package. Should only be executed
+ once upon installation.
+
+ @author Anny Flores (annyflores@viaro.net)
+ @author Viaro Networks (www.viaro.net)
+}
+
+namespace eval apm::ae_portlet {}
+namespace eval apm::ae_admin_portlet {}
+
+ad_proc -public apm::ae_portlet::after_install {} {
+ Create the datasources needed by the anon-eval portlets.
+} {
+ ae_portlet::after_install
+ ae_admin_portlet::after_install
+}
+
+ad_proc -public apm::anon-eval_portlet::before_uninstall {} {
+ Anon-Eval Portlet package uninstall proc
+} {
+
+ db_transaction {
+ ae_portlet::uninstall
+ ae_admin_portlet::uninstall
+ }
+}
+
+
Index: openacs-4/packages/ae-portlet/www/ae-admin-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/www/ae-admin-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/www/ae-admin-portlet.adp 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+
+@actions;noquote@
+
Index: openacs-4/packages/ae-portlet/www/ae-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/www/ae-admin-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/www/ae-admin-portlet.tcl 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,62 @@
+ad_page_contract {
+ The display logic for the assessment admin portlet
+
+ @author Anny Flores (annyflores@viaro.net)
+ @author Viaro Networks (www.viaro.net)
+
+} -properties {
+
+}
+
+array set config $cf
+set user_id [ad_conn user_id]
+set list_of_package_ids $config(package_id)
+set dotlrn_admin_p [dotlrn::admin_p -user_id $user_id]
+
+if {[llength $list_of_package_ids] > 1} {
+ # We have a problem!
+ return -code error "[_ assessment-portlet.error_one_assessment] "
+}
+
+set package_id [lindex $list_of_package_ids 0]
+
+set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0]
+set user_id [ad_conn user_id]
+set package_admin_p [permission::permission_p -party_id $user_id -object_id $package_id -privilege "admin"]
+set actions "[_ assessment.New_Assessment]"
+
+if { $package_admin_p == 0} {
+ set m_name "get_all_assessments_admin"
+} else {
+ set m_name "get_all_assessments"
+}
+
+#list all assessments
+
+db_multirow -extend { export permissions admin_request} assessments $m_name {} {
+ set export "[_ assessment.Export]"
+ set permissions "[_ assessment.permissions]"
+ set admin_request "[_ assessment.Request] [_ assessment.Administration]"
+}
+
+list::create \
+ -name assessments \
+ -key assessment_id \
+ -no_data "[_ assessment.None]" \
+ -elements {
+ title {
+ label {[_ ae-portlet.title]}
+ display_template {
@assessments.title@}
+ }
+ edit {
+ display_template {}
+ }
+ view_results {
+ label {[_ ae-portlet.view_results]}
+ display_template {#assessment.All# |
+ #assessment.CSV_file#}
+ }
+ }
+
+
+ad_return_template
Index: openacs-4/packages/ae-portlet/www/ae-admin-portlet.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/www/ae-admin-portlet.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/www/ae-admin-portlet.xql 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+ select ci.item_id as assessment_id, cr.title
+ from cr_folders cf, cr_items ci, cr_revisions cr, as_assessments a
+ where cr.revision_id = ci.latest_revision
+ and a.assessment_id = cr.revision_id
+ and ci.parent_id = cf.folder_id and cf.package_id = :package_id
+ order by cr.title
+
+
+
+
+
+
+
+ select ci.item_id as assessment_id, cr.title
+ from cr_folders cf, cr_items ci, cr_revisions cr, as_assessments a
+ where cr.revision_id = ci.latest_revision
+ and a.assessment_id = cr.revision_id
+ and ci.parent_id = cf.folder_id
+ and ci.item_id in (select object_id from acs_permissions where
+ grantee_id=:user_id and privilege='admin') and cf.package_id = :package_id
+ order by cr.title
+
+
+
+
+
+
Index: openacs-4/packages/ae-portlet/www/ae-portlet-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/www/Attic/ae-portlet-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/www/ae-portlet-oracle.xql 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,26 @@
+
+
+
+oracle8.1.6
+
+
+
+ select cri.item_id as assessment_id,
+ crr.title,
+ crr.description,
+ acs_object.name(apm_package.parent_id(crf.package_id)) as parent_name,
+ (select site_node.url(site_nodes.node_id)
+ from site_nodes
+ where site_nodes.object_id = crf.package_id) as url,
+ crf.package_id
+ from as_assessments asa, cr_items cri, cr_revisions crr, cr_folders crf
+ where crr.revision_id = asa.assessment_id
+ and crr.revision_id = cri.latest_revision
+ and cri.parent_id = crf.folder_id
+ and crf.package_id in ([join $list_of_package_ids ", "])
+ and (asa.start_time < current_timestamp or asa.start_time is null)
+ order by package_id, lower(crr.title)
+
+
+
+
Index: openacs-4/packages/ae-portlet/www/ae-portlet-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/www/Attic/ae-portlet-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/www/ae-portlet-postgresql.xql 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,31 @@
+
+
+
+postgresql7.1
+
+
+
+ select cr.item_id as assessment_id, cr.title, cr.description, a.password,
+ to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time,
+ to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time,
+ to_char(now(), 'YYYY-MM-DD HH24:MI:SS') as cur_time,
+ cf.package_id, p.instance_name as community_name,
+ sc.node_id as comm_node_id, sa.node_id as as_node_id
+ from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf,
+ site_nodes sa, site_nodes sc, apm_packages p
+ where a.assessment_id = cr.revision_id
+ and cr.revision_id = ci.latest_revision
+ and ci.parent_id = cf.folder_id
+ and cf.package_id in ([join $list_of_package_ids ", "])
+ and sa.object_id = cf.package_id
+ and sc.node_id = sa.parent_id
+ and p.package_id = sc.object_id
+ and exists (select 1
+ from as_assessment_section_map asm, as_item_section_map ism
+ where asm.assessment_id = a.assessment_id
+ and ism.section_id = asm.section_id)
+ order by lower(p.instance_name), lower(cr.title)
+
+
+
+
Index: openacs-4/packages/ae-portlet/www/ae-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/www/ae-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/www/ae-portlet.adp 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ #assessment.answered_assessments#
+
+
+
+
+
+
+
+
Index: openacs-4/packages/ae-portlet/www/ae-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/www/ae-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/www/ae-portlet.tcl 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,112 @@
+ad_page_contract {
+ The display logic for the assessment portlet
+
+ @author Anny Flores (annyflores@viaro.net)
+ @author Viaro Networks (www.viaro.net)
+} {
+ {page_num 0}
+} -properties {
+}
+
+set user_id [ad_conn user_id]
+
+array set config $cf
+set shaded_p $config(shaded_p)
+
+set list_of_package_ids $config(package_id)
+set package_id [lindex $list_of_package_ids 0]
+set user_id [ad_conn user_id]
+set package_admin_p [permission::permission_p -party_id $user_id -object_id $package_id -privilege "admin"]
+set dotlrn_admin_p [dotlrn::admin_p -user_id $user_id]
+
+set one_instance_p [ad_decode [llength $list_of_package_ids] 1 1 0]
+
+set elements [list]
+if {!$one_instance_p} {
+ set elements [list community_name \
+ [list \
+ label "[_ dotlrn.Community]" \
+ display_template {@assessments.community_name@ }]]
+}
+
+lappend elements title \
+ [list \
+ label "[_ assessment.open_assessments]" \
+ display_template {@assessments.title@}]
+
+
+# create a list with all open assessments
+template::list::create \
+ -name assessments \
+ -multirow assessments \
+ -key assessment_id \
+ -elements $elements \
+ -main_class narrow
+
+# get the information of all open assessments
+template::multirow create assessments assessment_id title description assessment_url community_url community_name
+set old_comm_node_id 0
+db_foreach open_asssessments {} {
+ if {([empty_string_p $start_time] || $start_time <= $cur_time) && ([empty_string_p $end_time] || $end_time >= $cur_time)} {
+ if {$comm_node_id == $old_comm_node_id} {
+ set community_name ""
+ }
+ set community_url [site_node::get_url -node_id $comm_node_id]
+ set assessment_url [site_node::get_url -node_id $as_node_id]
+ set old_comm_node_id $comm_node_id
+
+ if {[empty_string_p $password]} {
+ append assessment_url [export_vars -base "assessment" {assessment_id}]
+ } else {
+ append assessment_url [export_vars -base "assessment-password" {assessment_id}]
+ }
+
+ template::multirow append assessments $assessment_id $title $description $assessment_url $community_url $community_name
+ }
+}
+
+
+set elements [list]
+if {!$one_instance_p} {
+ set elements [list community_name \
+ [list \
+ label "[_ dotlrn.Community]" \
+ display_template {@sessions.community_name@ }]]
+}
+
+lappend elements title \
+ [list \
+ label "[_ assessment.Assessments]"] \
+
+lappend elements edit\
+ [list \
+ display_template {}
+ ]
+
+lappend elements view \
+ [list \
+ display_template {}
+ ]
+
+# create a list with all answered assessments and their sessions
+template::list::create \
+ -name sessions \
+ -multirow sessions \
+ -key assessment_id \
+ -elements $elements \
+ -main_class narrow
+
+# get the information of all assessments store in the database
+set old_comm_node_id 0
+db_multirow -extend { session_id session_url community_url } sessions answered_assessments {} {
+ if {$comm_node_id == $old_comm_node_id} {
+ set community_name ""
+ }
+ as::assessment::data -assessment_id $assessment_id
+ set assessment_rev_id $assessment_data(assessment_rev_id)
+ set session_id [db_string last_session {select max(session_id) as session_id from as_sessions where assessment_id = :assessment_rev_id and subject_id = :user_id}]
+
+ set community_url [site_node::get_url -node_id $comm_node_id]
+ set session_url "[site_node::get_url -node_id $as_node_id][export_vars -base sessions {assessment_id}]"
+ set old_comm_node_id $comm_node_id
+}
Index: openacs-4/packages/ae-portlet/www/ae-portlet.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ae-portlet/www/Attic/ae-portlet.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/ae-portlet/www/ae-portlet.xql 9 Jun 2005 05:54:36 -0000 1.1
@@ -0,0 +1,29 @@
+
+
+
+
+
+ select cr.item_id as assessment_id, cr.title, cr.description,
+ cf.package_id, p.instance_name as community_name,
+ sc.node_id as comm_node_id, sa.node_id as as_node_id
+ from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf,
+ site_nodes sa, site_nodes sc, apm_packages p
+ where a.assessment_id = cr.revision_id
+ and cr.revision_id = ci.latest_revision
+ and ci.parent_id = cf.folder_id
+ and cf.package_id in ([join $list_of_package_ids ", "])
+ and sa.object_id = cf.package_id
+ and sc.node_id = sa.parent_id
+ and p.package_id = sc.object_id
+ and exists (select 1
+ from as_sessions s
+ where s.assessment_id = a.assessment_id
+ and s.subject_id = :user_id
+ and s.completed_datetime is not null)
+ order by lower(p.instance_name), lower(cr.title)
+
+
+
+
+
+
Index: openacs-4/packages/anon-eval/catalog/anon-eval.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/catalog/anon-eval.en_US.ISO-8859-1.xml,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/anon-eval/catalog/anon-eval.en_US.ISO-8859-1.xml 4 Jun 2005 10:15:55 -0000 1.1
+++ openacs-4/packages/anon-eval/catalog/anon-eval.en_US.ISO-8859-1.xml 9 Jun 2005 05:54:36 -0000 1.2
@@ -1,7 +1,10 @@
+ You are not able to submit a respose for this evaluation.
+ You don't have permission to admin Course Evaluations.
Course Evaluations
Course Evaluations Administration
Anonymous Course Evaluations
+ You don't have permission to see the results.
Index: openacs-4/packages/anon-eval/www/assessment.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/www/assessment.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/anon-eval/www/assessment.tcl 2 Jun 2005 06:28:45 -0000 1.1
+++ openacs-4/packages/anon-eval/www/assessment.tcl 9 Jun 2005 05:54:36 -0000 1.2
@@ -18,7 +18,6 @@
context_bar:onevalue
page_title:onevalue
}
-
set user_id [ad_conn user_id]
set page_title "[_ assessment.Show_Items]"
set context [list $page_title]
@@ -36,8 +35,13 @@
# Get the assessment data
as::assessment::data -assessment_id $assessment_id
-permission::require_permission -object_id $assessment_id -privilege read
+set admin_p [permission::permission_p -privilege admin -object_id [ad_conn package_id]]
+if { $admin_p } {
+ ad_return_complaint 1 "[_ anon-eval.admin_message]"
+ ad_script_abort
+}
+
if {![info exists assessment_data(assessment_id)]} {
ad_return_complaint 1 "[_ assessment.Requested_assess_does]"
ad_script_abort
@@ -55,7 +59,6 @@
db_transaction {
if {[empty_string_p $session_id]} {
-
# Check if there is an unfinished session lying around
set session_id [db_string unfinished_session_id {}]
if {[empty_string_p $session_id]} {
Index: openacs-4/packages/anon-eval/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/www/index.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/anon-eval/www/index.tcl 2 Jun 2005 06:28:45 -0000 1.1
+++ openacs-4/packages/anon-eval/www/index.tcl 9 Jun 2005 05:54:36 -0000 1.2
@@ -15,7 +15,13 @@
set package_id [ad_conn package_id]
set folder_id [as::assessment::folder_id -package_id $package_id]
set user_id [ad_conn user_id]
+set admin_p [permission::permission_p -privilege admin -object_id [ad_conn package_id]]
+if { $admin_p } {
+ ad_return_complaint 1 "[_ anon-eval.permission_denied]"
+ ad_script_abort
+}
+
# create a list with all open assessments
template::list::create \
-name assessments \
Index: openacs-4/packages/anon-eval/www/session.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/www/session.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/anon-eval/www/session.tcl 2 Jun 2005 06:28:45 -0000 1.1
+++ openacs-4/packages/anon-eval/www/session.tcl 9 Jun 2005 05:54:36 -0000 1.2
@@ -17,7 +17,13 @@
# Get the assessment data
as::assessment::data -assessment_id $assessment_id
permission::require_permission -object_id $assessment_id -privilege read
+set admin_p [permission::permission_p -privilege admin -object_id [ad_conn package_id]]
+if { $admin_p } {
+ ad_return_complaint 1 "[_ anon-eval.permission_denied]"
+ ad_script_abort
+}
+
if {![info exists assessment_data(assessment_id)]} {
ad_return_complaint 1 "[_ assessment.Requested_assess_does]"
ad_script_abort
Index: openacs-4/packages/anon-eval/www/sessions.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/www/sessions.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/anon-eval/www/sessions.tcl 2 Jun 2005 06:28:45 -0000 1.1
+++ openacs-4/packages/anon-eval/www/sessions.tcl 9 Jun 2005 05:54:36 -0000 1.2
@@ -19,7 +19,14 @@
set format "[lc_get formbuilder_date_format], [lc_get formbuilder_time_format]"
set user_id [ad_conn user_id]
permission::require_permission -object_id $assessment_id -privilege read
+set dotlrn_admin_p [dotlrn::admin_p]
+if { !$dotlrn_admin_p } {
+ ad_return_complaint 1 "[_ anon-eval.permission_denied]"
+ ad_script_abort
+}
+
+
# Get the assessment data
as::assessment::data -assessment_id $assessment_id
Index: openacs-4/packages/anon-eval/www/asm-admin/assessment-form.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/www/asm-admin/assessment-form.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/anon-eval/www/asm-admin/assessment-form.tcl 2 Jun 2005 06:28:45 -0000 1.1
+++ openacs-4/packages/anon-eval/www/asm-admin/assessment-form.tcl 9 Jun 2005 05:54:37 -0000 1.2
@@ -25,6 +25,14 @@
set package_id [ad_conn package_id]
permission::require_permission -object_id $package_id -privilege create
+set dotlrn_admin_p [dotlrn::admin_p]
+
+if { !$dotlrn_admin_p } {
+ ad_return_complaint 1 "[_ anon-eval.admin_permission_denied]"
+ ad_script_abort
+}
+
+
set context [list [list index [_ assessment.admin]] $page_title]
set sql_format "YYYY-MM-DD HH24:MI:SS"
Index: openacs-4/packages/anon-eval/www/asm-admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/www/asm-admin/index.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/anon-eval/www/asm-admin/index.tcl 2 Jun 2005 06:28:45 -0000 1.1
+++ openacs-4/packages/anon-eval/www/asm-admin/index.tcl 9 Jun 2005 05:54:37 -0000 1.2
@@ -20,7 +20,14 @@
set categories_url [db_string get_category_url {}]
set user_id [ad_conn user_id]
set package_admin_p [permission::permission_p -party_id $user_id -object_id $package_id -privilege "admin"]
+set dotlrn_admin_p [dotlrn::admin_p]
+if { !$dotlrn_admin_p } {
+ ad_return_complaint 1 "[_ anon-eval.admin_permission_denied]"
+ ad_script_abort
+}
+
+
if { $package_admin_p == 0} {
set m_name "get_all_assessments_admin"
} else {
Index: openacs-4/packages/anon-eval/www/asm-admin/one-a.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/www/asm-admin/one-a.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/anon-eval/www/asm-admin/one-a.tcl 2 Jun 2005 06:28:45 -0000 1.1
+++ openacs-4/packages/anon-eval/www/asm-admin/one-a.tcl 9 Jun 2005 05:54:37 -0000 1.2
@@ -18,6 +18,13 @@
permission::require_permission -object_id $package_id -privilege create
permission::require_permission -object_id $assessment_id -privilege admin
+set dotlrn_admin_p [dotlrn::admin_p]
+
+if { !$dotlrn_admin_p } {
+ ad_return_complaint 1 "[_ anon-eval.admin_permission_denied]"
+ ad_script_abort
+}
+
set admin_p [acs_user::site_wide_admin_p]
# Get the assessment data
as::assessment::data -assessment_id $assessment_id
Index: openacs-4/packages/attendance/lib/cp-attendance.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/lib/cp-attendance.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/attendance/lib/cp-attendance.adp 9 Jun 2005 05:54:37 -0000 1.1
@@ -0,0 +1,8 @@
+Sessions
+
+
+
Index: openacs-4/packages/attendance/lib/cp-attendance.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/lib/cp-attendance.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/attendance/lib/cp-attendance.tcl 9 Jun 2005 05:54:37 -0000 1.1
@@ -0,0 +1,66 @@
+
+set current_url [ad_conn url]
+
+set package_id [ad_conn package_id]
+set community_id [dotlrn_community::get_community_id]
+
+set attendance_package_id [db_string "getattpack" "select object_id from acs_objects a, apm_packages b where a.object_id = b.package_id and a.context_id = :package_id and b.package_key = 'attendance';"]
+set attendance_url [apm_package_url_from_id $attendance_package_id]
+
+set calendar_id [dotlrn_calendar::get_group_calendar_id -community_id $community_id]
+set calendar_url [calendar_portlet_display::get_url_stub $calendar_id]
+set item_type_id [db_string item_type_id "select item_type_id from cal_item_types where type='Session' and calendar_id = :calendar_id limit 1" -default 0]
+
+set grade_item_id [db_string "getgradeid" "select eg.grade_item_id as grade_item_id
+ from evaluation_grades eg, acs_objects ao, cr_items cri
+ where cri.live_revision = eg.grade_id
+ and eg.grade_item_id = ao.object_id
+ and ao.context_id = :attendance_package_id
+ and eg.grade_name = 'Attendance'"]
+
+ns_log Notice " -- Attendance Package ID : $attendance_package_id, Grade Item : $grade_item_id --"
+
+attendance::add_sessions -community_id $community_id -grade_item_id $grade_item_id -package_id $attendance_package_id
+
+template::list::create \
+ -name session_list \
+ -multirow session_list \
+ -pass_properties { attendance_url current_url calendar_url calendar_id item_type_id } \
+ -key task_id \
+ -no_data "No sessions" \
+ -elements {
+ task_name {
+ label "Session"
+ }
+ action {
+ label "Actions"
+ display_template { Edit | Mark Attendance }
+ }
+ }
+
+db_multirow -extend {cal_item_id} session_list get_sessions {
+ select et.task_name, et.number_of_members, et.task_id, et.grade_item_id,
+ to_char(et.due_date,'YYYY-MM-DD HH24:MI:SS') as due_date_ansi,
+ et.online_p,
+ et.late_submit_p,
+ et.item_id,
+ et.task_item_id,
+ et.due_date,
+ et.requires_grade_p, et.description, et.grade_item_id,
+ cr.title as task_title,
+ et.data as task_data,
+ et.task_id as revision_id,
+ coalesce(round(cr.content_length/1024,0),0) as content_length,
+ et.late_submit_p,
+ crmt.label as pretty_mime_type
+ from cr_revisions cr,
+ evaluation_tasksi et,
+ cr_items cri,
+ cr_mime_types crmt
+ where cr.revision_id = et.revision_id
+ and grade_item_id = :grade_item_id
+ and cri.live_revision = et.task_id
+ and et.mime_type = crmt.mime_type
+} {
+ set cal_item_id [db_string "getcalid" "select cal_item_id from evaluation_cal_task_map where task_item_id=:item_id"]
+}
\ No newline at end of file
Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/attendance/tcl/attendance-init.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/attendance/tcl/attendance-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/tcl/attendance-procs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/attendance/tcl/attendance-procs.tcl 31 May 2005 22:02:59 -0000 1.1
+++ openacs-4/packages/attendance/tcl/attendance-procs.tcl 9 Jun 2005 05:54:37 -0000 1.2
@@ -9,9 +9,8 @@
namespace eval attendance {
-
ad_proc get_grade_info {
- {-package_id:required}
+ -package_id:required
} {
HAM (hamilton.chua@gmail.com)
Retreives grade_id and grade_item_id from evaluation and sets them in the calling environment
@@ -20,14 +19,15 @@
uplevel 1 { db_0or1row "getgradeid" "select eg.grade_id as grade_id, eg.grade_item_id as grade_item_id, eg.grade_plural_name
from evaluation_grades eg, acs_objects ao, cr_items cri
where cri.live_revision = eg.grade_id
- and eg.grade_item_id = ao.object_id
- and ao.context_id = :package_id
+ and eg.grade_item_id = ao.object_id
+ and ao.context_id = :package_id
and eg.grade_name = 'Attendance'"}
}
ad_proc create_task {
- {-cal_item_id:required}
- {-grade_item_id:required}
+ -cal_item_id:required
+ -grade_item_id:required
+ {-package_id ""}
} {
HAM (hamilton.chua@gmail.com)
Create an attendance task
@@ -42,6 +42,10 @@
set item_id [db_nextval acs_object_id_seq]
set cal_start_date [template::util::date::from_ansi $cal_item_array(start_date_ansi) "YYYY-MM-DD HH24:MI:SS"]
set cal_end_date [template::util::date::from_ansi $cal_item_array(end_date_ansi) "YYYY-MM-DD HH24:MI:SS"]
+
+ if {[empty_string_p $package_id]} {
+ set package_id [ad_conn package_id]
+ }
set due_date_ansi $cal_item_array(start_date_ansi)
set url ""
@@ -62,7 +66,7 @@
-storage_type $storage_type \
-due_date $due_date_ansi \
-requires_grade_p "f" \
- -title $title ]
+ -title $title -package_id $package_id ]
content::item::set_live_revision -revision_id $revision_id
db_dml update_date {
@@ -82,26 +86,31 @@
}
ad_proc add_sessions {
- {-community_id:required}
- {-grade_item_id:required}
+ -community_id:required
+ -grade_item_id:required
+ {-package_id ""}
} {
HAM (hamilton.chua@gmail.com)
Check if there are calendar sessions for the section
- Cehck if the session is arleady an evaluation
+ Check if the session is already an evaluation task
if not then create a task with the session's details
} {
# let's retrieve sessions for this community
set calendar_id [dotlrn_calendar::get_group_calendar_id -community_id $community_id]
set item_type_id [db_string item_type_id "select item_type_id from cal_item_types where type='Session' and calendar_id = :calendar_id"]
+ if {[empty_string_p $package_id]} {
+ set package_id [ad_conn package_id]
+ }
+
# create the task
db_transaction {
# check if each session has corresponding evaluation task, if none then add it
db_foreach "cal_item" "select cal_item_id from cal_items where on_which_calendar = :calendar_id and item_type_id = :item_type_id" {
- attendance::create_task -cal_item_id $cal_item_id -grade_item_id $grade_item_id
+ attendance::create_task -cal_item_id $cal_item_id -grade_item_id $grade_item_id -package_id $package_id
}
Index: openacs-4/packages/attendance/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/www/index.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/attendance/www/index.adp 31 May 2005 22:02:59 -0000 1.1
+++ openacs-4/packages/attendance/www/index.adp 9 Jun 2005 05:54:37 -0000 1.2
@@ -1,4 +1,4 @@
-ExpensesAttendanceFor admins only.
Index: openacs-4/packages/attendance/www/admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/www/admin/index.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/attendance/www/admin/index.tcl 31 May 2005 22:02:59 -0000 1.1
+++ openacs-4/packages/attendance/www/admin/index.tcl 9 Jun 2005 05:54:37 -0000 1.2
@@ -14,14 +14,16 @@
# initial variables
set page_title "Attendance Tasks"
set context $page_title
-set package_id [ad_conn package_id]
set community_id [dotlrn_community::get_community_id]
+set package_id [ad_conn package_id]
# get grade info
attendance::get_grade_info -package_id $package_id
+ns_log Notice " -- Attendance Package ID : $package_id, Grade Item : $grade_item_id --"
+
# check calendar items for session and turn them into attendance tasks
-attendance::add_sessions -community_id $community_id -grade_item_id $grade_item_id
+attendance::add_sessions -community_id $community_id -grade_item_id $grade_item_id -package_id $package_id
set elements [list task_name \
[list label "Task Name" \
Index: openacs-4/packages/attendance/www/admin/mark-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/www/admin/mark-2.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/attendance/www/admin/mark-2.tcl 31 May 2005 22:02:59 -0000 1.1
+++ openacs-4/packages/attendance/www/admin/mark-2.tcl 9 Jun 2005 05:54:37 -0000 1.2
@@ -8,16 +8,18 @@
} {
cal_item_id:integer,notnull
user_id:integer,multiple,optional
+ {return_url "index"}
}
-# delete attendance for a cal_item_id
-db_dml "delattendance" "delete from attendance_cal_item_map where cal_item_id = :cal_item_id"
-
if { [exists_and_not_null user_id ] } {
+
+ # delete attendance for a cal_item_id
+ db_dml "delattendance" "delete from attendance_cal_item_map where cal_item_id = :cal_item_id"
+
foreach id $user_id {
db_dml "updatemap" "insert into attendance_cal_item_map (cal_item_id, user_id) values (:cal_item_id, :id)"
}
}
-ad_returnredirect -message "Attendance has been marked" "index"
\ No newline at end of file
+ad_returnredirect -message "Attendance has been marked" $return_url
\ No newline at end of file
Index: openacs-4/packages/attendance/www/admin/mark.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/www/admin/mark.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/attendance/www/admin/mark.adp 31 May 2005 22:02:59 -0000 1.1
+++ openacs-4/packages/attendance/www/admin/mark.adp 9 Jun 2005 05:54:37 -0000 1.2
@@ -6,6 +6,7 @@