Index: openacs-4/packages/assessment/assessment.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/assessment.info,v
diff -u -r1.17 -r1.18
--- openacs-4/packages/assessment/assessment.info 18 Jan 2005 12:42:49 -0000 1.17
+++ openacs-4/packages/assessment/assessment.info 19 Jan 2005 16:49:22 -0000 1.18
@@ -7,7 +7,7 @@
f
f
-
+
oracle
postgresql
@@ -20,7 +20,7 @@
0
E-LANE
Create assessments and evalueate.
-
+
Index: openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql 18 Jan 2005 12:42:36 -0000 1.6
+++ openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql 19 Jan 2005 16:49:14 -0000 1.7
@@ -83,9 +83,12 @@
staff_id integer
constraint as_item_data_staff_id_fk
references users(user_id),
- as_item_id integer
+ as_item_id integer
constraint as_item_data_item_id
references as_items(as_item_id),
+ section_id integer
+ constraint as_item_data_section_id
+ references as_sections(section_id),
is_unknown_p char(1) default 'f'
constraint as_item_data_is_unknown_p_ck
check (is_unknown_p in ('t','f')),
@@ -168,3 +171,15 @@
constraint as_session_choices_pk
primary key (session_id, section_id, as_item_id, choice_id)
);
+
+-- here all references to answers of a session are stored
+create table as_session_item_map (
+ session_id integer
+ constraint as_session_item_map_session_fk
+ references as_sessions,
+ item_data_id integer
+ constraint as_session_item_map_item_data_fk
+ references as_item_data,
+ constraint as_session_item_map_pk
+ primary key (session_id, item_data_id)
+);
Index: openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.10d1-0.10d2.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.10d1-0.10d2.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/assessment/sql/postgresql/upgrade/upgrade-0.10d1-0.10d2.sql 19 Jan 2005 16:49:14 -0000 1.1
@@ -0,0 +1,25 @@
+alter table as_item_data add column section_id integer constraint as_item_data_section_id references as_sections(section_id);
+
+-- here all references to answers of a session are stored
+create table as_session_item_map (
+ session_id integer
+ constraint as_session_item_map_session_fk
+ references as_sessions,
+ item_data_id integer
+ constraint as_session_item_map_item_data_fk
+ references as_item_data,
+ constraint as_session_item_map_pk
+ primary key (session_id, item_data_id)
+);
+
+delete from as_item_data where session_id is null;
+
+update as_item_data
+set section_id = (select i.section_id
+ from as_session_items i
+ where i.session_id = as_item_data.session_id
+ and i.as_item_id = as_item_data.as_item_id);
+
+insert into as_session_item_map (session_id, item_data_id)
+(select session_id, item_data_id
+from as_item_data);
Index: openacs-4/packages/assessment/tcl/as-assessment-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-assessment-procs.tcl,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 18 Jan 2005 15:04:21 -0000 1.14
+++ openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 19 Jan 2005 16:49:14 -0000 1.15
@@ -44,7 +44,7 @@
if {[empty_string_p $name]} {
set name "ASS_$assessment_item_id"
}
- set assessment_item_id [content::item::new -item_id $assessment_item_id -parent_id $folder_id -content_type {as_assessments} -name $name -title $title ]
+ set assessment_item_id [content::item::new -item_id $assessment_item_id -parent_id $folder_id -content_type {as_assessments} -name $name]
set as_assessment_id [content::revision::new \
-item_id $assessment_item_id \
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.18 -r1.19
--- openacs-4/packages/assessment/tcl/as-install-procs.tcl 18 Jan 2005 12:42:36 -0000 1.18
+++ openacs-4/packages/assessment/tcl/as-install-procs.tcl 19 Jan 2005 16:49:14 -0000 1.19
@@ -182,6 +182,7 @@
content::type::attribute::new -content_type {as_item_data} -attribute_name {subject_id} -datatype {number} -pretty_name {Subject ID} -column_spec {integer}
content::type::attribute::new -content_type {as_item_data} -attribute_name {staff_id} -datatype {number} -pretty_name {Staff ID} -column_spec {integer}
content::type::attribute::new -content_type {as_item_data} -attribute_name {as_item_id} -datatype {number} -pretty_name {Item ID} -column_spec {integer}
+content::type::attribute::new -content_type {as_item_data} -attribute_name {section_id} -datatype {number} -pretty_name {Section ID} -column_spec {integer}
content::type::attribute::new -content_type {as_item_data} -attribute_name {is_unknown_p} -datatype {boolean} -pretty_name {Is Unknown} -column_spec {char(1)}
content::type::attribute::new -content_type {as_item_data} -attribute_name {boolean_answer} -datatype {boolean} -pretty_name {Boolean Answer} -column_spec {boolean}
content::type::attribute::new -content_type {as_item_data} -attribute_name {clob_answer} -datatype {string} -pretty_name {Clob Answer} -column_spec {text}
@@ -249,5 +250,8 @@
0.09d1 0.10d1 {
content::type::attribute::new -content_type {as_section_data} -attribute_name {points} -datatype {number} -pretty_name {Points Awarded} -column_spec {integer}
}
+ 0.10d1 0.10d2 {
+ content::type::attribute::new -content_type {as_item_data} -attribute_name {section_id} -datatype {number} -pretty_name {Section ID} -column_spec {integer}
+ }
}
}
Index: openacs-4/packages/assessment/tcl/as-item-answer-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-answer-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/assessment/tcl/as-item-answer-procs.tcl 22 Nov 2004 11:59:22 -0000 1.3
+++ openacs-4/packages/assessment/tcl/as-item-answer-procs.tcl 19 Jan 2005 16:49:14 -0000 1.4
@@ -26,7 +26,7 @@
# Insert as_item_answer in the CR (and as_item_sa_answers table) getting the revision_id (as_item_answer_id)
db_transaction {
- set item_answer_id [content::item::new -parent_id $folder_id -content_type {as_item_choices} -name [exec uuidgen] -title $title ]
+ set item_answer_id [content::item::new -parent_id $folder_id -content_type {as_item_choices} -name [exec uuidgen]]
set as_item_answer_id [content::revision::new \
-item_id $item_answer_id \
-content_type {as_item_answers} \
Index: openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl 7 Jan 2005 16:10:44 -0000 1.6
+++ openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl 19 Jan 2005 16:49:14 -0000 1.7
@@ -31,7 +31,7 @@
# Insert as_item_choice in the CR (and as_item_choices table) getting the revision_id (as_item_choice_id)
db_transaction {
- set item_choice_id [content::item::new -parent_id $folder_id -content_type {as_item_choices} -name [exec uuidgen] -title $title ]
+ set item_choice_id [content::item::new -parent_id $folder_id -content_type {as_item_choices} -name [exec uuidgen]]
set as_item_choice_id [content::revision::new \
-item_id $item_choice_id \
-content_type {as_item_choices} \
Index: openacs-4/packages/assessment/tcl/as-item-data-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-data-procs.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/assessment/tcl/as-item-data-procs.tcl 8 Jan 2005 10:51:09 -0000 1.7
+++ openacs-4/packages/assessment/tcl/as-item-data-procs.tcl 19 Jan 2005 16:49:14 -0000 1.8
@@ -11,6 +11,7 @@
{-subject_id ""}
{-staff_id ""}
{-as_item_id:required}
+ {-section_id:required}
{-choice_answer ""}
{-boolean_answer ""}
{-clob_answer ""}
@@ -21,6 +22,7 @@
{-content_answer ""}
{-signed_data ""}
{-points ""}
+ {-allow_overwrite_p t}
} {
@author Eduardo Perez (eperez@it.uc3m.es)
@creation-date 2004-09-12
@@ -29,18 +31,29 @@
} {
set package_id [ad_conn package_id]
set folder_id [as::assessment::folder_id -package_id $package_id]
+ set name "$as_item_id-$section_id-$session_id"
+ set new_p 1
# Insert as_item_data in the CR (and as_item_data table) getting the revision_id (item_data_id)
db_transaction {
- set item_data_id [content::item::new -parent_id $folder_id -content_type {as_item_data} -name "$as_item_id-$session_id" -title "$as_item_id-$session_id" ]
+ if {[db_0or1row old_item_id {}]} {
+ if {$allow_overwrite_p == "f"} {
+ return
+ }
+ set new_p 0
+ } else {
+ set item_data_id [content::item::new -parent_id $folder_id -content_type {as_item_data} -name $name]
+ }
+
set as_item_data_id [content::revision::new \
-item_id $item_data_id \
-content_type {as_item_data} \
- -title "$as_item_id-$session_id" \
+ -title $name \
-attributes [list [list session_id $session_id] \
[list subject_id $subject_id] \
[list staff_id $staff_id] \
[list as_item_id $as_item_id] \
+ [list section_id $section_id] \
[list boolean_answer $boolean_answer] \
[list clob_answer $clob_answer] \
[list numeric_answer $numeric_answer] \
@@ -54,6 +67,12 @@
foreach choice_id $choice_answer {
db_dml save_choice_answer {}
}
+
+ if {$new_p} {
+ db_dml insert_session_map {}
+ } else {
+ db_dml update_session_map {}
+ }
}
return $as_item_data_id
@@ -70,7 +89,9 @@
Get as_item_data from the database
} {
if {[empty_string_p $session_id]} {
- db_1row last_session {}
+ set last_sessions [db_list_of_lists last_sessions {}]
+ set session_id [lindex [lindex $last_sessions 0] 0]
+ set as_item_id [lindex [lindex $last_sessions 0] 1]
}
if {![empty_string_p $session_id] && [db_0or1row response {} -column_array response]} {
Index: openacs-4/packages/assessment/tcl/as-item-data-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-data-procs.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/assessment/tcl/as-item-data-procs.xql 24 Dec 2004 15:32:38 -0000 1.3
+++ openacs-4/packages/assessment/tcl/as-item-data-procs.xql 19 Jan 2005 16:49:14 -0000 1.4
@@ -1,6 +1,17 @@
+
+
+
+ select item_id as item_data_id, latest_revision
+ from cr_items
+ where name = :name
+ and parent_id = :folder_id
+
+
+
+
@@ -10,31 +21,56 @@
-
+
- select max(session_id) as session_id
- from as_item_data
- where subject_id = :subject_id
- and as_item_id = :as_item_id
+ insert into as_session_item_map (session_id, item_data_id)
+ values (:session_id, :as_item_data_id)
-
+
- select item_data_id, boolean_answer, clob_answer, numeric_answer,
- integer_answer, text_answer, timestamp_answer, content_answer,
- points
- from as_item_data
+ update as_session_item_map
+ set item_data_id = :as_item_data_id
where session_id = :session_id
- and subject_id = :subject_id
- and as_item_id = :as_item_id
+ and item_data_id = :latest_revision
+
+
+
+ select d.session_id, d.as_item_id
+ from as_item_data d, cr_revisions r, cr_revisions r2
+ where d.subject_id = :subject_id
+ and d.as_item_id = r.revision_id
+ and r2.revision_id = :as_item_id
+ and r.item_id = r2.item_id
+ order by d.session_id decr
+
+
+
+
+
+
+
+ select d.item_data_id, d.boolean_answer, d.clob_answer, d.numeric_answer,
+ d.integer_answer, d.text_answer, d.timestamp_answer, d.content_answer,
+ d.points
+ from as_item_data d, as_session_item_map m
+ where d.session_id = :session_id
+ and d.subject_id = :subject_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
+
+
+
+
Index: openacs-4/packages/assessment/tcl/as-item-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-procs.tcl,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/assessment/tcl/as-item-procs.tcl 14 Jan 2005 13:13:37 -0000 1.9
+++ openacs-4/packages/assessment/tcl/as-item-procs.tcl 19 Jan 2005 16:49:14 -0000 1.10
@@ -36,7 +36,7 @@
if {[empty_string_p $name]} {
set name "QUE_$item_item_id"
}
- set item_item_id [content::item::new -item_id $item_item_id -parent_id $folder_id -content_type {as_items} -name $name -title $title ]
+ set item_item_id [content::item::new -item_id $item_item_id -parent_id $folder_id -content_type {as_items} -name $name]
set as_item_id [content::revision::new -item_id $item_item_id \
-content_type {as_items} \
-title $title \
@@ -164,7 +164,7 @@
if {[empty_string_p $name]} {
set name "QUE_$item_item_id"
}
- set item_item_id [content::item::new -item_id $item_item_id -parent_id $folder_id -content_type {as_items} -name $name -title $title ]
+ set item_item_id [content::item::new -item_id $item_item_id -parent_id $folder_id -content_type {as_items} -name $name]
set new_item_id [content::revision::new \
-item_id $item_item_id \
-content_type {as_items} \
Index: openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 7 Jan 2005 16:10:44 -0000 1.11
+++ openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 19 Jan 2005 16:49:14 -0000 1.12
@@ -25,7 +25,7 @@
# Insert as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id)
db_transaction {
- set item_item_type_mc_id [content::item::new -parent_id $folder_id -content_type {as_item_type_mc} -name [exec uuidgen] -title $title ]
+ set item_item_type_mc_id [content::item::new -parent_id $folder_id -content_type {as_item_type_mc} -name [exec uuidgen]]
set as_item_type_mc_id [content::revision::new \
-item_id $item_item_type_mc_id \
-content_type {as_item_type_mc} \
@@ -276,10 +276,12 @@
-type_id:required
-session_id:required
-as_item_id:required
+ -section_id:required
-subject_id:required
{-staff_id ""}
{-response ""}
{-max_points 0}
+ {-allow_overwrite_p t}
} {
@author Timo Hentschel (timo@timohentschel.de)
@creation-date 2004-12-11
@@ -317,5 +319,5 @@
set points [expr round($max_points * $percent / 100)]
- as::item_data::new -session_id $session_id -subject_id $subject_id -staff_id $staff_id -as_item_id $as_item_id -choice_answer $response -points $points
+ as::item_data::new -session_id $session_id -subject_id $subject_id -staff_id $staff_id -as_item_id $as_item_id -section_id $section_id -choice_answer $response -points $points -allow_overwrite_p $allow_overwrite_p
}
Index: openacs-4/packages/assessment/tcl/as-item-type-oq-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-oq-procs.tcl,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/assessment/tcl/as-item-type-oq-procs.tcl 7 Jan 2005 16:10:44 -0000 1.11
+++ openacs-4/packages/assessment/tcl/as-item-type-oq-procs.tcl 19 Jan 2005 16:49:14 -0000 1.12
@@ -21,7 +21,7 @@
# Insert as_item_type_oq in the CR (and as_item_type_oq table) getting the revision_id (as_item_type_id)
db_transaction {
- set item_item_type_oq_id [content::item::new -parent_id $folder_id -content_type {as_item_type_oq} -name [exec uuidgen] -title $title ]
+ set item_item_type_oq_id [content::item::new -parent_id $folder_id -content_type {as_item_type_oq} -name [exec uuidgen]]
set as_item_type_oq_id [content::revision::new \
-item_id $item_item_type_oq_id \
-content_type {as_item_type_oq} \
@@ -108,15 +108,17 @@
-type_id:required
-session_id:required
-as_item_id:required
+ -section_id:required
-subject_id:required
{-staff_id ""}
{-response ""}
{-max_points 0}
+ {-allow_overwrite_p t}
} {
@author Timo Hentschel (timo@timohentschel.de)
@creation-date 2004-12-11
Process a Response to an Open Question Type
} {
- as::item_data::new -session_id $session_id -subject_id $subject_id -staff_id $staff_id -as_item_id $as_item_id -clob_answer [lindex $response 0] -points ""
+ as::item_data::new -session_id $session_id -subject_id $subject_id -staff_id $staff_id -as_item_id $as_item_id -section_id $section_id -clob_answer [lindex $response 0] -points "" -allow_overwrite_p $allow_overwrite_p
}
Index: openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl 7 Jan 2005 16:10:44 -0000 1.11
+++ openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl 19 Jan 2005 16:49:14 -0000 1.12
@@ -21,7 +21,7 @@
# Insert as_item_type_sa in the CR (and as_item_type_sa table) getting the revision_id (as_item_type_id)
db_transaction {
- set item_item_type_sa_id [content::item::new -parent_id $folder_id -content_type {as_item_type_sa} -name [exec uuidgen] -title $title ]
+ set item_item_type_sa_id [content::item::new -parent_id $folder_id -content_type {as_item_type_sa} -name [exec uuidgen]]
set as_item_type_sa_id [content::revision::new \
-item_id $item_item_type_sa_id \
-content_type {as_item_type_sa} \
@@ -108,15 +108,17 @@
-type_id:required
-session_id:required
-as_item_id:required
+ -section_id:required
-subject_id:required
{-staff_id ""}
{-response ""}
{-max_points 0}
+ {-allow_overwrite_p t}
} {
@author Timo Hentschel (timo@timohentschel.de)
@creation-date 2004-12-11
Process a Response to a Short Answer Type
} {
- as::item_data::new -session_id $session_id -subject_id $subject_id -staff_id $staff_id -as_item_id $as_item_id -text_answer [lindex $response 0] -points ""
+ as::item_data::new -session_id $session_id -subject_id $subject_id -staff_id $staff_id -as_item_id $as_item_id -section_id $section_id -text_answer [lindex $response 0] -points "" -allow_overwrite_p $allow_overwrite_p
}
Index: openacs-4/packages/assessment/tcl/as-section-data-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-data-procs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/assessment/tcl/as-section-data-procs.tcl 18 Jan 2005 12:42:37 -0000 1.1
+++ openacs-4/packages/assessment/tcl/as-section-data-procs.tcl 19 Jan 2005 16:49:14 -0000 1.2
@@ -27,7 +27,7 @@
# Insert as_section_data in the CR (and as_section_data table) getting the revision_id (section_data_id)
db_transaction {
- set section_data_id [content::item::new -parent_id $folder_id -content_type {as_section_data} -name "$section_id-$session_id" -title "$section_id-$session_id" ]
+ set section_data_id [content::item::new -parent_id $folder_id -content_type {as_section_data} -name "$section_id-$session_id"]
set as_section_data_id [content::revision::new \
-item_id $section_data_id \
-content_type {as_section_data} \
Index: openacs-4/packages/assessment/tcl/as-section-display-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-display-procs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/assessment/tcl/as-section-display-procs.tcl 10 Dec 2004 11:42:23 -0000 1.1
+++ openacs-4/packages/assessment/tcl/as-section-display-procs.tcl 19 Jan 2005 16:49:14 -0000 1.2
@@ -26,7 +26,7 @@
# Insert as_section_display_type in the CR (and as_section_display_types table) getting the revision_id (display_type_id)
db_transaction {
- set display_item_id [content::item::new -parent_id $folder_id -content_type {as_section_display_types} -name [exec uuidgen] -title $title -description $description ]
+ set display_item_id [content::item::new -parent_id $folder_id -content_type {as_section_display_types} -name [exec uuidgen]]
set display_id [content::revision::new \
-item_id $display_item_id \
Index: openacs-4/packages/assessment/tcl/as-section-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-procs-oracle.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/assessment/tcl/as-section-procs-oracle.xql 18 Jan 2005 12:42:37 -0000 1.2
+++ openacs-4/packages/assessment/tcl/as-section-procs-oracle.xql 19 Jan 2005 16:49:14 -0000 1.3
@@ -55,10 +55,13 @@
where asm.assessment_id = :assessment_id
and asm.section_id = :section_id
and not exists (select 1
- from as_item_data d, as_session_items i
- where i.session_id = :session_id
- and d.as_item_id(+) = i.as_item_id
- and d.session_id(+) = i.session_id
+ from as_session_items i, as_item_data d, as_session_item_map m
+ where d.section_id (+) = i.section_id
+ and d.session_id (+) = i.session_id
+ and d.as_item_id (+) = i.as_item_id
+ and m.session_id (+) = d.session_id
+ and m.item_data_id (+) = d.item_data_id
+ and i.session_id = :session_id
and i.section_id = :section_id
and d.points is null)
Index: openacs-4/packages/assessment/tcl/as-section-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-procs-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/assessment/tcl/as-section-procs-postgresql.xql 18 Jan 2005 12:42:37 -0000 1.2
+++ openacs-4/packages/assessment/tcl/as-section-procs-postgresql.xql 19 Jan 2005 16:49:14 -0000 1.3
@@ -53,8 +53,11 @@
and asm.section_id = :section_id
and not exists (select 1
from as_session_items i
- left outer join as_item_data d on (d.as_item_id = i.as_item_id
- and d.session_id = i.session_id)
+ left outer join as_item_data d on (d.section_id = i.section_id
+ and d.session_id = i.session_id
+ and d.as_item_id = i.as_item_id)
+ left outer join as_session_item_map m on (m.session_id = d.session_id
+ and m.item_data_id = d.item_data_id)
where i.session_id = :session_id
and i.section_id = :section_id
and d.points is null)
Index: openacs-4/packages/assessment/tcl/as-section-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-procs.tcl,v
diff -u -r1.13 -r1.14
--- openacs-4/packages/assessment/tcl/as-section-procs.tcl 18 Jan 2005 15:04:21 -0000 1.13
+++ openacs-4/packages/assessment/tcl/as-section-procs.tcl 19 Jan 2005 16:49:14 -0000 1.14
@@ -31,7 +31,7 @@
if {[empty_string_p $name]} {
set name "SEC_$section_item_id"
}
- set section_item_id [content::item::new -item_id $section_item_id -parent_id $folder_id -content_type {as_sections} -name $name -title $title -description $description ]
+ set section_item_id [content::item::new -item_id $section_item_id -parent_id $folder_id -content_type {as_sections} -name $name]
set as_section_id [content::revision::new \
-item_id $section_item_id \
@@ -154,7 +154,7 @@
if {[empty_string_p $name]} {
set name "SEC_$section_item_id"
}
- set section_item_id [content::item::new -item_id $section_item_id -parent_id $folder_id -content_type {as_sections} -name $name -title $title -description $description ]
+ set section_item_id [content::item::new -item_id $section_item_id -parent_id $folder_id -content_type {as_sections} -name $name]
set new_section_id [content::revision::new \
-item_id $section_item_id \
-content_type {as_sections} \
Index: openacs-4/packages/assessment/tcl/as-section-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-section-procs.xql,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/assessment/tcl/as-section-procs.xql 18 Jan 2005 12:42:37 -0000 1.8
+++ openacs-4/packages/assessment/tcl/as-section-procs.xql 19 Jan 2005 16:49:14 -0000 1.9
@@ -75,10 +75,13 @@
select sum(m.points) as item_max_points, sum(d.points) as item_points
- from as_item_data d, as_item_section_map m
+ from as_item_data d, as_item_section_map m, as_session_item_map sm
where m.section_id = :section_id
+ and d.section_id = m.section_id
and d.as_item_id = m.as_item_id
and d.session_id = :session_id
+ and sm.session_id = d.session_id
+ and sm.item_data_id = d.item_data_id
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.21 -r1.22
--- openacs-4/packages/assessment/www/assessment.tcl 18 Jan 2005 12:42:37 -0000 1.21
+++ openacs-4/packages/assessment/www/assessment.tcl 19 Jan 2005 16:49:14 -0000 1.22
@@ -169,7 +169,7 @@
}
set points [ad_decode $points "" 0 $points]
- as::item_type_$item_type\::process -type_id $item_type_id -session_id $session_id -as_item_id $response_item_id -subject_id $user_id -response $response_to_item($as_item_id) -max_points $points
+ as::item_type_$item_type\::process -type_id $item_type_id -session_id $session_id -as_item_id $response_item_id -section_id $section_id -subject_id $user_id -response $response_to_item($as_item_id) -max_points $points -allow_overwrite_p $display(back_button_p)
if {$section_order != $new_section_order} {
as::section::calculate -section_id $section_id -assessment_id $assessment_rev_id -session_id $session_id
@@ -213,7 +213,7 @@
set item_type [string range $item_type end-1 end]
set points [ad_decode $points "" 0 $points]
- as::item_type_$item_type\::process -type_id $item_type_id -session_id $session_id -as_item_id $response_item_id -subject_id $user_id -response $response_to_item($response_item_id) -max_points $points
+ as::item_type_$item_type\::process -type_id $item_type_id -session_id $session_id -as_item_id $response_item_id -section_id $section_id -subject_id $user_id -response $response_to_item($response_item_id) -max_points $points -allow_overwrite_p $display(back_button_p)
}
if {$section_order != $new_section_order} {