Index: openacs-4/packages/imsld/tcl/imsld-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/tcl/imsld-procs.tcl,v diff -u -r1.70 -r1.71 --- openacs-4/packages/imsld/tcl/imsld-procs.tcl 29 Jun 2006 11:21:55 -0000 1.70 +++ openacs-4/packages/imsld/tcl/imsld-procs.tcl 5 Jul 2006 14:59:10 -0000 1.71 @@ -300,10 +300,11 @@ if { [imsld::role_part_finished_p -run_id $run_id -role_part_id $role_part_id -user_id $user_id] } { return } - db_1row role_part_info { - select item_id as role_part_item_id - from imsld_role_partsi - where role_part_id = :role_part_id + db_1row role_part_info { *SQL* } + + # first, verify that the role part is marked as started + if { ![db_0or1row marked_as_started { *SQL* }] } { + db_dml mark_role_part_started { *SQL* } } db_dml insert_role_part { *SQL* } @@ -615,6 +616,10 @@ set url [ns_conn url] regexp {finish-component-element-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([a-z]+).imsld$} $url match imsld_id run_id play_id act_id role_part_id element_id type } + if { ![db_0or1row marked_as_started { *SQL* }] } { + # NOTE: this should not happen... UNLESS the activity is marked as finished automatically + db_dml mark_element_started { *SQL* } + } # now that we have the necessary info, mark the finished element completed and return db_dml insert_element_entry { *SQL* }