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.41.2.1 -r1.41.2.2 --- openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 25 Aug 2020 14:54:20 -0000 1.41.2.1 +++ openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 13 Sep 2022 12:03:23 -0000 1.41.2.2 @@ -35,10 +35,10 @@ {-package_id ""} {-type ""} } { + New assessment to the database + @author Eduardo Perez (eperez@it.uc3m.es) @creation-date 2004-07-26 - - New assessment to the database } { if { $package_id eq "" } { set package_id [ad_conn package_id] } set folder_id [as::assessment::folder_id -package_id $package_id] @@ -121,10 +121,10 @@ {-section_navigation ""} {-type ""} } { + Edit assessment in the database + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-10-26 - - Edit assessment in the database } { set assessment_rev_id [db_string assessment_revision {}] @@ -165,13 +165,14 @@ ad_proc -public as::assessment::data { {-assessment_id:required} } { - @author Timo Hentschel (timo@timohentschel.de) - @creation-date 2004-10-25 - Get all assessment info - creates a Tcl array variable named "assessment_data" in the caller's environment, - which contains key/value pairs for all properties of the requested assessment. + Creates a Tcl array variable named "assessment_data" in the + caller's environment, which contains key/value pairs for all + properties of the requested assessment. + + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2004-10-25 } { upvar assessment_data assessment_data @@ -194,10 +195,10 @@ ad_proc -public as::assessment::new_revision { {-assessment_id:required} } { + Creates new revision of an assessment with all sections + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-11-02 - - Creates new revision of an assessment with all sections } { data -assessment_id $assessment_id array set a [array get assessment_data] @@ -246,10 +247,10 @@ {-folder_id ""} {-new_title ""} } { + Copies an assessment with all sections and items + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-23 - - Copies an assessment with all sections and items } { if {$folder_id eq ""} { set package_id [ad_conn package_id] @@ -310,10 +311,10 @@ {-assessment_id:required} {-new_assessment_id:required} } { + Copies all sections from assessment_id to new_assessment_id + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-11-07 - - Copies all sections from assessment_id to new_assessment_id } { db_dml copy_sections {} } @@ -322,10 +323,10 @@ {-from_id:required} {-to_id:required} } { + Copies all categories from one object to new object + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-07 - - Copies all categories from one object to new object } { db_dml copy_categories {} } @@ -336,11 +337,11 @@ {-sort_order_type ""} {-random_p ""} } { + Returns all sections of an assessment in the correct order. May + vary from session to session. + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-14 - - Returns all sections of an assessment in the correct order. - may vary from session to session } { set section_list [db_list get_sorted_sections {}] @@ -379,10 +380,10 @@ -assessment_id:required -session_id:required } { + Award points to this assessment if all sections are filled out. + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-14 - - Award points to this assessment if all sections are filled out } { if {[db_string check_sections_calculated {}] > 0} { return @@ -404,10 +405,10 @@ -subject_id:required -password:required } { + Checks if subject is allowed to take the assessment. + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-22 - - Checks if subject is allowed to take the assessment } { db_1row assessment_data {} db_1row total_tries {} @@ -450,10 +451,10 @@ {-seconds} {-hours:boolean} } { + Returns a pretty string of min:sec + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-14 - - Returns a pretty string of min:sec } { if {$seconds eq "0" || $seconds eq ""} { return $seconds @@ -478,10 +479,10 @@ ad_proc as::assessment::pretty_time_hours_minutes { {-seconds} } { + Returns a pretty string of min:sec + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-14 - - Returns a pretty string of min:sec } { if {$seconds eq "0" || $seconds eq ""} { return $seconds @@ -514,10 +515,10 @@ ad_proc as::assessment::folder_id { -package_id:required } { + Returns the folder_id of the package instance. Cached + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-06 - - Returns the folder_id of the package instance. Cached } { ns_log notice "assessment folder id package_id = '${package_id}'" return [util_memoize [list as::assessment::folder_id_not_cached -package_id $package_id]] @@ -528,10 +529,11 @@ {-new_p 1} {-item_id ""} } { + Checks if a name string is unique or empty, excluding a given + item. + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-05 - - Checks if a name string is unique or empty, excluding a given item } { if {$new_p && $name ne ""} { if {$item_id eq ""} { @@ -549,10 +551,10 @@ ad_proc as::assessment::check_html_options { -options:required } { + Checks if list contains only key value pairs + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-11 - - Checks if list contains only key value pairs } { if {[llength $options] % 2 == 0} { return 1 @@ -567,10 +569,10 @@ -filename:required {-title ""} } { + Returns a html snippet to display a content item (i.e. image) + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-06 - - Returns a html snippet to display a content item (i.e. image) } { if {$content_id eq ""} { return $title @@ -585,10 +587,10 @@ ad_proc -private as::assessment::quote_export { -text:required } { + Quotes a string for csv export + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-26 - - Quotes a string for csv export } { regsub -all {;} $text {,,} text regsub -all "\n" $text {} text @@ -597,10 +599,10 @@ } ad_proc -private as::assessment::compare_numbers {a b} { + Compares the first part of a pair of strings as numbers + @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-18 - - Compares the first part of a pair of strings as numbers } { set a0 [expr double([lindex $a 0 0])] set b0 [expr double([lindex $b 0 0])]