Index: openacs-4/packages/assessment/tcl/as-checks-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-checks-procs.tcl,v
diff -u -r1.24.2.3 -r1.24.2.4
--- openacs-4/packages/assessment/tcl/as-checks-procs.tcl 26 Jul 2005 11:43:15 -0000 1.24.2.3
+++ openacs-4/packages/assessment/tcl/as-checks-procs.tcl 26 Jul 2005 13:41:25 -0000 1.24.2.4
@@ -260,8 +260,6 @@
set failed_p "t"
set failed [catch $tcl_code errorMsg]
- ns_log Notice "DEDS as::assessment::check::action_exec -- $tcl_code"
-
if { $failed > 0 } {
set failed_p "f"
}
@@ -473,6 +471,30 @@
}
+ad_proc -public as::assessment::check::eval_sa_checks {
+ {-session_id}
+ {-assessment_id}
+} {
+
+} {
+
+ set assessment_rev_id [db_string get_assessment_id {}]
+
+ set checks [db_list_of_lists section_checks {}]
+ foreach check_id $checks {
+
+ set info [db_0or1row check_info {}]
+ set perform [db_string check_sql $check_sql -default 0]
+ if {$action_p == "t"} {
+ if {$perform == 1} {
+ as::assessment::check::action_exec -inter_item_check_id $inter_item_check_id -session_id $session_id
+ }
+ }
+ }
+
+}
+
+
ad_proc -public as::assessment::check::confirm_display {
{-check_id}
{-index}
Index: openacs-4/packages/assessment/tcl/as-checks-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-checks-procs.xql,v
diff -u -r1.19.2.2 -r1.19.2.3
--- openacs-4/packages/assessment/tcl/as-checks-procs.xql 26 Jul 2005 11:43:15 -0000 1.19.2.2
+++ openacs-4/packages/assessment/tcl/as-checks-procs.xql 26 Jul 2005 13:41:25 -0000 1.19.2.3
@@ -277,6 +277,23 @@
select c.inter_item_check_id,c.check_sql,action_p from as_inter_item_checks c,as_action_map am where c.inter_item_check_id=am.inter_item_check_id and am.action_perform='or' and section_id_from=:section_id order by am.order_by
+
+
+ select c.inter_item_check_id from as_inter_item_checks c,as_action_map am where c.inter_item_check_id=am.inter_item_check_id and am.action_perform='sa' and c.assessment_id=:assessment_id order by am.order_by
+
+
+
+
+ select max(revision_id) from cr_revisions where item_id=:assessment_id
+
+
+
+
+ select * from as_inter_item_checks c,as_action_map am where
+ c.inter_item_check_id=am.inter_item_check_id and am.action_perform='sa'
+ and c.assessment_id=:assessment_id and c.inter_item_check_id=:check_id order by am.order_by
+
+
select * from as_inter_item_checks where inter_item_check_id=:check_id
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.5 -r1.47.2.6
--- openacs-4/packages/assessment/www/assessment.tcl 26 Jul 2005 11:43:15 -0000 1.47.2.5
+++ openacs-4/packages/assessment/www/assessment.tcl 26 Jul 2005 13:41:25 -0000 1.47.2.6
@@ -239,6 +239,8 @@
as::assessment::calculate -session_id $session_id -assessment_id $assessment_rev_id
db_dml session_finished {}
as::assessment::check::eval_aa_checks -session_id $session_id -assessment_id $assessment_id
+ # section based aa checks
+ as::assessment::check::eval_sa_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 next_asm}]
@@ -446,6 +448,8 @@
as::assessment::calculate -session_id \$session_id -assessment_id \$assessment_rev_id
db_dml session_finished {}
as::assessment::check::eval_aa_checks -session_id $session_id -assessment_id $assessment_id
+ # section based aa checks
+ as::assessment::check::eval_sa_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 next_asm}\]
@@ -499,6 +503,8 @@
as::assessment::calculate -session_id $session_id -assessment_id $assessment_rev_id
db_dml session_finished {}
as::assessment::check::eval_aa_checks -session_id $session_id -assessment_id $assessment_id
+ # section based aa checks
+ as::assessment::check::eval_sa_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 next_asm}]
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.5.2.2 -r1.5.2.3
--- openacs-4/packages/assessment/www/asm-admin/action-params.tcl 26 Jul 2005 11:43:15 -0000 1.5.2.2
+++ openacs-4/packages/assessment/www/asm-admin/action-params.tcl 26 Jul 2005 13:41:25 -0000 1.5.2.3
@@ -69,7 +69,7 @@
db_foreach get_params {} {
set choices [list]
if { $type == "n" } {
- if { $action_perform == "aa" || $action_perform == "m" || $action_perform == "or"} {
+ if { $action_perform == "aa" || $action_perform == "m" || $action_perform == "or" || $action_perform == "sa"} {
set choices [db_list_of_lists choices {}]
} else {
set choices [db_list_of_lists prev_choices {}]
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.5.2.3 -r1.5.2.4
--- openacs-4/packages/assessment/www/asm-admin/action-select.tcl 26 Jul 2005 12:10:12 -0000 1.5.2.3
+++ openacs-4/packages/assessment/www/asm-admin/action-select.tcl 26 Jul 2005 13:41:25 -0000 1.5.2.4
@@ -36,7 +36,7 @@
set title "[_ assessment.action_select]"
if {$section_check_p} {
- set options [list [list "On Request" "or"]]
+ set options [list [list "On Request" "or"] [list "[_ assessment.at_the_end]" "sa"]]
} else {
set options [list [list "[_ assessment.immediately]" "i"] [list "[_ assessment.at_the_end]" "aa"] [list "[_ assessment.manually]" "m"]]
}
Index: openacs-4/packages/assessment/www/asm-admin/checks-admin.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/checks-admin.adp,v
diff -u -r1.2.2.1 -r1.2.2.2
--- openacs-4/packages/assessment/www/asm-admin/checks-admin.adp 26 Jul 2005 11:43:15 -0000 1.2.2.1
+++ openacs-4/packages/assessment/www/asm-admin/checks-admin.adp 26 Jul 2005 13:41:25 -0000 1.2.2.2
@@ -2,11 +2,14 @@
@title@ #assessment.Administration#
@context;noquote@
-On request
+On Request (section check)
+#assessment.after_this_asm# (section check)
+
+
#assessment.after_this_asm#
Index: openacs-4/packages/assessment/www/asm-admin/checks-admin.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/checks-admin.tcl,v
diff -u -r1.8.2.1 -r1.8.2.2
--- openacs-4/packages/assessment/www/asm-admin/checks-admin.tcl 26 Jul 2005 11:43:15 -0000 1.8.2.1
+++ openacs-4/packages/assessment/www/asm-admin/checks-admin.tcl 26 Jul 2005 13:41:25 -0000 1.8.2.2
@@ -48,6 +48,7 @@
}
db_multirow or_checks get_or_checks {}
+db_multirow sa_checks get_sa_checks {}
db_multirow aa_checks get_aa_checks {}
db_multirow i_checks get_i_checks {}
db_multirow branches get_branches {}
@@ -109,6 +110,50 @@
template::list::create \
+ -name sa_checks \
+ -multirow sa_checks \
+ -key inter_item_check_id \
+ -bulk_actions {
+ "\#assessment.Delete\#" "confirm-delete" "\#assessment.delete_checked\#"
+ }\
+ -bulk_action_method post \
+ -bulk_action_export_vars {
+ assessment_id
+ section_id
+ {type_check t}
+ item_id_check
+ by_item_p
+ }\
+ -row_pretty_plural "[_ assessment.Assessment] [_ assessment.triggers]" \
+ -elements {
+ name {
+ label "[_ assessment.Name]"
+ display_template {
+ @sa_checks.name@
+ }
+ }
+ action_name {
+ label "[_ assessment.action_to_perform]"
+ }
+ counter {
+ display_template {
+
+
+
+
+
+
+
+
+ #assessment.notify_user#
+
+ }
+
+ }
+ }
+
+
+template::list::create \
-name aa_checks \
-multirow aa_checks \
-key inter_item_check_id \
Index: openacs-4/packages/assessment/www/asm-admin/checks-admin.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/checks-admin.xql,v
diff -u -r1.2.2.1 -r1.2.2.2
--- openacs-4/packages/assessment/www/asm-admin/checks-admin.xql 26 Jul 2005 11:43:15 -0000 1.2.2.1
+++ openacs-4/packages/assessment/www/asm-admin/checks-admin.xql 26 Jul 2005 13:41:25 -0000 1.2.2.2
@@ -7,6 +7,12 @@
+
+
+ select c.check_sql,am.action_perform,c.inter_item_check_id,c.name,a.name as action_name, am.order_by,c.section_id_from from as_inter_item_checks c,as_actions a, as_action_map am where am.inter_item_check_id = c.inter_item_check_id and am.action_id=a.action_id and c.section_id_from =:section_id and am.action_perform = 'sa' and c.action_p = 't'and c.assessment_id=:assessment_id $check_list order by order_by
+
+
+
select c.check_sql,am.action_perform,c.inter_item_check_id,c.name,a.name as action_name, am.order_by,c.section_id_from from as_inter_item_checks c,as_actions a, as_action_map am where am.inter_item_check_id = c.inter_item_check_id and am.action_id=a.action_id and c.section_id_from =:section_id and am.action_perform = 'aa' and c.action_p = 't'and c.assessment_id=:assessment_id $check_list order by order_by