Index: openacs-4/packages/assessment/tcl/as-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-callback-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/tcl/as-callback-procs.tcl 17 Nov 2005 15:41:51 -0000 1.2 +++ openacs-4/packages/assessment/tcl/as-callback-procs.tcl 17 Feb 2006 12:13:54 -0000 1.3 @@ -1,27 +1,16 @@ ad_library { - assessment -- callback routines - @author eduardo.perez@uc3m.es - @creation-date 2005-05-23 - @cvs-id $Id$ + assessment -- callback routines + @author eduardo.perez@uc3m.es + @creation-date 2005-05-23 + @cvs-id $Id$ } -ad_proc -public -callback lors::import -impl qti {} { - this is the lors qti importer -} { - if {$res_type == "imsqti_xmlv1p0" || $res_type == "imsqti_xmlv1p1" || $res_type =="imsqti_item_xmlv2p0"} { - return [as::qti::register \ - -tmp_dir $tmp_dir/$res_href \ - -community_id $community_id] - } -} - - ad_proc -public -callback imsld::import -impl qti {} { this is the imsld qti importer } { - if {$res_type == "imsqti_xmlv1p0" || $res_type == "imsqti_xmlv1p1" || $res_type =="imsqti_item_xmlv2p0"} { - return [as::qti::register_xml_object_id \ - -xml_file $tmp_dir/$res_href \ - -community_id $community_id] - } + if {$res_type == "imsqti_xmlv1p0" || $res_type == "imsqti_xmlv1p1" || $res_type =="imsqti_item_xmlv2p0"} { + return [as::qti::register_xml_object_id \ + -xml_file $tmp_dir/$res_href \ + -community_id $community_id] + } } Index: openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 9 Apr 2005 22:39:27 -0000 1.17 +++ openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 17 Feb 2006 12:13:55 -0000 1.18 @@ -352,14 +352,15 @@ ad_proc -public as::item_type_mc::results { -as_item_item_id:required -section_item_id:required - -data_type:required + {-data_type ""} -sessions:required } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-26 Return the results of a given item in a given list of sessions as an array } { + db_foreach get_results {} { if {[empty_string_p $text_value]} { lappend results($session_id) [as::assessment::quote_export -text $title] Index: openacs-4/packages/assessment/tcl/as-item-type-sa-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-sa-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/tcl/as-item-type-sa-procs.xql 26 Jan 2005 11:06:45 -0000 1.2 +++ openacs-4/packages/assessment/tcl/as-item-type-sa-procs.xql 17 Feb 2006 12:13:55 -0000 1.3 @@ -29,9 +29,9 @@ from as_item_data d, as_session_item_map m, cr_revisions ri, cr_revisions rs where d.session_id in ([join $sessions ,]) and d.as_item_id = ri.revision_id - and ri.item_id = :as_item_item_id + and ri.item_id = $as_item_item_id and d.section_id = rs.revision_id - and rs.item_id = :section_item_id + and rs.item_id = $section_item_id and m.session_id = d.session_id and m.item_data_id = d.item_data_id Index: openacs-4/packages/assessment/www/asm-admin/assessment-copy-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/assessment-copy-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/assessment-copy-oracle.xql 2 May 2005 10:11:22 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/assessment-copy-oracle.xql 17 Feb 2006 12:13:55 -0000 1.2 @@ -13,8 +13,10 @@ and na.object_id = pa.package_id and nc.node_id = na.parent_id and pc.package_id = nc.object_id - and acs_permission.permission_p (pa.package_id, :user_id, 'admin') = 't' - + and exists (select 1 from acs_object_party_privilege_map ppm + where ppm.object_id = pa.package_id + and ppm.privilege = 'admin' + and ppm.party_id = :user_id) Index: openacs-4/packages/assessment/www/asm-admin/change-timing.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/change-timing.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/change-timing.adp 17 Feb 2006 12:13:55 -0000 1.1 @@ -0,0 +1,4 @@ + +#assessment.Change_timings# +@context;noquote@ + Index: openacs-4/packages/assessment/www/asm-admin/change-timing.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/change-timing.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/change-timing.tcl 17 Feb 2006 12:13:55 -0000 1.1 @@ -0,0 +1,49 @@ +# packages/project-manager/www/assign-myself +ad_page_contract { + Assign all the recieved tasks to the recieved role, default to lead. + @author Malte Sussdorff (malte.sussdorff@cognovis.de) + @author cognovis www.cognovis.de +} { + assessment_id:multiple + {return_url "index"} +} + +set form_format "[lc_get formbuilder_date_format] [lc_get formbuilder_time_format]" +set user_id [ad_conn user_id] +set context [list "[_ assessment.admin]"] + +ad_form -name "change-timing" -form { + {assessment_id:text(hidden) + {value $assessment_id} + } + {start_time:date,to_sql(sql_date),to_html(display_date),optional + {label "[_ assessment.Start_Time]"} + {format $form_format} + {help} + {help_text "[_ assessment.as_Start_Time_help]"} + } + {end_time:date,to_sql(sql_date),to_html(display_date),optional + {label "[_ assessment.End_Time]"} + {format $form_format} + {help} + {help_text "[_ assessment.as_End_Time_help]"} + } +} -on_submit { + + if {[db_type] == "postgresql"} { + regsub -all -- {to_date} $start_time {to_timestamp} start_time + regsub -all -- {to_date} $end_time {to_timestamp} end_time + } + + foreach assessment $assessment_id { + set assessment_rev_id [content::item::get_latest_revision -item_id $assessment] + if {![empty_string_p $start_time]} { + db_dml update_start_time {} + } + if {![empty_string_p $end_time]} { + db_dml update_end_time {} + } + } +} -after_submit { + ad_returnredirect $return_url +} \ No newline at end of file Index: openacs-4/packages/assessment/www/asm-admin/change-timing.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/change-timing.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/change-timing.xql 17 Feb 2006 12:13:55 -0000 1.1 @@ -0,0 +1,24 @@ + + + + + + + update as_assessments + set start_time = $start_time + where assessment_id = :assessment_rev_id + + + + + + + + update as_assessments + set end_time = $end_time + where assessment_id = :assessment_rev_id + + + + + Index: openacs-4/packages/assessment/www/asm-admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/index.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/www/asm-admin/index.tcl 18 Aug 2005 17:33:42 -0000 1.8 +++ openacs-4/packages/assessment/www/asm-admin/index.tcl 17 Feb 2006 12:13:55 -0000 1.9 @@ -46,6 +46,12 @@ set admin_request "[_ assessment.Request] [_ assessment.Administration]" } +# Bulk action for mass setting the start and endtime of assessments. +set bulk_actions [list \ + "[_ assessment.Change_timings]" \ + "change-timing" \ + "[_ assessment.Change_multiple_timings]"] + #list all assessments list::create \ -name assessments \ @@ -69,7 +75,8 @@ link_url_eval "[export_vars -base admin-request { {assessment $assessment_id} }]" } - - } -actions $actions + + } -actions $actions \ + -bulk_actions $bulk_actions ad_return_template Index: openacs-4/packages/assessment/www/asm-admin/results-export.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-export.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/asm-admin/results-export.tcl 18 Aug 2005 17:33:42 -0000 1.7 +++ openacs-4/packages/assessment/www/asm-admin/results-export.tcl 17 Feb 2006 12:13:55 -0000 1.8 @@ -69,16 +69,18 @@ if {$assessment_data(anonymous_p) == "t"} { set csv_result_list($session_id) [list $percent_score $submission_date] } else { - set csv_result_list($session_id) [list $percent_score $submission_date $subject_id [as::assessment::quote_export -text [party::email -party_id $subject_id]] [as::assessment::quote_export -text [person::name -person_id $subject_id]]] + set subject_mail [db_string get-email "select email from parties where party_id = :subject_id"] + set csv_result_list($session_id) [list $percent_score $submission_date $subject_id [as::assessment::quote_export -text $subject_mail] [as::assessment::quote_export -text [person::name -person_id $subject_id]]] } } + set item_list [list] if {![empty_string_p $session_list]} { - set section_list [db_list all_sections {}] + set section_list [db_list_of_lists all_sections {}] - set item_list [list] - foreach section_id $section_list { + foreach one_section $section_list { + util_unlist $one_section section_id section_item_id set mc_item_list [list] db_foreach all_section_items {} { lappend item_list $as_item_item_id @@ -95,7 +97,7 @@ if {$item_type == "mc"} { lappend mc_item_list $as_item_item_id } else { - array set results [as::item_type_$item_type\::results -as_item_item_id $as_item_item_id -section_item_id $section_id -data_type $data_type -sessions $session_list] + array set results [as::item_type_$item_type\::results -as_item_item_id $as_item_item_id -section_item_id $section_item_id -data_type $data_type -sessions $session_list] foreach session_id $session_list { if {[info exists results($session_id)]} { set csv_${as_item_item_id}($session_id) [as::assessment::quote_export -text $results($session_id)] @@ -111,7 +113,13 @@ if {![empty_string_p $mc_item_list]} { db_foreach mc_items {} { if {[empty_string_p $text_value]} { - set csv_${mc_item_id}($session_id) [as::assessment::quote_export -text $title] + if {[exists_and_not_null csv_${mc_item_id}($session_id)]} { + # append list of choices seperated with comma + append csv_${mc_item_id}($session_id) ",[as::assessment::quote_export -text $title]" + } else { + # just set the choice value + set csv_${mc_item_id}($session_id) [as::assessment::quote_export -text $title] + } } else { set csv_${mc_item_id}($session_id) [as::assessment::quote_export -text $text_value] } @@ -120,7 +128,7 @@ } } } - + foreach item_id $item_list { lappend csv_first_row_list $csv_first_row($item_id) } @@ -136,6 +144,7 @@ } append csv_text "[join $csv_result_list($session_id) ";"]\r\n" } + set csv_text [string map {\xe4 � \xfc � \xf6 � \xdf � \xc4 � \xdc � \xd6 �} $csv_text] } -after_submit { set tmp_filename [ns_tmpnam] set tmp_csv_filename "$tmp_filename.csv" Index: openacs-4/packages/assessment/www/asm-admin/results-export.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-export.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/asm-admin/results-export.xql 18 Aug 2005 17:33:42 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/results-export.xql 17 Feb 2006 12:13:55 -0000 1.6 @@ -3,7 +3,13 @@ - select item_id from as_assessment_section_map asm, cr_items ci where asm.assessment_id = $assessment_rev_id and asm.section_id = ci.latest_revision + + select asm.section_id, cr.item_id + from as_assessment_section_map asm, cr_revisions cr + where asm.assessment_id = :assessment_rev_id + and asm.section_id = cr.revision_id + order by asm.sort_order + @@ -12,16 +18,15 @@ select cr.title, cr.description, o.object_type, i.data_type, i.field_name, cr.item_id as as_item_item_id - from as_item_section_map ism, cr_revisions cr, cr_items ci, + from as_item_section_map ism, cr_revisions cr, as_items i, as_item_rels ir, acs_objects o - where ism.section_id = ci.latest_revision - and ci.item_id = $section_id + where ism.section_id = :section_id and cr.revision_id = ism.as_item_id and i.as_item_id = ism.as_item_id and ir.item_rev_id = i.as_item_id and ir.rel_type = 'as_item_type_rel' and o.object_id = ir.target_rev_id - order by o.object_type, ism.sort_order + order by ism.sort_order, o.object_type @@ -49,12 +54,15 @@ select d.session_id, d.item_data_id, c.text_value, rc.title, ri.item_id as mc_item_id - from as_item_data d, as_session_item_map m, cr_revisions ri, cr_revisions rs, - as_item_data_choices dc, as_item_choices c, cr_revisions rc - where d.session_id in ([join $session_list ,]) + from as_item_data d, as_session_item_map m, cr_revisions ri, + as_item_data_choices dc, as_item_choices c, cr_revisions rc, + as_session_sections s, cr_revisions rs + where s.session_id in ([join $session_list ,]) + and s.section_id = rs.revision_id + and rs.item_id = :section_item_id + and d.session_id = s.session_id and d.as_item_id = ri.revision_id - and d.section_id = rs.revision_id - and rs.item_id = $section_id + and d.section_id = s.section_id and m.session_id = d.session_id and m.item_data_id = d.item_data_id and dc.item_data_id = d.item_data_id Index: openacs-4/packages/assessment/www/asm-admin/section-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/section-delete.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/section-delete.tcl 6 May 2005 00:42:13 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/section-delete.tcl 17 Feb 2006 12:13:55 -0000 1.4 @@ -38,7 +38,9 @@ if {$confirmation} { db_transaction { set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] - set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] + # This needs to be fixed. The call is useful if we are dealing with the fact that someone edits the assessment + # While the section is being deleted. + # set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] db_1row get_sort_order_to_be_removed {} db_dml remove_section_from_assessment {} Index: openacs-4/packages/assessment/www/asm-admin/sqlnet.log =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/Attic/sqlnet.log,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/sqlnet.log 17 Feb 2006 12:13:55 -0000 1.1 @@ -0,0 +1,39 @@ + + +*********************************************************************** +Fatal NI connect error 12541, connecting to: + (DESCRIPTION=(CONNECT_DATA=(SID=*)(SERVICE_NAME=athena2.uni-heidelberg.de)(CID=(PROGRAM=)(HOST=athena2)(USER=root)))(ADDRESS=(PROTOCOL=TCP)(HOST=athena2)(PORT=1521))) + + VERSION INFORMATION: + TNS for Linux: Version 9.2.0.4.0 - Production + TCP/IP NT Protocol Adapter for Linux: Version 9.2.0.4.0 - Production + Time: 30-AUG-2005 18:32:13 + Tracing not turned on. + Tns error struct: + nr err code: 0 + ns main err code: 12541 + TNS-12541: TNS:no listener + ns secondary err code: 12560 + nt main err code: 511 + TNS-00511: No listener + nt secondary err code: 111 + nt OS err code: 0 + + +*********************************************************************** +Fatal NI connect error 12514, connecting to: + (DESCRIPTION=(CONNECT_DATA=(SID=*)(SERVICE_NAME=athena.uni-heidelberg.de)(CID=(PROGRAM=)(HOST=athena2)(USER=root)))(ADDRESS=(PROTOCOL=TCP)(HOST=athena)(PORT=1521))) + + VERSION INFORMATION: + TNS for Linux: Version 9.2.0.4.0 - Production + TCP/IP NT Protocol Adapter for Linux: Version 9.2.0.4.0 - Production + Time: 30-AUG-2005 18:32:50 + Tracing not turned on. + Tns error struct: + nr err code: 0 + ns main err code: 12564 + TNS-12564: TNS:connection refused + ns secondary err code: 0 + nt main err code: 0 + nt secondary err code: 0 + nt OS err code: 0 Index: openacs-4/packages/assessment-portlet/tcl/assessment-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/tcl/assessment-portlet-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment-portlet/tcl/assessment-portlet-procs.tcl 20 Apr 2005 06:10:36 -0000 1.3 +++ openacs-4/packages/assessment-portlet/tcl/assessment-portlet-procs.tcl 17 Feb 2006 12:17:58 -0000 1.4 @@ -58,15 +58,17 @@ @return element_id The new element's id } { + + ns_log Notice "portal_id:: $portal_id;; $page_name" return [portal::add_element_parameters \ - -portal_id $portal_id \ - -portlet_name [get_my_name] \ - -value $package_id \ - -force_region $force_region \ + -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 - ] + -pretty_name [get_pretty_name] \ + -param_action $param_action + ] } Index: openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql 22 Apr 2005 15:15:17 -0000 1.7 +++ openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql 17 Feb 2006 12:17:58 -0000 1.8 @@ -12,19 +12,22 @@ 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 + site_nodes sa, site_nodes sc, apm_packages p, + (select distinct asm.assessment_id + from as_assessment_section_map asm, as_item_section_map ism, + acs_object_party_privilege_map ppm + where ism.section_id = asm.section_id + and ppm.object_id = asm.assessment_id + and ppm.privilege = 'read' + and ppm.party_id = :user_id) s 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) - and acs_permission__permission_p (a.assessment_id, :user_id, 'read') = 't' + and s.assessment_id = a.assessment_id order by lower(p.instance_name), lower(cr.title) Index: openacs-4/packages/assessment-portlet/www/assessment-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/www/assessment-portlet.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment-portlet/www/assessment-portlet.tcl 26 Apr 2005 17:25:42 -0000 1.8 +++ openacs-4/packages/assessment-portlet/www/assessment-portlet.tcl 17 Feb 2006 12:17:58 -0000 1.9 @@ -45,7 +45,6 @@ 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 "" } @@ -60,7 +59,6 @@ } template::multirow append assessments $assessment_id $title $description $assessment_url $community_url $community_name - } } @@ -70,8 +68,13 @@ [list \ label "[_ dotlrn.Community]" \ display_template {@sessions.community_name@ }]] + set package_id_sql "" +} else { +# set package_id_sql "and cf.package_id in ([join $list_of_package_ids ", "])" + set package_id_sql "" } + lappend elements title \ [list \ label "[_ assessment.Assessments]"] \ Index: openacs-4/packages/assessment-portlet/www/assessment-portlet.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/www/Attic/assessment-portlet.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment-portlet/www/assessment-portlet.xql 27 Apr 2005 10:51:33 -0000 1.3 +++ openacs-4/packages/assessment-portlet/www/assessment-portlet.xql 17 Feb 2006 12:17:58 -0000 1.4 @@ -3,24 +3,25 @@ - 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 +select ass.*, sc.node_id as comm_node_id, sa.node_id as as_node_id, p.instance_name as community_name from +(select cr.item_id as assessment_id, cr.title, cr.description, + cf.package_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 + (select distinct s.assessment_id 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) + where s.subject_id = :user_id + and s.completed_datetime is not null) s + where a.assessment_id = cr.revision_id + and cr.revision_id = ci.latest_revision + and ci.parent_id = cf.folder_id + $package_id_sql + and s.assessment_id = a.assessment_id + ) ass, +site_nodes sa, site_nodes sc, apm_packages p +where sa.object_id = ass.package_id +and sc.node_id = sa.parent_id +and p.package_id = sc.object_id +order by lower(p.instance_name), lower(ass.title)