Index: openacs-4/packages/assessment/tcl/as-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-install-procs.tcl,v diff -u -r1.30.2.3 -r1.30.2.4 --- openacs-4/packages/assessment/tcl/as-install-procs.tcl 14 Jun 2005 16:08:10 -0000 1.30.2.3 +++ openacs-4/packages/assessment/tcl/as-install-procs.tcl 15 Jun 2005 18:07:50 -0000 1.30.2.4 @@ -19,12 +19,7 @@ inter_item_checks::apm_callback::package_install -set value [parameter::get -parameter "AsmForRegisterId" -package_id [subsite::main_site_id]] -if {[empty_string_p $value]} { - apm_parameter_register "AsmForRegisterId" "Assessment used on the registration process." "acs-subsite" "0" "number" "user-login" -} - content::type::new -content_type {as_item_choices} -supertype {content_revision} -pretty_name {Assessment Item Choice} -pretty_plural {Assessment Item Choices} -table_name {as_item_choices} -id_column {choice_id} content::type::new -content_type {as_item_sa_answers} -supertype {content_revision} -pretty_name {Assessment Item Answer} -pretty_plural {Assessment Item Answer} -table_name {as_item_sa_answers} -id_column {choice_id} Index: openacs-4/packages/assessment/tcl/callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/callback-procs.tcl,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/assessment/tcl/callback-procs.tcl 10 Jun 2005 18:53:30 -0000 1.1.2.2 +++ openacs-4/packages/assessment/tcl/callback-procs.tcl 15 Jun 2005 18:07:50 -0000 1.1.2.3 @@ -2,7 +2,7 @@ Callback definitions } -ad_proc -public -callback user::registration -impl url {} { +ad_proc -public -callback user::registration -impl asm_url {} { Return the properly formed link (URL) that the user will click to go into the registration process. Index: openacs-4/packages/assessment/tcl/callback-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/callback-procs.xql,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/assessment/tcl/callback-procs.xql 10 Jun 2005 18:53:30 -0000 1.1.2.2 +++ openacs-4/packages/assessment/tcl/callback-procs.xql 15 Jun 2005 18:07:50 -0000 1.1.2.3 @@ -1,7 +1,7 @@ - + select package_id from cr_folders where folder_id=(select context_id from acs_objects where object_id=:assessment_id) Index: openacs-4/packages/assessment/www/assessment-consent.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/assessment-consent.adp,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/assessment/www/assessment-consent.adp 31 May 2005 23:13:01 -0000 1.3.2.1 +++ openacs-4/packages/assessment/www/assessment-consent.adp 15 Jun 2005 18:07:50 -0000 1.3.2.2 @@ -1,6 +1,6 @@ @page_title;noquote@ -@context_bar;noquote@ +@context;noquote@
@assessment_data.consent_page;noquote@ Index: openacs-4/packages/assessment/www/assessment-section-submit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/assessment-section-submit.adp,v diff -u -r1.8.2.2 -r1.8.2.3 --- openacs-4/packages/assessment/www/assessment-section-submit.adp 7 Jun 2005 22:09:08 -0000 1.8.2.2 +++ openacs-4/packages/assessment/www/assessment-section-submit.adp 15 Jun 2005 18:07:50 -0000 1.8.2.3 @@ -1,6 +1,6 @@ @page_title;noquote@ -@context_bar;noquote@ +@context;noquote@ Index: openacs-4/packages/assessment/www/assessment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/assessment.tcl,v diff -u -r1.47.2.1 -r1.47.2.2 --- openacs-4/packages/assessment/www/assessment.tcl 31 May 2005 23:13:01 -0000 1.47.2.1 +++ openacs-4/packages/assessment/www/assessment.tcl 15 Jun 2005 18:07:50 -0000 1.47.2.2 @@ -14,26 +14,29 @@ {item_id ""} {return_url:optional} response_to_item:array,optional,multiple,html + {next_asm:optional} } -properties { - context_bar:onevalue + context:onevalue page_title:onevalue } set user_id [ad_conn user_id] set page_title "[_ assessment.Show_Items]" -set context_bar [ad_context_bar $page_title] +set context [list $page_title] set section_to "" set item_to "" set url "" if { [info exists return_url] } { + set url $return_url ns_log notice "$return_url" } set return_url "$url" + # Get the assessment data as::assessment::data -assessment_id $assessment_id permission::require_permission -object_id $assessment_id -privilege read @@ -62,13 +65,13 @@ # set the time when the subject initiated the Assessment db_dml session_start {} } else { - set consent_url [export_vars -base assessment-consent {assessment_id session_id password return_url}] + set consent_url [export_vars -base assessment-consent {assessment_id session_id password return_url next_asm}] } } else { # pick up old session db_1row unfinished_section_order {} if {[empty_string_p $section_order]} { - set consent_url [export_vars -base assessment-consent {assessment_id session_id password return_url}] + set consent_url [export_vars -base assessment-consent {assessment_id session_id password return_url next_asm}] } else { db_1row unfinished_section_id {} db_1row unfinished_item_order {} @@ -227,7 +230,7 @@ # go to next section set section_order $new_section_order set item_order $new_item_order - ad_returnredirect [export_vars -base assessment {assessment_id session_id section_order item_order password return_url}] + ad_returnredirect [export_vars -base assessment {assessment_id session_id section_order item_order password return_url next_asm}] ad_script_abort } else { # calculate session points at end of session @@ -236,7 +239,7 @@ as::assessment::check::eval_aa_checks -session_id $session_id -assessment_id $assessment_id as::assessment::check::eval_m_checks -session_id $session_id -assessment_id $assessment_id if {[empty_string_p $assessment_data(return_url)]} { - ad_returnredirect [export_vars -base finish {session_id assessment_id return_url}] + ad_returnredirect [export_vars -base finish {session_id assessment_id return_url next_asm}] } else { ad_returnredirect $assessment_data(return_url) } @@ -246,7 +249,7 @@ # form for display an assessment with sections and items -ad_form -name show_item_form -action assessment -html {enctype multipart/form-data} -export {assessment_id section_id section_order item_order password return_url} -form { +ad_form -name show_item_form -action assessment -html {enctype multipart/form-data} -export { next_asm assessment_id section_id section_order item_order password return_url} -form { {session_id:text(hidden) {value $session_id}} } @@ -295,7 +298,7 @@ } # create seperate submit form for each item - ad_form -name show_item_form_$as_item_id -mode $mode -action assessment -html {enctype multipart/form-data} -export {assessment_id section_id section_order item_order password return_url} -form { + ad_form -name show_item_form_$as_item_id -mode $mode -action assessment -html {enctype multipart/form-data} -export {assessment_id section_id section_order item_order password return_url next_asm} -form { {session_id:text(hidden) {value $session_id}} {item_id:text(hidden) {value $as_item_id}} } @@ -309,7 +312,7 @@ # save answer set response_item_id \$item_id db_1row process_item_type {} - set item_type \[lindex \[split \$item_type \"_\"\] end\] + set item_type \[string range \$item_type end-1 end\] if {!\[info exists response_to_item(\$response_item_id)\]} { set response_to_item(\$response_item_id) \"\" } else { @@ -325,7 +328,7 @@ } }" set after_submit "{ - ad_returnredirect \[export_vars -base assessment {assessment_id session_id section_order item_order password return_url}\] + ad_returnredirect \[export_vars -base assessment {assessment_id session_id section_order item_order password return_url next_asm}\] ad_script_abort }" @@ -374,7 +377,7 @@ foreach one_response \$item_list { util_unlist \$one_response response_item_id db_1row process_item_type {} - set item_type \[lindex \[split \$item_type \"_\"\] end\] + set item_type \[string range \$item_type end-1 end\] if {!\[info exists response_to_item(\$response_item_id)\]} { set response_to_item(\$response_item_id) \"\" } else { @@ -416,7 +419,7 @@ } set item_order \$new_item_order - ad_returnredirect \[export_vars -base assessment {assessment_id session_id section_order item_order password return_url}\] + ad_returnredirect \[export_vars -base assessment {assessment_id session_id section_order item_order password return_url next_asm}\] ad_script_abort } else { # calculate session points at end of session @@ -425,7 +428,7 @@ as::assessment::check::eval_aa_checks -session_id $session_id -assessment_id $assessment_id as::assessment::check::eval_m_checks -session_id $session_id -assessment_id $assessment_id if {\[empty_string_p \$assessment_data(return_url)\]} { - ad_returnredirect \[export_vars -base finish {session_id assessment_id return_url}\] + ad_returnredirect \[export_vars -base finish {session_id assessment_id return_url next_asm}\] } else { ad_returnredirect \$assessment_data(return_url) } @@ -462,7 +465,7 @@ # go to next section set section_order $new_section_order set item_order $new_item_order - ad_returnredirect [export_vars -base assessment {assessment_id session_id section_order item_order password return_url}] + ad_returnredirect [export_vars -base assessment {assessment_id session_id section_order item_order password return_url next_asm}] ad_script_abort } else { # calculate session points at end of session @@ -471,7 +474,7 @@ as::assessment::check::eval_aa_checks -session_id $session_id -assessment_id $assessment_id as::assessment::check::eval_m_checks -session_id $session_id -assessment_id $assessment_id if {[empty_string_p $assessment_data(return_url)]} { - ad_returnredirect [export_vars -base finish {session_id assessment_id return_url}] + ad_returnredirect [export_vars -base finish {session_id assessment_id return_url next_asm}] } else { ad_returnredirect $assessment_data(return_url) } Index: openacs-4/packages/assessment/www/finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/finish.tcl,v diff -u -r1.6.2.2 -r1.6.2.3 --- openacs-4/packages/assessment/www/finish.tcl 13 Jun 2005 20:20:18 -0000 1.6.2.2 +++ openacs-4/packages/assessment/www/finish.tcl 15 Jun 2005 18:07:50 -0000 1.6.2.3 @@ -20,18 +20,25 @@ } -if {[info exists return_url]} { - if { [exists_and_not_null next_asm ] } { - ad_returnredirect "assessment?assessment_id=$next_asm" - } elseif { $return_url != ""} { - ad_returnredirect "$return_url" - } - -} + set page_title "[_ assessment.Response_Submitted]" set context [list $page_title] +if { [exists_and_not_null next_asm ] } { + ad_returnredirect "assessment?assessment_id=$next_asm" +} +set value [parameter::get -parameter "AsmForRegisterId" -package_id [subsite::main_site_id]] +if {[info exists return_url]} { + if { $return_url != ""} { + ad_returnredirect "$return_url" + } else { + if { [string eq $value $assessment_id] } { + ad_returnredirect "/pvt/home" + } + } +} + ad_return_template
@assessment_data.title@