curriculum_barWhat it does:
Returns a string containing the HTML for a curriculum bar. Assumes the system is enabled but checks to see if this particular user should get one.Defined in: /web/philip/tcl/curriculum.tcl
Source code:
# check cookie to make sure this person isn't finished
set cookie [ns_set get [ns_conn headers] Cookie]
if { [regexp {CurriculumProgress=([^;]+)} $cookie {} input_cookie] } {
# we have a cookie
if { [string compare $input_cookie "finished"] == 0 } {
# user has completed curriculum, don't bother showing the bar
return ""
} else {
# compare what the user has seen to what is in the full curriculum
# to put in checkboxes; we check the output headers first and then
# the input headers, in case there is going to be a newer value
set output_cookie [curriculum_get_output_cookie]
if { [empty_string_p $output_cookie] } {
return [curriculum_bar_internal $input_cookie]
} else {
return [curriculum_bar_internal $output_cookie]
}
}
} else {
# no cookie; this person is either brand new or their browser is rejecting cookies
# let's not uglify all their pages with a bar that they can't use
return ""
}