Index: openacs-4/packages/assessment/lib/assessment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/assessment.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/assessment/lib/assessment.tcl 6 Aug 2006 19:03:08 -0000 1.14 +++ openacs-4/packages/assessment/lib/assessment.tcl 26 Sep 2006 00:22:44 -0000 1.15 @@ -1,5 +1,5 @@ ad_page_contract { - +e This page allows to display an assessment with sections and items @author Eduardo PĂ©rez Ureta (eperez@it.uc3m.es) @@ -13,7 +13,7 @@ {item_order:integer,optional ""} {item_id ""} {return_url:optional} - response_to_item:array,optional,multiple,html + response_to_item:array,optional,multiple {next_asm:optional} {response:multiple,optional} {next_url ""} Index: openacs-4/packages/assessment/lib/comments-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/comments-chunk.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/lib/comments-chunk.adp 12 Jun 2006 02:49:49 -0000 1.2 +++ openacs-4/packages/assessment/lib/comments-chunk.adp 26 Sep 2006 00:22:44 -0000 1.3 @@ -1,18 +1,17 @@ -

Comments

+

Reviewer Comments

-

-@comments.title@ Edit -

+@comments.title@ +
@comments.html_content;noquote@ -

+
- @comments.author@ (on @comments.creation_date_ansi@) -No comments. +No reviewer comments have been added to this assessment yet. -

+
Add comment \ No newline at end of file Index: openacs-4/packages/assessment/lib/results-messages.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/results-messages.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/lib/results-messages.adp 21 Feb 2005 14:32:55 -0000 1.1 +++ openacs-4/packages/assessment/lib/results-messages.adp 26 Sep 2006 00:22:44 -0000 1.2 @@ -1,9 +1,5 @@ -


+
  • @results.description@ #assessment.Results_change_display#
  • +
    Index: openacs-4/packages/assessment/lib/results-messages.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/results-messages.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/lib/results-messages.tcl 21 Feb 2005 14:32:55 -0000 1.1 +++ openacs-4/packages/assessment/lib/results-messages.tcl 26 Sep 2006 00:22:44 -0000 1.2 @@ -1,9 +1,10 @@ # Display all change messages for result points # author Timo Hentschel (timo@timohentschel.de) -set format "[lc_get formbuilder_date_format], [lc_get formbuilder_time_format]" +set format "[lc_get d_fmt], [lc_get t_fmt]" db_multirow -extend {user_url} results result_changes { } { + set creation_date [lc_time_fmt $creation_date $format] set user_url [acs_community_member_url -user_id $creation_user] } Index: openacs-4/packages/assessment/lib/results-messages.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/results-messages.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/lib/results-messages.xql 24 Feb 2005 09:22:11 -0000 1.2 +++ openacs-4/packages/assessment/lib/results-messages.xql 26 Sep 2006 00:22:44 -0000 1.3 @@ -5,7 +5,7 @@ select cr.title, cr.description, sr.points, p.first_names, p.last_name, - to_char(o.creation_date, :format) as create_date, o.creation_user + o.creation_date, o.creation_user from as_session_results sr, cr_revisions cr, acs_objects o, persons p, as_item_data d, as_session_item_map m where cr.revision_id = sr.result_id Index: openacs-4/packages/assessment/lib/session-items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session-items.adp,v diff -u -r1.11 -r1.12 --- openacs-4/packages/assessment/lib/session-items.adp 12 Jul 2006 23:36:30 -0000 1.11 +++ openacs-4/packages/assessment/lib/session-items.adp 26 Sep 2006 00:22:44 -0000 1.12 @@ -1,53 +1,22 @@ - - + #assessment.not_answered# - +
      - - -
    - - - - - - - + + - - - - - + + @items.feedback_right;noquote@ + @items.feedback_wrong;noquote@ + + +
    -
    #assessment.not_answered#
    @items.name@: 
    - - (#assessment.max_time# @items.max_time_to_complete@) - @items.result_points@ / @items.points@ #assessment.points# - - : @items.feedback;noquote@ - +
  • + @items.name@: + + (#assessment.max_time# @items.max_time_to_complete@) - - - #assessment.not_yet_reviewed# - #assessment.not_answered# - - #assessment.Edit# - - -
  •  
    @items.title;noquote@ @items.content;noquote@ -
    @items.feedback_right;noquote@
    -
    @items.feedback_wrong;noquote@
    -
    - -
    +
    - -
    @@ -103,18 +71,24 @@ -
    -
    @items.description;noquote@ @@ -74,7 +43,6 @@ - +
    [i] @items.subtext@
    -
    -
    +
    Index: openacs-4/packages/assessment/lib/session.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/lib/session.adp 10 Jul 2006 19:16:16 -0000 1.4 +++ openacs-4/packages/assessment/lib/session.adp 26 Sep 2006 00:22:44 -0000 1.5 @@ -5,7 +5,7 @@ #assessment.Assessment#: @assessment_data.title@ #assessment.User_ID#: @first_names@ @last_name@
    #assessment.lt_bNoteb_This_assessmen#
    #assessment.anonymous_name#
    -#assessment.Attempt#: @session_attempt@ / @assessment_data.number_tries@ +#assessment.Attempt#: @session_attempts.rownum@@session_attempts.rownum@   #assessment.Percent_Score#: @percent_score@ #assessment.Started#: @session_start@ Index: openacs-4/packages/assessment/lib/session.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/lib/session.tcl 27 Jun 2006 19:11:40 -0000 1.2 +++ openacs-4/packages/assessment/lib/session.tcl 26 Sep 2006 00:22:44 -0000 1.3 @@ -6,12 +6,23 @@ @date 2004-12-24 @cvs-id $Id: } { - session_id:integer + {session_id:integer 0} + {assessment_id:integer 0} {next_url ""} } -properties { context_bar:onevalue page_title:onevalue } +set user_id [ad_conn user_id] +if {$session_id == 0} { + # require assessment_id if session_id is blank + if {$assessment_id == 0} { + ad_return_complaint 1 "Session_id or Assessment_id is required" + } + #find the latest session + db_1row get_latest_session "" -column_array latest_session + set session_id $latest_session(session_id) +} db_1row find_assessment {} @@ -24,7 +35,6 @@ ad_script_abort } -set user_id [ad_conn user_id] if {$subject_id != $user_id} { permission::require_permission -object_id $assessment_id -privilege admin } @@ -39,8 +49,8 @@ set session_time [as::assessment::pretty_time -seconds $session_time -hours] # get the number of attempts -set session_attempt [db_string session_attempt {}] +db_multirow session_attempts session_attempts {} set show_username_p 1 # only admins are allowed to see responses of other users if {$assessment_data(anonymous_p) == "t" && $subject_id != $user_id} { Index: openacs-4/packages/assessment/lib/session.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/lib/session.xql 12 Jun 2006 03:30:09 -0000 1.1 +++ openacs-4/packages/assessment/lib/session.xql 26 Sep 2006 00:22:44 -0000 1.2 @@ -12,13 +12,14 @@
    - + - select count(*) + select session_id from as_sessions s, cr_revisions r where s.subject_id = :subject_id and s.assessment_id = r.revision_id and r.item_id = :assessment_id + order by last_mod_datetime @@ -40,4 +41,17 @@ + + + select max(o.creation_date), s.session_id + from as_sessions s, + acs_objects o, + cr_revisions cr + where s.subject_id=:user_id + and s.assessment_id=(select latest_revision from cr_items where item_id=:assessment_id) + and o.object_id = cr.item_id + and s.session_id = cr.revision_id + group by s.session_id + + Index: openacs-4/packages/assessment/sql/oracle/upgrade/upgrade-0.20-0.21.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/oracle/upgrade/upgrade-0.20-0.21.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/sql/oracle/upgrade/upgrade-0.20-0.21.sql 15 Aug 2006 01:44:05 -0000 1.2 +++ openacs-4/packages/assessment/sql/oracle/upgrade/upgrade-0.20-0.21.sql 26 Sep 2006 00:22:45 -0000 1.3 @@ -7,4 +7,12 @@ -- update cr_revisions set content=title where item_id in (select item_id from cr_items where content_type='as_items'); -update cr_items set storage_type='lob' where content_type='as_items'; \ No newline at end of file +update cr_items set storage_type='lob' where content_type='as_items'; + +alter table as_assessments rename type to type_int; +alter table as_assessments add type varchar2(1000); +update as_assessments set type='survey' where type_int = 1; +update as_assessments set type='test' where type_int = 2; +alter table as_assessments drop type_int; +update acs_attributes set datatype='string' where attribute_name='type' and object_type='as_assessments'; + Index: openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.20-0.21.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.20-0.21.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.20-0.21.sql 15 Aug 2006 01:44:05 -0000 1.2 +++ openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.20-0.21.sql 26 Sep 2006 00:22:45 -0000 1.3 @@ -7,4 +7,12 @@ -- update cr_revisions set content=title where item_id in (select item_id from cr_items where content_type='as_items'); -update cr_items set storage_type='text' where content_type='as_items'; \ No newline at end of file +update cr_items set storage_type='text' where content_type='as_items'; + +alter table as_assessments rename type to type_int; +alter table as_assessments add type varchar(1000); +update as_assessments set type='survey' where type_int = 1; +update as_assessments set type='test' where type_int = 2; +alter table as_assessments drop type_int; +update acs_attributes set datatype='string' where attribute_name='type' and object_type='as_assessments'; + Index: openacs-4/packages/assessment/tcl/as-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-install-procs.tcl,v diff -u -r1.34 -r1.35 --- openacs-4/packages/assessment/tcl/as-install-procs.tcl 12 Jun 2006 02:49:50 -0000 1.34 +++ openacs-4/packages/assessment/tcl/as-install-procs.tcl 26 Sep 2006 00:22:45 -0000 1.35 @@ -172,10 +172,9 @@ content::type::attribute::new -content_type {as_assessments} -attribute_name {password} -datatype {string} -pretty_name {Password} -column_spec {varchar(100)} content::type::attribute::new -content_type {as_assessments} -attribute_name {show_feedback} -datatype {string} -pretty_name {Assessment Show comments to the user} -column_spec {varchar(50)} content::type::attribute::new -content_type {as_assessments} -attribute_name {section_navigation} -datatype {string} -pretty_name {Assessment Navigation of sections} -column_spec {varchar(50)} -content::type::attribute::new -content_type {as_assessments} -attribute_name {survey_p} -datatype {string} -pretty_name {Survey} -column_spec {char(1)} -content::type::attribute::new -content_type {as_assessments} -attribute_name {type} -datatype {number} -pretty_name {Type} -column_spec {integer} +# survey_p is replaced by type +content::type::attribute::new -content_type {as_assessments} -attribute_name {type} -datatype {string} -pretty_name {Type} -column_spec {varchar(1000)} - # Sessions content::type::attribute::new -content_type {as_sessions} -attribute_name {assessment_id} -datatype {number} -pretty_name {Assessment ID} -column_spec {integer} content::type::attribute::new -content_type {as_sessions} -attribute_name {subject_id} -datatype {number} -pretty_name {Subject ID} -column_spec {integer} Index: openacs-4/packages/assessment/tcl/as-list-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-list-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/tcl/as-list-procs.tcl 21 Jul 2006 19:27:29 -0000 1.3 +++ openacs-4/packages/assessment/tcl/as-list-procs.tcl 26 Sep 2006 00:22:45 -0000 1.4 @@ -139,7 +139,7 @@ (:as_item_id_$option_item_id is null or exists (select 1 - from as_itemsi ii, as_item_data dd, + from as_items ii, as_item_data dd, (select oi.object_type, it.item_rev_id as as_item_id from as_item_rels it, as_item_rels dt, acs_objects oi where dt.item_rev_id = it.item_rev_id @@ -148,7 +148,7 @@ and oi.object_id = it.target_rev_id) tt, cr_items ci - where ii.item_id = $option_item_id + where ci.item_id = $option_item_id and ii.as_item_id = dd.as_item_id and ii.as_item_id = tt.as_item_id and dd.session_id = m.session_id @@ -160,7 +160,6 @@ } } - ns_log notice "as_list_filters returning '[list list_filters $list_filters assessment_search_options $assessment_search_options search_js_array $search_js_array]'" return [list list_filters $list_filters assessment_search_options $assessment_search_options search_js_array $search_js_array] } @@ -301,7 +300,7 @@ (:as_item_id_$option_item_id is null or exists (select 1 - from as_itemsi ii, as_item_data dd, + from as_items ii, as_item_data dd, (select oi.object_type, it.item_rev_id as as_item_id from as_item_rels it, as_item_rels dt, acs_objects oi where dt.item_rev_id = it.item_rev_id @@ -310,7 +309,7 @@ and oi.object_id = it.target_rev_id) tt, cr_items ci - where ii.item_id = $option_item_id + where ci.item_id = $option_item_id and ii.as_item_id = dd.as_item_id and ii.as_item_id = tt.as_item_id and dd.session_id = m.session_id Index: openacs-4/packages/assessment/tcl/as-session-results-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-session-results-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/tcl/as-session-results-procs.tcl 12 Jun 2006 03:02:38 -0000 1.3 +++ openacs-4/packages/assessment/tcl/as-session-results-procs.tcl 26 Sep 2006 00:22:45 -0000 1.4 @@ -17,33 +17,32 @@ @creation-date 2005-02-17 New as_session_results + } { if {$package_id eq ""} { set package_id [ad_conn package_id] } - ns_log notice "session results new package_id = '${package_id}'" +# ns_log notice "session results new package_id = '${package_id}'" set folder_id [as::assessment::folder_id -package_id $package_id] # Insert as_session_results in the CR (and as_session_results table) getting the revision_id - set transaction_successful_p 0 - while { ! $transaction_successful_p } { - db_transaction { +# db_transaction { if {![db_0or1row result_exists {}]} { set result_item_id [content::item::new -parent_id $folder_id -content_type {as_session_results} -name [as::item::generate_unique_name]] - } + ns_log notice "DAVEB101 session rsults new new item $result_item_id" + } + ns_log notice "DAVEB101 session rsults new new revision $result_item_id" set result_id [content::revision::new \ -item_id $result_item_id \ -content_type {as_session_results} \ -title $title \ -description $description \ -attributes [list [list target_id $target_id] \ [list points $points] ] ] - set transaction_successful_p 1 - } on_error { - ns_log notice "as::session_results::new: Transaction Error: $errmsg" - } - } +# } on_error { +# ns_log notice "as::session_results::new: Transaction Error: $errmsg" +# } return $result_id } Index: openacs-4/packages/assessment/tcl/as-session-results-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-session-results-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/tcl/as-session-results-procs.xql 21 Feb 2005 14:32:56 -0000 1.1 +++ openacs-4/packages/assessment/tcl/as-session-results-procs.xql 26 Sep 2006 00:22:45 -0000 1.2 @@ -3,12 +3,12 @@ - select cr.item_id as result_item_id - from cr_revisions cr, as_session_results sr + from cr_revisions cr, as_session_results sr, + cr_items ci where sr.target_id = :target_id and sr.result_id = cr.revision_id - + and cr.revision_id = ci.latest_revision Index: openacs-4/packages/assessment/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/index.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/assessment/www/index.tcl 12 Jun 2006 12:17:10 -0000 1.16 +++ openacs-4/packages/assessment/www/index.tcl 26 Sep 2006 00:22:45 -0000 1.17 @@ -26,6 +26,10 @@ label "[_ assessment.open_assessments]" display_template {@assessments.title;noquote@} } + results { + label "[_ assessment.View_results]" + display_template {\#assessment.View_results\#} + } } -main_class { narrow } Index: openacs-4/packages/assessment/www/asm-admin/approve-check.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/approve-check.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/approve-check.tcl 4 Feb 2005 21:14:22 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/approve-check.tcl 26 Sep 2006 00:22:46 -0000 1.2 @@ -11,6 +11,11 @@ } +permission::require_permission \ + -object_id [ad_conn package_id] \ + -party_id [ad_conn user_id] \ + -privilege "admin" + set count [llength $action_log_id] for { set i 0} { $i< $count } {incr i} { Index: openacs-4/packages/assessment/www/asm-admin/assessment-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/assessment-form.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/assessment/www/asm-admin/assessment-form.tcl 27 Jun 2006 19:11:41 -0000 1.11 +++ openacs-4/packages/assessment/www/asm-admin/assessment-form.tcl 26 Sep 2006 00:22:46 -0000 1.12 @@ -56,7 +56,7 @@ {name:text(inform) {label "#assessment.Name#"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.assessment_Name_help]"}} } } else { - if {$type > 1 } { + if {$type > "survey" } { ad_form -extend -name assessment_form -form { {name:text,optional,nospell {label "[_ assessment.Name]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.assessment_Name_help]"}} } @@ -80,7 +80,7 @@ ad_form -extend -name assessment_form -form {{instructions:text(textarea),optional {label "[_ assessment.Instructions]"} {html {rows 5 cols 80}} {help_text "[_ assessment.as_Instructions_help]"}}} -if { $type == 2 } { +if { $type eq "test" } { ad_form -extend -name assessment_form -form { {run_mode:text,optional,nospell {label "[_ assessment.Mode]"} {html {size 25 maxlength 25}} {help_text "[_ assessment.as_Mode_help]"}} } @@ -98,7 +98,7 @@ } } -if { $type == 2 } { +if { $type eq "test" } { ad_form -extend -name assessment_form -form { {secure_access_p:text(select) {label "[_ assessment.Secure_Access_1]"} {options $boolean_options} {help_text "[_ assessment.as_Secure_Access_help]"}} {reuse_responses_p:text(select) {label "[_ assessment.Reuse_Responses_1]"} {options $boolean_options} {help_text "[_ assessment.as_Reuse_Responses_help]"}} @@ -111,23 +111,23 @@ } -if { ($type == 2 || $type == 5) } { +if { ($type eq "test" || $type eq "5") } { ad_form -extend -name assessment_form -form { {show_item_name_p:text(select) {label "[_ assessment.Show_Item_Name_1]"} {options $boolean_options} {help_text "[_ assessment.as_Show_Item_Name_help]"}} } } else { ad_form -extend -name assessment_form -form { {show_item_name_p:text(hidden) {value "f"}} } } -if { ($type == 2 || $type == 5) } { +if { ($type eq "test" || $type eq "5") } { ad_form -extend -name assessment_form -form { {random_p:text(select) {label "[_ assessment.Allow_Random]"} {options $boolean_options} {help_text "[_ assessment.as_Allow_Random_help]"}} } } else { ad_form -extend -name assessment_form -form { {random_p:text(hidden) {value "t"}} } } -if { ($type == 2 || $type == 3 || $type == 4) } { +if { ($type eq "test" || $type eq "3" || $type eq "4") } { ad_form -extend -name assessment_form -form { {consent_page:text(textarea),optional,nospell {label "[_ assessment.Consent_Page]"} {html {rows 5 cols 80}} {help_text "[_ assessment.as_Consent_Page_help]"}} } @@ -144,7 +144,7 @@ } -if { $type == 2 } { +if { $type eq "test" } { ad_form -extend -name assessment_form -form { {start_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.Start_Time]"} {format $form_format} {help} {help_text "[_ assessment.as_Start_Time_help]"}} {end_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.End_Time]"} {format $form_format} {help} {help_text "[_ assessment.as_End_Time_help]"}} @@ -156,7 +156,7 @@ } } -if { $type == 2 } { +if { $type eq "test" } { ad_form -extend -name assessment_form -form { {number_tries:integer,optional,nospell {label "[_ assessment.Number_of_Tries]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_Number_Tries_help]"}} {wait_between_tries:integer,optional,nospell {label "[_ assessment.Minutes_for_Retry]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_Minutes_Retry_help]"}} @@ -168,7 +168,7 @@ } } -if { $type == 2 } { +if { $type eq "test" } { ad_form -extend -name assessment_form -form { {time_for_response:integer,optional,nospell {label "[_ assessment.time_for_response]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_time_help]"}} } @@ -178,7 +178,7 @@ } } -if { $type == 2 } { +if { $type eq "test" } { ad_form -extend -name assessment_form -form { {ip_mask:text,optional,nospell {label "[_ assessment.ip_mask]"} {html {size 20 maxlength 100}} {help_text "[_ assessment.as_ip_mask_help]"}} {password:text,optional,nospell {label "[_ assessment.password]"} {html {size 20 maxlength 100}} {help_text "[_ assessment.as_password_help]"}} @@ -190,7 +190,7 @@ } } -if { $type == 2 } { +if { $type eq "test" } { ad_form -extend -name assessment_form -form { {show_feedback:text(select),optional {label "[_ assessment.Show_Feedback]"} {options $feedback_options} {help_text "[_ assessment.as_Feedback_help]"}} } @@ -200,7 +200,7 @@ } } -if { $type == 2 } { +if { $type eq "test" } { ad_form -extend -name assessment_form -form { {section_navigation:text(select),optional {label "[_ assessment.Section_Navigation]"} {options $navigation_options} {help_text "[_ assessment.as_Navigation_help]"}} } @@ -306,7 +306,7 @@ if {![empty_string_p $end_time]} { db_dml update_end_time {} } - if { $type == 1} { + if { $type eq "survey"} { db_transaction { set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] Index: openacs-4/packages/assessment/www/asm-admin/assessment-history.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/assessment-history.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/assessment-history.tcl 15 Apr 2005 18:17:29 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/assessment-history.tcl 26 Sep 2006 00:22:46 -0000 1.2 @@ -11,6 +11,11 @@ page_title:onevalue } +permission::require_permission \ + -object_id $assessment_id \ + -party_id [ad_conn user_id] \ + -privilege admin + # Get the assessment data as::assessment::data -assessment_id $assessment_id Index: openacs-4/packages/assessment/www/asm-admin/assessment-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/assessment-new.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/asm-admin/assessment-new.tcl 12 Jun 2006 02:49:51 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/assessment-new.tcl 26 Sep 2006 00:22:46 -0000 1.3 @@ -10,6 +10,11 @@ page_title:onevalue } +permission::require_permission \ + -object_id $assessment_id \ + -party_id [ad_conn user_id] \ + -privilege admin + if {[info exists assessment_id]} { # Get the assessment data @@ -24,7 +29,7 @@ } set context [list [list index [_ assessment.admin]] $page_title] -set types_list [list [list "[_ assessment.type_s]" 1] [list "[_ assessment.type_ea]" 2 ]] +set types_list [list [list "[_ assessment.type_s]" survey] [list "[_ assessment.type_test]" test ]] ad_form -name assessment_type -export {assessment_id permission_p} -form { {type:text(radio) Index: openacs-4/packages/assessment/www/asm-admin/bulk-mail.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/bulk-mail.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/bulk-mail.tcl 30 Mar 2005 17:33:21 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/bulk-mail.tcl 26 Sep 2006 00:22:46 -0000 1.4 @@ -8,6 +8,11 @@ d_state } +permission::require_permission \ + -object_id [ad_conn package_id] \ + -party_id [ad_conn user_id] \ + -privilege admin + if {[llength $action_log_id] == 1} { set action_log_id [split [lindex $action_log_id 0] " "] } Index: openacs-4/packages/assessment/www/asm-admin/change-timing.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/change-timing.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/change-timing.tcl 17 Feb 2006 12:13:55 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/change-timing.tcl 26 Sep 2006 00:22:46 -0000 1.2 @@ -8,6 +8,12 @@ {return_url "index"} } +foreach id $assessment_id { + permission::require_permission \ + -object_id $asessment_id \ + -privilege admin \ + -party_id [ad_conn user_id] +} set form_format "[lc_get formbuilder_date_format] [lc_get formbuilder_time_format]" set user_id [ad_conn user_id] set context [list "[_ assessment.admin]"] Index: openacs-4/packages/assessment/www/asm-admin/checks-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/checks-delete.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/asm-admin/checks-delete.tcl 18 Feb 2005 16:32:28 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/checks-delete.tcl 26 Sep 2006 00:22:46 -0000 1.5 @@ -9,6 +9,12 @@ by_item_p item_id:optional } + +permission::require_permission \ + -object_id $assessment_id \ + -party_id [ad_conn user_id] \ + -privilege admin + set inter_item_check_id [split [lindex $inter_item_check_id 0] " "] set count [llength $inter_item_check_id] Index: openacs-4/packages/assessment/www/asm-admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/index.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/assessment/www/asm-admin/index.tcl 12 Jun 2006 02:49:51 -0000 1.10 +++ openacs-4/packages/assessment/www/asm-admin/index.tcl 26 Sep 2006 00:22:46 -0000 1.11 @@ -31,13 +31,13 @@ set actions [list] set advanced_options_p [parameter::get -parameter ShowAdvancedOptions -default 1] if { $advanced_options_p } { - lappend actions "[_ assessment.New_Survey]" {assessment-form?type=1} "[_ assessment.New_Survey]" \ + lappend actions "[_ assessment.New_Survey]" {assessment-form?type=survey} "[_ assessment.New_Survey]" \ "[_ assessment.New_Review_Assessment]" {assessment-form?type=3} "[_ assessment.New_Review_Assessment]" \ "[_ assessment.New_Partial_Assessment]" {assessment-form?type=4} "[_ assessment.New_Partial_Assessment]" \ "[_ assessment.New_Quick_Assessment]" {assessment-form?type=5} "[_ assessment.New_Quick_Assessment]" } -lappend actions "[_ assessment.New_Assessment]" {assessment-form?type=2} "[_ assessment.New_Assessment2]" +lappend actions "[_ assessment.New_Assessment]" {assessment-form?type=test} "[_ assessment.New_Assessment2]" if { $sw_admin && $advanced_options_p } { lappend actions [_ assessment.set_reg_asm] "../admin/set-reg-assessment" [_ assessment.set_reg_asm] Index: openacs-4/packages/assessment/www/asm-admin/results-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-edit.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/asm-admin/results-edit.adp 15 Apr 2005 17:26:46 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/results-edit.adp 26 Sep 2006 00:22:46 -0000 1.3 @@ -2,16 +2,15 @@ @page_title;noquote@ @context;noquote@ -@item_title;noquote@ -

    +

    #assessment.Add_Comment#

    +

    #assessment.item_Title#: @item_title;noquote@

    - +

    -

    -#assessment.currently# @result_points@ / @max_points@ #assessment.points# +

    #assessment.currently# @result_points@ / @max_points@ #assessment.points# #assessment.not_yet_reviewed#

    - + Index: openacs-4/packages/assessment/www/asm-admin/results-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-edit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/results-edit.tcl 7 Apr 2006 23:16:58 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/results-edit.tcl 26 Sep 2006 00:22:46 -0000 1.4 @@ -34,26 +34,38 @@ set page_title "[_ assessment.Results_edit]" set context [list [list index [_ assessment.admin]] [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] [list [export_vars -base results-users {assessment_id}] [_ assessment.Results_by_user]] [list [export_vars -base results-session {session_id}] [_ assessment.View_Results]] $page_title] - -ad_form -name results_edit -action results-edit -export { session_id section_id as_item_id } -form { +# DAVEB removed title, doesn't make sense. +ad_form -name results-edit -action results-edit -export { session_id section_id as_item_id } -form { {result_id:key} - {title:text,nospell,optional {label "[_ assessment.Title]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.Results_edit_Title_help]"}} {description:text(textarea),optional {label "[_ assessment.Results_edit_Description]"} {html {rows 5 cols 80}} {help_text "[_ assessment.Results_edit_Description_help]"}} - {points:integer,nospell {label "[_ assessment.points_answer]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_answer_help]"}} -} -new_request { - set title "" +} + +# check for type to see if we set points +if {0} { + ad_form -extend -form { + {points:integer,nospell {label "[_ assessment.points_answer]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_answer_help]"}} + } +} +ad_form -extend -new_request { set description "" set points "" } -new_data { + if {![info exists points]} { + set points "" + } db_transaction { - as::session_results::new -target_id $item_data_id -title $title -description $description -points $points - db_dml update_item_data {} - as::section::calculate -section_id $section_id -assessment_id $assessment_rev_id -session_id $session_id - as::assessment::calculate -assessment_id $assessment_rev_id -session_id $session_id + as::session_results::new -target_id $item_data_id -title "" -description $description -points $points + if {$points ne ""} { + db_dml update_item_points {} + as::section::calculate -section_id $section_id -assessment_id $assessment_rev_id -session_id $session_id + as::assessment::calculate -assessment_id $assessment_rev_id -session_id $session_id + } } + ns_log notice "DONE results edit new_data" } -after_submit { + ns_log notice "DONE results edit after_submit" ad_returnredirect [export_vars -base results-session {session_id}] ad_script_abort } - + ns_log notice "DONE results edit return template" ad_return_template Index: openacs-4/packages/assessment/www/asm-admin/results-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-edit.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/results-edit.xql 21 Feb 2005 14:32:56 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/results-edit.xql 26 Sep 2006 00:22:46 -0000 1.2 @@ -43,7 +43,7 @@ - + update as_item_data set points = :points Index: openacs-4/packages/assessment/www/asm-admin/results-session-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-session-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/results-session-postgresql.xql 21 Feb 2005 14:32:56 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/results-session-postgresql.xql 26 Sep 2006 00:22:46 -0000 1.2 @@ -4,8 +4,7 @@ - SELECT percent_score, to_char(creation_datetime, :format) AS session_start, - to_char(completed_datetime, :format) AS session_finish, + SELECT percent_score, creation_datetime, completed_datetime, round(date_part('epoch', completed_datetime - creation_datetime)) as session_time FROM as_sessions s WHERE s.session_id = :session_id Index: openacs-4/packages/assessment/www/asm-admin/results-session.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-session.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/asm-admin/results-session.adp 19 Jul 2006 13:58:13 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/results-session.adp 26 Sep 2006 00:22:46 -0000 1.5 @@ -2,55 +2,28 @@ @page_title;noquote@ @context;noquote@ - - - - - - +
    +

    @assessment_data.title@

    +

    #acs-subsite.Name#: @first_names@ @last_name@#assessment.anonymous_name# + #assessment.Attempt#: @session_attempt@ / @assessment_data.number_tries@ + #assessment.Percent_Score#: @assessment_score@ + #assessment.Started#: @session_start@ + #assessment.Finished#: @session_finish@ + #assessment.Time_spent#: @session_time@ +

    -
    - - - - - - -
    #assessment.Assessment#: @assessment_data.title@
    #assessment.User_ID#: @first_names@ @last_name@#assessment.anonymous_name##assessment.Attempt#: @session_attempt@ / @assessment_data.number_tries@#assessment.Percent_Score#: @assessment_score@
    #assessment.Started#: @session_start@#assessment.Finished#: @session_finish@#assessment.Time_spent#: @session_time@
    -

    - - - - - - - -
    - - - - - - -
    #assessment.section# @sections.title@ +
    +

    @sections.title@

    (#assessment.max_time# @sections.max_time_to_complete@) - (@sections.points@ / @sections.max_points@ #assessment.points#) -
    @sections.description@
    @sections.feedback_text@
    - -
    - -
    - +

    @sections.description@

    +

    @sections.feedback_text@

    +

    +
    -
    - -


    -#assessment.Total_score#: @session_score@ / @assessment_score@ = @percent_score@% - +#assessment.Total_score#: @session_score@ / @assessment_score@ = @percent_score@% - - + \ No newline at end of file Index: openacs-4/packages/assessment/www/asm-admin/results-session.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-session.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/results-session.tcl 12 Jun 2006 02:49:51 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/results-session.tcl 26 Sep 2006 00:22:46 -0000 1.4 @@ -33,12 +33,14 @@ set page_title "[_ assessment.View_Results]" set context [list [list index [_ assessment.admin]] [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] [list [export_vars -base results-users {assessment_id}] [_ assessment.Results_by_user]] $page_title] -set format "[lc_get formbuilder_date_format], [lc_get formbuilder_time_format]" +set format "[lc_get d_fmt], [lc_get t_fmt]" set session_user_url [acs_community_member_url -user_id $subject_id] # get start and end times db_1row session_data {} set session_time [as::assessment::pretty_time -seconds $session_time -hours] +set session_start [lc_time_fmt $creation_datetime $format] +set session_finish [lc_time_fmt $completed_datetime $format] # get the number of attempts set session_attempt [db_string session_attempt {}] Index: openacs-4/packages/assessment/www/asm-admin/results-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/www/asm-admin/results-users.tcl 6 Dec 2005 14:24:34 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/results-users.tcl 26 Sep 2006 00:22:46 -0000 1.7 @@ -13,6 +13,11 @@ page_title:onevalue } +permission::require_permission \ + -object_id $assessment_id \ + -party_id [ad_conn user_id] \ + -privilege "admin" + # Get the assessment data as::assessment::data -assessment_id $assessment_id @@ -64,11 +69,11 @@ -elements { session_id { label {[_ assessment.Session]} - display_template {@results.session_id@} + display_template {View} } subject_name { label {[_ assessment.Subject_Name]} - display_template {@results.subject_name@@results.subject_name@} + display_template {@results.subject_name@} } completed_datetime { label {[_ assessment.Finish_Time]} Index: openacs-4/packages/assessment/www/asm-admin/sessions.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/sessions.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/sessions.adp 12 Jun 2006 12:14:58 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/sessions.adp 26 Sep 2006 00:22:46 -0000 1.2 @@ -1,6 +1,5 @@ #assessment.All_Users# -

    #assessment.lt_Responses_for_assessm#

    #assessment.lt_Responses_of_user_per#

    Index: openacs-4/packages/assessment/www/asm-admin/swap-actions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/swap-actions.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/swap-actions.tcl 1 Feb 2005 22:00:10 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/swap-actions.tcl 26 Sep 2006 00:22:46 -0000 1.2 @@ -12,6 +12,12 @@ direction assessment_id:integer } + +permission::require_permission \ + -object_id $assessment_id \ + -party_id [ad_conn user_id] \ + -privilege "admin" + as::assessment::check::swap_actions -check_id $check_id -action_perform $action_perform -section_id $section_id -direction $direction -order_by $order_by Index: openacs-4/packages/assessment/www/asm-admin/unsubscribe.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/unsubscribe.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/unsubscribe.tcl 1 Feb 2005 22:00:10 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/unsubscribe.tcl 26 Sep 2006 00:22:46 -0000 1.2 @@ -11,6 +11,11 @@ section_id } +permission::require_permission \ + -object_id $assessment_id \ + -party_id [ad_conn user_id] \ + -privilege "admin" + set request_count [llength $request_id] for { set i 0} { $i < $request_count } { incr i } { db_transaction { Index: openacs-4/packages/assessment/www/asm-admin/unzip-file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/unzip-file.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/unzip-file.tcl 1 Feb 2005 22:00:10 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/unzip-file.tcl 26 Sep 2006 00:22:46 -0000 1.2 @@ -9,6 +9,10 @@ qti_items_imported_number context:onevalue } +permission::require_permission \ + -object_id [ad_conn package_id] \ + -party_id [ad_conn user_id] \ + -privilege "admin" set context [list "[_ assessment.Import_Results]"]