OfficeLinebacker has asked for the wisdom of the Perl Monks concerning the following question:

I hope the subject makes sense and sparks interest. It's literally the way my boss expressed the project, and I think the parallels are relevant.

For those of you wondering what the heck a bathroom checklist is, in many restaurants, there is a whiteboard on the back of the door to the bathroom with a list of times. The idea is that the bathroom should be checked for cleanliness at certain intervals (usually each hour) and the empoloyee responsible writes his initials next to the time at which he cleaned/checked the bathroom. This creates personal accountability, which is exactly what we want.

The purpose of this program is to aid users in checking that they indeed have access to various sources of data, which are sparsely used yet came in handy in critical situations.

We want the people in our group (8 people) to check that they a) still have the credentials to access the information to which they're expected to have access b) still know how to get to it (practice).

The idea is a public web page, editable by the users themselves, which lists for each user the data sources, and the date they last checked when they attempted to access it. Making the information public will presumably be increased incentive.

I've thought it over a bit, and discussed it in the Chatterbox last night. So far my ideas are as follows:

One feature would be that in the event of a report of a failed test, I am immediately notified via email. Perhaps my boss would want to be, too, though probably not.

Another feature, and a good reason to use Perl rather than a simple Wiki page, would be that the program would generate timestamps rather than having the user have to enter the date on which the data access was last checked. This will work on the assumption that the data access was checked immediately before clicking the appropriate button. Do you think this could be problematic?

One issue I need to look into is how easy it would be to detect who is visiting the page, and thus automatically cater to that particular user, rather than letting any user edit any other user's settings/test results. This is not a trust issue, as we all trust each other, but more of a convenience and error-avoidance measure.

A great option would be to have a program automatically remind each user via email to check their data access. I think an interval of about 4 weeks would be appropriate. Not sure if I want to make the interval configurable. Simple on/off switch for now is best, I think. Reactions? That feature would require a separate script to run in cron once a day and check to see who needed a reminder, and email as appropriate--adds complexity.

Finally, perhaps the user test result reporting page and the user options page could be combined into one to simplify the system.

TIA for your thoughts and responses! I know I am not the best at explaining things, and the concept may seem strange to some (if experience in the CB last night are any indication) so feel free to ask questions.

  • Comment on A web-based checklist in the manner of the checklists in the bathrooms of fast-food restaurants

Replies are listed 'Best First'.
Re: A web-based checklist in the manner of the checklists in the bathrooms of fast-food restaurants
by Asim (Hermit) on May 03, 2006 at 15:59 UTC

    Commenting OutOfOrder:

    how easy it would be to detect who is visiting the page

    Setting up simple login will give you the REMOTE_USER ENV upon login. Getting them in your perl code is as simple as checking the $ENV{REMOTE_USER} upon successful login. Setting up your web server to prompt for, say, Basic Authentification is going to be something you'll want to look up, since it's very server-dependent.

    a good reason to use Perl rather than a simple Wiki page, would be that the program would generate timestamps rather than having the user have to enter the date on which the data access was last checked.

    Any decent Wiki backend can be setup to add a timestamp for every entry on a page; many allow you to do Version Control, as well, which would auto-timestamp each change.

    So far as your overall idea, it looks good.

    ----Asim, known to some as Woodrow.

Re: A web-based checklist in the manner of the checklists in the bathrooms of fast-food restaurants
by eric256 (Parson) on May 03, 2006 at 22:04 UTC

    How many services are we talking about? Is it a set number for all users, or does it vary?

    If its is set then maybe the display looks like

    Name | Date | Service1 | Service 2 | Service 3 Fred 05-06-06 PASS PASS PASS George 05-16-06 PASS PASS PASS Fred 05-06-06 PASS FAIL PASS

    If there are multiple data sources, then maybe one table per data source is in order

    Service1 Name | Date | PASS Fred 05-06-06 PASS Fred 05-07-06 FAIL George 04-05-05 PASS

    or

    Name | Date | SERVICE | PASS Fred 05-06-06 Service1 PASS Fred 05-06-06 Service2 PASS Fred 05-07-06 Service2 FAIL Dale 05-06-06 Service2 PASS

    It all realy depends on the number of services and what you are looking for when glancing at the report. That aside I think a kind of wizard interface would be cool. First page you enter your credentials, then based on the credentials it provides you with a page for each service. Perhaps those pages even have refresher directions on accessing the specific data source, and two giant buttons PASS and FAIL. Last page takes you to the report and reminds you of the next time you need to verify your data access.


    ___________
    Eric Hodges
      Hey eric, thanks for your response.

      There are multiple data sources, and some data sources are only used by one person, and others are used by all, and everything in between. So I'd like the page to be organized by user.

      The total number of services is about say 15 or 20 or so. I have to run now, but will post more later.

      _________________________________________________________________________________
      Without me, it's just aweso
Re: A web-based checklist in the manner of the checklists in the bathrooms of fast-food restaurants
by OfficeLinebacker (Chaplain) on May 03, 2006 at 20:29 UTC
    Hey guys.

    I am thinking of what type of back-end to use for this. I suppose the simplest case would be a delimited text file of the form

    user1,service1,date1,pass
    user1,service2,date2,pass
    user1,service3,date3,fail
    user2,service1,date4,pass
    ...
    
    that's quite simple and easy. the only drawback is the repetition of the username for each of his services.

    an alternative would be XML, but that seems like overkill, and frankly I am not too comfortable with it, though I used it for a similar application before, more as a learning exercise than anything else.

    Thoughts?

    TIA, T.

    Without me, it's just aweso
Re: A web-based checklist in the manner of the checklists in the bathrooms of fast-food restaurants
by OfficeLinebacker (Chaplain) on May 04, 2006 at 18:00 UTC
    Ok here is what I am using so far: (very raw)
    #!/opt/local/bin/perl # # Script to keep track of peoples' access to their data sources # # # sub showparams{ foreach $a (param()){ $b=param($a); print "param $a has value :$b: <br>"; } } BEGIN { use CGI qw/:standard *table/; use Text::CSV::Simple; $datafile='/dma/lib/www/fst/datachecklist/dataaccess.txt'; my $parser = Text::CSV::Simple->new; my @data = $parser->read_file($datafile); print header(); if (!param('editbutton')){ @now=localtime; #month returned by localtime() are zero-indexed. #got to pad the zeroes for the time/date elements $timestamp=sprintf("%02d-%02d-%04d",$now[4]+1,$now[3],$now[5]+19 +00); @params=param(); unless (param('Cancel')){ foreach $d (@params){ if ($d =~ /-/){ @param1=split(/-/,$d); if ($d =~ /Add/){ unless (param('New service') eq ""){push(@data,[$param1[0],par +am('New service')]);} sub servicesort { $a->[0] cmp $b->[0] } @data=sort servicesort @data; }else{ foreach $c (@data){ if ($c->[0] eq $param1[0]){ if ($c->[1] eq $param1[1]){ $c->[2]=$timestamp; $c->[3]=$param1[2]; } } } } } } } open(FH,">$datafile") || die "Couldn't open datafile: $!"; foreach $g (@data){ print FH join(',', @$g), "\n"; } close(FH); print start_html( -title => "Data Access", -bgcolor => 'purple' +); print start_form(); showparams(); print h6({-align=>'right'},"Today is $timestamp"); my $lastuser; $lastuser=""; foreach $i (@data){ if ($i->[0] ne $lastuser){ print end_table(); print br(),table({-width=>'33%'},Tr(th({-align=>'left'},[$i->[0] +,submit('editbutton',"edit $i->[0]")]))), br(); print start_table({-width=>'33%',-cellpadding=>2,-cellspacing=>0 +,-border=>2,-frame=>'box'}); print Tr(th(['Data Source','Date Last Checked','Check Result'])) +; } print Tr(td($i->[1]),td($i->[2]),td($i->[3])); $lastuser=$i->[0]; } print end_table(); print "\n"; } else{ $user=substr(param('editbutton'),6); print start_html( -title =>"Edit $user", -bgcolor => 'purple' ); print start_form(); showparams(); print h2($user); print start_table({-cellpadding=>2,-cellspacing=>0,-border=>2,-f +rame=>'box'}); print Tr(th(['Data Source','Date Last Checked','Last Check Resul +t','Report Success','Report Failure'])); foreach $i (@data){ if (@$i[0] eq $user){ print Tr(td($i->[1]),td($i->[2]),td($i->[3]),td(submit("$user-$i +->[1]-Pass","Report Success")),td(submit("$user-$i->[1]-Fail","Report + Failure"))); } } print end_table(); print textfield(-name=>'New service'),submit("$user-Addbutton",' +Add new service'),br(); print submit('cancel','Cancel'); } print end_form(); print end_html(); }
    I am grappling with how to manipulate the data once it's updated and write it back to the file right now. I could probably cook up a simple routine to write out the CSV data, but I am also going to have to look up how to insert a record into an array at a certain point.

    Any and all comments appreciated. T.

    _________________________________________________________________________________
    Without me, it's just aweso
Re: A web-based checklist in the manner of the checklists in the bathrooms of fast-food restaurants
by OfficeLinebacker (Chaplain) on May 05, 2006 at 15:01 UTC
    So that's what I have so far (I've been editing the prior node with the code as I go along). I think I'm about ready to let my users start testing it (and trying to break it).

    To show what a Perl newbie I am, the thing I "cooked up" to write back to the file was a simple join(). DOH!

    Step 2 would be adding a final field in the csv file that is simply either a 1 or a 0, and turning on email updates (and adding a button for toggling of email updates to the "Edit User" page. Will take a bit of work to turn the names into email addresses though.

    Any thoughts?

    _________________________________________________________________________________ Without me, it's just aweso
Re: A web-based checklist in the manner of the checklists in the bathrooms of fast-food restaurants
by OfficeLinebacker (Chaplain) on May 18, 2006 at 12:14 UTC
    So the boss said ask the users first before implementing email reminders, and they weren't interested. So it's basically done, and I got it to use our website stylesheet, so that's pretty cool. Thanks for any and all help/advice. _________________________________________________________________________________
    Without me, it's just aweso