Index: openacs-4/packages/assessment/lib/section-items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/section-items.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/lib/section-items.adp 14 Nov 2004 16:45:52 -0000 1.1 @@ -0,0 +1,76 @@ +
#assessment.Add_New# | ||||||
@items.rownum@. |
+
+#assessment.Edit#
+
+ | |||||
+ ++ | ||||||
#assessment.Add_New# |
+Index: openacs-4/packages/assessment/www/admin/assessment-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/assessment-form.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/assessment-form.tcl 14 Nov 2004 16:42:32 -0000 1.1 @@ -0,0 +1,150 @@ +ad_page_contract { + Form to add/edit an assessment. + + @author Timo Hentschel (timo@timohentschel.de) + @cvs-id $Id: +} { + assessment_id:integer,optional +} -properties { + context_bar:onevalue + page_title:onevalue +} + +if {[info exists assessment_id]} { + set page_title [_ assessment.Edit_Assessment] +} else { + set page_title [_ assessment.New_Assessment2] +} + +set context_bar [ad_context_bar $page_title] +set format "YYYY-MM-DD HH24:MI" + + +ad_form -name assessment_form -action assessment-form -form { + {assessment_id:key} +} + +if {![exists_and_not_null assessment_id]} { + ad_form -extend -name assessment_form -form { + {name:text {label "[_ assessment.Name]"} {html {size 40 maxlength 400}}} + } +} + +set boolean_options [list [list "[_ assessment.yes]" t] [list "[_ assessment.no]" f]] +set feedback_options [list [list "[_ assessment.None]" none] [list "[_ assessment.All]" all] [list "[_ assessment.Only_incorrect]" incorrect] [list "[_ assessment.Only_correct]" correct]] +set navigation_options [list [list "[_ assessment.Default_Path]" "default path"] [list "[_ assessment.Randomized]" randomized] [list "[_ assessment.Rulebased_branching]" "rule-based branching"]] + + +ad_form -extend -name assessment_form -form { + {title:text {label "[_ assessment.Title]"} {html {size 80 maxlength 1000}}} + {description:text(textarea) {label "[_ assessment.Description]"} {html {rows 5 cols 80}}} + {instructions:text(textarea),optional {label "[_ assessment.Instructions]"} {html {rows 5 cols 80}}} + {mode:text,optional {label "[_ assessment.Mode]"} {html {size 25 maxlength 25}}} + {editable_p:text(select) {label "[_ assessment.Editable]"} {options $boolean_options}} + {anonymous_p:text(select) {label "[_ assessment.Anonymous_Responses]"} {options $boolean_options}} + {secure_access_p:text(select) {label "[_ assessment.Secure_Access_1]"} {options $boolean_options}} + {reuse_responses_p:text(select) {label "[_ assessment.Reuse_Responses_1]"} {options $boolean_options}} + {show_item_name_p:text(select) {label "[_ assessment.Show_Item_Name_1]"} {options $boolean_options}} + {entry_page:text,optional {label "[_ assessment.Entry_Page]"} {html {size 50 maxlength 50}}} + {exit_page:text,optional {label "[_ assessment.Exit_Page]"} {html {size 50 maxlength 50}}} + {consent_page:text(textarea),optional {label "[_ assessment.Consent_Page]"} {html {rows 5 cols 80}}} + {return_url:text,optional {label "[_ assessment.Return_Url]"} {html {size 50 maxlength 50}}} + {start_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.Start_Time]"} {format $format} {help}} + {end_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.End_Time]"} {format $format} {help}} + {number_tries:integer,optional {label "[_ assessment.Number_of_Tries]"} {html {size 10 maxlength 10}}} + {wait_between_tries:integer,optional {label "[_ assessment.Minutes_for_Retry]"} {html {size 10 maxlength 10}}} + {time_for_response:integer,optional {label "[_ assessment.time_for_completion]"} {html {size 10 maxlength 10}}} + {show_feedback:text(select),optional {label "[_ assessment.Show_Feedback]"} {options $feedback_options}} + {section_navigation:text(select),optional {label "[_ assessment.Section_Navigation]"} {options $navigation_options}} +} -new_request { + set name "" + set title "" + set description "" + set instructions "" + set mode "" + set editable_p f + set anonymous_p f + set secure_access_p f + set reuse_responses_p f + set show_item_name_p f + set entry_page "" + set exit_page "" + set consent_page "" + set return_url "" + set start_time "" + set end_time "" + set number_tries "" + set wait_between_tries "" + set time_for_response "" + set show_feedback "none" + set section_navigation "default path" +} -edit_request { + db_1row assessment_data {} + + if {![empty_string_p $start_time]} { + set start_time [util::date::acquire clock [clock scan $start_time]] + } + if {![empty_string_p $end_time]} { + set end_time [util::date::acquire clock [clock scan $end_time]] + } +} -on_submit { + if {$start_time == "NULL"} { + set start_time "" + } + if {$end_time == "NULL"} { + set end_time "" + } +} -new_data { + set assessment_rev_id [as::assessment::new \ + -name $name \ + -title $title \ + -description $description \ + -instructions $instructions \ + -mode $mode \ + -editable_p $editable_p \ + -anonymous_p $anonymous_p \ + -secure_access_p $secure_access_p \ + -reuse_responses_p $reuse_responses_p \ + -show_item_name_p $show_item_name_p \ + -entry_page $entry_page \ + -exit_page $exit_page \ + -consent_page $consent_page \ + -return_url $return_url \ + -start_time $start_time \ + -end_time $end_time \ + -number_tries $number_tries \ + -wait_between_tries $wait_between_tries \ + -time_for_response $time_for_response \ + -show_feedback $show_feedback \ + -section_navigation $section_navigation] + + set assessment_id [db_string assessment_id_from_revision {}] +} -edit_data { + set assessment_rev_id [as::assessment::edit \ + -assessment_id $assessment_id \ + -title $title \ + -description $description \ + -instructions $instructions \ + -mode $mode \ + -editable_p $editable_p \ + -anonymous_p $anonymous_p \ + -secure_access_p $secure_access_p \ + -reuse_responses_p $reuse_responses_p \ + -show_item_name_p $show_item_name_p \ + -entry_page $entry_page \ + -exit_page $exit_page \ + -consent_page $consent_page \ + -return_url $return_url \ + -start_time $start_time \ + -end_time $end_time \ + -number_tries $number_tries \ + -wait_between_tries $wait_between_tries \ + -time_for_response $time_for_response \ + -show_feedback $show_feedback \ + -section_navigation $section_navigation] +} -after_submit { + ad_returnredirect [export_vars -base one-a {assessment_id}] + ad_script_abort +} + +ad_return_template Index: openacs-4/packages/assessment/www/admin/assessment-form.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/assessment-form.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/assessment-form.xql 14 Nov 2004 16:42:32 -0000 1.1 @@ -0,0 +1,30 @@ + ++
+Index: openacs-4/packages/assessment/www/admin/item-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/item-delete.tcl 14 Nov 2004 16:42:31 -0000 1.1 @@ -0,0 +1,53 @@ +ad_page_contract { + Confirmation form to remove an item from a section. + + @author Timo Hentschel (timo@timohentschel.de) + @cvs-id $Id: +} { + assessment_id:integer + section_id:integer + as_item_id:integer +} -properties { + context_bar:onevalue + page_title:onevalue +} + +ad_require_permission $assessment_id admin + +# Get the assessment data +as::assessment::data -assessment_id $assessment_id + +if {![info exists assessment_data(assessment_id)]} { + ad_return_complaint 1 "[_ assessment.Requested_assess_does]" + ad_script_abort +} + +set page_title "[_ assessment.remove_item]" +set context_bar [ad_context_bar [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title] + +set confirm_options [list [list "[_ assessment.continue_with_remove]" t] [list "[_ assessment.cancel_and_return]" f]] + +ad_form -name item_delete_confirm -action item-delete -export { assessment_id section_id } -form { + {as_item_id:key} + {item_title:text(inform) {label "[_ assessment.remove_1]"}} + {from:text(inform) {label "[_ assessment.from]"} {value $assessment_data(title)}} + {confirmation:text(radio) {label " "} {options $confirm_options} {value f}} +} -select_query_name {item_title} -on_submit { + if {$confirmation} { + db_transaction { + set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] + + set new_section_id [as::section::new_revision -section_id $section_id] + + db_dml update_section_in_assessment {} + db_1row get_sort_order_to_be_removed {} + db_dml remove_item_from_section {} + db_dml move_up_items {} + } + } +} -after_submit { + ad_returnredirect [export_vars -base one-a {assessment_id}] + ad_script_abort +} + +ad_return_template Index: openacs-4/packages/assessment/www/admin/item-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-delete.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/item-delete.xql 14 Nov 2004 16:42:31 -0000 1.1 @@ -0,0 +1,57 @@ + ++
$errmsg" + ad_script_abort +} + +ad_returnredirect [export_vars -base one-a {assessment_id}] Index: openacs-4/packages/assessment/www/admin/item-swap.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/item-swap.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/item-swap.xql 14 Nov 2004 16:42:31 -0000 1.1 @@ -0,0 +1,15 @@ + +
#assessment.Assessment_Administration#
+ +@assessment_data.title@ #assessment.Created_by# @assessment_data.creator_name@#assessment.on_creation_date# + + ++
#assessment.Assessment_Title#: #assessment.Description#: #assessment.Instructions#: |
+ #assessment.Preview#
+ #assessment.Edit#
+ @assessment_data.title@
+ |
+
#assessment.View_Responses# | + #assessment.By_user# | + #assessment.Summary# | + #assessment.CSV_file# | +
#assessment.Email_Options# | @notification_chunk;noquote@ |
#assessment.Send_bulkmail# #assessment.regarding_this_assess# | |
+ + | |
#assessment.Extreme_Actions# | +#assessment.Delete_this_assess# #assessment.Removes_all_questio# + #assessment.Copy_this_assess# #assessment.Lets_you_use_this_a# |
+
@sections.rownum@. |
+
+#assessment.Edit#
+
+#assessment.add_new_section#
+
+#assessment.add_existing_section#
+
+ | |
+ + @sections.title@ ++ |
++ ++
+ #assessment.add_new_section# + #assessment.add_existing_section# + |
+Index: openacs-4/packages/assessment/www/admin/section-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/section-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/section-delete.tcl 14 Nov 2004 16:43:21 -0000 1.1 @@ -0,0 +1,50 @@ +ad_page_contract { + Confirmation form to remove a section from an assessment. + + @author Timo Hentschel (timo@timohentschel.de) + @cvs-id $Id: +} { + assessment_id:integer + section_id:integer +} -properties { + context_bar:onevalue + page_title:onevalue +} + +ad_require_permission $assessment_id admin + +# Get the assessment data +as::assessment::data -assessment_id $assessment_id + +if {![info exists assessment_data(assessment_id)]} { + ad_return_complaint 1 "[_ assessment.Requested_assess_does]" + ad_script_abort +} + +set page_title "[_ assessment.remove_section]" +set context_bar [ad_context_bar [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title] + +set confirm_options [list [list "[_ assessment.continue_with_remove]" t] [list "[_ assessment.cancel_and_return]" f]] + +ad_form -name section_delete_confirm -action section-delete -export { assessment_id } -form { + {section_id:key} + {section_title:text(inform) {label "[_ assessment.remove_1]"}} + {from:text(inform) {label "[_ assessment.from]"} {value $assessment_data(title)}} + {confirmation:text(radio) {label " "} {options $confirm_options} {value f}} +} -select_query_name {section_title} -on_submit { +} -on_submit { + if {$confirmation} { + db_transaction { + set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] + + db_1row get_sort_order_to_be_removed {} + db_dml remove_section_from_assessment {} + db_dml move_up_sections {} + } + } +} -after_submit { + ad_returnredirect [export_vars -base one-a {assessment_id}] + ad_script_abort +} + +ad_return_template Index: openacs-4/packages/assessment/www/admin/section-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/section-delete.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/section-delete.xql 14 Nov 2004 16:43:21 -0000 1.1 @@ -0,0 +1,46 @@ + ++
+Index: openacs-4/packages/assessment/www/admin/section-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/section-form.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/section-form.tcl 14 Nov 2004 16:43:21 -0000 1.1 @@ -0,0 +1,111 @@ +ad_page_contract { + Form to add/edit a section. + + @author Timo Hentschel (timo@timohentschel.de) + @cvs-id $Id: +} { + assessment_id:integer + section_id:integer,optional + after:integer,optional +} -properties { + context_bar:onevalue + page_title:onevalue +} + +ad_require_permission $assessment_id admin + +# Get the assessment data +as::assessment::data -assessment_id $assessment_id + +if {![info exists assessment_data(assessment_id)]} { + ad_return_complaint 1 "[_ assessment.Requested_assess_does]" + ad_script_abort +} + +if {[info exists section_id]} { + set page_title [_ assessment.edit_section] +} else { + set page_title [_ assessment.add_new_section] +} + +set context_bar [ad_context_bar [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title] + +set display_types [db_list_of_lists section_display_types {}] +set display_types [concat [list [list "" ""]] $display_types] + + +ad_form -name section_form -action section-form -export { assessment_id after } -form { + {section_id:key} +} + +if {[exists_and_not_null after]} { + ad_form -extend -name section_form -form { + {name:text {label "[_ assessment.Name]"} {html {size 40 maxlength 400}}} + } +} + +set boolean_options [list [list "[_ assessment.yes]" t] [list "[_ assessment.no]" f]] + +ad_form -extend -name section_form -form { + {title:text {label "[_ assessment.Title]"} {html {size 80 maxlength 1000}}} + {description:text(textarea) {label "[_ assessment.Description]"} {html {rows 5 cols 80}}} + {definition:text(textarea),optional {label "[_ assessment.Definition]"} {html {rows 5 cols 80}}} + {instructions:text(textarea),optional {label "[_ assessment.Instructions]"} {html {rows 5 cols 80}}} + {feedback_text:text(textarea),optional {label "[_ assessment.Feedback]"} {html {rows 5 cols 80}}} + {max_time_to_complete:integer,optional {label "[_ assessment.time_for_completion]"} {html {size 10 maxlength 10}}} + {section_display_type_id:text(select),optional {label "[_ assessment.Display_Type]"} {options $display_types}} + {required_p:text(select) {label "[_ assessment.Required]"} {options $boolean_options}} +} -new_request { + set name "" + set title "" + set description "" + set definition "" + set instructions "" + set feedback_text "" + set max_time_to_complete "" + set section_display_type_id "" + set required_p t +} -edit_request { + db_1row section_data {} +} -new_data { + db_transaction { + set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] + + set section_id [as::section::new \ + -name $name \ + -title $title \ + -description $description \ + -definition $definition \ + -instructions $instructions \ + -feedback_text $feedback_text \ + -max_time_to_complete $max_time_to_complete \ + -required_p $required_p \ + -section_display_type_id $section_display_type_id] + + db_dml move_down_sections {} + set sort_order [expr $after + 1] + db_dml add_section_to_assessment {} + } +} -edit_data { + db_transaction { + set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] + + set new_section_id [as::section::edit \ + -section_id $section_id \ + -title $title \ + -description $description \ + -definition $definition \ + -instructions $instructions \ + -feedback_text $feedback_text \ + -max_time_to_complete $max_time_to_complete \ + -required_p $required_p \ + -section_display_type_id $section_display_type_id] + + db_dml update_section_of_assessment {} + } +} -after_submit { + ad_returnredirect [export_vars -base one-a {assessment_id}] + ad_script_abort +} + +ad_return_template Index: openacs-4/packages/assessment/www/admin/section-form.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/admin/Attic/section-form.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/admin/section-form.xql 14 Nov 2004 16:43:21 -0000 1.1 @@ -0,0 +1,59 @@ + ++
$errmsg" + ad_script_abort +} + +ad_returnredirect [export_vars -base one-a {assessment_id}]