+
+
+#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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/asm-admin/results-edit.tcl 21 Feb 2005 14:32:56 -0000 1.1
@@ -0,0 +1,59 @@
+ad_page_contract {
+ Form to edit the points awarded to an item response.
+
+ @author Timo Hentschel (timo@timohentschel.de)
+ @cvs-id $Id:
+} {
+ session_id:integer
+ section_id:integer
+ as_item_id:integer
+} -properties {
+ context_bar:onevalue
+ page_title:onevalue
+}
+
+db_1row find_assessment {}
+
+set package_id [ad_conn package_id]
+permission::require_permission -object_id $package_id -privilege create
+permission::require_permission -object_id $assessment_id -privilege admin
+
+# Get the assessment data
+as::assessment::data -assessment_id $assessment_id
+set assessment_rev_id $assessment_data(assessment_rev_id)
+
+if {![info exists assessment_data(assessment_id)]} {
+ ad_return_complaint 1 "[_ assessment.Requested_assess_does]"
+ ad_script_abort
+}
+
+db_1row get_item_data {}
+set item_type [string range $item_type end-1 end]
+set result_points [db_string result_points {} -default ""]
+
+set page_title "[_ assessment.Results_edit]"
+set context_bar [ad_context_bar [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 {
+ {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) {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 ""
+ set description ""
+ set points ""
+} -new_data {
+ 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
+ }
+} -after_submit {
+ ad_returnredirect [export_vars -base results-session {session_id}]
+ ad_script_abort
+}
+
+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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/asm-admin/results-edit.xql 21 Feb 2005 14:32:56 -0000 1.1
@@ -0,0 +1,54 @@
+
+
+
+
+
+ select r.item_id as assessment_id, s.assessment_id as assessment_rev_id,
+ s.subject_id, p.first_names, p.last_name
+ from as_sessions s, cr_revisions r, persons p
+ where s.session_id = :session_id
+ and r.revision_id = s.assessment_id
+ and s.subject_id = p.person_id
+
+
+
+
+
+ select d.item_data_id, o.object_type as item_type,
+ cr.title as item_title, ism.points as max_points
+ from as_item_data d, as_session_item_map m, as_item_rels r, acs_objects o,
+ cr_revisions cr, as_item_section_map ism
+ where d.session_id = :session_id
+ and d.section_id = :section_id
+ and d.as_item_id = :as_item_id
+ and m.session_id = d.session_id
+ and m.item_data_id = d.item_data_id
+ and r.item_rev_id = d.as_item_id
+ and r.target_rev_id = o.object_id
+ and r.rel_type = 'as_item_type_rel'
+ and cr.revision_id = d.as_item_id
+ and ism.as_item_id = d.as_item_id
+ and ism.section_id = d.section_id
+
+
+
+
+
+ select r.points
+ from as_session_results r
+ where r.target_id = :item_data_id
+ and r.result_id = (select max(result_id)
+ from as_session_results r2
+ where r2.target_id = :item_data_id)
+
+
+
+
+
+ update as_item_data
+ set points = :points
+ where item_data_id = :item_data_id
+
+
+
+
Index: openacs-4/packages/assessment/www/asm-admin/results-session-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-session-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/asm-admin/results-session-oracle.xql 21 Feb 2005 14:32:56 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+ postgresql7.3
+
+
+
+ SELECT percent_score, to_char(creation_datetime, :format) AS session_start,
+ to_char(completed_datetime, :format) AS session_finish,
+ round(86400 * (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-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-session-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/asm-admin/results-session-postgresql.xql 21 Feb 2005 14:32:56 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+ postgresql7.3
+
+
+
+ SELECT percent_score, to_char(creation_datetime, :format) AS session_start,
+ to_char(completed_datetime, :format) AS session_finish,
+ 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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/asm-admin/results-session.adp 21 Feb 2005 14:32:56 -0000 1.1
@@ -0,0 +1,51 @@
+
+@page_title;noquote@
+@context_bar;noquote@
+
+
+
+#assessment.Assessment#: @assessment_data.title@ |
+#assessment.User_ID#: @first_names@ @last_name@#assessment.anonymous_name# |
+#assessment.Attempt#: @session_attempt@ / @assessment_data.number_tries@ |
+#assessment.Out_of#: @assessment_score@ |
+
+#assessment.Started#: @session_start@ |
+#assessment.Finished#: @session_finish@ |
+#assessment.Time_spent#: @session_time@ |
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+#assessment.section# @sections.title@
+ (#assessment.max_time# @sections.max_time_to_complete@)
+ (@sections.points@ / @sections.max_points@ #assessment.points#)
+ |
+
+ @sections.description@
|
+@sections.feedback_text@ |
+
+
+
+
+
+
+
+ |
+
+
+ |
+
+
+
+#assessment.Total_score#: @session_score@ / @assessment_score@ = @percent_score@%
+
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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/asm-admin/results-session.tcl 21 Feb 2005 14:32:56 -0000 1.1
@@ -0,0 +1,73 @@
+ad_page_contract {
+
+ Show the result of a session and provide links to edit the points.
+
+ @author timo@timohentschel.de
+ @date 2005-02-16
+ @cvs-id $Id:
+} {
+ session_id:integer
+} -properties {
+ context_bar:onevalue
+ page_title:onevalue
+}
+
+db_1row find_assessment {}
+
+set package_id [ad_conn package_id]
+permission::require_permission -object_id $package_id -privilege create
+permission::require_permission -object_id $assessment_id -privilege 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 user_id [ad_conn user_id]
+if {$subject_id != $user_id} {
+ permission::require_permission -object_id $assessment_id -privilege admin
+}
+
+set page_title "[_ assessment.View_Results]"
+set context_bar [ad_context_bar [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 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]
+
+# get the number of attempts
+set session_attempt [db_string session_attempt {}]
+
+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} {
+ set show_username_p 0
+}
+
+if {[empty_string_p $assessment_data(show_feedback)]} {
+ set assessment_data(show_feedback) "all"
+}
+
+# show_feedback: none, all, incorrect, correct
+
+
+set session_score 0
+set assessment_score 0
+db_multirow sections sections {} {
+ if {[empty_string_p $points]} {
+ set points 0
+ }
+ if {[empty_string_p $max_points]} {
+ set max_points 0
+ }
+ set max_time_to_complete [as::assessment::pretty_time -seconds $max_time_to_complete]
+ incr session_score $points
+ incr assessment_score $max_points
+}
+
+ad_return_template
Index: openacs-4/packages/assessment/www/asm-admin/results-session.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-session.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/www/asm-admin/results-session.xql 21 Feb 2005 14:32:56 -0000 1.1
@@ -0,0 +1,43 @@
+
+
+
+
+
+ select r.item_id as assessment_id, s.assessment_id as assessment_rev_id,
+ s.subject_id, p.first_names, p.last_name
+ from as_sessions s, cr_revisions r, persons p
+ where s.session_id = :session_id
+ and r.revision_id = s.assessment_id
+ and s.subject_id = p.person_id
+
+
+
+
+
+ select count(*)
+ 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
+
+
+
+
+
+ select s.section_id, cr.title, cr.description, ci.name, s.instructions,
+ s.feedback_text, m.max_time_to_complete, m.points as max_points, d.points
+ from as_assessment_section_map m, as_session_sections ss, as_section_data d,
+ as_sections s, cr_revisions cr, cr_items ci
+ where ci.item_id = cr.item_id
+ and cr.revision_id = s.section_id
+ and s.section_id = m.section_id
+ and m.assessment_id = :assessment_rev_id
+ and m.section_id = ss.section_id
+ and ss.session_id = :session_id
+ and d.session_id = ss.session_id
+ and d.section_id = ss.section_id
+ order by ss.sort_order
+
+
+
+
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.1 -r1.2
--- openacs-4/packages/assessment/www/asm-admin/results-users.tcl 1 Feb 2005 22:00:10 -0000 1.1
+++ openacs-4/packages/assessment/www/asm-admin/results-users.tcl 21 Feb 2005 14:32:56 -0000 1.2
@@ -30,8 +30,9 @@
-multirow results \
-key sessions_id \
-elements {
- all_responses {
- link_url_eval {[export_vars -base "../sessions" {session_id assessment_id}]}
+ session_id {
+ label {[_ assessment.Session]}
+ link_url_eval {[export_vars -base "results-session" {session_id}]}
}
subject_name {
label {[_ assessment.Subject_Name]}
@@ -43,17 +44,16 @@
}
percent_score {
label {[_ assessment.Percent_Score]}
- link_url_eval {[export_vars -base "../session" {session_id}]}
+ link_url_eval {[export_vars -base "results-session" {session_id}]}
html {align right nowrap}
}
} -main_class {
narrow
}
-db_multirow -extend { subject_url all_responses } results assessment_results {
+db_multirow -extend { subject_url } results assessment_results {
} {
- set all_responses "[_ assessment.View_all_responses]"
if {$assessment_data(anonymous_p) == "t" && $subject_id != $user_id} {
set subject_name "[_ assessment.anonymous_name]"
set subject_url ""
Index: openacs-4/packages/assessment/www/asm-admin/section-form.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/section-form.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/assessment/www/asm-admin/section-form.tcl 2 Feb 2005 21:31:15 -0000 1.2
+++ openacs-4/packages/assessment/www/asm-admin/section-form.tcl 21 Feb 2005 14:32:56 -0000 1.3
@@ -34,7 +34,6 @@
}
set context_bar [ad_context_bar [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title]
-set package_id [ad_conn package_id]
set display_types [db_list_of_lists section_display_types {}]
set display_types [concat [list [list "[_ assessment.section_new_display]" ""]] $display_types]
@@ -68,7 +67,7 @@
{feedback_text:text(textarea),optional {label "[_ assessment.Feedback]"} {html {rows 5 cols 80}} {help_text "[_ assessment.section_Feedback_help]"}}
{max_time_to_complete:integer,optional,nospell {label "[_ assessment.time_for_completion]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.section_time_help]"}}
{num_items:integer,optional,nospell {label "[_ assessment.num_items]"} {html {size 5 maxlength 5}} {help_text "[_ assessment.num_items_help]"}}
- {points:integer,optional,nospell {label "[_ assessment.points_section]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_item_help]"}}
+ {points:integer,optional,nospell {label "[_ assessment.points_section]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_section_help]"}}
{display_type_id:text(select),optional {label "[_ assessment.Display_Type]"} {options $display_types} {help_text "[_ assessment.section_Display_Type_help]"}}
} -new_request {
set name ""