Index: openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request-2.tcl 6 Sep 2005 05:25:38 -0000 1.2 +++ openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request-2.tcl 7 Sep 2005 17:44:12 -0000 1.3 @@ -11,8 +11,6 @@ } { user_id:integer,notnull return_url:notnull - rel_id:integer,notnull - session_id:integer,notnull,optional } -properties { } -validate { } -errors { @@ -21,7 +19,7 @@ set assessment_id [parameter::get -parameter ApplicationAssessment -default ""] set viewing_user_id [ad_conn user_id] -if { ! [exists_and_not_null session_id] && ! [empty_string_p $assessment_id] } { +if { ! [empty_string_p $assessment_id] && $assessment_id != -1 } { set session_id [db_string session { select ss.session_id @@ -47,13 +45,4 @@ } } -# Create a mapping for the application rel_id and the assessment -# session -if { [exists_and_not_null session_id] } { - db_dml map_application_to_assessment { - insert into dotlrn_ecommerce_application_assessment_map - values (:rel_id, :session_id) - } -} - ad_returnredirect $return_url \ No newline at end of file Index: openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl 7 Sep 2005 14:28:52 -0000 1.19 +++ openacs-4/packages/dotlrn-ecommerce/www/ecommerce/application-request.tcl 7 Sep 2005 17:44:12 -0000 1.20 @@ -163,6 +163,14 @@ set session_id [content::revision::new -item_id $session_item_id -content_type {as_sessions} -title "$user_id-$assessment_rev_id-[as::item::generate_unique_name]" -attributes [list [list assessment_id $assessment_rev_id] [list subject_id $user_id] [list staff_id ""] [list target_datetime ""] [list creation_datetime ""] [list first_mod_datetime ""] [list last_mod_datetime ""] [list completed_datetime ""] [list percent_score ""] [list consent_timestamp ""] ] ] } - set return_url [export_vars -base "[ad_conn package_url]ecommerce/application-request-2" { user_id {return_url $next_url} rel_id session_id }] + # If a course or prerequisite assessment exists, it should be + # mapped now to the rel_id, even if the assessment isn't complete, + # it will show in the assessment list + db_dml map_application_to_assessment { + insert into dotlrn_ecommerce_application_assessment_map + values (:rel_id, :session_id) + } + + set return_url [export_vars -base "[ad_conn package_url]ecommerce/application-request-2" { user_id {return_url $next_url} }] ad_returnredirect [export_vars -base "[apm_package_url_from_id [parameter::get -parameter AssessmentPackage]]assessment" { assessment_id return_url session_id }] }