Index: openacs-4/packages/assessment/assessment.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/assessment.info,v diff -u -r1.15 -r1.16 --- openacs-4/packages/assessment/assessment.info 7 Jan 2005 16:11:17 -0000 1.15 +++ openacs-4/packages/assessment/assessment.info 8 Jan 2005 10:51:19 -0000 1.16 @@ -7,7 +7,7 @@ f f - + oracle postgresql @@ -20,7 +20,7 @@ 0 E-LANE Create assessments and evalueate. - + @@ -30,6 +30,7 @@ + Index: openacs-4/packages/assessment/tcl/as-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-install-procs.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/assessment/tcl/as-install-procs.tcl 7 Jan 2005 16:10:44 -0000 1.15 +++ openacs-4/packages/assessment/tcl/as-install-procs.tcl 8 Jan 2005 10:51:09 -0000 1.16 @@ -90,6 +90,7 @@ content::type::attribute::new -content_type {as_item_choices} -attribute_name {feedback_text} -datatype {string} -pretty_name {Feedback Text} -column_spec {varchar(500)} content::type::attribute::new -content_type {as_item_choices} -attribute_name {correct_answer_p} -datatype {boolean} -pretty_name {Correct Answer} -column_spec {char(1)} content::type::attribute::new -content_type {as_item_choices} -attribute_name {selected_p} -datatype {boolean} -pretty_name {Selected} -column_spec {char(1)} +content::type::attribute::new -content_type {as_item_choices} -attribute_name {fixed_position} -datatype {number} -pretty_name {Fixed Position} -column_spec {integer} content::type::attribute::new -content_type {as_item_choices} -attribute_name {percent_score} -datatype {number} -pretty_name {Percent Score} -column_spec {integer} content::type::attribute::new -content_type {as_item_choices} -attribute_name {sort_order} -datatype {number} -pretty_name {Sort Order} -column_spec {integer} @@ -123,6 +124,7 @@ # Sections content::type::attribute::new -content_type {as_sections} -attribute_name {display_type_id} -datatype {number} -pretty_name {Section Display Type} -column_spec {integer} content::type::attribute::new -content_type {as_sections} -attribute_name {instructions} -datatype {string} -pretty_name {Section Instructions} -column_spec {text} +content::type::attribute::new -content_type {as_sections} -attribute_name {num_items} -datatype {number} -pretty_name {Number of items displayed in this section} -column_spec {integer} content::type::attribute::new -content_type {as_sections} -attribute_name {feedback_text} -datatype {string} -pretty_name {Section Feedback} -column_spec {text} content::type::attribute::new -content_type {as_sections} -attribute_name {max_time_to_complete} -datatype {number} -pretty_name {Section Max Time to Complete} -column_spec {integer} content::type::attribute::new -content_type {as_sections} -attribute_name {points} -datatype {number} -pretty_name {Points awarded for this section} -column_spec {integer} @@ -226,3 +228,27 @@ # set temp_id [content::template::new -name {as_files_default} -text {@text;noquote@} -is_live {t} -package_id $package_id] # content::type::register_template -content_type {as_files} -template_id $temp_id -use_context {public} -is_default {t} } + + +ad_proc -public as::install::after_upgrade { + {-from_version_name:required} + {-to_version_name:required} +} { + apm_upgrade_logic \ + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ + -spec { + 0.08d 0.09d1 { + db_transaction { + content::type::attribute::new -content_type {as_sections} -attribute_name {num_items} -datatype {number} -pretty_name {Number of items displayed in this section} -column_spec {integer} + content::type::attribute::new -content_type {as_item_choices} -attribute_name {fixed_position} -datatype {number} -pretty_name {Fixed Position} -column_spec {integer} + set packages [db_list packages {select package_id from apm_packages where package_key = 'assessment'}] + foreach package_id $packages { + set folder_id [as::assessment::folder_id -package_id $package_id] + content::folder::register_content_type -folder_id $folder_id -content_type {image} -include_subtypes t + content::folder::register_content_type -folder_id $folder_id -content_type {content_revision} -include_subtypes t + } + } + } + } +} Index: openacs-4/packages/assessment/tcl/as-item-data-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-data-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/tcl/as-item-data-procs.tcl 7 Jan 2005 16:10:44 -0000 1.6 +++ openacs-4/packages/assessment/tcl/as-item-data-procs.tcl 8 Jan 2005 10:51:09 -0000 1.7 @@ -32,11 +32,11 @@ # Insert as_item_data in the CR (and as_item_data table) getting the revision_id (item_data_id) db_transaction { - set item_data_id [content::item::new -parent_id $folder_id -content_type {as_item_data} -name "$as_item_id-$session_id-$choice_answer" -title "$as_item_id-$session_id-$choice_answer" ] + set item_data_id [content::item::new -parent_id $folder_id -content_type {as_item_data} -name "$as_item_id-$session_id" -title "$as_item_id-$session_id" ] set as_item_data_id [content::revision::new \ -item_id $item_data_id \ -content_type {as_item_data} \ - -title "$as_item_id-$session_id-$choice_answer" \ + -title "$as_item_id-$session_id" \ -attributes [list [list session_id $session_id] \ [list subject_id $subject_id] \ [list staff_id $staff_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.4 -r1.5 --- openacs-4/packages/assessment/www/admin/item-add-mc-choices.tcl 7 Jan 2005 16:10:45 -0000 1.4 +++ openacs-4/packages/assessment/www/admin/item-add-mc-choices.tcl 8 Jan 2005 10:51:09 -0000 1.5 @@ -98,7 +98,7 @@ ad_return_complaint 1 "[_ assessment.file_zero_size]" return } - set content_rev_id [cr_import_content -package_id $package_id -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [exec uuidgen]] + set content_rev_id [cr_import_content -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [exec uuidgen]] } else { set content_rev_id "" } 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.8 -r1.9 --- openacs-4/packages/assessment/www/admin/item-add.tcl 7 Jan 2005 16:10:45 -0000 1.8 +++ openacs-4/packages/assessment/www/admin/item-add.tcl 8 Jan 2005 10:51:09 -0000 1.9 @@ -116,7 +116,7 @@ } set folder_id [as::assessment::folder_id -package_id $package_id] - set content_rev_id [cr_import_content -package_id $package_id -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [exec uuidgen]] + set content_rev_id [cr_import_content -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [exec uuidgen]] as::item_rels::new -item_rev_id $as_item_id -target_rev_id $content_rev_id -type as_item_content_rel } } 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.5 -r1.6 --- openacs-4/packages/assessment/www/admin/item-edit-general.tcl 7 Jan 2005 16:10:45 -0000 1.5 +++ openacs-4/packages/assessment/www/admin/item-edit-general.tcl 8 Jan 2005 10:51:09 -0000 1.6 @@ -112,7 +112,7 @@ } set folder_id [as::assessment::folder_id -package_id $package_id] - set content_rev_id [cr_import_content -package_id $package_id -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [exec uuidgen]] + set content_rev_id [cr_import_content -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [exec uuidgen]] db_dml update_item_content {} } elseif {[info exists delete_content]} { db_dml delete_item_content {} 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.3 -r1.4 --- openacs-4/packages/assessment/www/admin/item-edit-mc-choices.tcl 7 Jan 2005 16:10:45 -0000 1.3 +++ openacs-4/packages/assessment/www/admin/item-edit-mc-choices.tcl 8 Jan 2005 10:51:09 -0000 1.4 @@ -118,7 +118,7 @@ ad_return_complaint 1 "[_ assessment.file_zero_size]" return } - set content_rev_id [cr_import_content -package_id $package_id -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [exec uuidgen]] + set content_rev_id [cr_import_content -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [exec uuidgen]] db_dml update_choice_content {} } elseif {[info exists delete_content($choice_id)]} { db_dml delete_choice_content {}