Index: openacs-4/packages/assessment/lib/feedback.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/feedback.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/assessment/lib/feedback.tcl 7 Aug 2017 23:48:03 -0000 1.10 +++ openacs-4/packages/assessment/lib/feedback.tcl 20 Jan 2018 22:38:28 -0000 1.11 @@ -32,19 +32,24 @@ #} if { $next_url eq "" } { - if { $return_p && ([info exists return_url] && $return_url ne "") } { + if { $return_p && [info exists return_url] && $return_url ne "" } { set next_url $return_url } else { - set next_url [export_vars -base assessment {assessment_id session_id section_order item_order password return_url next_asm section_id}] + set next_url [export_vars -base assessment { + assessment_id session_id section_order item_order password return_url next_asm section_id + }] } } -ad_form -name next -export {next_url assessment_id section_id session_id} -form { - {next_button:text(submit) {label "[_ assessment.Next]"}} -} -on_submit { - ad_returnredirect $next_url -} +ad_form -name next \ + -export {next_url assessment_id section_id session_id} \ + -form { + {next_button:text(submit) {label "[_ assessment.Next]"}} + } -on_submit { + ad_returnredirect $next_url + ad_script_abort + } set subject_id [ad_conn user_id] as::assessment::data -assessment_id $assessment_id Index: openacs-4/packages/assessment/lib/finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/finish.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/lib/finish.tcl 7 Aug 2017 23:48:03 -0000 1.4 +++ openacs-4/packages/assessment/lib/finish.tcl 20 Jan 2018 22:38:28 -0000 1.5 @@ -23,7 +23,7 @@ } -set page_title "[_ assessment.Response_Submitted]" +set page_title [_ assessment.Response_Submitted] set context [list $page_title] # Raise finish_object event @@ -33,20 +33,22 @@ -if { ([info exists next_asm] && $next_asm ne "") } { +if { [info exists next_asm] && $next_asm ne "" } { ad_returnredirect "assessment?assessment_id=$next_asm" + ad_script_abort } set value [parameter::get -parameter "RegistrationId" -package_id [subsite::main_site_id]] -if {[info exists return_url]} { +if {[info exists return_url]} { if { $return_url ne ""} { ad_returnredirect "$return_url" } else { if {$value eq $assessment_id} { ad_returnredirect "/pvt/home" } - } + } + ad_script_abort } ad_return_template Index: openacs-4/packages/assessment/www/finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/finish.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/assessment/www/finish.tcl 7 Aug 2017 23:48:04 -0000 1.12 +++ openacs-4/packages/assessment/www/finish.tcl 20 Jan 2018 22:38:28 -0000 1.13 @@ -42,18 +42,21 @@ callback imsld::finish_object -object_id $assessment_id -user_id $user_id -session_id $session_id -if { ([info exists next_asm] && $next_asm ne "") } { +if { [info exists next_asm] && $next_asm ne "" } { ad_returnredirect "assessment?assessment_id=$next_asm" + ad_script_abort } set value [parameter::get -parameter "RegistrationId" -package_id [subsite::main_site_id]] if {[info exists return_url]} { if { $return_url ne ""} { ad_returnredirect "$return_url" + ad_script_abort } else { if {$value eq $assessment_id} { ad_returnredirect "/pvt/home" + ad_script_abort } } } Index: openacs-4/packages/assessment/www/session.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.tcl,v diff -u -r1.42 -r1.43 --- openacs-4/packages/assessment/www/session.tcl 7 Aug 2017 23:48:04 -0000 1.42 +++ openacs-4/packages/assessment/www/session.tcl 20 Jan 2018 22:38:28 -0000 1.43 @@ -20,10 +20,12 @@ # require assessment_id if session_id is blank if {$assessment_id == 0} { ad_return_complaint 1 "Session_id or Assessment_id is required" + ad_script_abort } #find the latest session if {![db_0or1row get_latest_session "" -column_array latest_session]} { ad_return_complaint 1 "You have not completed this assessment yet." + ad_script_abort } set session_id $latest_session(session_id) } Index: openacs-4/packages/assessment/www/admin/asm-action-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/asm-action-delete.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/admin/asm-action-delete.tcl 7 Aug 2017 23:48:04 -0000 1.7 +++ openacs-4/packages/assessment/www/admin/asm-action-delete.tcl 20 Jan 2018 22:38:28 -0000 1.8 @@ -20,14 +20,11 @@ {submit:text(submit) {label "delete"}} {back:text(submit) {label "back"}} } -on_submit { - if { $back eq "back" } { - ad_returnredirect "asm-action-admin" - } else { + if { $back ne "back" } { as::actionparam::actiondelete $action_id - ad_returnredirect "asm-action-admin" - - } + ad_returnredirect "asm-action-admin" + ad_script_abort } # Local variables: Index: openacs-4/packages/assessment/www/admin/asm-action-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/asm-action-new.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/assessment/www/admin/asm-action-new.tcl 7 Aug 2017 23:48:04 -0000 1.10 +++ openacs-4/packages/assessment/www/admin/asm-action-new.tcl 20 Jan 2018 22:38:28 -0000 1.11 @@ -51,7 +51,8 @@ } -edit_data { db_dml edit_action {} } -after_submit { - ad_returnredirect "asm-action-new?action_id=$action_id" + ad_returnredirect "asm-action-new?action_id=$action_id" + ad_script_abort } Index: openacs-4/packages/assessment/www/admin/asm-action-param-admin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/asm-action-param-admin.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/assessment/www/admin/asm-action-param-admin.tcl 7 Aug 2017 23:48:04 -0000 1.9 +++ openacs-4/packages/assessment/www/admin/asm-action-param-admin.tcl 20 Jan 2018 22:38:28 -0000 1.10 @@ -78,6 +78,7 @@ } -on_submit { ad_returnredirect "asm-action-param-admin?action_id=$action_id" + ad_script_abort } # Local variables: Index: openacs-4/packages/assessment/www/admin/asm-action-param-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/asm-action-param-delete.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/www/admin/asm-action-param-delete.tcl 7 Aug 2017 23:48:04 -0000 1.8 +++ openacs-4/packages/assessment/www/admin/asm-action-param-delete.tcl 20 Jan 2018 22:38:28 -0000 1.9 @@ -24,10 +24,12 @@ } -on_submit { if { $back eq "back" } { ad_returnredirect "asm-action-new?action_id=$action_id" + ad_script_abort } else { as::actionparam::paramdelete $parameter_id ad_returnredirect "asm-action-new?action_id=$action_id" + ad_script_abort } } Index: openacs-4/packages/assessment/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/index.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/assessment/www/admin/index.tcl 7 Aug 2017 23:48:04 -0000 1.13 +++ openacs-4/packages/assessment/www/admin/index.tcl 20 Jan 2018 22:38:28 -0000 1.14 @@ -1,4 +1,7 @@ + ad_returnredirect "../asm-admin/" +ad_script_abort + # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/assessment/www/admin/set-reg-assessment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/set-reg-assessment.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/admin/set-reg-assessment.tcl 7 Aug 2017 23:48:04 -0000 1.4 +++ openacs-4/packages/assessment/www/admin/set-reg-assessment.tcl 20 Jan 2018 22:38:28 -0000 1.5 @@ -44,11 +44,13 @@ set package_id [db_string package_id {}] set url [apm_package_url_from_id $package_id] ad_returnredirect "${url}asm-admin/one-a?assessment_id=$assessment_id®_p=1&asm_instance=$asm_instance" + ad_script_abort } } else { parameter::set_value -package_id [subsite::main_site_id] -parameter RegistrationId -value $assessment_id parameter::set_value -package_id [subsite::main_site_id] -parameter RegistrationImplName -value "asm_url" ad_returnredirect "" + ad_script_abort } } Index: openacs-4/packages/assessment/www/asm-admin/action-params.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/action-params.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/assessment/www/asm-admin/action-params.tcl 7 Aug 2017 23:48:04 -0000 1.10 +++ openacs-4/packages/assessment/www/asm-admin/action-params.tcl 20 Jan 2018 22:38:28 -0000 1.11 @@ -36,7 +36,7 @@ set new_assessment_revision $assessment_data(assessment_rev_id) -if {([info exists by_item_p] && $by_item_p ne "")} { +if {[info exists by_item_p] && $by_item_p ne ""} { set return_url "checks-admin?assessment_id=$assessment_id§ion_id=$section_id" if {$by_item_p == 1} { @@ -50,7 +50,8 @@ set has_params_p [db_string has_params {} -default 0] if {$has_params_p == 0} { - ad_returnredirect "one-a?assessment_id=$assessment_id" + ad_returnredirect "one-a?assessment_id=$assessment_id" + ad_script_abort } set action_perform [db_string get_perform {} -default " "] @@ -98,19 +99,27 @@ set action_id $action_id db_foreach get_params {} { - set param_$parameter_id [as::assessment::check::get_parameter_value -parameter_id $parameter_id -type $type -check_id $inter_item_check_id] + set param_$parameter_id [as::assessment::check::get_parameter_value \ + -parameter_id $parameter_id \ + -type $type \ + -check_id $inter_item_check_id] if { [set param_$parameter_id] eq ""} { set param_$parameter_id [lindex $choices 0 1] } } } -edit_data { db_foreach get_params {} { - as::assessment::check::set_parameter_value -parameter_id $parameter_id -type $type -check_id $inter_item_check_id -value [set param_$parameter_id] + as::assessment::check::set_parameter_value \ + -parameter_id $parameter_id \ + -type $type \ + -check_id $inter_item_check_id \ + -value [set param_$parameter_id] } } -on_submit { - ad_returnredirect $return_url + ad_returnredirect $return_url + ad_script_abort } Index: openacs-4/packages/assessment/www/asm-admin/action-select.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/action-select.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/assessment/www/asm-admin/action-select.tcl 7 Aug 2017 23:48:04 -0000 1.10 +++ openacs-4/packages/assessment/www/asm-admin/action-select.tcl 20 Jan 2018 22:38:28 -0000 1.11 @@ -116,8 +116,9 @@ } -on_submit { - set url "action-params?assessment_id=$assessment_id&inter_item_check_id=$inter_item_check_id&action_id=$action_id§ion_id=$section_id" + set url [export_vars -base action-params {assessment_id inter_item_check_id action_id section_id}] ad_returnredirect "${url}$return_url" + ad_script_abort } -after_submit { if { $action_perform eq "m" } { Index: openacs-4/packages/assessment/www/asm-admin/add-edit-check.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/add-edit-check.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/assessment/www/asm-admin/add-edit-check.tcl 7 Aug 2017 23:48:04 -0000 1.10 +++ openacs-4/packages/assessment/www/asm-admin/add-edit-check.tcl 20 Jan 2018 22:38:28 -0000 1.11 @@ -35,7 +35,7 @@ set title $assessment_data(title) set context [list [list index [_ assessment.admin]] [list "one-a?assessment_id=$assessment_id" $title] "$title Triggers"] -if {(![info exists as_item_id] || $as_item_id eq "") } { +if {![info exists as_item_id] || $as_item_id eq ""} { set condition_sql [db_string get_item_id {}] #parse condition_sql to get item_id set cond_list [split $condition_sql "="] @@ -47,7 +47,7 @@ set item_id $as_item_id } -if {([info exists section_id] && $section_id ne "")} { +if {[info exists section_id] && $section_id ne ""} { set section_id_from $section_id } @@ -58,13 +58,13 @@ set choices [db_list_of_lists get_choices {} ] set question_text [db_string get_question {}] -if {([info exists edit_check] && $edit_check ne "")} { +if {[info exists edit_check] && $edit_check ne ""} { if { (![info exists type] || $type eq "")} { - set return_url "&check_id=$inter_item_check_id&edit_check=t" - } + set return_url "&check_id=$inter_item_check_id&edit_check=t" + } } -if {([info exists by_item_p] && $by_item_p ne "")} { +if {[info exists by_item_p] && $by_item_p ne ""} { if {$by_item_p==1} { append return_url "&item_id=$item_id&by_item_p=$by_item_p" } else { @@ -105,7 +105,7 @@ } -if {(![info exists inter_item_check_id] || $inter_item_check_id eq "")} { +if {![info exists inter_item_check_id] || $inter_item_check_id eq ""} { ad_form -extend -name new_check -form { {action_p:boolean(radio) {label "[_ assessment.parameter_type]"} @@ -144,6 +144,7 @@ set url [as::assessment::check::add_check_return_url $action_p] ad_returnredirect "${url}?assessment_id=$assessment_id&inter_item_check_id=$inter_item_check_id§ion_id=$section_id_from$return_url" + ad_script_abort } # Local variables: Index: openacs-4/packages/assessment/www/asm-admin/add-edit-section-check.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/add-edit-section-check.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/www/asm-admin/add-edit-section-check.tcl 7 Aug 2017 23:48:04 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/add-edit-section-check.tcl 20 Jan 2018 22:38:28 -0000 1.7 @@ -85,12 +85,15 @@ } } -edit_request { db_1row get_check_properties {} + } -edit_data { set check_sql "select 1 as perform_p from dual" db_dml update_check {} + } -after_submit { set url [as::assessment::check::add_check_return_url $action_p] ad_returnredirect "${url}?assessment_id=$assessment_id&inter_item_check_id=$inter_item_check_id§ion_id=$section_id_from§ion_check_p=1$return_url" + ad_script_abort } # Local variables: Index: openacs-4/packages/assessment/www/asm-admin/admin-request.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/admin-request.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/asm-admin/admin-request.tcl 7 Aug 2017 23:48:04 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/admin-request.tcl 20 Jan 2018 22:38:28 -0000 1.6 @@ -135,6 +135,8 @@ } } -on_submit { ad_returnredirect "admin-request?state=$state&assessment=$assessment&date=$specific_date" + ad_script_abort + } -on_request { template::add_event_listener -id sel2-control -script {showCalendar('sel2', 'y-m-d');} } Index: openacs-4/packages/assessment/www/asm-admin/approve-check.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/approve-check.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/asm-admin/approve-check.tcl 7 Aug 2017 23:48:04 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/approve-check.tcl 20 Jan 2018 22:38:28 -0000 1.5 @@ -26,7 +26,10 @@ as::assessment::check::manual_action_exec -inter_item_check_id $inter_item_check_id -session_id $session_id -action_log_id $log_id } + ad_returnredirect "admin-request?assessment=$d_assessment&state=$d_state&interval=$d_interval&date=$d_date" +ad_script_abort + # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/assessment/www/asm-admin/assessment-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/assessment-new.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/www/asm-admin/assessment-new.tcl 7 Aug 2017 23:48:04 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/assessment-new.tcl 20 Jan 2018 22:38:28 -0000 1.7 @@ -28,7 +28,6 @@ set page_title [_ assessment.New_Assessment2] } set context [list [list index [_ assessment.admin]] $page_title] - set types_list [list [list "[_ assessment.type_s]" survey] [list "[_ assessment.type_test]" test ]] ad_form -name assessment_type -export {assessment_id permission_p} -form { @@ -38,16 +37,19 @@ {value $type} } } -on_submit { - if { ([info exists assessment_id] && $assessment_id ne "")} { - set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] - db_dml update_asm { update as_assessments set type=:type where assessment_id=:new_assessment_rev_id} - ad_returnredirect [export_vars -base one-a {assessment_id}] + if { [info exists assessment_id] && $assessment_id ne ""} { + set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] + db_dml update_asm {update as_assessments set type=:type where assessment_id=:new_assessment_rev_id} + ad_returnredirect [export_vars -base one-a {assessment_id}] + ad_script_abort + } else { if { $permission_p ne ""} { ad_returnredirect [export_vars -base assessment-form {type assessment_id permission_p}] } else { ad_returnredirect [export_vars -base assessment-form {type assessment_id}] } + ad_script_abort } } # Local variables: Index: openacs-4/packages/assessment/www/asm-admin/bulk-mail.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/bulk-mail.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/asm-admin/bulk-mail.tcl 7 Aug 2017 23:48:04 -0000 1.7 +++ openacs-4/packages/assessment/www/asm-admin/bulk-mail.tcl 20 Jan 2018 22:38:28 -0000 1.8 @@ -102,14 +102,10 @@ -message $message \ -query $query] ad_returnredirect "admin-request?assessment=$d_assessment&state=$d_state&interval=$d_interval&date=$d_date" + ad_script_abort } - - - - - # Local variables: # mode: tcl # tcl-indent-level: 4 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 -r1.5 -r1.6 --- openacs-4/packages/assessment/www/asm-admin/change-timing.tcl 7 Aug 2017 23:48:04 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/change-timing.tcl 20 Jan 2018 22:38:28 -0000 1.6 @@ -52,6 +52,7 @@ } } -after_submit { ad_returnredirect $return_url + ad_script_abort } # Local variables: # mode: tcl Index: openacs-4/packages/assessment/www/asm-admin/checks-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/checks-delete.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/www/asm-admin/checks-delete.tcl 7 Aug 2017 23:48:04 -0000 1.8 +++ openacs-4/packages/assessment/www/asm-admin/checks-delete.tcl 20 Jan 2018 22:38:28 -0000 1.9 @@ -30,6 +30,8 @@ } else { ad_returnredirect "checks-admin?section_id=$section_id&assessment_id=$assessment_id&by_item_p=$by_item_p" } +ad_script_abort + # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/assessment/www/asm-admin/confirm-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/confirm-delete.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/assessment/www/asm-admin/confirm-delete.tcl 7 Aug 2017 23:48:04 -0000 1.9 +++ openacs-4/packages/assessment/www/asm-admin/confirm-delete.tcl 20 Jan 2018 22:38:28 -0000 1.10 @@ -36,12 +36,12 @@ } -after_submit { if {$by_item_p == 1} { - ad_returnredirect "checks-delete?section_id=$section_id&inter_item_check_id=$inter_item_check_id&assessment_id=$assessment_id&by_item_p=$by_item_p&item_id=$item_id_check" + ad_returnredirect [export_vars -base checks-delete {section_id inter_item_check_id assessment_id by_item_p item_id}] } else { - ad_returnredirect "checks-delete?section_id=$section_id&inter_item_check_id=$inter_item_check_id&assessment_id=$assessment_id&by_item_p=$by_item_p" + ad_returnredirect [export_vars -base checks-delete {section_id inter_item_check_id assessment_id by_item_p}] } + ad_script_abort - } # Local variables: Index: openacs-4/packages/assessment/www/asm-admin/item-create-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-create-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/asm-admin/item-create-2.tcl 7 Aug 2017 23:48:04 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/item-create-2.tcl 20 Jan 2018 22:38:28 -0000 1.5 @@ -55,72 +55,82 @@ #for each type of item we create some elements switch -- $item_type { "textarea" { - element create item-add-2 as_item_type_oq__as_item_default -label "Default value" -datatype text -html {size 15} - element create item-add-2 as_item_type_oq__feedback_text -label "Feedback" -datatype text -html {rows 5 cols 50} -widget textarea -optional + element create item-add-2 as_item_type_oq__as_item_default -label "Default value" \ + -datatype text -html {size 15} + element create item-add-2 as_item_type_oq__feedback_text -label "Feedback" \ + -datatype text -html {rows 5 cols 50} -widget textarea -optional form set_properties item-add-2 -action "index" } "checkbox" - - "radiobutton" { - element create item-add-2 as_item_type_mc__increasing_p -label "Increasing" -datatype text -widget select -options {{{All or Nothing} f } {Increasing t} } -optional + "radiobutton" { + element create item-add-2 as_item_type_mc__increasing_p -label "Increasing" \ + -datatype text -widget select -options {{{All or Nothing} f } {Increasing t} } -optional - element create item-add-2 as_item_type_mc__allow_negative_p -label "Allow negative?" -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional - element create item-add-2 as_item_type_mc__num_correct_answers -label "Number of Correct Answers" -datatype integer -html {size 7} -optional - element create item-add-2 as_item_type_mc__num_answers -label "Number of Answers" -datatype integer -html {size 7} + element create item-add-2 as_item_type_mc__allow_negative_p -label "Allow negative?" \ + -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional + element create item-add-2 as_item_type_mc__num_correct_answers -label "Number of Correct Answers" \ + -datatype integer -html {size 7} -optional + element create item-add-2 as_item_type_mc__num_answers -label "Number of Answers" \ + -datatype integer -html {size 7} - element set_properties item-add-2 as_item_type_mc__num_answers -value $as_item_type_mc__num_answers + element set_properties item-add-2 as_item_type_mc__num_answers -value $as_item_type_mc__num_answers - - + if { [template::form is_valid item-add-2] } { + #valid new item submission so create new item type + set as_item_type_mc__increasing_p [template::element::get_value item-add-2 as_item_type_mc__increasing_p] + set as_item_type_mc__allow_negative_p [template::element::get_value item-add-2 as_item_type_mc__allow_negative_p] + set as_item_type_mc__num_correct_answers [template::element::get_value item-add-2 as_item_type_mc__num_correct_answers] + set as_item_type_mc__num_answers [template::element::get_value item-add-2 as_item_type_mc__num_answers] -if { [template::form is_valid item-add-2] } { - #valid new item submission so create new item type - set as_item_type_mc__increasing_p [template::element::get_value item-add-2 as_item_type_mc__increasing_p] - set as_item_type_mc__allow_negative_p [template::element::get_value item-add-2 as_item_type_mc__allow_negative_p] - set as_item_type_mc__num_correct_answers [template::element::get_value item-add-2 as_item_type_mc__num_correct_answers] - set as_item_type_mc__num_answers [template::element::get_value item-add-2 as_item_type_mc__num_answers] + db_transaction { + #Insert as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id) + set as_item_type_id [as::item_type_mc::new -increasing_p $as_item_type_mc__increasing_p \ + -allow_negative_p $as_item_type_mc__allow_negative_p \ + -num_correct_answers $as_item_type_mc__num_correct_answers \ + -num_answers $as_item_type_mc__num_answers] + #set the relation between as_items table and as_item_type_mc table + content::item::relate \ + -item_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_id1"] \ + -object_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_type_id"] \ + -relation_tag {as_item_type_rel} \ + -relation_type {cr_item_rel} + } - db_transaction { - #Insert as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id) - set as_item_type_id [as::item_type_mc::new -increasing_p $as_item_type_mc__increasing_p -allow_negative_p $as_item_type_mc__allow_negative_p -num_correct_answers $as_item_type_mc__num_correct_answers -num_answers $as_item_type_mc__num_answers] - #set the relation between as_items table and as_item_type_mc table - content::item::relate -item_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_id1"] -object_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_type_id"] -relation_tag {as_item_type_rel} -relation_type {cr_item_rel} - } - - #redirect back to choice-add - ad_returnredirect "choice-add?as_item_type_id=$as_item_type_id&as_item_type_mc__num_answers=$as_item_type_mc__num_answers&item_type=$item_type" - - } - + #redirect back to choice-add + ad_returnredirect [export_vars -base choice-add {as_item_type_id as_item_type_mc__num_answers item_type}] + ad_script_abort + } } "open_question" { - element create item-add-2 as_item_type_oq__as_item_default -label "Item default" -datatype text -html {size 15} -optional - element create item-add-2 as_item_type_oq__feedback_text -label "Feedback" -datatype text -widget textarea -html {rows 5 cols 50} -optional + element create item-add-2 as_item_type_oq__as_item_default -label "Item default" \ + -datatype text -html {size 15} -optional + element create item-add-2 as_item_type_oq__feedback_text -label "Feedback" \ + -datatype text -widget textarea -html {rows 5 cols 50} -optional - form set_properties item-add-2 -action "index" + form set_properties item-add-2 -action "index" } "shortanswer" { - element create item-add-2 as_item_type_sa__increasing_p -label "Increasing" -datatype text -widget select -options {{{All or Nothing} f } {Increasing t} } -optional - element create item-add-2 as_item_type_sa__allow_negative_p -label "Allow negative?" -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional - element create item-add-2 as_item_type_mc__num_answers -label "Number of Answers" -datatype integer -html {size 7} - - + element create item-add-2 as_item_type_sa__increasing_p -label "Increasing" \ + -datatype text -widget select -options {{{All or Nothing} f } {Increasing t} } -optional + element create item-add-2 as_item_type_sa__allow_negative_p -label "Allow negative?" \ + -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional + element create item-add-2 as_item_type_mc__num_answers -label "Number of Answers" \ + -datatype integer -html {size 7} } - "imagemap" { - element create item-add-2 as_item_type_im__increasing_p -label "Increasing" -datatype text -widget select -options {{{All or Nothing} f } {Increasing t} } -optional - element create item-add-2 as_item_type_im__allow_negative_p -label "Allow negative?" -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional - element create item-add-2 as_item_type_mc__num_answers -label "Number of Answers" -datatype integer -html {size 7} - - + element create item-add-2 as_item_type_im__increasing_p -label "Increasing" \ + -datatype text -widget select -options {{{All or Nothing} f } {Increasing t} } -optional + element create item-add-2 as_item_type_im__allow_negative_p -label "Allow negative?" \ + -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional + element create item-add-2 as_item_type_mc__num_answers -label "Number of Answers" \ + -datatype integer -html {size 7} } - - -} +} ad_return_template Index: openacs-4/packages/assessment/www/asm-admin/item-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-create.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/item-create.tcl 7 Aug 2017 23:48:04 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/item-create.tcl 20 Jan 2018 22:38:28 -0000 1.4 @@ -39,30 +39,31 @@ element set_properties item-add as_items_name -value $item_id if { [template::form is_valid item-add] } { - #valid new item submission so create new item - set as_items_name [template::element::get_value item-add as_items_name] - set as_items_title [template::element::get_value item-add as_items_title] - set as_items_subtext [template::element::get_value item-add as_items_subtext] - set as_items_definition [template::element::get_value item-add as_items_definition] - set item_type [template::element::get_value item-add item_type] - set as_items_max_time_to_complete [template::element::get_value item-add as_items_max_time_to_complete] - set as_items_required_p [template::element::get_value item-add as_items_required_p] - set as_items_data_type [template::element::get_value item-add as_items_data_type] + #valid new item submission so create new item + set as_items_name [template::element::get_value item-add as_items_name] + set as_items_title [template::element::get_value item-add as_items_title] + set as_items_subtext [template::element::get_value item-add as_items_subtext] + set as_items_definition [template::element::get_value item-add as_items_definition] + set item_type [template::element::get_value item-add item_type] + set as_items_max_time_to_complete [template::element::get_value item-add as_items_max_time_to_complete] + set as_items_required_p [template::element::get_value item-add as_items_required_p] + set as_items_data_type [template::element::get_value item-add as_items_data_type] - db_transaction { - #add the item + db_transaction { + #add the item #Insert as_item in the CR (and as_items table) getting the revision_id (as_item_id) - set as_item_id [as::item::new -title $as_items_title -definition $as_items_definition -required_p $as_items_required_p -data_type $as_items_data_type -max_time_to_complete $as_items_max_time_to_complete] + set as_item_id [as::item::new -title $as_items_title \ + -definition $as_items_definition \ + -required_p $as_items_required_p \ + -data_type $as_items_data_type \ + -max_time_to_complete $as_items_max_time_to_complete] } #redirect back to display-create-type ad_returnredirect "display-create-type?item_type=$item_type&as_item_id1=$as_item_id" + ad_script_abort } -#item_type -label "Item Type" -datatype text -widget select -options {{{Open Question} textarea} {{Short Answer} shortanswer} {Matching matching} {{File Upload} {file_upload}} {{Multiple Choice (radio buttons)} radiobutton} {{Multiple Choice (checkboxes)} checkbox } {{Multiple Choices (Image Map)} image_map_mc} {{Multiple Choice with Fill-in-Blank} textarea} {Rank rank} {{Matrix table} {matrix table}} {{Composite matrix-based multiple response} radiobutton} } - - - ad_return_template Index: openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-delete.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-delete.tcl 7 Aug 2017 23:48:04 -0000 1.7 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-delete.tcl 20 Jan 2018 22:38:28 -0000 1.8 @@ -49,7 +49,9 @@ set section_id $new_section_id set as_item_id $new_item_id + ad_returnredirect [export_vars -base item-edit {assessment_id section_id as_item_id}] +ad_script_abort # Local variables: # mode: tcl Index: openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-swap.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-swap.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-swap.tcl 7 Aug 2017 23:48:04 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-swap.tcl 20 Jan 2018 22:38:28 -0000 1.7 @@ -32,12 +32,18 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] set new_item_id [as::item::new_revision -as_item_id $as_item_id] - as::assessment::check::copy_item_checks -assessment_id $assessment_id -section_id $new_section_id -as_item_id $as_item_id -new_item_id $new_item_id + as::assessment::check::copy_item_checks \ + -assessment_id $assessment_id \ + -section_id $new_section_id\ + -as_item_id $as_item_id \ + -new_item_id $new_item_id + set new_mc_id [as::item_type_mc::new_revision -as_item_type_id $mc_id] as::section::update_section_in_assessment\ - -old_section_id $section_id \ - -new_section_id $new_section_id \ - -new_assessment_rev_id $new_assessment_rev_id + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id + db_dml update_item_in_section {} db_dml update_item_type_in_item {} db_dml swap_choices {} @@ -49,6 +55,7 @@ set section_id $new_section_id set as_item_id $new_item_id ad_returnredirect [export_vars -base item-edit {assessment_id section_id as_item_id}] +ad_script_abort # Local variables: # mode: tcl Index: openacs-4/packages/assessment/www/asm-admin/permissions-user-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/permissions-user-add.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/permissions-user-add.tcl 7 Aug 2017 23:48:04 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/permissions-user-add.tcl 20 Jan 2018 22:38:28 -0000 1.4 @@ -34,8 +34,10 @@ } on_error { ad_return_complaint 1 "We had a problem adding the users you selected. Sorry." + ad_script_abort } - ad_returnredirect "permissions?object_id=$object_id" + ad_returnredirect [export_vars -base permissions {object_id}] + ad_script_abort } # Local variables: Index: openacs-4/packages/assessment/www/asm-admin/request-notification.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/request-notification.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/asm-admin/request-notification.tcl 7 Aug 2017 23:48:04 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/request-notification.tcl 20 Jan 2018 22:38:28 -0000 1.6 @@ -62,26 +62,24 @@ -interval_id $interval_id \ -delivery_method_id $delivery_method_id - - - ad_returnredirect "request-notification?assessment_id=$assessment_id§ion_id=$section_id&inter_item_check_id=$inter_item_check_id" + ad_returnredirect [export_vars -base request-notification {assessment_id section_id inter_item_check_id}] + ad_script_abort } template::list::create -name notify_users\ --multirow notify_users\ --key request_id\ --bulk_actions\ - { + -multirow notify_users \ + -key request_id \ + -bulk_actions { "\#assessment.unsubscribe\#" "unsubscribe" "\#assessment.unsubscribe_user\#" - }\ + } \ -bulk_action_method post -bulk_action_export_vars { inter_item_check_id type_id assessment_id section_id - }\ - -no_data "\#assessment.there_are_no_users\#"\ - -row_pretty_plural "notify_users"\ + } \ + -no_data "\#assessment.there_are_no_users\#" \ + -row_pretty_plural "notify_users" \ -elements { name { label "[_ assessment.User_ID] [_ assessment.Name]" Index: openacs-4/packages/assessment/www/asm-admin/section-select.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/section-select.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/asm-admin/section-select.tcl 7 Aug 2017 23:48:04 -0000 1.7 +++ openacs-4/packages/assessment/www/asm-admin/section-select.tcl 20 Jan 2018 22:38:28 -0000 1.8 @@ -68,7 +68,7 @@ } -on_submit { ad_returnredirect $return_url - + ad_script_abort } # Local variables: # mode: tcl Index: openacs-4/packages/assessment/www/asm-admin/section-swap.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/section-swap.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/asm-admin/section-swap.tcl 7 Aug 2017 23:48:04 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/section-swap.tcl 20 Jan 2018 22:38:28 -0000 1.6 @@ -33,6 +33,7 @@ } ad_returnredirect [export_vars -base questions {assessment_id}] +ad_script_abort # Local variables: # mode: tcl Index: openacs-4/packages/assessment/www/asm-admin/swap-actions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/swap-actions.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/asm-admin/swap-actions.tcl 7 Aug 2017 23:48:04 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/swap-actions.tcl 20 Jan 2018 22:38:28 -0000 1.5 @@ -18,10 +18,17 @@ -party_id [ad_conn user_id] \ -privilege "admin" -as::assessment::check::swap_actions -check_id $check_id -action_perform $action_perform -section_id $section_id -direction $direction -order_by $order_by +as::assessment::check::swap_actions \ + -check_id $check_id \ + -action_perform $action_perform \ + -section_id $section_id \ + -direction $direction \ + -order_by $order_by -ad_returnredirect "checks-admin?assessment_id=$assessment_id§ion_id=$section_id" +ad_returnredirect [export_vars -base checks-admin {assessment_id section_id}] +ad_script_abort + # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/assessment/www/asm-admin/toggle-boolean.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/toggle-boolean.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/asm-admin/toggle-boolean.tcl 7 Aug 2017 23:48:04 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/toggle-boolean.tcl 20 Jan 2018 22:38:28 -0000 1.5 @@ -16,6 +16,8 @@ db_dml toggle_boolean "" ad_returnredirect [export_vars -base one-a {assessment_id}] +ad_script_abort + # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/assessment/www/asm-admin/toggle-publish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/toggle-publish.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/asm-admin/toggle-publish.tcl 7 Aug 2017 23:48:04 -0000 1.7 +++ openacs-4/packages/assessment/www/asm-admin/toggle-publish.tcl 20 Jan 2018 22:38:28 -0000 1.8 @@ -19,7 +19,7 @@ # returns list of empty sections set empty_sections [db_list count_questions ""] -if { ($empty_sections eq "") || ($old_publish_status eq "live") } { +if { $empty_sections eq "" || $old_publish_status eq "live" } { # if no empty sections, or if we're un-publishing, then proceed db_dml toggle_publish "" set message "Set to [ad_decode $old_publish_status "live" invisible visible]" @@ -30,7 +30,9 @@ if {$return_url eq ""} { set return_url [export_vars -base one-a {assessment_id}] } + ad_returnredirect -message $message $return_url +ad_script_abort # Local variables: # mode: tcl Index: openacs-4/packages/assessment/www/asm-admin/toggle-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/toggle-type.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/asm-admin/toggle-type.tcl 7 Aug 2017 23:48:04 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/toggle-type.tcl 20 Jan 2018 22:38:28 -0000 1.5 @@ -15,6 +15,8 @@ db_dml toggle_type "" ad_returnredirect [export_vars -base one-a {assessment_id}] +ad_script_abort + # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/assessment/www/asm-admin/unsubscribe.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/unsubscribe.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/asm-admin/unsubscribe.tcl 7 Aug 2017 23:48:04 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/unsubscribe.tcl 20 Jan 2018 22:38:28 -0000 1.5 @@ -25,6 +25,7 @@ } ad_returnredirect "request-notification?inter_item_check_id=$inter_item_check_id&type_id=$type_id&assessment_id=$assessment_id§ion_id=$section_id" +ad_script_abort # Local variables: # mode: tcl