Index: openacs-4/packages/assessment/sql/postgresql/assessment-item-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-item-create.sql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/sql/postgresql/assessment-item-create.sql 10 Aug 2004 13:22:45 -0000 1.8 +++ openacs-4/packages/assessment/sql/postgresql/assessment-item-create.sql 23 Sep 2004 18:46:55 -0000 1.9 @@ -25,7 +25,9 @@ -- optional max number of seconds to perform Item max_time_to_complete integer, -- a denormalization to cache the generated "widget" for the Item (NB: when any change is made to an as_item_choice related to an as_item, this will have to be updated!) - adp_chunk varchar(500) + adp_chunk varchar(500), + -- feedback + feedback_text text ); create table as_item_choices ( Index: openacs-4/packages/assessment/tcl/assessment-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/Attic/assessment-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/assessment/tcl/assessment-procs.tcl 23 Sep 2004 14:20:55 -0000 1.12 +++ openacs-4/packages/assessment/tcl/assessment-procs.tcl 23 Sep 2004 18:46:56 -0000 1.13 @@ -116,6 +116,7 @@ {-required_p ""} {-data_type ""} {-max_time_to_complete ""} + {-feedback_text ""} } { @author Eduardo Perez (eperez@it.uc3m.es) @creation-date 2004-07-26 @@ -127,7 +128,7 @@ # Insert as_item in the CR (and as_items table) getting the revision_id (as_item_id) set item_item_id [content::item::new -parent_id $folder_id -content_type {as_items} -name $name -title $title ] - set as_item_id [content::revision::new -item_id $item_item_id -content_type {as_items} -title $title -attributes [list [list subtext $subtext] [list field_code $field_code] [list definition $definition] [list required_p $required_p] [list data_type $data_type] [list max_time_to_complete $max_time_to_complete] ] ] + set as_item_id [content::revision::new -item_id $item_item_id -content_type {as_items} -title $title -attributes [list [list subtext $subtext] [list field_code $field_code] [list definition $definition] [list required_p $required_p] [list data_type $data_type] [list max_time_to_complete $max_time_to_complete] [list feedback_text $feedback_text] ] ] return $as_item_id } Index: openacs-4/packages/assessment/tcl/assessment-qti-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/Attic/assessment-qti-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/assessment/tcl/assessment-qti-procs.tcl 23 Sep 2004 14:20:55 -0000 1.19 +++ openacs-4/packages/assessment/tcl/assessment-qti-procs.tcl 23 Sep 2004 18:46:56 -0000 1.20 @@ -93,13 +93,21 @@ set as_items__name [$item getAttribute {ident}] array set as_item_choices__correct_answer_p {} array set as_item_choices__score {} + set as_items__feedback_text {} set objectivesNodes [$item selectNodes {objectives}] foreach objectives $objectivesNodes { set mattextNodes [$objectives selectNodes {material/mattext/text()}] foreach mattext $mattextNodes { set as_items__name [$mattext nodeValue] } } + set itemfeedbackNodes [$item selectNodes {itemfeedback}] + foreach itemfeedback $itemfeedbackNodes { + if {[regexp displayWrong [$itemfeedback getAttribute {ident} {}]]} { + set feedback_textNodes [$itemfeedback selectNodes {.//mattext/text()}] + set as_items__feedback_text [[lindex $feedback_textNodes 0] nodeValue] + } + } set resprocessingNodes [$item selectNodes {resprocessing}] foreach resprocessing $resprocessingNodes { set respconditionNodes [$resprocessing selectNodes {respcondition}] @@ -151,7 +159,7 @@ set as_item__display_type_id 1 } # Insert as_item in the CR (and as_items table) getting the revision_id (as_item_id) - set as_item_id [as_item_new -name $as_items__name -title $as_items__title] + set as_item_id [as_item_new -name $as_items__name -title $as_items__title -feedback_text $as_items__feedback_text] lappend items $as_item_id foreach node $nodeNodes { if {[$node nodeName] == {material}} { @@ -182,7 +190,7 @@ } set as_item_type_id [as_item_type_mc_new -name $as_item_type__name] # Insert as_item in the CR (and as_items table) getting the revision_id (as_item_id) - set as_item_id [as_item_new -name $as_items__name -title $as_items__title] + set as_item_id [as_item_new -name $as_items__name -title $as_items__title -feedback_text $as_items__feedback_text] lappend items $as_item_id content::item::relate -item_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_id"] -object_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_type_id"] -relation_tag {as_item_type_rel} -relation_type {cr_item_rel} content::item::relate -item_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_id"] -object_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_display_id"] -relation_tag {as_item_display_rel} -relation_type {cr_item_rel} Index: openacs-4/packages/assessment/tcl/install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/Attic/install-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/tcl/install-procs.tcl 23 Sep 2004 14:46:09 -0000 1.5 +++ openacs-4/packages/assessment/tcl/install-procs.tcl 23 Sep 2004 18:46:56 -0000 1.6 @@ -64,8 +64,10 @@ content::type::create_attribute -content_type {as_items} -attribute_name {data_type} -datatype {string} -pretty_name {Item Data Type} -column_spec {varchar(50)} content::type::create_attribute -content_type {as_items} -attribute_name {max_time_to_complete} -datatype {number} -pretty_name {Item Max Time to Complete} -column_spec {integer} content::type::create_attribute -content_type {as_items} -attribute_name {adp_chunk} -datatype {string} -pretty_name {Item Adp Chunk} -column_spec {varchar(500)} +content::type::create_attribute -content_type {as_items} -attribute_name {feedback_text} -datatype {string} -pretty_name {Item Wrong Feedback} -column_spec {text} + content::type::create_attribute -content_type {as_sections} -attribute_name {instructions} -datatype {string} -pretty_name {Section Instructions} -column_spec {text}