Index: openacs-4/packages/assessment/www/admin/choice-add.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/choice-add.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/choice-add.adp 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,8 @@
+
+@context;noquote@
+Create a new Choice
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/assessment/www/admin/choice-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/choice-add.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/choice-add.tcl 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,111 @@
+ad_page_contract {
+
+ Form for creating choices
+
+ @author nperper@it.uc3m.es
+ @date Sept 13, 2004
+} {
+ {as_item_type_id}
+ {as_item_type_mc__num_answers}
+ {item_type}
+} -properties {
+ context:onevalue
+}
+
+set context [list "Create a new Choice"]
+
+set package_id [ad_conn package_id]
+set user_id [ad_get_user_id]
+ad_require_permission $package_id admin
+
+#set as_item_type_id [db_nextval acs_object_id_seq]
+
+
+
+#Form for creating a specific type of item
+form create choice-create -elements {
+ item_type -datatype text -widget hidden
+ as_item_type_mc__num_answers -datatype integer -widget hidden
+ as_item_type_id -datatype integer -widget text
+
+}
+
+
+#element set_properties choice-create item_type -value "radiobutton"
+element set_properties choice-create item_type -value $item_type
+element set_properties choice-create as_item_type_mc__num_answers -value $as_item_type_mc__num_answers
+element set_properties choice-create as_item_type_id -value $as_item_type_id
+
+
+#set item_type "radiobutton"
+#set as_item_type_mc__num_answers 2
+
+
+#for each type of item we create some elements
+switch -- $item_type {
+
+ "checkbox" -
+ "radiobutton" {
+
+ array set as_item_choices__name {}
+ array set as_item_choices__title {}
+ array set as_item_choices__feedback_text {}
+
+ for {set i 0 } { $i <$as_item_type_mc__num_answers} {incr i } {
+
+ set choice_id [db_nextval acs_object_id_seq]
+ template::form::section choice-create Choice_${i}
+
+
+
+ element create choice-create as_item_choices__name_${i} -label "Choice Title" -datatype text -html {size 59}
+ element create choice-create as_item_choices__title_${i} -label "Choice Text" -datatype text -html {rows 5 cols 50} -widget textarea -value ""
+ element create choice-create as_item_choices__feedback_text_${i} -label "Feedback" -datatype text -html {rows 8 cols 50} -widget textarea -optional
+ element create choice-create as_item_choices__selected_p_${i} -label "Selected?" -datatype text -widget select -options {{yes t} {no f}} -value f
+ element create choice-create as_item_choices__correct_answer_p_${i} -label "Correct?" -datatype text -widget select -options {{yes t} {no f}} -value f
+ element create choice-create as_item_choices__score_${i} -label "Score (in percent)" -datatype integer -html {size 7} -value 0
+
+ element set_properties choice-create as_item_choices__name_${i} -value $choice_id
+ element set_properties choice-create as_item_choices__title_${i}
+ element set_properties choice-create as_item_choices__feedback_text_${i}
+ element set_properties choice-create as_item_choices__selected_p_${i}
+ element set_properties choice-create as_item_choices__correct_answer_p_${i}
+ element set_properties choice-create as_item_choices__score_${i}
+ }
+
+
+
+ if { [template::form is_valid choice-create] } {
+
+ set item_type [template::element::get_value choice-create item_type]
+ set as_item_type_mc__num_answers [template::element::get_value choice-create as_item_type_mc__num_answers]
+ set as_item_type_id [template::element::get_value choice-create as_item_type_id]
+
+ for {set i 0 } { $i <$as_item_type_mc__num_answers} {incr i } {
+
+ set as_item_choices__name($i) [template::element::get_value choice-create as_item_choices__name_${i}]
+ set as_item_choices__title($i) [template::element::get_value choice-create as_item_choices__title_${i}]
+ set as_item_choices__feedback_text($i) [template::element::get_value choice-create as_item_choices__feedback_text_${i}]
+ set as_item_choices__selected_p($i) [template::element::get_value choice-create as_item_choices__selected_p_${i}]
+ set as_item_choices__correct_answer_p($i) [template::element::get_value choice-create as_item_choices__correct_answer_p_${i}]
+ set as_item_choices__score($i) [template::element::get_value choice-create as_item_choices__score_${i}]
+
+
+
+ db_transaction {
+ as_item_choice_new -mc_id $as_item_type_id -name $as_item_choices__name($i) -title $as_item_choices__title($i) -feedback_text $as_item_choices__feedback_text($i) -percent_score $as_item_choices__score($i)
+
+ }
+
+ #redirect back to one
+ ad_returnredirect "one"
+
+}
+}
+
+}
+}
+
+
+ad_return_template
+
\ No newline at end of file
Index: openacs-4/packages/assessment/www/admin/display-create-type.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/display-create-type.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/display-create-type.adp 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,8 @@
+
+@context;noquote@
+Display Options
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/assessment/www/admin/display-create-type.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/display-create-type.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/display-create-type.tcl 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,156 @@
+ad_page_contract {
+
+ Form for selecting display options
+
+ @author nperper@it.uc3m.es
+ @date July 21, 2004
+} {
+ item_type:html,notnull
+ {as_item_id1}
+
+} -properties {
+ context:onevalue
+ item_type:onevalue
+ as_item_id1:onevalue
+}
+
+
+set context [list "Presentation Type"]
+
+set package_id [ad_conn package_id]
+set user_id [ad_get_user_id]
+ad_require_permission $package_id admin
+
+
+set as_item_display_id1 [db_nextval acs_object_id_seq]
+
+
+
+
+#Form for selecting display options
+form create display-type -elements {
+ as_item_id1 -datatype integer -widget hidden
+ item_type -datatype text -widget hidden
+ as_item_display_type__name -datatype text -widget hidden
+ as_item_display_type__html_display_options -label "Html Display Options" -datatype text -html {rows 5 cols 50} -widget textarea -optional
+}
+
+
+ #set a value for as_item_id
+ element set_properties display-type as_item_id1 -value $as_item_id1
+ element set_properties display-type item_type -value $item_type
+ element set_properties display-type as_item_display_type__name -value $as_item_display_id1
+
+#for each item_type (textbox, shortanswer, textarea, radiobutton, checkbox, select, imagemap, multiplechoice, pop-up_date, typed_date, file_upload)
+switch -- $item_type {
+ "textbox" {
+ element set_properties display-type as_item_display_type__name -value "textbox"
+ element create display-type as_item_display_tb__abs_size -label "Abs Size" -datatype text -widget select -options {{small small} {medium medium} {large large}} -optional
+
+ element create display-type as_item_display_tb__item_answer_alignment -label "Answer Alignment" -datatype text -widget select -options {{{beside left} beside_left} {{beside right} beside_right} {bellow bellow} {above above}} -optional
+ }
+
+ "shortanswer" {
+ element set_properties display-type as_item_display_type__name -value "short answer"
+ element create display-type as_item_display_sa__abs_size -label "Abs Size" -datatype text -widget select -options {{small small} {medium medium} {large large}} -optional
+ element create display-type as_item_display_sa__box_orientation -label "Box Orientation" -datatype text -widget select -options {{horizontal horizontal} {vertical vertical}} -optional
+ }
+
+ "textarea" {
+ element set_properties display-type as_item_display_type__name -value "textarea"
+ element create display-type as_item_display_ta__abs_size -label "Abs Size" -datatype text -widget select -options {{small small} {medium medium} {large large}} -optional
+ element create display-type as_item_display_ta__acs_widget -datatype text -widget hidden -value "text"
+ element create display-type as_item_display_ta__item_answer_alignment -label "Answer Alignment" -datatype text -widget select -options {{{beside left} beside_left} {{beside right} beside_right} {bellow bellow} {above above}} -optional
+ }
+
+ "radiobutton" {
+ element create display-type as_item_display_rb__acs_widget -datatype text -widget hidden -value "radio"
+ element create display-type as_item_display_rb__choice_orientation -label "Choice Orientation" -datatype text -widget select -options {{horizontal horizontal} {vertical vertical}} -optional
+ element create display-type as_item_display_rb__choice_label_orientation -label "Choice Label Orientation" -datatype text -widget select -options {{top top} {left left} {right right} {buttom buttom}} -optional
+ element create display-type as_item_display_rb__sort_order -label "Sort Order" -datatype text -widget select -options {{numerical numerical} {alphabetic alphabetic} {randomized randomized} {{by order of entry} {by order of entry}}} -optional
+ element create display-type as_item_display_rb__item_answer_alignment -label "Answer Alignment" -datatype text -widget select -options {{{beside left} beside_left} {{beside right} beside_right} {bellow bellow} {above above}} -optional
+
+ if { [template::form is_valid display-type] } {
+ #valid new display-type submission so create the display type
+ set as_item_display_type__name [template::element::get_value display-type as_item_display_type__name]
+ set as_item_display_type__html_display_options [template::element::get_value display-type as_item_display_type__html_display_options]
+ set as_item_display_rb__choice_orientation [template::element::get_value display-type as_item_display_rb__choice_orientation]
+ set as_item_display_rb__choice_label_orientation [template::element::get_value display-type as_item_display_rb__choice_label_orientation]
+ set item_type [template::element::get_value display-type item_type]
+ set as_item_display_rb__sort_order [template::element::get_value display-type as_item_display_rb__sort_order]
+ set as_item_display_rb__item_answer_alignment [template::element::get_value display-type as_item_display_rb__item_answer_alignment]
+
+ set as_item_id1 [template::element::get_value display-type as_item_id1]
+
+ db_transaction {
+ #add the item
+ #Insert as_item_display_rb in the CR (and as_item_display_rb table) getting the revision_id (as_item_display_id)
+ set as_item_display_rb_id [as_item_display_rb_new -name $as_item_display_type__name -html_display_options $as_item_display_type__html_display_options -choice_orientation $as_item_display_rb__choice_orientation -choice_label_orientation $as_item_display_rb__choice_label_orientation -sort_order_type $as_item_display_rb__sort_order -item_answer_alignment $as_item_display_rb__item_answer_alignment]
+
+ #set the relation between as_items table and as_item_display_rb table
+ content::item::relate -item_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_id1"] -object_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_display_rb_id"] -relation_tag {as_item_display_rel} -relation_type {cr_item_rel}
+
+ }
+
+ #redirect back to item-create-2
+ ad_returnredirect "item-create-2?item_type=$item_type&as_item_id1=$as_item_id1"
+}
+
+ }
+
+ "checkbox" {
+ element set_properties display-type as_item_display_type__name -value "CheckBox"
+ element create display-type as_item_display_cb__choice_orientation -label "Choice Orientation" -datatype text -widget select -options {{horizontal horizontal} {vertical vertical}} -optional
+ element create display-type as_item_display_cb__choice_label_orientation -label "Choice Label Orientation" -datatype text -widget select -options {{top top} {left left} {right right} {buttom buttom}} -optional
+ element create display-type as_item_display_cb__allow_multiple_p -label "Allow Multiple?" -datatype text -widget radio -options {{Yes t} {No f}} -value t -optional
+ element create display-type as_item_display_cb__sort_order -label "Sort Order" -datatype text -widget select -options {{numerical numerical} {alphabetic alphabetic} {randomized randomized} {{by order of entry} {by order of entry}}} -optional
+ element create display-type as_item_display_cb__item_answer_alignment -label "Answer Alignment" -datatype text -widget select -options {{{beside left} beside_left} {{beside right} beside_right} {bellow bellow} {above above}} -optional
+ }
+
+ "select" {
+ element set_properties display-type as_item_display_type__name -value "Select Box"
+ element create display-type as_item_display_sb__acs_widget -datatype text -widget hidden -value "select"
+ element create display-type as_item_display_sb__sort_order -label "Sort Order" -datatype text -widget select -options {{numerical numerical} {alphabetic alphabetic} {randomized randomized} {{by order of entry} {by order of entry}}} -optional
+ element create display-type as_item_display_sb__allow_multiple_p -label "Allow Multiple?" -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional
+ element create display-type as_item_display_sb__item_answer_alignment -label "Answer Alignment" -datatype text -widget select -options {{{beside left} beside_left} {{beside right} beside_right} {bellow bellow} {above above}} -optional
+ }
+
+ "imagemap" {
+ element set_properties display-type as_item_display_type__name -value "Image map"
+ element create display-type as_item_display_im__allow_multiple_p -label "Allow Multiple?" -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional
+ element create display-type as_item_display_im__item_answer_alignment -label "Answer Alignment" -datatype text -widget select -options {{{beside left} beside_left} {{beside right} beside_right} {bellow bellow} {above above}} -optional
+ }
+
+ "multiplechoice" {
+ element set_properties display-type as_item_display_type__name -value "MultipleChoice"
+ element create display-type widget_choice -label "Widget Choice" -datatype text -widget select -options {{select select} {radio radio} {checkbox checkbox}} -optional
+ element create display-type sort_order -label "Sort Order" -datatype text -widget select -options {{numerical numerical} {alphabetic alphabetic} {randomized randomized} {{by order of entry} {by order of entry}}} -optional
+ element create display-type other_size -label "Other Size" -datatype text -html {size 15}
+ element create display-type other_label -label "Other Label" -datatype text -html {size 59}
+ element create display-type item_answer_alignment -label "Answer Alignment" -datatype text -widget select -options {{{beside left} beside_left} {{beside right} beside_right} {bellow bellow} {above above}} -optional
+ }
+
+ "pop-up_date" {
+ element set_properties display-type as_item_display_type__name -value "Pop Up Date"
+ element create display-type pop-up_date -label "Date" -datatype date -widget date -format "MONTH DD YYYY" -today -help
+ }
+
+ "typed_date" {
+ element set_properties display-type as_item_display_type__name -value "Typed Date"
+ element create display-type typed_date -label "Date" -datatype date -widget date -format "MMt/DDt/YYYYt" -today -help
+ }
+
+ "file_upload" {
+ element set_properties display-type as_item_display_type__name -value "File Upload"
+ element create display-type file_upload -label "File" -datatype text -widget file
+ }
+
+}
+
+
+
+
+
+
+ad_return_template
+
Index: openacs-4/packages/assessment/www/admin/item-create-2.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-create-2.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/item-create-2.adp 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,10 @@
+
+@context;noquote@
+Create a new Item
+
+
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/assessment/www/admin/item-create-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-create-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/item-create-2.tcl 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,127 @@
+ad_page_contract {
+
+ Form for creating a specific type of item
+
+ @author nperper@it.uc3m.es
+ @date July 20, 2004
+} {
+ {as_item_id1:integer ""}
+ {item_type:html}
+ {as_item_type_mc__num_answers "0"}
+} -properties {
+ context:onevalue
+ item_type:onevalue
+ as_item_type_mc__num_answers:onevalue
+}
+
+set context [list "Create a new Item"]
+
+set package_id [ad_conn package_id]
+set user_id [ad_get_user_id]
+ad_require_permission $package_id admin
+
+
+set item_title [db_string item_title {SELECT as_itemsx.title FROM as_itemsx WHERE as_itemsx.as_item_id=:as_item_id1}]
+set item_definition [db_string item_definition {SELECT as_itemsx.definition FROM as_itemsx WHERE as_itemsx.as_item_id=:as_item_id1}]
+
+set as_item_type_id1 [db_nextval acs_object_id_seq]
+
+#Form for creating a specific type of item
+form create item-add-2 -elements {
+
+ as_item_id1 -datatype integer -widget hidden
+ as_item_type_id1 -datatype integer -widget hidden
+ as_items__title -label "Item Text" -datatype text -widget inform
+ item_type -datatype text -widget hidden
+
+}
+
+
+element set_properties item-add-2 as_item_id1 -value $as_item_id1
+element set_properties item-add-2 as_item_type_id1 -value $as_item_type_id1
+element set_properties item-add-2 as_items__title -value $item_title
+element set_properties item-add-2 item_type -value $item_type
+
+
+
+#as_items.definition isn't mandatory, then this field can't be filled. If this field is filled we show its value.
+set null ""
+if {[string compare $item_definition $null] != 0} {
+ element create item-add-2 as_items__definition -label "Description" -datatype text -widget inform
+ element set_properties item-add-2 as_items__definition -value $item_definition
+}
+
+
+#for each type of item we create some elements
+switch -- $item_type {
+ "textarea" {
+ element create item-add-2 as_item_type_oq__as_item_default -label "Default value" -datatype text -html {size 15}
+ element create item-add-2 as_item_type_oq__feedback_text -label "Feedback" -datatype text -html {rows 5 cols 50} -widget textarea -optional
+
+ form set_properties item-add-2 -action "index"
+ }
+ "checkbox" -
+ "radiobutton" {
+ element create item-add-2 as_item_type_mc__increasing_p -label "Increasing" -datatype text -widget select -options {{{All or Nothing} f } {Increasing t} } -optional
+
+ element create item-add-2 as_item_type_mc__allow_negative_p -label "Allow negative?" -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional
+ element create item-add-2 as_item_type_mc__num_correct_answers -label "Number of Correct Answers" -datatype integer -html {size 7} -optional
+ element create item-add-2 as_item_type_mc__num_answers -label "Number of Answers" -datatype integer -html {size 7}
+
+ element set_properties item-add-2 as_item_type_mc__num_answers -value $as_item_type_mc__num_answers
+
+
+
+
+if { [template::form is_valid item-add-2] } {
+ #valid new item submission so create new item type
+ set as_item_type_mc__increasing_p [template::element::get_value item-add-2 as_item_type_mc__increasing_p]
+ set as_item_type_mc__allow_negative_p [template::element::get_value item-add-2 as_item_type_mc__allow_negative_p]
+ set as_item_type_mc__num_correct_answers [template::element::get_value item-add-2 as_item_type_mc__num_correct_answers]
+ set as_item_type_mc__num_answers [template::element::get_value item-add-2 as_item_type_mc__num_answers]
+
+ db_transaction {
+ #Insert as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id)
+ set as_item_type_id [as_item_type_mc_new -name $as_item_type_id1 -increasing_p $as_item_type_mc__increasing_p -allow_negative_p $as_item_type_mc__allow_negative_p -num_correct_answers $as_item_type_mc__num_correct_answers -num_answers $as_item_type_mc__num_answers]
+ #set the relation between as_items table and as_item_type_mc table
+ content::item::relate -item_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_id1"] -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}
+ }
+
+ #redirect back to choice-add
+ ad_returnredirect "choice-add?as_item_type_id=$as_item_type_id&as_item_type_mc__num_answers=$as_item_type_mc__num_answers&item_type=$item_type"
+
+ }
+
+
+ }
+
+ "open_question" {
+ element create item-add-2 as_item_type_oq__as_item_default -label "Item default" -datatype text -html {size 15} -optional
+ element create item-add-2 as_item_type_oq__feedback_text -label "Feedback" -datatype text -widget textarea -html {rows 5 cols 50} -optional
+
+ form set_properties item-add-2 -action "index"
+ }
+
+ "shortanswer" {
+ element create item-add-2 as_item_type_sa__increasing_p -label "Increasing" -datatype text -widget select -options {{{All or Nothing} f } {Increasing t} } -optional
+ element create item-add-2 as_item_type_sa__allow_negative_p -label "Allow negative?" -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional
+ element create item-add-2 as_item_type_mc__num_answers -label "Number of Answers" -datatype integer -html {size 7}
+
+
+ }
+
+
+ "imagemap" {
+ element create item-add-2 as_item_type_im__increasing_p -label "Increasing" -datatype text -widget select -options {{{All or Nothing} f } {Increasing t} } -optional
+ element create item-add-2 as_item_type_im__allow_negative_p -label "Allow negative?" -datatype text -widget radio -options {{Yes t} {No f}} -value f -optional
+ element create item-add-2 as_item_type_mc__num_answers -label "Number of Answers" -datatype integer -html {size 7}
+
+
+ }
+
+
+}
+
+
+ad_return_template
+
\ No newline at end of file
Index: openacs-4/packages/assessment/www/admin/item-create.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-create.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/item-create.adp 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,6 @@
+
+@context;noquote@
+Create a new Item
+
+
+
\ No newline at end of file
Index: openacs-4/packages/assessment/www/admin/item-create.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-create.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/item-create.tcl 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,67 @@
+ad_page_contract {
+
+ Form for creating an item.
+
+ @author nperper@it.uc3m.es
+ @date September 14, 2004
+} -properties {
+ context:onevalue
+ as_items__title:onevalue
+ as_items__definition:onevalue
+ item_type:onevalue
+}
+
+set context [list "Create a new Item"]
+
+set package_id [ad_conn package_id]
+set user_id [ad_get_user_id]
+ad_require_permission $package_id admin
+
+
+
+#item_id
+set item_id [db_nextval acs_object_id_seq]
+
+#form for creating an item
+form create item-add -elements {
+ as_items_name -datatype integer -widget hidden
+ as_items_title -label "Item Title" -datatype text -html {size 59}
+ as_items_subtext -label "Item Text" -datatype text -html {rows 5 cols 50} -widget textarea -optional
+ as_items_definition -label "Description" -datatype text -html {rows 8 cols 50} -widget textarea -value "" -optional
+ item_type -label "Item Type" -datatype text -widget select -options {{{Open Question} textarea} {{Short Answer} shortanswer} {{Multiple Choice (radio buttons)} radiobutton} {{Multiple Choice (checkboxes)} checkbox } {{Multiple Choices (Image Map)} imagemap} {{Multiple Choice with Fill-in-Blank} shortanswer} }
+
+ as_items_max_time_to_complete -label "Maximum time to complete (in seconds)" -datatype integer -html {size 15} -optional
+ as_items_required_p -label "Required?" -datatype text -widget radio -options {{Yes t} {No f}} -value t
+ as_items_data_type -label "Data Type of the answer" -datatype text -widget select -options {{integer integer} {numeric numeric} {exponential exponential} {varchar varchar} {text text} {date date} {boolean boolean} {timestamp timestamp} {{content type} {content type}} } -optional
+}
+
+
+element set_properties item-add as_items_name -value $item_id
+
+if { [template::form is_valid item-add] } {
+ #valid new item submission so create new item
+ set as_items_name [template::element::get_value item-add as_items_name]
+ set as_items_title [template::element::get_value item-add as_items_title]
+ set as_items_subtext [template::element::get_value item-add as_items_subtext]
+ set as_items_definition [template::element::get_value item-add as_items_definition]
+ set item_type [template::element::get_value item-add item_type]
+ set as_items_max_time_to_complete [template::element::get_value item-add as_items_max_time_to_complete]
+ set as_items_required_p [template::element::get_value item-add as_items_required_p]
+ set as_items_data_type [template::element::get_value item-add as_items_data_type]
+
+ db_transaction {
+ #add the item
+ #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 -definition $as_items_definition -required_p $as_items_required_p -data_type $as_items_data_type -max_time_to_complete $as_items_max_time_to_complete]
+ }
+
+ #redirect back to display-create-type
+ ad_returnredirect "display-create-type?item_type=$item_type&as_item_id1=$as_item_id"
+}
+
+#item_type -label "Item Type" -datatype text -widget select -options {{{Open Question} textarea} {{Short Answer} shortanswer} {Matching matching} {{File Upload} {file_upload}} {{Multiple Choice (radio buttons)} radiobutton} {{Multiple Choice (checkboxes)} checkbox } {{Multiple Choices (Image Map)} image_map_mc} {{Multiple Choice with Fill-in-Blank} textarea} {Rank rank} {{Matrix table} {matrix table}} {{Composite matrix-based multiple response} radiobutton} }
+
+
+
+ad_return_template
+
Index: openacs-4/packages/assessment/www/admin/one-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/one-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/one-postgresql.xql 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,24 @@
+
+
+ postgresql7.4
+
+
+
+ select as_assessmentsx.name, as_assessmentsx.title, as_assessmentsx.creator_id, as_assessmentsx.description
+ from as_assessmentsx
+ where as_assessmentsx.assessment_id=:assessment_id
+
+
+
+
+
+ SELECT distinct as_itemsx.as_item_id, as_itemsx.name, as_itemsx.title, 'radiobutton' as presentation_type
+ FROM as_itemsx
+
+
+
+
+
+
+
+
Index: openacs-4/packages/assessment/www/admin/one.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/one.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/one.adp 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
Items
+
+
Index: openacs-4/packages/assessment/www/admin/one.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/one.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/admin/one.tcl 29 Sep 2004 11:16:07 -0000 1.1
@@ -0,0 +1,24 @@
+ad_page_contract {
+ @author nperper@it.uc3m.es
+ @date September 16, 2004
+}
+
+
+
+ad_form -name show_item_form -html {enctype multipart/form-data} -form {
+ { assessment_id:text {value 1} }
+}
+
+
+#For each item:
+db_multirow items query_all_items {}
+#{
+ #If there is an item
+# if {![empty_string_p $as_item_id]} {
+# add_item_to_form show_item_form $as_item_id
+ # }
+#}
+
+
+
+ad_return_template
\ No newline at end of file