Index: openacs-4/packages/assessment/lib/session-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session-oracle.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/assessment/lib/session-oracle.xql 7 Oct 2007 22:36:53 -0000 1.3
+++ openacs-4/packages/assessment/lib/session-oracle.xql 2 Sep 2008 17:39:57 -0000 1.4
@@ -24,6 +24,7 @@
and o.object_id = cr.item_id
and s.session_id = cr.revision_id
group by assessment_id, subject_id, session_id)
+ order by o.creation_date desc
where rownum=1
Index: openacs-4/packages/assessment/lib/session-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/assessment/lib/session-postgresql.xql 21 Nov 2006 15:13:30 -0000 1.3
+++ openacs-4/packages/assessment/lib/session-postgresql.xql 2 Sep 2008 17:39:57 -0000 1.4
@@ -22,7 +22,8 @@
and s.assessment_id in (select revision_id from cr_revisions where item_id= :assessment_id)
and o.object_id = cr.item_id
and s.session_id = cr.revision_id
- group by assessment_id, subject_id, session_id
+ group by assessment_id, subject_id, session_id, o.creation_date
+ order by o.creation_date desc
limit 1
Index: openacs-4/packages/assessment/lib/session.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session.adp,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/assessment/lib/session.adp 2 Feb 2008 21:15:46 -0000 1.9
+++ openacs-4/packages/assessment/lib/session.adp 2 Sep 2008 17:39:57 -0000 1.10
@@ -36,11 +36,11 @@
+
-
-#assessment.Total_score#: @session_score@ / @assessment_score@ = @percent_score@%
+#assessment.Total_score#: @session_score@ / @assessment_score@ = @percent_score@%
Index: openacs-4/packages/assessment/lib/session.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/assessment/lib/session.tcl 7 Oct 2007 22:36:53 -0000 1.6
+++ openacs-4/packages/assessment/lib/session.tcl 2 Sep 2008 17:39:57 -0000 1.7
@@ -55,7 +55,7 @@
# get start and end times
db_1row session_data {}
-set session_time [as::assessment::pretty_time -seconds $session_time -hours]
+set session_time [as::assessment::pretty_time_hours_minutes -seconds $session_time]
# get the number of attempts
@@ -72,23 +72,23 @@
# 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
+db_multirow sections sections {}
+if {$session_finish ne ""} {
+ set session_score [db_string get_session_score "select sum(coalesce(points,0)) from as_item_data where session_id=:session_id" -default ""]
+ set assessment_score [db_string get_max_points "select sum(coalesce(i.points,0)) from as_items i, as_item_data d where d.session_id = :session_id and i.as_item_id = d.as_item_id" -default ""]
+ #set max_time_to_complete [as::assessment::pretty_time -seconds $assessment_data(max_time_to_complete)]
+ set max_time_to_complete ""
+ if {$session_score ne "" && $assessment_score ne "" && $assessment_score > 0} {
+ set percent_score "[format "%3.2f" [expr {$session_score / ($assessment_score + 0.0) * 100}]]%"
+ } else {
+ set percent_score ""
+ }
+ set showpoints [parameter::get -parameter "ShowPoints" -default 1 ]
+} else {
+ set percent_score ""
+ set showpoints 0
}
-set showpoints [parameter::get -parameter "ShowPoints" -default 1 ]
-
set comments_installed_p [apm_package_enabled_p "general-comments"]
ad_return_template