@items.name@:#assessment.Question# @items.rownum@: * |
+ @items.title;noquote@
+ @items.content;noquote@
+
+ |
+
+
+
+
+
+
+
+
+
+ |
- @formgroup.widget;noquote@
- @formgroup.label;noquote@
-
+ @formgroup.label;noquote@ |
+
+ @items.description@ |
+
+
+
+ @formgroup.widget;noquote@ @formgroup.label;noquote@
+
+
+
+
+ @formgroup.widget;noquote@ @formgroup.label;noquote@
+
+
+
+
+
+ @formgroup.widget;noquote@ |
+
+ | | |
+
+
- @items.html;noquote@
+ @items.html;noquote@
-
+
@@ -58,10 +85,12 @@
+ | | |
+
-
- |
+
+
|
Index: openacs-4/packages/assessment/www/assessment-single-submit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/assessment-single-submit.adp,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/assessment/www/assessment-single-submit.adp 24 Jan 2005 14:54:30 -0000 1.3
+++ openacs-4/packages/assessment/www/assessment-single-submit.adp 11 Mar 2005 18:54:12 -0000 1.4
@@ -37,13 +37,19 @@
@items.content;noquote@ |
-
+
|
Index: openacs-4/packages/assessment/www/assessment.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/assessment.tcl,v
diff -u -r1.39 -r1.40
--- openacs-4/packages/assessment/www/assessment.tcl 2 Mar 2005 22:37:05 -0000 1.39
+++ openacs-4/packages/assessment/www/assessment.tcl 11 Mar 2005 18:54:12 -0000 1.40
@@ -249,15 +249,15 @@
{session_id:text(hidden) {value $session_id}}
}
-multirow create items as_item_id name title description subtext required_p max_time_to_complete presentation_type html submitted_p content
+multirow create items as_item_id name title description subtext required_p max_time_to_complete presentation_type html submitted_p content as_item_type_id choice_orientation next_title
set unsubmitted_list [list]
set validate_list [list]
set required_count 0
foreach one_item $item_list {
- util_unlist $one_item as_item_id name title description subtext required_p max_time_to_complete content_rev_id content_filename content_type
-
+ util_unlist $one_item as_item_id name title description subtext required_p max_time_to_complete content_rev_id content_filename content_type as_item_type_id
+
if {$required_p == "t"} {
# make sure that mandatory items are answered
lappend validate_list "response_to_item.$as_item_id {\[exists_and_not_null response_to_item($as_item_id)\]} \"\[_ assessment.form_element_required\]\""
@@ -338,9 +338,25 @@
}
set max_time_to_complete [as::assessment::pretty_time -seconds $max_time_to_complete]
- multirow append items $as_item_id $name $title $description $subtext $required_p $max_time_to_complete $presentation_type "" $submitted_p [as::assessment::display_content -content_id $content_rev_id -filename $content_filename -content_type $content_type]
+ if {$presentation_type == "rb" || $presentation_type == "cb"} {
+ db_1row choice_orientation {}
+ } else {
+ set choice_orientation ""
+ }
+
+ multirow append items $as_item_id $name $title $description $subtext $required_p $max_time_to_complete $presentation_type "" $submitted_p [as::assessment::display_content -content_id $content_rev_id -filename $content_filename -content_type $content_type] $as_item_type_id $choice_orientation ""
}
+for {set i 1; set j 2} {$i <= ${items:rowcount}} {incr i; incr j} {
+ upvar 0 items:$i this
+ if {$i < ${items:rowcount}} {
+ upvar 0 items:$j next
+ set this(next_title) $next(title)
+ } else {
+ set this(next_title) ""
+ }
+}
+
if {$display(submit_answer_p) != "t"} {
# process multiple submit
set template "assessment-section-submit"
Index: openacs-4/packages/assessment/www/assessment.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/assessment.xql,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/assessment/www/assessment.xql 29 Jan 2005 11:03:07 -0000 1.11
+++ openacs-4/packages/assessment/www/assessment.xql 11 Mar 2005 18:54:12 -0000 1.12
@@ -73,6 +73,18 @@
+
+
+
+ select d.choice_orientation
+ from as_item_rels r, as_item_display_$presentation_type d
+ where r.item_rev_id = :as_item_id
+ and r.rel_type = 'as_item_display_rel'
+ and r.target_rev_id = d.as_item_display_id
+
+
+
+
Index: openacs-4/packages/assessment/www/asm-admin/item-add-mc-choices.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-mc-choices.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/assessment/www/asm-admin/item-add-mc-choices.tcl 24 Feb 2005 09:22:12 -0000 1.5
+++ openacs-4/packages/assessment/www/asm-admin/item-add-mc-choices.tcl 11 Mar 2005 18:54:12 -0000 1.6
@@ -47,9 +47,9 @@
set count_correct 0
db_foreach get_choices {} {
if {$correct_answer_p == "t"} {
- append ad_form_code "\{infotxt.$choice_id:text(inform) \{label \"[_ assessment.Choice]\"\} \{value \"$title \"\}\}\n"
+ append ad_form_code "\{infotxt.$choice_id:text(inform) \{label \"[_ assessment.Choice] $title\"\} \{value \"\"\}\}\n"
} else {
- append ad_form_code "\{infotxt.$choice_id:text(inform) \{label \"[_ assessment.Choice]\"\} \{value \"$title \"\}\}\n"
+ append ad_form_code "\{infotxt.$choice_id:text(inform) \{label \"[_ assessment.Choice] $title\"\} \{value \"\"\}\}\n"
}
append ad_form_code "\{selected.$choice_id:text(checkbox),optional \{label \"[_ assessment.Default_Selected]\"\} \{options \$selected_options\} \{help_text \"[_ assessment.Default_Selected_help]\"\}\}\n"
append ad_form_code "\{fixed_pos.$choice_id:text,optional,nospell \{label \"[_ assessment.Fixed_Position]\"\} \{html \{size 5 maxlength 5\}\} \{help_text \"[_ assessment.choice_Fixed_Position_help]\"\}\}\n"
Index: openacs-4/packages/assessment/www/asm-admin/item-add-mc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-mc.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/assessment/www/asm-admin/item-add-mc.tcl 21 Feb 2005 14:32:56 -0000 1.3
+++ openacs-4/packages/assessment/www/asm-admin/item-add-mc.tcl 11 Mar 2005 18:54:12 -0000 1.4
@@ -30,10 +30,13 @@
set page_title [_ assessment.add_item_type_mc]
set context_bar [ad_context_bar [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title]
+set folder_id [as::assessment::folder_id -package_id $package_id]
set boolean_options [list [list "[_ assessment.yes]" t] [list "[_ assessment.no]" f]]
set correct_options [list [list "[_ assessment.yes]" t]]
+set choice_sets [db_list_of_lists existing_choice_sets {}]
+set choice_sets [concat [list [list "" ""]] $choice_sets]
set display_types [list]
foreach display_type [db_list display_types {}] {
lappend display_types [list "[_ assessment.item_display_$display_type]" $display_type]
@@ -48,6 +51,7 @@
{num_correct_answers:text,optional,nospell {label "[_ assessment.num_Correct_Answer]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_Correct_help]"}}
{num_answers:text,optional,nospell {label "[_ assessment.num_Answers]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_Answers_help]"}}
{display_type:text(select) {label "[_ assessment.Display_Type]"} {options $display_types} {help_text "[_ assessment.Display_Type_help]"}}
+ {mc_id:text(select),optional {label "[_ assessment.Choice_Sets]"} {options $choice_sets} {help_text "[_ assessment.Choice_Sets_help]"}}
}
# add form entries for each choice
@@ -70,6 +74,7 @@
append ad_form_code "\}"
eval ad_form -extend -name item_add_mc $ad_form_code
+
set edit_request "{
set title \"\"
set increasing_p f
@@ -91,16 +96,20 @@
set edit_data "{
db_transaction {
if {!\[db_0or1row item_type {}\] || \$object_type != \"as_item_type_mc\"} {
- set mc_id \[as::item_type_mc::new \\
+ if {\[empty_string_p \$mc_id\]} {
+ set new_mc_id \[as::item_type_mc::new \\
-title \$title \\
-increasing_p \$increasing_p \\
-allow_negative_p \$negative_p \\
-num_correct_answers \$num_correct_answers \\
-num_answers \$num_answers\]
+ } else {
+ set new_mc_id \$mc_id
+ }
if {!\[info exists object_type\]} {
# first item type mapped
- as::item_rels::new -item_rev_id \$as_item_id -target_rev_id \$mc_id -type as_item_type_rel
+ as::item_rels::new -item_rev_id \$as_item_id -target_rev_id \$new_mc_id -type as_item_type_rel
} else {
# old item type existing
set as_item_id \[as::item::new_revision -as_item_id \$as_item_id\]
@@ -109,22 +118,27 @@
} else {
# old mc item type existing
set as_item_id \[as::item::new_revision -as_item_id \$as_item_id\]
- set mc_id \[as::item_type_mc::edit \\
+ if {\[empty_string_p \$mc_id\]} {
+ set new_mc_id \[as::item_type_mc::edit \\
-as_item_type_id \$as_item_type_id \\
-title \$title \\
-increasing_p \$increasing_p \\
-allow_negative_p \$negative_p \\
-num_correct_answers \$num_correct_answers \\
-num_answers \$num_answers\]
+ } else {
+ set new_mc_id \$mc_id
+ }
db_dml update_item_type {}
}
set count 0
- foreach i \[lsort -integer \[array names choice\]\] {
- if {!\[empty_string_p \$choice(\$i)\]} {
- incr count
- set choice_id \[as::item_choice::new -mc_id \$mc_id \\
+ if {\[empty_string_p \$mc_id\]} {
+ foreach i \[lsort -integer \[array names choice\]\] {
+ if {!\[empty_string_p \$choice(\$i)\]} {
+ incr count
+ set choice_id \[as::item_choice::new -mc_id \$new_mc_id \\
-title \$choice(\$i) \\
-numeric_value \"\" \\
-text_value \"\" \\
@@ -134,14 +148,19 @@
-correct_answer_p \[ad_decode \[info exists correct(\$i)\] 0 f t\] \\
-sort_order \$count \\
-percent_score \"\"\]
+ }
}
}
}
}"
set after_submit "{
# now go to form to enter choice-specific data
- ad_returnredirect \[export_vars -base \"item-add-mc-choices\" {assessment_id section_id as_item_id after mc_id display_type}\]
+ if {\[empty_string_p \$mc_id\]} {
+ ad_returnredirect \[export_vars -base \"item-add-mc-choices\" {assessment_id section_id as_item_id after mc_id display_type}\]
+ } else {
+ ad_returnredirect \[export_vars -base \"item-add-display-\$display_type\" {assessment_id section_id as_item_id after}\]
+ }
ad_script_abort
}"
Index: openacs-4/packages/assessment/www/asm-admin/item-add-mc.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-mc.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/assessment/www/asm-admin/item-add-mc.xql 1 Feb 2005 22:00:10 -0000 1.1
+++ openacs-4/packages/assessment/www/asm-admin/item-add-mc.xql 11 Mar 2005 18:54:12 -0000 1.2
@@ -1,6 +1,18 @@
+
+
+
+ select r.title, r.revision_id
+ from cr_revisions r, cr_items i
+ where r.revision_id = i.latest_revision
+ and i.parent_id = :folder_id
+ and i.content_type = 'as_item_type_mc'
+
+
+
+
@@ -27,7 +39,7 @@
update as_item_rels
- set target_rev_id = :mc_id
+ set target_rev_id = :new_mc_id
where item_rev_id = :as_item_id
and rel_type = 'as_item_type_rel'
Index: openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices.tcl 21 Feb 2005 14:32:56 -0000 1.4
+++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices.tcl 11 Mar 2005 18:54:12 -0000 1.5
@@ -48,9 +48,9 @@
foreach one_choice $choices {
util_unlist $one_choice choice_id title correct_answer_p feedback_text selected_p percent_score fixed_position answer_value content_rev_id content_filename content_name
if {$correct_answer_p == "t"} {
- append ad_form_code "\{infotxt.$choice_id:text(inform) \{label \"[_ assessment.Choice]\"\} \{value \"$title \"\}\}\n"
+ append ad_form_code "\{infotxt.$choice_id:text(inform) \{label \"[_ assessment.Choice] $title\"\} \{value \"\"\}\}\n"
} else {
- append ad_form_code "\{infotxt.$choice_id:text(inform) \{label \"[_ assessment.Choice]\"\} \{value \"$title \"\}\}\n"
+ append ad_form_code "\{infotxt.$choice_id:text(inform) \{label \"[_ assessment.Choice] $title\"\} \{value \"\"\}\}\n"
}
if {$selected_p == "t"} {
append ad_form_code "\{selected.$choice_id:text(checkbox),optional \{label \"[_ assessment.Default_Selected]\"\} \{options \$selected_options\} \{value \"t\"\} \{help_text \"[_ assessment.Default_Selected_help]\"\}\}\n"
| |