Index: openacs-4/packages/assessment/www/admin/export/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/export/Attic/index.vuh,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/admin/export/index.vuh 16 Dec 2004 09:27:18 -0000 1.2 +++ openacs-4/packages/assessment/www/admin/export/index.vuh 22 Dec 2004 11:15:23 -0000 1.3 @@ -108,28 +108,27 @@ $selection_ordering appendChild $order db_foreach query_all_items {} { - set as_item_display_cbx__item_id {} - unset as_item_display_cbx__item_id - set as_item_display_rbx__item_id {} - unset as_item_display_rbx__item_id - set as_item_display_tbx__item_id {} - unset as_item_display_tbx__item_id - set as_item_display_tax__item_id {} - unset as_item_display_tax__item_id - set item_item_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_id"] - set item_mc_id [db_string item_item_type "SELECT related_object_id FROM cr_item_rels WHERE relation_tag = 'as_item_type_rel' AND item_id=:item_item_id"] - set mc_id [db_string item_to_rev "SELECT revision_id FROM cr_revisions WHERE item_id=:item_mc_id"] - set item_display_id [db_string item_item_type "SELECT related_object_id FROM cr_item_rels WHERE relation_tag = 'as_item_display_rel' AND item_id=:item_item_id"] - set items_as_item_id [db_string items_items_as_item_id "SELECT as_itemsx.as_item_id FROM as_itemsx WHERE as_itemsx.item_id = :item_item_id"] - #checkbox - db_0or1row as_item_display_cbx "SELECT item_id AS as_item_display_cbx__item_id FROM as_item_display_cbx WHERE item_id=:item_display_id" + #reset variables + set cb__display_id {} + unset cb__display_id + set rb__display_id {} + unset rb__display_id + set tb__display_id {} + unset tb__display_id + set ta__display_id {} + unset ta__display_id + set mc_id [as::item_rels::get_target -item_rev_id $as_item_id -type as_item_type_rel] + set item_display_id [as::item_rels::get_target -item_rev_id $as_item_id -type as_item_display_rel] + set items_as_item_id [db_string items_items_as_item_id "SELECT item_id FROM cr_revisions WHERE revision_id = :as_item_id"] + #checkbox + db_0or1row as_item_display_cbx "SELECT as_item_display_id AS cb__display_id FROM as_item_display_cb WHERE as_item_display_id=:item_display_id" #radiobutton - db_0or1row as_item_display_rbx "SELECT item_id AS as_item_display_rbx__item_id FROM as_item_display_rbx WHERE item_id=:item_display_id" + db_0or1row as_item_display_rbx "SELECT as_item_display_id AS rb__display_id FROM as_item_display_rb WHERE as_item_display_id=:item_display_id" #textbox (fill-in-the-blank) - db_0or1row as_item_display_tbx "SELECT item_id AS as_item_display_tbx__item_id FROM as_item_display_tbx WHERE item_id=:item_display_id" + db_0or1row as_item_display_tbx "SELECT as_item_display_id AS tb__display_id FROM as_item_display_tb WHERE as_item_display_id=:item_display_id" #textarea (short answer) - db_0or1row as_item_display_tax "SELECT item_id AS as_item_display_tax__item_id FROM as_item_display_tax WHERE item_id=:item_display_id" - + db_0or1row as_item_display_tax "SELECT as_item_display_id AS ta__display_id FROM as_item_display_ta WHERE as_item_display_id=:item_display_id" + # set item [$doc createElement item] $item setAttribute ident $item_name @@ -155,7 +154,7 @@ set flow [$doc createElement flow] $presentation appendChild $flow - if {![info exists as_item_display_tbx__item_id]} { + if {![info exists tb__display_id]} { # set material [$doc createElement material] $flow appendChild $material @@ -168,8 +167,8 @@ #find out the item type (multiple choice or multiple response) - if {[info exists as_item_display_cbx__item_id] || [info exists as_item_display_rbx__item_id]} { - if {[info exists as_item_display_cbx__item_id]} { + if {[info exists cb__display_id] || [info exists rb__display_id]} { + if {[info exists cb__display_id]} { # checkbox set rcardinality "Multiple" } else { @@ -205,15 +204,15 @@ } } else { #short answer - if {[info exists as_item_display_tax__item_id]} { + if {[info exists ta__display_id]} { # set response_str [$doc createElement response_str] $response_str setAttribute ident $item_name $response_str setAttribute rcardinality "Single" $response_str setAttribute rtiming "No" $flow appendChild $response_str #get rows and cols for painting a textarea (in abs_size is stored as "rows value cols value", we need to add the symbol =) - db_0or1row html_rows_cols "SELECT html_display_options FROM as_item_display_tax WHERE item_id=:item_display_id" + db_0or1row html_rows_cols "SELECT html_display_options FROM as_item_display_ta WHERE as_item_display_id=:item_display_id" set rows "[lindex $html_display_options 1]" set columns "[lindex $html_display_options 3]" # @@ -268,7 +267,7 @@ } } - if { $assessment_data(survey_p) == "f" && ![info exists as_item_display_tax__item_id] } { + if { $assessment_data(survey_p) == "f" && ![info exists ta__display_id] } { # set resprocessing [$doc createElement resprocessing] $item appendChild $resprocessing @@ -280,7 +279,7 @@ $respcondition appendChild $conditionvar #fill-in-blank - if {[info exists as_item_display_tbx__item_id]} { + if {[info exists tb__display_id]} { set i 0 db_foreach query_all_choices {} { # @@ -351,7 +350,7 @@ $respcondition appendChild $conditionvar #fill-in-blank - if {[info exists as_item_display_tbx__item_id]} { + if {[info exists tb__display_id]} { set i 0 # set not [$doc createElement not] @@ -420,12 +419,12 @@ db_foreach query_all_choices {} { set i 0 - # [info exists as_item_display_tbx__item_id] because for fib item choice_correct_answer_p is null - if { $choice_correct_answer_p == "t" || [info exists as_item_display_tbx__item_id] } { + # [info exists tb__display_id] because for fib item choice_correct_answer_p is null + if { $choice_correct_answer_p == "t" || [info exists tb__display_id] } { set list_choice_title $choice_title set length_list_choice_title [llength $list_choice_title] - if {![info exists as_item_display_tbx__item_id]} { + if {![info exists tb__display_id]} { set length_list_choice_title 1 } @@ -439,13 +438,13 @@ $respcondition appendChild $conditionvar # set varequal [$doc createElement varequal] - if {[info exists as_item_display_tbx__item_id]} { + if {[info exists tb__display_id]} { $varequal setAttribute respident $item_name$i } else { $varequal setAttribute respident $item_name } $conditionvar appendChild $varequal - if {[info exists as_item_display_tbx__item_id]} { + if {[info exists tb__display_id]} { set text [$doc createCDATASection [lindex $list_choice_title $j]] } else { set text [$doc createCDATASection $choice_name] Index: openacs-4/packages/assessment/www/admin/export/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/export/Attic/index.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/admin/export/index.xql 3 Dec 2004 10:24:23 -0000 1.1 +++ openacs-4/packages/assessment/www/admin/export/index.xql 22 Dec 2004 11:15:23 -0000 1.2 @@ -3,7 +3,7 @@ - SELECT s.section_id, s.name as section_name, s.title as section_title, s.description as section_description, s.definition as section_definition, s.instructions as section_instructions, s.required_p as section_required_p, s.content_value as section_content_value, s.numeric_value as section_numeric_value, s.feedback_text as section_feedback_text, s.max_time_to_complete as section_max_time_to_complete + SELECT s.section_id, s.name as section_name, s.title as section_title, s.description as section_description, s.instructions as section_instructions, s.feedback_text as section_feedback_text, s.max_time_to_complete as section_max_time_to_complete FROM as_sectionsx s, as_assessment_section_map asm, as_assessmentsx a WHERE s.section_id = asm.section_id AND asm.assessment_id = a.assessment_id @@ -14,7 +14,7 @@ - SELECT i.as_item_id, i.title as item_title, i.name as item_name, i.description as item_description, i.subtext as item_subtext, i.field_code as item_field_code, i.definition as item_definition, i.required_p as item_required_p, i.data_type as item_data_type, i.max_time_to_complete as item_max_time_to_complete, i.feedback_right as item_feedback_right, i.feedback_wrong as item_feedback_wrong + SELECT i.as_item_id, i.title as item_title, i.name as item_name, i.description as item_description, i.subtext as item_subtext, i.field_code as item_field_code, i.required_p as item_required_p, i.data_type as item_data_type, i.max_time_to_complete as item_max_time_to_complete, i.feedback_right as item_feedback_right, i.feedback_wrong as item_feedback_wrong FROM as_itemsx i, as_item_section_map ism WHERE i.as_item_id = ism.as_item_id AND ism.section_id = :section_id ORDER BY ism.sort_order