Index: openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml,v diff -u -r1.22 -r1.23 --- openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml 7 Jan 2005 16:10:43 -0000 1.22 +++ openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml 14 Jan 2005 13:13:37 -0000 1.23 @@ -146,6 +146,7 @@ Email Options: End Time Entry Page + Need to be pairs of \"key value\". Exit Page Export Extreme Actions: Index: openacs-4/packages/assessment/tcl/as-assessment-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-assessment-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 7 Jan 2005 16:10:44 -0000 1.11 +++ openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 14 Jan 2005 13:13:37 -0000 1.12 @@ -303,16 +303,38 @@ ad_proc as::assessment::unique_name { {-name ""} {-new_p 1} + {-item_id ""} } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-05 - Checks if a name string is unique or empty + Checks if a name string is unique or empty, excluding a given item } { - if {$new_p && ![empty_string_p $name] && [db_string check_unique {}] > 0} { - return 0 - } else { + if {$new_p && ![empty_string_p $name]} { + if {[empty_string_p $item_id]} { + set count [db_string check_unique {}] + } else { + set count [db_string check_unique_excluding_item {}] + } + if {$count > 0} { + return 0 + } + } + return 1 +} + +ad_proc as::assessment::check_html_options { + -options:required +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2005-01-11 + + Checks if list contains only key value pairs +} { + if {[llength $options] % 2 == 0} { return 1 + } else { + return 0 } } Index: openacs-4/packages/assessment/tcl/as-assessment-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-assessment-procs.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/tcl/as-assessment-procs.xql 7 Jan 2005 16:10:44 -0000 1.6 +++ openacs-4/packages/assessment/tcl/as-assessment-procs.xql 14 Jan 2005 13:13:37 -0000 1.7 @@ -86,4 +86,15 @@ + + + + select count(*) + from cr_items + where name = :name + and item_id <> :item_id + + + + Index: openacs-4/packages/assessment/tcl/as-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/tcl/as-item-procs.tcl 7 Jan 2005 16:10:44 -0000 1.8 +++ openacs-4/packages/assessment/tcl/as-item-procs.tcl 14 Jan 2005 13:13:37 -0000 1.9 @@ -7,6 +7,7 @@ namespace eval as::item {} ad_proc -public as::item::new { + {-item_item_id ""} {-name ""} {-title:required} {-description ""} @@ -29,7 +30,9 @@ # Insert as_item in the CR (and as_items table) getting the revision_id (as_item_id) db_transaction { - set item_item_id [db_nextval acs_object_id_seq] + if {[empty_string_p $item_item_id]} { + set item_item_id [db_nextval acs_object_id_seq] + } if {[empty_string_p $name]} { set name "QUE_$item_item_id" } @@ -124,6 +127,22 @@ return $new_item_id } +ad_proc -public as::item::latest { + -as_item_id:required + -section_id:required + {-default ""} +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2005-01-13 + + Returns the latest revision of an item +} { + if {![db_0or1row get_latest_item_id {}] && ![empty_string_p $default]} { + return $default + } + return $as_item_id +} + ad_proc -public as::item::copy { {-as_item_id:required} {-name ""} Index: openacs-4/packages/assessment/tcl/as-item-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/tcl/as-item-procs.xql 10 Dec 2004 11:42:23 -0000 1.2 +++ openacs-4/packages/assessment/tcl/as-item-procs.xql 14 Jan 2005 13:13:37 -0000 1.3 @@ -24,6 +24,19 @@ + + + + select m.as_item_id + from as_item_section_map m, cr_revisions r, cr_revisions i + where m.section_id = :section_id + and m.as_item_id = r.revision_id + and i.revision_id = :as_item_id + and i.item_id = r.item_id + + + + Index: openacs-4/packages/assessment/tcl/as-item-rels-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-rels-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/tcl/as-item-rels-procs.tcl 8 Dec 2004 15:30:34 -0000 1.1 +++ openacs-4/packages/assessment/tcl/as-item-rels-procs.tcl 14 Jan 2005 13:13:37 -0000 1.2 @@ -28,5 +28,5 @@ Get target object of given relationship type } { - return [db_string target_object {}] + return [db_string target_object {} -default ""] } Index: openacs-4/packages/assessment/tcl/as-section-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/assessment/tcl/as-section-procs.tcl 7 Jan 2005 16:10:44 -0000 1.10 +++ openacs-4/packages/assessment/tcl/as-section-procs.tcl 14 Jan 2005 13:13:37 -0000 1.11 @@ -117,6 +117,22 @@ return $new_section_id } +ad_proc -public as::section::latest { + -section_id:required + -assessment_rev_id:required + {-default ""} +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2005-01-13 + + Returns the latest revision of a section +} { + if {![db_0or1row get_latest_section_id {}] && ![empty_string_p $default]} { + return $default + } + return $section_id +} + ad_proc -public as::section::copy { {-section_id:required} {-name ""} Index: openacs-4/packages/assessment/tcl/as-section-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-procs.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/tcl/as-section-procs.xql 7 Jan 2005 16:10:44 -0000 1.6 +++ openacs-4/packages/assessment/tcl/as-section-procs.xql 14 Jan 2005 13:13:37 -0000 1.7 @@ -24,6 +24,19 @@ + + + + select m.section_id + from as_assessment_section_map m, cr_revisions r, cr_revisions s + where m.assessment_id = :assessment_rev_id + and m.section_id = r.revision_id + and s.revision_id = :section_id + and s.item_id = r.item_id + + + + Index: openacs-4/packages/assessment/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/index.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/index.tcl 8 Jan 2005 14:51:19 -0000 1.7 +++ openacs-4/packages/assessment/www/index.tcl 14 Jan 2005 13:13:37 -0000 1.8 @@ -15,7 +15,6 @@ set package_id [ad_conn package_id] set folder_id [as::assessment::folder_id -package_id $package_id] - # create a list with all assessments and their sessions template::list::create \ -name assessments \ Index: openacs-4/packages/assessment/www/admin/catalog-item-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/catalog-item-add.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/admin/catalog-item-add.tcl 10 Jan 2005 13:40:01 -0000 1.5 +++ openacs-4/packages/assessment/www/admin/catalog-item-add.tcl 14 Jan 2005 13:13:37 -0000 1.6 @@ -46,6 +46,7 @@ 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] set new_section_id [as::section::new_revision -section_id $section_id] set item_count [llength $item_ids] Index: openacs-4/packages/assessment/www/admin/catalog-item-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/catalog-item-add.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/catalog-item-add.xql 10 Dec 2004 20:21:50 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/catalog-item-add.xql 14 Jan 2005 13:13:37 -0000 1.4 @@ -57,7 +57,11 @@ required_p, :after as sort_order, max_time_to_complete, 0 as fixed_position, points from as_items - where as_item_id = :as_item_id) + where as_item_id = :as_item_id + and not exists (select 1 + from as_item_section_map + where as_item_id = :as_item_id + and section_id = :new_section_id)) Index: openacs-4/packages/assessment/www/admin/catalog-search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/catalog-search.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/catalog-search.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/catalog-search.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -54,7 +54,7 @@ } ad_form -extend -name catalog_search -form { - {keywords:text,optional {label "[_ assessment.Keywords]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.Keywords_help]"}} + {keywords:text,optional,nospell {label "[_ assessment.Keywords]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.Keywords_help]"}} {letter:text(select),optional {label "[_ assessment.Letter]"} {options $letter_options} {help_text "[_ assessment.Letter_help]"}} } Index: openacs-4/packages/assessment/www/admin/catalog-section-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/catalog-section-add.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/catalog-section-add.xql 10 Dec 2004 11:42:23 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/catalog-section-add.xql 14 Jan 2005 13:13:37 -0000 1.3 @@ -32,7 +32,11 @@ (select :new_assessment_rev_id as assessment_id, :section_id as section_id, :after as sort_order, max_time_to_complete, points from as_sections - where section_id = :section_id) + where section_id = :section_id + and not exists (select 1 + from as_assessment_section_map + where assessment_id = :new_assessment_rev_id + and section_id = :section_id)) Index: openacs-4/packages/assessment/www/admin/item-add-display-cb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-cb.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/item-add-display-cb.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/item-add-display-cb.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -49,7 +49,7 @@ ad_form -name item_add_display_cb -action item-add-display-cb -export { assessment_id section_id after } -form { {as_item_id:key} - {html_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {html_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} {choice_orientation:text(select) {label "[_ assessment.Choice_Orientation]"} {options $choice_or_types} {help_text "[_ assessment.Choice_Orientation_help]"}} {label_orientation:text(select) {label "[_ assessment.Label_Orientation]"} {options $label_or_types} {help_text "[_ assessment.Label_Orientation_help]"}} {order_type:text(select) {label "[_ assessment.Order_Type]"} {options $order_types} {help_text "[_ assessment.Order_Type_help]"}} @@ -60,23 +60,55 @@ set label_orientation "top" set order_type "order_of_entry" set answer_alignment "besideright" +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { - set as_item_display_id [as::item_display_cb::new \ - -html_display_options $html_options \ - -choice_orientation $choice_orientation \ - -choice_label_orientation $label_orientation \ - -sort_order_type $order_type \ - -item_answer_alignment $answer_alignment] - - as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel - 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] set new_section_id [as::section::new_revision -section_id $section_id] db_dml update_section_in_assessment {} - db_dml move_down_items {} - incr after - db_dml insert_new_item {} + set old_item_id $as_item_id + + if {![db_0or1row item_display {}] || $object_type != "as_item_display_cb"} { + set as_item_display_id [as::item_display_cb::new \ + -html_display_options $html_options \ + -choice_orientation $choice_orientation \ + -choice_label_orientation $label_orientation \ + -sort_order_type $order_type \ + -item_answer_alignment $answer_alignment] + + if {![info exists object_type]} { + # first item display mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel + } else { + # old item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + db_dml update_item_display {} + } + } else { + # old cb item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + set as_item_display_id [as::item_display_cb::edit \ + -as_item_display_id $as_item_display_id \ + -html_display_options $html_options \ + -choice_orientation $choice_orientation \ + -choice_label_orientation $label_orientation \ + -sort_order_type $order_type \ + -item_answer_alignment $answer_alignment] + + db_dml update_item_display {} + } + + set old_item_id [as::item::latest -as_item_id $old_item_id -section_id $new_section_id -default 0] + if {$old_item_id == 0} { + db_dml move_down_items {} + incr after + db_dml insert_new_item {} + } else { + db_1row item_data {} + db_dml update_item {} + } } } -after_submit { # now go to assessment-page Index: openacs-4/packages/assessment/www/admin/item-add-display-cb.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-cb.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-add-display-cb.xql 10 Dec 2004 11:42:23 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-add-display-cb.xql 14 Jan 2005 13:13:37 -0000 1.3 @@ -1,6 +1,18 @@ + + + + select r.target_rev_id, o.object_type + from as_item_rels r, acs_objects o + where r.item_rev_id = :as_item_id + and r.rel_type = 'as_item_display_rel' + and o.object_id = r.target_rev_id + + + + @@ -38,4 +50,39 @@ + + + + update as_item_rels + set target_rev_id = :as_item_display_id + where item_rev_id = :as_item_id + and rel_type = 'as_item_display_rel' + + + + + + + + select required_p, max_time_to_complete, points + from as_items + where as_item_id = :as_item_id + + + + + + + + update as_item_section_map + set as_item_id = :as_item_id, + required_p = :required_p, + max_time_to_complete = :max_time_to_complete, + points = :points + where as_item_id = :old_item_id + and section_id = :new_section_id + + + + Index: openacs-4/packages/assessment/www/admin/item-add-display-rb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-rb.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/item-add-display-rb.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/item-add-display-rb.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -49,7 +49,7 @@ ad_form -name item_add_display_rb -action item-add-display-rb -export { assessment_id section_id after } -form { {as_item_id:key} - {html_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {html_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} {choice_orientation:text(select) {label "[_ assessment.Choice_Orientation]"} {options $choice_or_types} {help_text "[_ assessment.Choice_Orientation_help]"}} {label_orientation:text(select) {label "[_ assessment.Label_Orientation]"} {options $label_or_types} {help_text "[_ assessment.Label_Orientation_help]"}} {order_type:text(select) {label "[_ assessment.Order_Type]"} {options $order_types} {help_text "[_ assessment.Order_Type_help]"}} @@ -60,23 +60,53 @@ set label_orientation "top" set order_type "order_of_entry" set answer_alignment "besideright" +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { - set as_item_display_id [as::item_display_rb::new \ - -html_display_options $html_options \ - -choice_orientation $choice_orientation \ - -choice_label_orientation $label_orientation \ - -sort_order_type $order_type \ - -item_answer_alignment $answer_alignment] - - as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel - 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] set new_section_id [as::section::new_revision -section_id $section_id] db_dml update_section_in_assessment {} - db_dml move_down_items {} - incr after - db_dml insert_new_item {} + set old_item_id $as_item_id + + if {![db_0or1row item_display {}] || $object_type != "as_item_display_rb"} { + set as_item_display_id [as::item_display_rb::new \ + -html_display_options $html_options \ + -choice_orientation $choice_orientation \ + -choice_label_orientation $label_orientation \ + -sort_order_type $order_type \ + -item_answer_alignment $answer_alignment] + + if {![info exists object_type]} { + # first item display mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel + } else { + # old item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + } + } else { + # old rb item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + set as_item_display_id [as::item_display_rb::edit \ + -as_item_display_id $as_item_display_id \ + -html_display_options $html_options \ + -choice_orientation $choice_orientation \ + -choice_label_orientation $label_orientation \ + -sort_order_type $order_type \ + -item_answer_alignment $answer_alignment] + } + + set old_item_id [as::item::latest -as_item_id $old_item_id -section_id $new_section_id -default 0] + if {$old_item_id == 0} { + db_dml move_down_items {} + incr after + db_dml insert_new_item {} + } else { + db_dml update_item_display {} + db_1row item_data {} + db_dml update_item {} + } } } -after_submit { # now go to assessment-page Index: openacs-4/packages/assessment/www/admin/item-add-display-rb.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-rb.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-add-display-rb.xql 10 Dec 2004 11:42:23 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-add-display-rb.xql 14 Jan 2005 13:13:37 -0000 1.3 @@ -1,6 +1,18 @@ + + + + select r.target_rev_id, o.object_type + from as_item_rels r, acs_objects o + where r.item_rev_id = :as_item_id + and r.rel_type = 'as_item_display_rel' + and o.object_id = r.target_rev_id + + + + @@ -38,4 +50,39 @@ + + + + update as_item_rels + set target_rev_id = :as_item_display_id + where item_rev_id = :as_item_id + and rel_type = 'as_item_display_rel' + + + + + + + + select required_p, max_time_to_complete, points + from as_items + where as_item_id = :as_item_id + + + + + + + + update as_item_section_map + set as_item_id = :as_item_id, + required_p = :required_p, + max_time_to_complete = :max_time_to_complete, + points = :points + where as_item_id = :old_item_id + and section_id = :new_section_id + + + + Index: openacs-4/packages/assessment/www/admin/item-add-display-sa.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-sa.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/item-add-display-sa.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/item-add-display-sa.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -35,28 +35,56 @@ ad_form -name item_add_display_sa -action item-add-display-sa -export { assessment_id section_id after } -form { {as_item_id:key} - {html_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} - {abs_size:text {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} + {html_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {abs_size:text,nospell {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} {box_orientation:text(select) {label "[_ assessment.Box_Orientation]"} {options $orientation_types} {help_text "[_ assessment.Box_Orientation_help]"}} } -edit_request { set html_options "" set abs_size 5 set box_orientation "vertical" +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { - set as_item_display_id [as::item_display_sa::new \ - -html_display_options $html_options \ - -abs_size $abs_size \ - -box_orientation $box_orientation] - - as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel - 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] set new_section_id [as::section::new_revision -section_id $section_id] db_dml update_section_in_assessment {} - db_dml move_down_items {} - incr after - db_dml insert_new_item {} + set old_item_id $as_item_id + + if {![db_0or1row item_display {}] || $object_type != "as_item_display_sa"} { + set as_item_display_id [as::item_display_sa::new \ + -html_display_options $html_options \ + -abs_size $abs_size \ + -box_orientation $box_orientation] + + if {![info exists object_type]} { + # first item display mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel + } else { + # old item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + } + } else { + # old sa item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + set as_item_display_id [as::item_display_sa::edit \ + -as_item_display_id $as_item_display_id \ + -html_display_options $html_options \ + -abs_size $abs_size \ + -box_orientation $box_orientation] + } + + set old_item_id [as::item::latest -as_item_id $old_item_id -section_id $new_section_id -default 0] + if {$old_item_id == 0} { + db_dml move_down_items {} + incr after + db_dml insert_new_item {} + } else { + db_dml update_item_display {} + db_1row item_data {} + db_dml update_item {} + } } } -after_submit { # now go to assessment-page Index: openacs-4/packages/assessment/www/admin/item-add-display-sa.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-sa.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-add-display-sa.xql 10 Dec 2004 11:42:23 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-add-display-sa.xql 14 Jan 2005 13:13:37 -0000 1.3 @@ -1,6 +1,18 @@ + + + + select r.target_rev_id, o.object_type + from as_item_rels r, acs_objects o + where r.item_rev_id = :as_item_id + and r.rel_type = 'as_item_display_rel' + and o.object_id = r.target_rev_id + + + + @@ -38,4 +50,39 @@ + + + + update as_item_rels + set target_rev_id = :as_item_display_id + where item_rev_id = :as_item_id + and rel_type = 'as_item_display_rel' + + + + + + + + select required_p, max_time_to_complete, points + from as_items + where as_item_id = :as_item_id + + + + + + + + update as_item_section_map + set as_item_id = :as_item_id, + required_p = :required_p, + max_time_to_complete = :max_time_to_complete, + points = :points + where as_item_id = :old_item_id + and section_id = :new_section_id + + + + Index: openacs-4/packages/assessment/www/admin/item-add-display-sb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-sb.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-add-display-sb.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-add-display-sb.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -45,7 +45,7 @@ ad_form -name item_add_display_sb -action item-add-display-sb -export { assessment_id section_id after } -form { {as_item_id:key} - {html_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {html_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} {multiple_p:text(select) {label "[_ assessment.Multiple]"} {options $boolean_options} {help_text "[_ assessment.Multiple_help]"}} {label_orientation:text(select) {label "[_ assessment.Label_Orientation]"} {options $label_or_types} {help_text "[_ assessment.Label_Orientation_help]"}} {order_type:text(select) {label "[_ assessment.Order_Type]"} {options $order_types} {help_text "[_ assessment.Order_Type_help]"}} @@ -56,23 +56,53 @@ set label_orientation "top" set order_type "order_of_entry" set answer_alignment "besideright" +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { - set as_item_display_id [as::item_display_sb::new \ - -html_display_options $html_options \ - -multiple_p $multiple_p \ - -choice_label_orientation $label_orientation \ - -sort_order_type $order_type \ - -item_answer_alignment $answer_alignment] - - as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel - 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] set new_section_id [as::section::new_revision -section_id $section_id] db_dml update_section_in_assessment {} - db_dml move_down_items {} - incr after - db_dml insert_new_item {} + set old_item_id $as_item_id + + if {![db_0or1row item_display {}] || $object_type != "as_item_display_sb"} { + set as_item_display_id [as::item_display_sb::new \ + -html_display_options $html_options \ + -multiple_p $multiple_p \ + -choice_label_orientation $label_orientation \ + -sort_order_type $order_type \ + -item_answer_alignment $answer_alignment] + + if {![info exists object_type]} { + # first item display mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel + } else { + # old item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + } + } else { + # old sb item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + set as_item_display_id [as::item_display_sb::edit \ + -as_item_display_id $as_item_display_id \ + -html_display_options $html_options \ + -multiple_p $multiple_p \ + -choice_label_orientation $label_orientation \ + -sort_order_type $order_type \ + -item_answer_alignment $answer_alignment] + } + + set old_item_id [as::item::latest -as_item_id $old_item_id -section_id $new_section_id -default 0] + if {$old_item_id == 0} { + db_dml move_down_items {} + incr after + db_dml insert_new_item {} + } else { + db_dml update_item_display {} + db_1row item_data {} + db_dml update_item {} + } } } -after_submit { # now go to assessment-page Index: openacs-4/packages/assessment/www/admin/item-add-display-sb.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-sb.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-add-display-sb.xql 10 Dec 2004 11:42:23 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-add-display-sb.xql 14 Jan 2005 13:13:37 -0000 1.3 @@ -1,6 +1,18 @@ + + + + select r.target_rev_id, o.object_type + from as_item_rels r, acs_objects o + where r.item_rev_id = :as_item_id + and r.rel_type = 'as_item_display_rel' + and o.object_id = r.target_rev_id + + + + @@ -38,4 +50,39 @@ + + + + update as_item_rels + set target_rev_id = :as_item_display_id + where item_rev_id = :as_item_id + and rel_type = 'as_item_display_rel' + + + + + + + + select required_p, max_time_to_complete, points + from as_items + where as_item_id = :as_item_id + + + + + + + + update as_item_section_map + set as_item_id = :as_item_id, + required_p = :required_p, + max_time_to_complete = :max_time_to_complete, + points = :points + where as_item_id = :old_item_id + and section_id = :new_section_id + + + + Index: openacs-4/packages/assessment/www/admin/item-add-display-ta.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-ta.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/item-add-display-ta.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/item-add-display-ta.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -35,29 +35,58 @@ ad_form -name item_add_display_ta -action item-add-display-ta -export { assessment_id section_id after } -form { {as_item_id:key} - {html_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} - {abs_size:text {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} + {html_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {abs_size:text,nospell {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} {answer_alignment:text(select) {label "[_ assessment.Answer_Alignment]"} {options $alignment_types} {help_text "[_ assessment.Answer_Alignment_help]"}} } -edit_request { set html_options "" set abs_size 1000 set answer_alignment "besideright" +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { - set as_item_display_id [as::item_display_ta::new \ - -html_display_options $html_options \ - -abs_size $abs_size \ - -acs_widget "" \ - -item_answer_alignment $answer_alignment] - - as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel - 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] set new_section_id [as::section::new_revision -section_id $section_id] db_dml update_section_in_assessment {} - db_dml move_down_items {} - incr after - db_dml insert_new_item {} + set old_item_id $as_item_id + + if {![db_0or1row item_display {}] || $object_type != "as_item_display_ta"} { + set as_item_display_id [as::item_display_ta::new \ + -html_display_options $html_options \ + -abs_size $abs_size \ + -acs_widget "" \ + -item_answer_alignment $answer_alignment] + + if {![info exists object_type]} { + # first item display mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel + } else { + # old item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + } + } else { + # old ta item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + set as_item_display_id [as::item_display_ta::edit \ + -as_item_display_id $as_item_display_id \ + -html_display_options $html_options \ + -abs_size $abs_size \ + -acs_widget "" \ + -item_answer_alignment $answer_alignment] + } + + set old_item_id [as::item::latest -as_item_id $old_item_id -section_id $new_section_id -default 0] + if {$old_item_id == 0} { + db_dml move_down_items {} + incr after + db_dml insert_new_item {} + } else { + db_dml update_item_display {} + db_1row item_data {} + db_dml update_item {} + } } } -after_submit { # now go to assessment-page Index: openacs-4/packages/assessment/www/admin/item-add-display-ta.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-ta.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-add-display-ta.xql 10 Dec 2004 11:42:23 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-add-display-ta.xql 14 Jan 2005 13:13:37 -0000 1.3 @@ -1,6 +1,18 @@ + + + + select r.target_rev_id, o.object_type + from as_item_rels r, acs_objects o + where r.item_rev_id = :as_item_id + and r.rel_type = 'as_item_display_rel' + and o.object_id = r.target_rev_id + + + + @@ -38,4 +50,39 @@ + + + + update as_item_rels + set target_rev_id = :as_item_display_id + where item_rev_id = :as_item_id + and rel_type = 'as_item_display_rel' + + + + + + + + select required_p, max_time_to_complete, points + from as_items + where as_item_id = :as_item_id + + + + + + + + update as_item_section_map + set as_item_id = :as_item_id, + required_p = :required_p, + max_time_to_complete = :max_time_to_complete, + points = :points + where as_item_id = :old_item_id + and section_id = :new_section_id + + + + Index: openacs-4/packages/assessment/www/admin/item-add-display-tb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-tb.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/item-add-display-tb.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/item-add-display-tb.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -35,28 +35,56 @@ ad_form -name item_add_display_tb -action item-add-display-tb -export { assessment_id section_id after } -form { {as_item_id:key} - {html_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} - {abs_size:text {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} + {html_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {abs_size:text,nospell {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} {answer_alignment:text(select) {label "[_ assessment.Answer_Alignment]"} {options $alignment_types} {help_text "[_ assessment.Answer_Alignment_help]"}} } -edit_request { set html_options "" set abs_size 20 set answer_alignment "besideright" +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { - set as_item_display_id [as::item_display_tb::new \ - -html_display_options $html_options \ - -abs_size $abs_size \ - -item_answer_alignment $answer_alignment] - - as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel - 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] set new_section_id [as::section::new_revision -section_id $section_id] db_dml update_section_in_assessment {} - db_dml move_down_items {} - incr after - db_dml insert_new_item {} + set old_item_id $as_item_id + + if {![db_0or1row item_display {}] || $object_type != "as_item_display_tb"} { + set as_item_display_id [as::item_display_tb::new \ + -html_display_options $html_options \ + -abs_size $abs_size \ + -item_answer_alignment $answer_alignment] + + if {![info exists object_type]} { + # first item display mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel + } else { + # old item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + } + } else { + # old tb item display existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + set as_item_display_id [as::item_display_tb::edit \ + -as_item_display_id $as_item_display_id \ + -html_display_options $html_options \ + -abs_size $abs_size \ + -item_answer_alignment $answer_alignment] + } + + set old_item_id [as::item::latest -as_item_id $old_item_id -section_id $new_section_id -default 0] + if {$old_item_id == 0} { + db_dml move_down_items {} + incr after + db_dml insert_new_item {} + } else { + db_dml update_item_display {} + db_1row item_data {} + db_dml update_item {} + } } } -after_submit { # now go to assessment-page Index: openacs-4/packages/assessment/www/admin/item-add-display-tb.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-display-tb.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-add-display-tb.xql 10 Dec 2004 11:42:23 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-add-display-tb.xql 14 Jan 2005 13:13:37 -0000 1.3 @@ -1,6 +1,18 @@ + + + + select r.target_rev_id, o.object_type + from as_item_rels r, acs_objects o + where r.item_rev_id = :as_item_id + and r.rel_type = 'as_item_display_rel' + and o.object_id = r.target_rev_id + + + + @@ -38,4 +50,39 @@ + + + + update as_item_rels + set target_rev_id = :as_item_display_id + where item_rev_id = :as_item_id + and rel_type = 'as_item_display_rel' + + + + + + + + select required_p, max_time_to_complete, points + from as_items + where as_item_id = :as_item_id + + + + + + + + update as_item_section_map + set as_item_id = :as_item_id, + required_p = :required_p, + max_time_to_complete = :max_time_to_complete, + points = :points + where as_item_id = :old_item_id + and section_id = :new_section_id + + + + Index: openacs-4/packages/assessment/www/admin/item-add-mc-choices.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-mc-choices.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/admin/item-add-mc-choices.tcl 8 Jan 2005 10:51:09 -0000 1.5 +++ openacs-4/packages/assessment/www/admin/item-add-mc-choices.tcl 14 Jan 2005 13:13:37 -0000 1.6 @@ -50,17 +50,17 @@ append ad_form_code "\{infotxt.$choice_id:text(inform) \{label \"[_ assessment.Choice]\"\} \{value \"$title \"\}\}\n" } append ad_form_code "\{selected.$choice_id:text(checkbox),optional \{label \"[_ assessment.Default_Selected]\"\} \{options \$selected_options\} \{help_text \"[_ assessment.Default_Selected_help]\"\}\}\n" - append ad_form_code "\{fixed_pos.$choice_id:text,optional \{label \"[_ assessment.Fixed_Position]\"\} \{html \{size 5 maxlength 5\}\} \{help_text \"[_ assessment.choice_Fixed_Position_help]\"\}\}\n" - append ad_form_code "\{answer_val.$choice_id:text,optional \{label \"[_ assessment.Answer_Value]\"\} \{html \{size 80 maxlength 500\}\} \{help_text \"[_ assessment.Answer_Value_help]\"\}\}\n" + append ad_form_code "\{fixed_pos.$choice_id:text,optional,nospell \{label \"[_ assessment.Fixed_Position]\"\} \{html \{size 5 maxlength 5\}\} \{help_text \"[_ assessment.choice_Fixed_Position_help]\"\}\}\n" + append ad_form_code "\{answer_val.$choice_id:text,optional,nospell \{label \"[_ assessment.Answer_Value]\"\} \{html \{size 80 maxlength 500\}\} \{help_text \"[_ assessment.Answer_Value_help]\"\}\}\n" append ad_form_code "\{content_$choice_id:file,optional \{label \"[_ assessment.choice_Content]\"\} \{help_text \"[_ assessment.choice_Content_help]\"\}\}\n" - append ad_form_code "\{feedback.$choice_id:text(textarea),optional \{label \"[_ assessment.Feedback]\"\} \{html \{rows 8 cols 80\}\} \{help_text \"[_ assessment.choice_Feedback_help]\"\}\}\n" + append ad_form_code "\{feedback.$choice_id:text(textarea),optional,nospell \{label \"[_ assessment.Feedback]\"\} \{html \{rows 8 cols 80\}\} \{help_text \"[_ assessment.choice_Feedback_help]\"\}\}\n" if {$correct_answer_p == "t"} { set default_percent "\$percentage" incr count_correct } else { set default_percent 0 } - append ad_form_code "\{percent.$choice_id:text \{label \"[_ assessment.Percent_Score]\"\} \{value \"$default_percent\"\} \{html \{size 5 maxlength 5\}\} \{help_text \"[_ assessment.Percent_Score_help]\"\}\}\n" + append ad_form_code "\{percent.$choice_id:text,nospell \{label \"[_ assessment.Percent_Score]\"\} \{value \"$default_percent\"\} \{html \{size 5 maxlength 5\}\} \{help_text \"[_ assessment.Percent_Score_help]\"\}\}\n" } append ad_form_code "\}" set percentage [expr 100 / $count_correct] Index: openacs-4/packages/assessment/www/admin/item-add-mc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-mc.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/admin/item-add-mc.tcl 29 Dec 2004 10:19:08 -0000 1.5 +++ openacs-4/packages/assessment/www/admin/item-add-mc.tcl 14 Jan 2005 13:13:37 -0000 1.6 @@ -43,18 +43,18 @@ {title:text {label "[_ assessment.choice_set_title]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.mc_Title_help]"}} {increasing_p:text(select) {label "[_ assessment.Increasing]"} {options $boolean_options} {help_text "[_ assessment.Increasing_help]"}} {negative_p:text(select) {label "[_ assessment.Allow_Negative]"} {options $boolean_options} {help_text "[_ assessment.Allow_Negative_help]"}} - {num_correct_answers:text,optional {label "[_ assessment.num_Correct_Answer]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_Correct_help]"}} - {num_answers:text,optional {label "[_ assessment.num_Answers]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_Answers_help]"}} + {num_correct_answers:text,optional,nospell {label "[_ assessment.num_Correct_Answer]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_Correct_help]"}} + {num_answers:text,optional,nospell {label "[_ assessment.num_Answers]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_Answers_help]"}} {display_type:text(select) {label "[_ assessment.Display_Type]"} {options $display_types} {help_text "[_ assessment.Display_Type_help]"}} } # add form entries for each choice set ad_form_code "-form \{\n" for {set i 1} {$i <= $num_choices} {incr i} { if {[info exists choice($i)]} { - append ad_form_code "\{choice.$i:text,optional \{label \"[_ assessment.Choice] $i\"\} \{html \{size 80 maxlength 1000\}\} \{value \"\$choice($i)\"\} \{help_text \"[_ assessment.Choice_help]\"\}\}\n" + append ad_form_code "\{choice.$i:text,optional,nospell \{label \"[_ assessment.Choice] $i\"\} \{html \{size 80 maxlength 1000\}\} \{value \"\$choice($i)\"\} \{help_text \"[_ assessment.Choice_help]\"\}\}\n" } else { - append ad_form_code "\{choice.$i:text,optional \{label \"[_ assessment.Choice] $i\"\} \{html \{size 80 maxlength 1000\}\} \{help_text \"[_ assessment.Choice_help]\"\}\}\n" + append ad_form_code "\{choice.$i:text,optional,nospell \{label \"[_ assessment.Choice] $i\"\} \{html \{size 80 maxlength 1000\}\} \{help_text \"[_ assessment.Choice_help]\"\}\}\n" } if {[info exists correct($i)]} { append ad_form_code "\{correct.$i:text(checkbox),optional \{label \"[_ assessment.Correct_Answer_Choice] $i\"\} \{options \$correct_options\} \{values t\} \{help_text \"[_ assessment.Correct_Answer_help]\"\}\}\n" @@ -82,29 +82,50 @@ } } -edit_data { db_transaction { - set mc_id [as::item_type_mc::new \ - -title $title \ - -increasing_p $increasing_p \ - -allow_negative_p $negative_p \ - -num_correct_answers $num_correct_answers \ - -num_answers $num_answers] + if {![db_0or1row item_type {}] || $object_type != "as_item_type_mc"} { + set mc_id [as::item_type_mc::new \ + -title $title \ + -increasing_p $increasing_p \ + -allow_negative_p $negative_p \ + -num_correct_answers $num_correct_answers \ + -num_answers $num_answers] + + if {![info exists object_type]} { + # first item type mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $mc_id -type as_item_type_rel + } else { + # old item type existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + db_dml update_item_type {} + } + } else { + # old mc item type existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + set mc_id [as::item_type_mc::edit \ + -as_item_type_id $as_item_type_id \ + -title $title \ + -increasing_p $increasing_p \ + -allow_negative_p $negative_p \ + -num_correct_answers $num_correct_answers \ + -num_answers $num_answers] + + db_dml update_item_type {} + } - as::item_rels::new -item_rev_id $as_item_id -target_rev_id $mc_id -type as_item_type_rel - set count 0 foreach i [lsort -integer [array names choice]] { if {![empty_string_p $choice($i)]} { - incr count - set choice_id [as::item_choice::new -mc_id $mc_id \ - -title "$choice($i)" \ - -numeric_value "" \ - -text_value "" \ - -content_value "" \ - -feedback_text "" \ - -selected_p "" \ - -correct_answer_p "[ad_decode [info exists correct($i)] 0 f t]" \ - -sort_order "$count" \ - -percent_score ""] + incr count + set choice_id [as::item_choice::new -mc_id $mc_id \ + -title "$choice($i)" \ + -numeric_value "" \ + -text_value "" \ + -content_value "" \ + -feedback_text "" \ + -selected_p "" \ + -correct_answer_p "[ad_decode [info exists correct($i)] 0 f t]" \ + -sort_order "$count" \ + -percent_score ""] } } } Index: openacs-4/packages/assessment/www/admin/item-add-mc.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-mc.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/admin/item-add-mc.xql 5 Dec 2004 17:11:59 -0000 1.1 +++ openacs-4/packages/assessment/www/admin/item-add-mc.xql 14 Jan 2005 13:13:37 -0000 1.2 @@ -11,4 +11,27 @@ + + + + select r.target_rev_id, o.object_type + from as_item_rels r, acs_objects o + where r.item_rev_id = :as_item_id + and r.rel_type = 'as_item_type_rel' + and o.object_id = r.target_rev_id + + + + + + + + update as_item_rels + set target_rev_id = :mc_id + where item_rev_id = :as_item_id + and rel_type = 'as_item_type_rel' + + + + Index: openacs-4/packages/assessment/www/admin/item-add-oq.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-oq.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/item-add-oq.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/item-add-oq.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -35,7 +35,7 @@ ad_form -name item_add_oq -action item-add-oq -export { assessment_id section_id after } -form { {as_item_id:key} {title:text {label "[_ assessment.Title]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.oq_Title_help]"}} - {default_value:text(textarea),optional {label "[_ assessment.Default_Value]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Deafult_Value_help]"}} + {default_value:text(textarea),optional,nospell {label "[_ assessment.Default_Value]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Deafult_Value_help]"}} {feedback:text(textarea),optional {label "[_ assessment.Feedback]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Feedback_help]"}} {display_type:text(select) {label "[_ assessment.Display_Type]"} {options $display_types} {help_text "[_ assessment.Display_Type_help]"}} } -edit_request { @@ -45,12 +45,31 @@ set display_type "tb" } -edit_data { db_transaction { - set as_item_type_id [as::item_type_oq::new \ - -title $title \ - -default_value $default_value \ - -feedback_text $feedback] + if {![db_0or1row item_type {}] || $object_type != "as_item_type_oq"} { + set as_item_type_id [as::item_type_oq::new \ + -title $title \ + -default_value $default_value \ + -feedback_text $feedback] - as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_type_id -type as_item_type_rel + if {![info exists object_type]} { + # first item type mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_type_id -type as_item_type_rel + } else { + # old item type existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + db_dml update_item_type {} + } + } else { + # old oq item type existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + set as_item_type_id [as::item_type_oq::edit \ + -as_item_type_id $as_item_type_id \ + -title $title \ + -default_value $default_value \ + -feedback_text $feedback] + + db_dml update_item_type {} + } } } -after_submit { # now go to display-type specific form (i.e. textbox) Index: openacs-4/packages/assessment/www/admin/item-add-oq.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-oq.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/admin/item-add-oq.xql 5 Dec 2004 17:11:59 -0000 1.1 +++ openacs-4/packages/assessment/www/admin/item-add-oq.xql 14 Jan 2005 13:13:37 -0000 1.2 @@ -11,4 +11,27 @@ + + + + select r.target_rev_id, o.object_type + from as_item_rels r, acs_objects o + where r.item_rev_id = :as_item_id + and r.rel_type = 'as_item_type_rel' + and o.object_id = r.target_rev_id + + + + + + + + update as_item_rels + set target_rev_id = :as_item_type_id + where item_rev_id = :as_item_id + and rel_type = 'as_item_type_rel' + + + + Index: openacs-4/packages/assessment/www/admin/item-add-sa.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-sa.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/item-add-sa.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/item-add-sa.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -47,12 +47,31 @@ set display_type "tb" } -edit_data { db_transaction { - set as_item_type_id [as::item_type_sa::new \ - -title $title \ - -increasing_p $increasing_p \ - -allow_negative_p $negative_p] + if {![db_0or1row item_type {}] || $object_type != "as_item_type_sa"} { + set as_item_type_id [as::item_type_sa::new \ + -title $title \ + -increasing_p $increasing_p \ + -allow_negative_p $negative_p] - as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_type_id -type as_item_type_rel + if {![info exists object_type]} { + # first item type mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_type_id -type as_item_type_rel + } else { + # old item type existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + db_dml update_item_type {} + } + } else { + # old sa item type existing + set as_item_id [as::item::new_revision -as_item_id $as_item_id] + set as_item_type_id [as::item_type_sa::edit \ + -as_item_type_id $as_item_type_id \ + -title $title \ + -increasing_p $increasing_p \ + -allow_negative_p $allow_negative_p] + + db_dml update_item_type {} + } } } -after_submit { # now go to display-type specific form (i.e. textbox) Index: openacs-4/packages/assessment/www/admin/item-add-sa.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add-sa.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/admin/item-add-sa.xql 5 Dec 2004 17:11:59 -0000 1.1 +++ openacs-4/packages/assessment/www/admin/item-add-sa.xql 14 Jan 2005 13:13:37 -0000 1.2 @@ -11,4 +11,27 @@ + + + + select r.target_rev_id, o.object_type + from as_item_rels r, acs_objects o + where r.item_rev_id = :as_item_id + and r.rel_type = 'as_item_type_rel' + and o.object_id = r.target_rev_id + + + + + + + + update as_item_rels + set target_rev_id = :as_item_type_id + where item_rev_id = :as_item_id + and rel_type = 'as_item_type_rel' + + + + Index: openacs-4/packages/assessment/www/admin/item-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/assessment/www/admin/item-add.tcl 8 Jan 2005 10:51:09 -0000 1.9 +++ openacs-4/packages/assessment/www/admin/item-add.tcl 14 Jan 2005 13:13:37 -0000 1.10 @@ -41,7 +41,7 @@ ad_form -name item_add -action item-add -export { assessment_id section_id after } -html {enctype multipart/form-data} -form { {as_item_id:key} - {name:text,optional {label "[_ assessment.Name]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.item_Name_help]"}} + {name:text,optional,nospell {label "[_ assessment.Name]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.item_Name_help]"}} {title:text(textarea) {label "[_ assessment.item_Title]"} {html {rows 3 cols 80 maxlength 1000}} {help_text "[_ assessment.item_Title_help]"}} {description:text(textarea),optional {label "[_ assessment.Description]"} {html {rows 5 cols 80}} {help_text "[_ assessment.item_Description_help]"}} } @@ -53,12 +53,12 @@ ad_form -extend -name item_add -form { {content:file,optional {label "[_ assessment.item_Content]"} {help_text "[_ assessment.item_Content_help]"}} {subtext:text,optional {label "[_ assessment.Subtext]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.item_Subtext_help]"}} - {field_code:text,optional {label "[_ assessment.Field_Code]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.Field_Code_help]"}} + {field_code:text,optional,nospell {label "[_ assessment.Field_Code]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.Field_Code_help]"}} {required_p:text(select) {label "[_ assessment.Required]"} {options $boolean_options} {help_text "[_ assessment.item_Required_help]"}} {feedback_right:text(textarea),optional {label "[_ assessment.Feedback_right]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Feedback_right_help]"}} {feedback_wrong:text(textarea),optional {label "[_ assessment.Feedback_wrong]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Feedback_wrong_help]"}} - {max_time_to_complete:integer,optional {label "[_ assessment.time_for_completion]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.item_time_help]"}} - {points:integer,optional {label "[_ assessment.points_item]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_item_help]"}} + {max_time_to_complete:integer,optional,nospell {label "[_ assessment.time_for_completion]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.item_time_help]"}} + {points:integer,optional,nospell {label "[_ assessment.points_item]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_item_help]"}} {data_type:text(select) {label "[_ assessment.Data_Type]"} {options $data_types} {help_text "[_ assessment.Data_Type_help]"}} {item_type:text(select) {label "[_ assessment.Item_Type]"} {options $item_types} {help_text "[_ assessment.Item_Type_help]"}} } -new_request { @@ -75,24 +75,46 @@ set data_type "varchar" set item_type "sa" } -validate { - {name {[as::assessment::unique_name -name $name -new_p 1]} "[_ assessment.name_used]"} + {name {[as::assessment::unique_name -name $name -new_p 1 -item_id $as_item_id]} "[_ assessment.name_used]"} } -on_submit { set category_ids [category::ad_form::get_categories -container_object_id $package_id] } -new_data { db_transaction { - set as_item_id [as::item::new \ - -name $name \ - -title $title \ - -description $description \ - -subtext $subtext \ - -field_code $field_code \ - -required_p $required_p \ - -data_type $data_type \ - -feedback_right $feedback_right \ - -feedback_wrong $feedback_wrong \ - -max_time_to_complete $max_time_to_complete \ - -points $points] + if {![db_0or1row item_exists {}]} { + set as_item_id [as::item::new \ + -item_item_id $as_item_id \ + -name $name \ + -title $title \ + -description $description \ + -subtext $subtext \ + -field_code $field_code \ + -required_p $required_p \ + -data_type $data_type \ + -feedback_right $feedback_right \ + -feedback_wrong $feedback_wrong \ + -max_time_to_complete $max_time_to_complete \ + -points $points] + } else { + set as_item_id [as::item::edit \ + -as_item_id $as_item_id \ + -title $title \ + -description $description \ + -subtext $subtext \ + -field_code $field_code \ + -required_p $required_p \ + -data_type $data_type \ + -feedback_right $feedback_right \ + -feedback_wrong $feedback_wrong \ + -max_time_to_complete $max_time_to_complete \ + -points $points] + db_dml delete_files {} + + if {![empty_string_p $name]} { + db_dml update_name {} + } + } + if {[exists_and_not_null category_ids]} { category::map_object -object_id $as_item_id $category_ids } Index: openacs-4/packages/assessment/www/admin/item-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-add.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/admin/item-add.xql 5 Dec 2004 17:11:59 -0000 1.1 +++ openacs-4/packages/assessment/www/admin/item-add.xql 14 Jan 2005 13:13:37 -0000 1.2 @@ -10,4 +10,34 @@ + + + + select latest_revision as as_item_id + from cr_items + where item_id = :as_item_id + + + + + + + + update cr_items + set name = :name + where latest_revision = :as_item_id + + + + + + + + delete from as_item_rels + where item_rev_id = :as_item_id + and rel_type = 'as_item_content_rel' + + + + Index: openacs-4/packages/assessment/www/admin/item-copy.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-copy.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/item-copy.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/item-copy.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -41,7 +41,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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] set new_item_id [as::item::copy -as_item_id $as_item_id -name $name] db_dml update_section_in_assessment {} Index: openacs-4/packages/assessment/www/admin/item-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-delete.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-delete.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-delete.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -36,8 +36,10 @@ 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_1row get_sort_order_to_be_removed {} Index: openacs-4/packages/assessment/www/admin/item-edit-display-cb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-display-cb.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-edit-display-cb.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-edit-display-cb.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -48,7 +48,7 @@ ad_form -name item_edit_display_cb -action item-edit-display-cb -export { assessment_id section_id } -form { {as_item_id:key} - {html_display_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {html_display_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} {choice_orientation:text(select) {label "[_ assessment.Choice_Orientation]"} {options $choice_or_types} {help_text "[_ assessment.Choice_Orientation_help]"}} {choice_label_orientation:text(select) {label "[_ assessment.Label_Orientation]"} {options $label_or_types} {help_text "[_ assessment.Label_Orientation_help]"}} {sort_order_type:text(select) {label "[_ assessment.Order_Type]"} {options $order_types} {help_text "[_ assessment.Order_Type_help]"}} @@ -67,6 +67,8 @@ set item_answer_alignment "besideright" set as_item_display_id 0 } +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { set new_item_id [as::item::new_revision -as_item_id $as_item_id] @@ -91,7 +93,9 @@ } 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_dml update_item_in_section {} db_dml update_display_of_item {} Index: openacs-4/packages/assessment/www/admin/item-edit-display-rb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-display-rb.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-edit-display-rb.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-edit-display-rb.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -48,7 +48,7 @@ ad_form -name item_edit_display_rb -action item-edit-display-rb -export { assessment_id section_id } -form { {as_item_id:key} - {html_display_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {html_display_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} {choice_orientation:text(select) {label "[_ assessment.Choice_Orientation]"} {options $choice_or_types} {help_text "[_ assessment.Choice_Orientation_help]"}} {choice_label_orientation:text(select) {label "[_ assessment.Label_Orientation]"} {options $label_or_types} {help_text "[_ assessment.Label_Orientation_help]"}} {sort_order_type:text(select) {label "[_ assessment.Order_Type]"} {options $order_types} {help_text "[_ assessment.Order_Type_help]"}} @@ -67,6 +67,8 @@ set item_answer_alignment "besideright" set as_item_display_id 0 } +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { set new_item_id [as::item::new_revision -as_item_id $as_item_id] @@ -91,7 +93,9 @@ } 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_dml update_item_in_section {} db_dml update_display_of_item {} Index: openacs-4/packages/assessment/www/admin/item-edit-display-sa.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-display-sa.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-edit-display-sa.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-edit-display-sa.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -33,8 +33,8 @@ ad_form -name item_edit_display_sa -action item-edit-display-sa -export { assessment_id section_id } -form { {as_item_id:key} - {html_display_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} - {abs_size:text {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} + {html_display_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {abs_size:text,nospell {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} {box_orientation:text(select) {label "[_ assessment.Box_Orientation]"} {options $orientation_types} {help_text "[_ assessment.Box_Orientation_help]"}} {as_item_display_id:text(hidden)} } -edit_request { @@ -48,6 +48,8 @@ set box_orientation "vertical" set as_item_display_id 0 } +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { set new_item_id [as::item::new_revision -as_item_id $as_item_id] @@ -68,7 +70,9 @@ } 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_dml update_item_in_section {} db_dml update_display_of_item {} Index: openacs-4/packages/assessment/www/admin/item-edit-display-sb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-display-sb.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-edit-display-sb.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-edit-display-sb.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -45,7 +45,7 @@ ad_form -name item_edit_display_sb -action item-edit-display-sb -export { assessment_id section_id } -form { {as_item_id:key} - {html_display_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {html_display_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} {multiple_p:text(select) {label "[_ assessment.Multiple]"} {options $boolean_options} {help_text "[_ assessment.Multiple_help]"}} {choice_label_orientation:text(select) {label "[_ assessment.Label_Orientation]"} {options $label_or_types} {help_text "[_ assessment.Label_Orientation_help]"}} {sort_order_type:text(select) {label "[_ assessment.Order_Type]"} {options $order_types} {help_text "[_ assessment.Order_Type_help]"}} @@ -64,6 +64,8 @@ set item_answer_alignment "besideright" set as_item_display_id 0 } +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { set new_item_id [as::item::new_revision -as_item_id $as_item_id] @@ -88,7 +90,9 @@ } 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_dml update_item_in_section {} db_dml update_display_of_item {} Index: openacs-4/packages/assessment/www/admin/item-edit-display-ta.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-display-ta.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-edit-display-ta.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-edit-display-ta.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -33,8 +33,8 @@ ad_form -name item_edit_display_ta -action item-edit-display-ta -export { assessment_id section_id } -form { {as_item_id:key} - {html_display_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} - {abs_size:text {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} + {html_display_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {abs_size:text,nospell {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} {item_answer_alignment:text(select) {label "[_ assessment.Answer_Alignment]"} {options $alignment_types} {help_text "[_ assessment.Answer_Alignment_help]"}} {as_item_display_id:text(hidden)} } -edit_request { @@ -48,6 +48,8 @@ set item_answer_alignment "besideright" set as_item_display_id 0 } +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { set new_item_id [as::item::new_revision -as_item_id $as_item_id] @@ -70,7 +72,9 @@ } 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_dml update_item_in_section {} db_dml update_display_of_item {} Index: openacs-4/packages/assessment/www/admin/item-edit-display-tb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-display-tb.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-edit-display-tb.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-edit-display-tb.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -33,8 +33,8 @@ ad_form -name item_edit_display_tb -action item-edit-display-tb -export { assessment_id section_id } -form { {as_item_id:key} - {html_display_options:text,optional {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} - {abs_size:text {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} + {html_display_options:text,optional,nospell {label "[_ assessment.Html_Options]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Html_Options_help]"}} + {abs_size:text,nospell {label "[_ assessment.Absolute_Size]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.Absolute_Size_help]"}} {item_answer_alignment:text(select) {label "[_ assessment.Answer_Alignment]"} {options $alignment_types} {help_text "[_ assessment.Answer_Alignment_help]"}} {as_item_display_id:text(hidden)} } -edit_request { @@ -48,6 +48,8 @@ set item_answer_alignment "besideright" set as_item_display_id 0 } +} -validate { + {html_options {[as::assessment::check_html_options -options $html_options]} "[_ assessment.error_html_options]"} } -edit_data { db_transaction { set new_item_id [as::item::new_revision -as_item_id $as_item_id] @@ -68,7 +70,9 @@ } 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_dml update_item_in_section {} db_dml update_display_of_item {} Index: openacs-4/packages/assessment/www/admin/item-edit-general.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-general.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/www/admin/item-edit-general.tcl 8 Jan 2005 10:51:09 -0000 1.6 +++ openacs-4/packages/assessment/www/admin/item-edit-general.tcl 14 Jan 2005 13:13:37 -0000 1.7 @@ -37,7 +37,7 @@ ad_form -name item_edit_general -action item-edit-general -export { assessment_id section_id } -html {enctype multipart/form-data} -form { {as_item_id:key} - {name:text(inform) {label "[_ assessment.Name]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.item_Name_help]"}} + {name:text(inform),nospell {label "[_ assessment.Name]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.item_Name_help]"}} {title:text {label "[_ assessment.Title]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.item_Title_help]"}} {description:text(textarea),optional {label "[_ assessment.Description]"} {html {rows 5 cols 80}} {help_text "[_ assessment.item_Description_help]"}} } @@ -55,12 +55,12 @@ ad_form -extend -name item_edit_general -form { {content:file,optional {label "[_ assessment.item_Content]"} {help_text "[_ assessment.item_Content_help]"}} {subtext:text,optional {label "[_ assessment.Subtext]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.item_Subtext_help]"}} - {field_code:text,optional {label "[_ assessment.Field_Code]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.Field_Code_help]"}} + {field_code:text,optional,nospell {label "[_ assessment.Field_Code]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.Field_Code_help]"}} {required_p:text(select) {label "[_ assessment.Required]"} {options $boolean_options} {help_text "[_ assessment.item_Required_help]"}} {feedback_right:text(textarea),optional {label "[_ assessment.Feedback_right]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Feedback_right_help]"}} {feedback_wrong:text(textarea),optional {label "[_ assessment.Feedback_wrong]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Feedback_wrong_help]"}} - {max_time_to_complete:integer,optional {label "[_ assessment.time_for_completion]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.item_time_help]"}} - {points:integer,optional {label "[_ assessment.points_item]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_item_help]"}} + {max_time_to_complete:integer,optional,nospell {label "[_ assessment.time_for_completion]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.item_time_help]"}} + {points:integer,optional,nospell {label "[_ assessment.points_item]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_item_help]"}} {data_type_disp:text(inform) {label "[_ assessment.Data_Type]"} {help_text "[_ assessment.Data_Type_help]"}} {data_type:text(hidden)} {display_type:text(select) {label "[_ assessment.Display_Type]"} {options $display_types} {help_text "[_ assessment.Display_Type_help]"}} @@ -119,7 +119,9 @@ } 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_dml update_item_in_section {} } Index: openacs-4/packages/assessment/www/admin/item-edit-mc-choices.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-mc-choices.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/admin/item-edit-mc-choices.tcl 8 Jan 2005 10:51:09 -0000 1.4 +++ openacs-4/packages/assessment/www/admin/item-edit-mc-choices.tcl 14 Jan 2005 13:13:37 -0000 1.5 @@ -55,21 +55,21 @@ } else { append ad_form_code "\{selected.$choice_id:text(checkbox),optional \{label \"[_ assessment.Default_Selected]\"\} \{options \$selected_options\} \{help_text \"[_ assessment.Default_Selected_help]\"\}\}\n" } - append ad_form_code "\{fixed_pos.$choice_id:text,optional \{label \"[_ assessment.Fixed_Position]\"\} \{html \{size 5 maxlength 5\}\} \{value \"$fixed_position\"\} \{help_text \"[_ assessment.choice_Fixed_Position_help]\"\}\}\n" - append ad_form_code "\{answer_val.$choice_id:text,optional \{label \"[_ assessment.Answer_Value]\"\} \{html \{size 80 maxlength 500\}\} \{value \"$answer_value\"\} \{help_text \"[_ assessment.Answer_Value_help]\"\}\}\n" + append ad_form_code "\{fixed_pos.$choice_id:text,optional,nospell \{label \"[_ assessment.Fixed_Position]\"\} \{html \{size 5 maxlength 5\}\} \{value \"$fixed_position\"\} \{help_text \"[_ assessment.choice_Fixed_Position_help]\"\}\}\n" + append ad_form_code "\{answer_val.$choice_id:text,optional,nospell \{label \"[_ assessment.Answer_Value]\"\} \{html \{size 80 maxlength 500\}\} \{value \"$answer_value\"\} \{help_text \"[_ assessment.Answer_Value_help]\"\}\}\n" if {![empty_string_p $content_rev_id]} { append ad_form_code "\{delete_content.$choice_id:text(checkbox),optional \{label \"[_ assessment.choice_Delete_Content]\"\} \{options \{\{\{$content_name\} t\}\} \}\}\n" } append ad_form_code "\{content_$choice_id:file,optional \{label \"[_ assessment.choice_Content]\"\} \{help_text \"[_ assessment.choice_Content_help]\"\}\}\n" - append ad_form_code "\{feedback.$choice_id:text(textarea),optional \{label \"[_ assessment.Feedback]\"\} \{html \{rows 8 cols 80\}\} \{value \{$feedback_text\}\} \{help_text \"[_ assessment.choice_Feedback_help]\"\}\}\n" + append ad_form_code "\{feedback.$choice_id:text(textarea),optional,nospell \{label \"[_ assessment.Feedback]\"\} \{html \{rows 8 cols 80\}\} \{value \{$feedback_text\}\} \{help_text \"[_ assessment.choice_Feedback_help]\"\}\}\n" if {$correct_answer_p == "t"} { set default_percent "\$percentage" incr count_correct } else { set default_percent $percent_score } - append ad_form_code "\{percent.$choice_id:text \{label \"[_ assessment.Percent_Score]\"\} \{value \"$default_percent\"\} \{html \{size 5 maxlength 5\}\} \{help_text \"[_ assessment.Percent_Score_help]\"\}\}\n" + append ad_form_code "\{percent.$choice_id:text,nospell \{label \"[_ assessment.Percent_Score]\"\} \{value \"$default_percent\"\} \{html \{size 5 maxlength 5\}\} \{help_text \"[_ assessment.Percent_Score_help]\"\}\}\n" } append ad_form_code "\}" set percentage [expr 100 / $count_correct] Index: openacs-4/packages/assessment/www/admin/item-edit-mc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-mc.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/item-edit-mc.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/item-edit-mc.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -37,8 +37,8 @@ {title:text {label "[_ assessment.Title]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.mc_Title_help]"}} {increasing_p:text(select) {label "[_ assessment.Increasing]"} {options $boolean_options} {help_text "[_ assessment.Increasing_help]"}} {negative_p:text(select) {label "[_ assessment.Allow_Negative]"} {options $boolean_options} {help_text "[_ assessment.Allow_Negative_help]"}} - {num_correct_answers:text,optional {label "[_ assessment.num_Correct_Answer]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_Correct_help]"}} - {num_answers:text,optional {label "[_ assessment.num_Answers]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_Answers_help]"}} + {num_correct_answers:text,optional,nospell {label "[_ assessment.num_Correct_Answer]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_Correct_help]"}} + {num_answers:text,optional,nospell {label "[_ assessment.num_Answers]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_Answers_help]"}} } # add form entries for existing choices @@ -55,7 +55,7 @@ set correct($choice_id) t } } - append ad_form_code "\{choice.$choice_id:text,optional \{label \"[_ assessment.Choice] $count\"\} \{html \{size 80 maxlength 1000\}\} \{value \"\$choice($choice_id)\"\} \{help_text \"[_ assessment.Choice_help]\"\}\}\n" + append ad_form_code "\{choice.$choice_id:text,optional,nospell \{label \"[_ assessment.Choice] $count\"\} \{html \{size 80 maxlength 1000\}\} \{value \"\$choice($choice_id)\"\} \{help_text \"[_ assessment.Choice_help]\"\}\}\n" if {[info exists correct($choice_id)]} { append ad_form_code "\{correct.$choice_id:text(checkbox),optional \{label \"[_ assessment.Correct_Answer_Choice] $count\"\} \{options \$correct_options\} \{values t\} \{help_text \"[_ assessment.Correct_Answer_help]\"\}\}\n" @@ -68,9 +68,9 @@ for {set i 1} {$i <= $num_choices} {incr i} { incr count if {[info exists choice(-$i)]} { - append ad_form_code "\{choice.-$i:text,optional \{label \"[_ assessment.Choice] $count\"\} \{html \{size 80 maxlength 1000\}\} \{value \"\$choice(-$i)\"\} \{help_text \"[_ assessment.Choice_help]\"\}\}\n" + append ad_form_code "\{choice.-$i:text,optional,nospell \{label \"[_ assessment.Choice] $count\"\} \{html \{size 80 maxlength 1000\}\} \{value \"\$choice(-$i)\"\} \{help_text \"[_ assessment.Choice_help]\"\}\}\n" } else { - append ad_form_code "\{choice.-$i:text,optional \{label \"[_ assessment.Choice] $count\"\} \{html \{size 80 maxlength 1000\}\} \{help_text \"[_ assessment.Choice_help]\"\}\}\n" + append ad_form_code "\{choice.-$i:text,optional,nospell \{label \"[_ assessment.Choice] $count\"\} \{html \{size 80 maxlength 1000\}\} \{help_text \"[_ assessment.Choice_help]\"\}\}\n" } if {[info exists correct(-$i)]} { append ad_form_code "\{correct.-$i:text(checkbox),optional \{label \"[_ assessment.Correct_Answer_Choice] $count\"\} \{options \$correct_options\} \{values t\} \{help_text \"[_ assessment.Correct_Answer_help]\"\}\}\n" @@ -104,7 +104,9 @@ -num_answers $num_answers] 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_dml update_item_in_section {} db_dml update_item_type {} Index: openacs-4/packages/assessment/www/admin/item-edit-oq.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-oq.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-edit-oq.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-edit-oq.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -29,7 +29,7 @@ ad_form -name item_edit_oq -action item-edit-oq -export { assessment_id section_id } -form { {as_item_id:key} {title:text {label "[_ assessment.Title]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.oq_Title_help]"}} - {default_value:text(textarea),optional {label "[_ assessment.Default_Value]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Deafult_Value_help]"}} + {default_value:text(textarea),optional,nospell {label "[_ assessment.Default_Value]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Deafult_Value_help]"}} {feedback_text:text(textarea),optional {label "[_ assessment.Feedback]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Feedback_help]"}} } -edit_request { db_1row item_type_data {} @@ -44,7 +44,9 @@ -feedback_text $feedback_text] 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_dml update_item_in_section {} db_dml update_item_type {} Index: openacs-4/packages/assessment/www/admin/item-edit-sa.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-edit-sa.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/item-edit-sa.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/item-edit-sa.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -46,7 +46,9 @@ -allow_negative_p $allow_negative_p] 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] set new_section_id [as::section::new_revision -section_id $section_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] db_dml update_section_in_assessment {} db_dml update_item_in_section {} db_dml update_item_type {} Index: openacs-4/packages/assessment/www/admin/section-copy.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/section-copy.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/section-copy.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/section-copy.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -40,6 +40,7 @@ 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] set new_section_id [as::section::copy -section_id $section_id -name $name] db_dml move_down_sections {} Index: openacs-4/packages/assessment/www/admin/section-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/section-delete.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/admin/section-delete.tcl 29 Dec 2004 09:07:39 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/section-delete.tcl 14 Jan 2005 13:13:37 -0000 1.4 @@ -36,6 +36,7 @@ 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] db_1row get_sort_order_to_be_removed {} db_dml remove_section_from_assessment {} Index: openacs-4/packages/assessment/www/admin/section-display-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/section-display-form.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/section-display-form.tcl 29 Dec 2004 09:07:39 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/section-display-form.tcl 14 Jan 2005 13:13:37 -0000 1.3 @@ -43,8 +43,8 @@ {display_type_id:key} {title:text {label "[_ assessment.Title]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.sect_disp_Title_help]"}} {description:text(textarea) {label "[_ assessment.Description]"} {html {rows 5 cols 80}} {help_text "[_ assessment.sect_disp_Description_help]"}} - {num_items:integer,optional {label "[_ assessment.section_num_Items]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.sect_num_items_help]"}} - {adp_chunk:text(textarea),optional {label "[_ assessment.Section_Template]"} {html {rows 5 cols 80}} {help_text "[_ assessment.section_template_help]"}} + {num_items:integer,optional,nospell {label "[_ assessment.section_num_Items]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.sect_num_items_help]"}} + {adp_chunk:text(textarea),optional,nospell {label "[_ assessment.Section_Template]"} {html {rows 5 cols 80}} {help_text "[_ assessment.section_template_help]"}} {branched_p:text(select) {label "[_ assessment.section_Branched]"} {options $boolean_options} {help_text "[_ assessment.section_branched_help]"}} {back_button_p:text(select) {label "[_ assessment.Back_Button]"} {options $boolean_options} {help_text "[_ assessment.back_button_help]"}} {submit_answer_p:text(select) {label "[_ assessment.Submit_Answer]"} {options $boolean_options} {help_text "[_ assessment.submit_answer_help]"}} @@ -60,6 +60,8 @@ set sort_order_type order_of_entry } -edit_request { db_1row section_display_data {} +} -on_submit { + set section_id [as::section::latest -section_id $section_id -assessment_rev_id $assessment_data(assessment_rev_id)] } -new_data { db_transaction { set display_id [as::section_display::new \ Index: openacs-4/packages/assessment/www/admin/section-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/section-form.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/admin/section-form.tcl 7 Jan 2005 16:10:45 -0000 1.7 +++ openacs-4/packages/assessment/www/admin/section-form.tcl 14 Jan 2005 13:13:37 -0000 1.8 @@ -48,7 +48,7 @@ } } else { ad_form -extend -name section_form -form { - {name:text,optional {label "[_ assessment.Name]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.section_Name_help]"}} + {name:text,optional,nospell {label "[_ assessment.Name]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.section_Name_help]"}} } } @@ -64,9 +64,9 @@ ad_form -extend -name section_form -form { {instructions:text(textarea),optional {label "[_ assessment.Instructions]"} {html {rows 5 cols 80}} {help_text "[_ assessment.section_Instructions_help]"}} {feedback_text:text(textarea),optional {label "[_ assessment.Feedback]"} {html {rows 5 cols 80}} {help_text "[_ assessment.section_Feedback_help]"}} - {max_time_to_complete:integer,optional {label "[_ assessment.time_for_completion]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.section_time_help]"}} - {num_items:integer,optional {label "[_ assessment.num_items]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_items_help]"}} - {points:integer,optional {label "[_ assessment.points_section]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_item_help]"}} + {max_time_to_complete:integer,optional,nospell {label "[_ assessment.time_for_completion]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.section_time_help]"}} + {num_items:integer,optional,nospell {label "[_ assessment.num_items]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_items_help]"}} + {points:integer,optional,nospell {label "[_ assessment.points_section]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_item_help]"}} {display_type_id:text(select),optional {label "[_ assessment.Display_Type]"} {options $display_types} {help_text "[_ assessment.section_Display_Type_help]"}} } -new_request { set name "" @@ -110,6 +110,7 @@ } -edit_data { 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] set new_section_id [as::section::edit \ -section_id $section_id \