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.5 -r1.6 --- openacs-4/packages/anon-eval/catalog/anon-eval.en_US.ISO-8859-1.xml 6 Feb 2006 21:47:27 -0000 1.5 +++ openacs-4/packages/anon-eval/catalog/anon-eval.en_US.ISO-8859-1.xml 9 Feb 2006 13:22:09 -0000 1.6 @@ -7,6 +7,7 @@ Evaluations Administration Answered Evaluations Anonymous Evaluations + Are you sure? Edit Evaluation Evaluation Create New Evaluation @@ -16,8 +17,10 @@ Instructions on how to use this evaluation One Evaluation: %assessment_data.title% Start Time of the evaluation + There are responses to this evaluation. Adding/editing a section or question could lead to inconsistent results. This allows you to give a special unique identifier to your evaluation, which might be a code. Title of the evaluation that will be displayed + Warning: There are responses to this evaluation New Evaluation Open 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.5 -r1.6 --- openacs-4/packages/anon-eval/www/assessment.tcl 7 Feb 2006 22:20:20 -0000 1.5 +++ openacs-4/packages/anon-eval/www/assessment.tcl 9 Feb 2006 13:22:09 -0000 1.6 @@ -8,7 +8,6 @@ } -query { assessment_id:integer,notnull {password:optional ""} - {session_id:integer,optional ""} {section_order:integer,optional ""} {item_order:integer,optional ""} {item_id ""} @@ -24,6 +23,7 @@ set section_to "" set item_to "" set url "" +set session_id "" if { [info exists return_url] } { set url $return_url Index: openacs-4/packages/anon-eval/www/asm-admin/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/www/asm-admin/index.vuh,v diff -u -r1.3 -r1.4 --- openacs-4/packages/anon-eval/www/asm-admin/index.vuh 9 Jun 2005 05:54:37 -0000 1.3 +++ openacs-4/packages/anon-eval/www/asm-admin/index.vuh 9 Feb 2006 13:22:09 -0000 1.4 @@ -8,4 +8,29 @@ # @cvs-id $Id$ set page [ad_conn path_info] -rp_internal_redirect /packages/assessment/www/asm-admin/${page} \ No newline at end of file + +# When adding/editing a section or question, check if the assessment has +# sessions +if { $page eq "section-form" || [string match "item-*" $page] } { + set form [rp_getform] + + if { $form ne "" } { + set assessment_id [ns_set get $form assessment_id] + set override_p [ns_set get $form override_p] + if { $assessment_id ne "" && $override_p != 1 } { + if { [db_0or1row get_sessions { + select 1 + from dual + where exists (select * + from as_sessionsi s, cr_revisions r + where s.assessment_id = r.revision_id + and r.item_id = :assessment_id) + }] } { + rp_form_put next_url [ad_return_url] + rp_internal_redirect warning + } + } + } +} + +rp_internal_redirect /packages/assessment/www/asm-admin/${page} Index: openacs-4/packages/anon-eval/www/asm-admin/warning.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/www/asm-admin/warning.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/anon-eval/www/asm-admin/warning.adp 9 Feb 2006 13:22:09 -0000 1.1 @@ -0,0 +1,9 @@ + + #anon-eval.lt_Warning_There_are_res# + +
+

#anon-eval.lt_There_are_responses_t#

+
+ #anon-eval.Are_you_sure# #assessment.yes# #assessment.no# +
+
\ No newline at end of file Index: openacs-4/packages/anon-eval/www/asm-admin/warning.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/anon-eval/www/asm-admin/warning.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/anon-eval/www/asm-admin/warning.tcl 9 Feb 2006 13:22:09 -0000 1.1 @@ -0,0 +1,19 @@ +# packages/anon-eval/www/asm-admin/warning.tcl + +ad_page_contract { + + Warning page + + @author Roel Canicula (roel@solutiongrove.com) + @creation-date 2006-02-09 + @arch-tag: 93f32c53-37cd-4603-8a1d-5c646bd724d3 + @cvs-id $Id: warning.tcl,v 1.1 2006/02/09 13:22:09 roelc Exp $ +} { + next_url:notnull +} -properties { +} -validate { +} -errors { +} + +set index_url [ad_conn package_url] +set next_url [export_vars -base $next_url { {override_p 1} }] \ No newline at end of file