Index: openacs-4/packages/assessment/www/process-response.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/process-response.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/www/process-response.tcl 14 Oct 2004 13:30:59 -0000 1.6 +++ openacs-4/packages/assessment/www/process-response.tcl 14 Oct 2004 14:15:04 -0000 1.7 @@ -22,15 +22,19 @@ 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 regsub -all -line -nocase -- {.*_} $response_to_item_name {} response_to_item_choice_id regsub -all -line -nocase -- {_.*} $response_to_item_name {} response_to_item_id set item_item_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:response_to_item_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"] 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_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_tax "SELECT item_id AS as_item_display_tax__item_id FROM as_item_display_tax WHERE item_id=:item_display_id" set presentation_type "checkbox" ;# DEFAULT if {[info exists as_item_display_rbx__item_id]} {set presentation_type "radio"} if {[info exists as_item_display_tbx__item_id]} {set presentation_type "fitb"} + if {[info exists as_item_display_tax__item_id]} {set presentation_type "textarea"} if {[info exists as_item_display_tbx__item_id]} { db_foreach session_responses_to_item {SELECT as_item_datax.item_id FROM as_item_datax WHERE as_item_datax.as_item_id=:response_to_item_id AND as_item_datax.choice_id_answer=:response_to_item_choice_id AND as_item_datax.session_id=:as_session_id} { @@ -41,7 +45,7 @@ } } else { db_foreach session_responses_to_item {SELECT as_item_datax.item_id FROM as_item_datax WHERE as_item_datax.as_item_id=:response_to_item_id AND as_item_datax.session_id=:as_session_id} { - content::item::delete -item_id $item_id + content::item::delete -item_id $item_id } foreach response $response_to_item($response_to_item_name) { as::item_data::new -session_id $as_session_id -as_item_id $response_to_item_id -choice_id_answer $response Index: openacs-4/packages/assessment/www/session.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/www/session.adp 7 Oct 2004 10:58:07 -0000 1.8 +++ openacs-4/packages/assessment/www/session.adp 14 Oct 2004 14:15:04 -0000 1.9 @@ -26,11 +26,18 @@ @items.choice_html;noquote@ + + #assessment.This_question_will_be_corrected_by_the_teacher#. + +
+
+ #assessment.Score#@items.score@ / @items.maxscore@ (#assessment.Question_not_answered#.) #assessment.Feedback#: @items.feedback_right@@items.feedback_wrong@
+
Index: openacs-4/packages/assessment/www/session.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/assessment/www/session.tcl 8 Oct 2004 11:52:40 -0000 1.11 +++ openacs-4/packages/assessment/www/session.tcl 14 Oct 2004 14:15:04 -0000 1.12 @@ -25,22 +25,37 @@ 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 + 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"] 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_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_tax "SELECT item_id AS as_item_display_tax__item_id FROM as_item_display_tax WHERE item_id=:item_display_id" set presentation_type "checkbox" ;# DEFAULT if {[info exists as_item_display_rbx__item_id]} {set presentation_type "radio"} if {[info exists as_item_display_tbx__item_id]} {set presentation_type "fitb"} + if {[info exists as_item_display_tax__item_id]} {set presentation_type "textarea"} set notanswered 1 set maxscore $itemmaxscore set score 0 set item_correct 1 set choice_html "" + + if {[string compare $presentation_type "textarea"] == 0} { + set text_answer {} + db_0or1row shortanswer {} + set choice_answer "" + set correct_answer {} + append choice_html "" + set item_correct 0 + } + db_foreach choices {} { if {[string length "$choice_id_answer"]} {set notanswered 0} set choice_correct 0 Index: openacs-4/packages/assessment/www/session.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment/www/session.xql 7 Oct 2004 10:58:07 -0000 1.7 +++ openacs-4/packages/assessment/www/session.xql 14 Oct 2004 14:15:04 -0000 1.8 @@ -23,5 +23,13 @@ as_item_choicesx.sort_order + + + + SELECT as_item_datax.text_answer + FROM as_item_datax, as_sessionsx + WHERE as_sessionsx.session_id = as_item_datax.session_id AND as_sessionsx.session_id = :session_id AND as_item_datax.choice_id_answer IS NULL AND as_item_datax.as_item_id = :items_as_item_id + +
$correct_answer$choice_answer