Index: openacs-4/packages/proctoring-support/lib/proctoring-upload.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/proctoring-support/lib/proctoring-upload.tcl,v diff -u -r1.1.2.17 -r1.1.2.18 --- openacs-4/packages/proctoring-support/lib/proctoring-upload.tcl 15 Feb 2022 15:47:00 -0000 1.1.2.17 +++ openacs-4/packages/proctoring-support/lib/proctoring-upload.tcl 4 Mar 2022 09:55:28 -0000 1.1.2.18 @@ -74,14 +74,11 @@ ad_script_abort } - set timestamp [clock seconds] - set file ${file.tmpfile}.${extension} file rename -- ${file.tmpfile} $file set artifact [::proctoring::artifact::store \ -object_id $object_id \ -user_id $user_id \ - -timestamp $timestamp \ -name $name \ -type $type \ -file $file] @@ -97,7 +94,7 @@ "user_id": "$user_id", "name": "$name", "type": "$type", - "timestamp": "$timestamp", + "timestamp": "[dict get $artifact timestamp]", "file": "[dict get $artifact file]", "id": "[dict get $artifact artifact_id]" } Index: openacs-4/packages/proctoring-support/tcl/proctoring-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/proctoring-support/tcl/proctoring-procs.tcl,v diff -u -r1.1.2.18 -r1.1.2.19 --- openacs-4/packages/proctoring-support/tcl/proctoring-procs.tcl 10 Feb 2022 16:31:03 -0000 1.1.2.18 +++ openacs-4/packages/proctoring-support/tcl/proctoring-procs.tcl 4 Mar 2022 09:55:28 -0000 1.1.2.19 @@ -272,23 +272,25 @@ @param object_id id of the proctored object @param user_id id of the user this artifact was created for - @param timestamp epoch in seconds. Defaults to clock seconds when - not specified + @param timestamp epoch in seconds. Defaults to current timestamp + when not specified, with microseconds resolution. @param name name of the source for this artifact (e.g. 'camera' or 'desktop') @param type type of artifact (e.g. 'image' or 'audio') @param file absolute path to the artifact file. The file will be moved inside of the proctoring folder, so this can be a tempfile from a request. - @return dict of fields 'artifact_id' and 'file'. File is the final - path of the file in the proctoring folder. + @return dict of fields 'artifact_id', 'timestamp' and + 'file'. Timestamp is the epoch of the artifact's creation, + File is the final path of the file in the proctoring + folder. } { if {![file exists $file]} { error "File does not exist" } if {![info exists timestamp]} { - set timestamp [clock seconds] + set timestamp [expr {[clock microseconds] / 1000000.0}] } set proctoring_dir [::proctoring::folder \ @@ -325,16 +327,18 @@ :type, :file_path ) - returning artifact_id + returning artifact_id, + extract(seconds from timestamp) as timestamp ) - select artifact_id from insert + select * from insert }] callback ::proctoring::callback::artifact::postprocess \ -artifact_id $artifact_id return [list \ artifact_id $artifact_id \ + timestamp $timestamp \ file $file_path] }