Index: openacs-4/packages/assessment/tcl/test/as-assessment-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/test/as-assessment-procs.tcl,v diff -u -N -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/assessment/tcl/test/as-assessment-procs.tcl 10 May 2006 14:39:08 -0000 1.1.2.2 +++ openacs-4/packages/assessment/tcl/test/as-assessment-procs.tcl 17 May 2006 15:53:56 -0000 1.1.2.3 @@ -38,14 +38,51 @@ -node_name $node_name \ -package_key assessment] aa_log "Package_id = '${package_id}'" - + # now try to create an empty assessment + set instructions "These are the instructions" set assessment_id \ [as::assessment::new \ -package_id $package_id \ -title "Test Assessment" \ - -instructions "These are the instructions"] + -instructions $instructions \ + -consent_page "This is the consent page"] + + aa_true "Instructions set for section" \ + [expr { + $instructions eq \ + [db_string get_instructions \ + "select instructions + from as_assessments + where assessment_id=:assessment_id"]}] + set section_id \ + [as::section::new \ + -package_id $package_id \ + -title "Test Title" \ + -instructions $instructions] +db_dml add_section_to_assessment "insert into as_assessment_section_map (assessment_id, section_id) + values (:assessment_id, :section_id)" + aa_true "Instructions set for section" \ + [expr { + $instructions eq \ + [db_string get_instructions \ + "select instructions + from as_sections + where section_id=:section_id"]}] + + as::assessment::edit \ + -assessment_id [content::revision::item_id -revision_id $assessment_id] \ + -title "Test Assessment" \ + -instructions $instructions \ + -consent_page "This is the consent_page" + + as::section::edit \ + -section_id $section_id \ + -title "Test Title" \ + -instructions $instructions \ + -assessment_id [content::revision::item_id -revision_id $assessment_id] + } } \ No newline at end of file