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.4 -r1.5 --- openacs-4/packages/assessment/tcl/assessment-procs.tcl 4 Aug 2004 09:40:24 -0000 1.4 +++ openacs-4/packages/assessment/tcl/assessment-procs.tcl 5 Aug 2004 10:33:43 -0000 1.5 @@ -5,20 +5,20 @@ } ad_proc -public as_item_choice_new { + {-parent_id:required} {-name:required} {-title:required} - {-description ""} - {-parent_id:required} {-data_type ""} {-numeric_value ""} {-text_value ""} - {-boolean:boolean ""} + {-boolean_value:boolean ""} {-content_value ""} {-feedback_text ""} {-selected_p:boolean ""} - {-corrent_answer_p:boolean ""} - {-score ""} + {-correct_answer_p:boolean ""} {-sort_order ""} + {-percent_score ""} + } { @author Eduardo Perez (eperez@it.uc3m.es) @creation-date 2004-07-26 @@ -30,7 +30,7 @@ # Insert as_item_choice in the CR (and as_item_choices table) getting the revision_id (as_item_choice_id) set item_choice_id [content::item::new -parent_id $folder_id -content_type {as_item_choices} -name $name -title $title ] - set as_item_choice_id [content::revision::new -item_id $item_choice_id -content_type {as_item_choices} -title $title -attributes [list [list parent_id $parent_id ] [list data_type $data_type ] [list numeric_value $numeric_value ] [list $text_value text_value] [list boolean $boolean] [list content_value $content_value] [list feedback_text $feedback_text] [list selected_p $selected_p] [list corrent_answer_p $corrent_answer_p] [list score $score] [list sort_order $sort_order] ] ] + set as_item_choice_id [content::revision::new -item_id $item_choice_id -content_type {as_item_choices} -title $title -attributes [list [list parent_id $parent_id ] [list data_type $data_type ] [list numeric_value $numeric_value ] [list $text_value text_value] [list boolean_value $boolean_value] [list content_value $content_value] [list feedback_text $feedback_text] [list selected_p $selected_p] [list correct_answer_p $correct_answer_p] [list sort_order $sort_order] [list percent_score $percent_score] ] ] # FIXME too much code repetition here # maybe there are more efficient ways to to it (maybe using hashes to pass the values between functions) return $as_item_choice_id @@ -39,7 +39,6 @@ ad_proc -public as_item_type_mc_new { {-name:required} {-title:required} - {-description ""} {-increasing_p ""} {-allow_negative_p ""} {-num_correct_answers ""} @@ -54,45 +53,48 @@ set folder_id [db_string get_folder_id "select folder_id from cr_folders where package_id=:package_id"] # Insert as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id) - set item_item_type_mc_id [content::item::new -parent_id $folder_id -content_type {as_item_type_mc} -name $as_items__name -title $as_items__title ] - set as_item_type_mc_id [content::revision::new -item_id $item_item_id -content_type {as_item_type_mc} -title $as_items__title -attributes [list [list increasing_p $increasing_p] [list allow_negative_p $allow_negative_p] [list num_correct_answers $num_correct_answers] [list num_answers $num_answers] ] ] + set item_item_type_mc_id [content::item::new -parent_id $folder_id -content_type {as_item_type_mc} -name $name -title $title ] + set as_item_type_mc_id [content::revision::new -item_id $item_item_type_mc_id -content_type {as_item_type_mc} -title $title -attributes [list [list increasing_p $increasing_p] [list allow_negative_p $allow_negative_p] [list num_correct_answers $num_correct_answers] [list num_answers $num_answers] ] ] + return $as_item_type_mc_id } ad_proc -public as_item_display_rb_new { {-name:required} - {-title:required} - {-description ""} - {-increasing_p ""} - {-allow_negative_p ""} - {-num_correct_answers ""} - {-num_answers ""} + {-html_display_options ""} + {-choice_orientation ""} + {-choice_label_orientation ""} + {-sort_order_type ""} + {-item_answer_alignment ""} } { @author Eduardo Perez (eperez@it.uc3m.es) + @author Natalia Perez (nperper@it.uc3m.es) @creation-date 2004-07-26 - New Multiple Choice item to the data database + New Item Display RadioButton Type to the data database } { set package_id [ad_conn package_id] set folder_id [db_string get_folder_id "select folder_id from cr_folders where package_id=:package_id"] - # Insert as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id) - set item_item_type_mc_id [content::item::new -parent_id $folder_id -content_type {as_item_type_mc} -name $as_items__name -title $as_items__title ] - set as_item_type_mc_id [content::revision::new -item_id $item_item_id -content_type {as_item_type_mc} -title $as_items__title -attributes [list [list increasing_p $increasing_p] [list allow_negative_p $allow_negative_p] [list num_correct_answers $num_correct_answers] [list num_answers $num_answers] ] ] + # Insert as_item_display_rb in the CR (and as_item_display_rb table) getting the revision_id (as_item_display_id) + set item_item_display_rb_id [content::item::new -parent_id $folder_id -content_type {as_item_display_rb} -name $name] + set as_item_display_rb_id [content::revision::new -item_id $item_item_display_rb_id -content_type {as_item_display_rb} -attributes [list [list html_display_options $html_display_options] [list choice_orientation $choice_orientation] [list choice_label_orientation $choice_label_orientation] [list sort_order_type $sort_order_type] [list item_answer_alignment $item_answer_alignment] ] ] + return $as_item_display_rb_id } ad_proc -public as_item_new { {-name:required} {-title:required} - {-description ""} {-type ""} {-type_attributes ""} {-display ""} {-display_attributes ""} {-subtext ""} {-field_code ""} + {-definition ""} {-required_p ""} + {-data_type ""} {-max_time_to_complete ""} } { @author Eduardo Perez (eperez@it.uc3m.es) @@ -105,7 +107,7 @@ # Insert as_item in the CR (and as_assessments 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 required_p $required_p] [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] ] ] if {$type == {mc}} { set as_item_type_id [as_item_type_mc_new $type_attributes]