Index: openacs-4/packages/assessment/tcl/as-qti-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-qti-procs.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/assessment/tcl/as-qti-procs.tcl 1 Feb 2005 20:06:06 -0000 1.22 +++ openacs-4/packages/assessment/tcl/as-qti-procs.tcl 10 Feb 2005 09:52:37 -0000 1.23 @@ -104,11 +104,18 @@ # Insert section in the CR (and in the as_sections table) getting the revision_id (section_id) set as_sections__section_id [as::section::new -title $as_sections__title -description $as_sections__definition] + set as_sections__points "" + # Relation between as_sections and as_assessments db_dml as_assessment_section_map_insert {} incr as_assessment_section_map__sort_order # Process the items as::qti::parse_item $section $as_sections__section_id [file dirname $xmlfile] + + #get points from a section + db_0or1row get_section_points {} + #update as_assessment_section_map with section points + db_dml update_as_assessment_section_map {} } } } else { @@ -293,7 +300,7 @@ set as_item_type_id [as::item_type_mc::new] # Insert as_item - set as_item_id [as::item::new -title $as_items__title -feedback_right $as_items__feedback_right -feedback_wrong $as_items__feedback_wrong] + set as_item_id [as::item::new -title $as_items__title -feedback_right $as_items__feedback_right -feedback_wrong $as_items__feedback_wrong -points $as_items__points] # set the relation between as_items and as_item_type tables as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_type_id -type as_item_type_rel Index: openacs-4/packages/assessment/tcl/as-qti-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-qti-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/tcl/as-qti-procs.xql 26 Nov 2004 20:48:37 -0000 1.1 +++ openacs-4/packages/assessment/tcl/as-qti-procs.xql 10 Feb 2005 09:52:37 -0000 1.2 @@ -3,16 +3,32 @@ - INSERT INTO as_assessment_section_map (assessment_id, section_id, sort_order) - VALUES (:as_assessments__assessment_id, :as_sections__section_id, :as_assessment_section_map__sort_order) + INSERT INTO as_assessment_section_map (assessment_id, section_id, sort_order, points) + VALUES (:as_assessments__assessment_id, :as_sections__section_id, :as_assessment_section_map__sort_order, :as_sections__points) - INSERT INTO as_item_section_map (as_item_id, section_id, sort_order) - VALUES (:as_item_id, :section_id, :as_item_section_map__sort_order) + INSERT INTO as_item_section_map (as_item_id, section_id, sort_order, points) + VALUES (:as_item_id, :section_id, :as_item_section_map__sort_order, :as_items__points) + + + + select sum(aism.points) as as_sections__points + from as_item_section_map aism, as_assessment_section_map aasm + where aism.section_id = aasm.section_id and aasm.section_id = :as_sections__section_id + + + + + + update as_assessment_section_map + set points = :as_sections__points + where section_id = :as_sections__section_id + +