source: trunk/gsdl/cgi-bin/readresults.cgi@ 4073

Last change on this file since 4073 was 4073, checked in by dana, 21 years ago

solved the paragraph problem, general interface tidying, code tidying

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
1#!/usr/bin/perl
2
3use usabcgi;
4
5print "Content-type:text/html\n\n";
6
7
8print "<html><head><title>Greenstone Usability - Report Details</title>\n";
9$ENV{HTTP_USER_AGENT}=~/([^\/]*)\/([0-9]+\.[0-9]+)/;
10if(($1 ne "Netscape")||($2 > 4.77)){
11 print "<style type=\"text/css\">\n";
12 print "\th1 \{font-family: sans-serif; font-size: 20px}\n";
13 print "\th2 \{font-family: sans-serif; font-size: 14px; color: #009966\}\n";
14 print "\ttd.sans {font-family:sans-serif; width: 50%; vertical-align:top}\n";
15 print "</style>\n"
16}
17print "</head><body>\n";
18
19($imageloc) = usabcgi::get_config_info("httpimg");
20if(!($imageloc =~ "http")) {$imageloc="http://".$ENV{HTTP_HOST}.$imageloc;}
21
22print "<table width=\"100%\"><tr>\n<td><h1>Greenstone Usability - Report Details</h1></td>\n";
23print "<td align=\"right\">";
24if ($imageloc) { print "<img src=\"$imageloc\/usabbanner.gif\" alt=\"Greenstonekoru design\" title=\"Greenstone koru design\">"; }
25print "</td>\n</tr></table>";
26
27if((!($ENV{QUERY_STRING}=~/\d/)) || ($ENV{QUERY_STRING}=~/\D/) ) {
28 print "<h2>Each report sent has an ID number. This page needs one of those numbers to work.</h2></body></html>";
29 die;
30}
31
32($etcfileloc) = usabcgi::get_config_info("gsdlhome");
33if(!($etcfileloc =~/\/$/)) {$etcfileloc.="/";}
34$etcfileloc .= "etc/usability.txt";
35open (FILEIN, $etcfileloc) or die "could not open usability.txt\n";
36while(<FILEIN>){
37 $etcfile.=$_;
38}
39close(FILEIN);
40
41if(!($etcfile=~ /$ENV{QUERY_STRING}/)) {
42 print "<h2>Each report sent has an ID number. This program needs one of those ID numbers to work, and the ID number provided wans't found</h2></body></html>";
43 die;
44}
45
46#get the report for whjich details are to be viewed.
47$etcfile=~/report-id := $ENV{QUERY_STRING}\&usabend\;\n/;
48$report = $&;
49$tmp=$';
50$tmp=~/----------------------?/;
51$report.=$`;
52@pairs=split(/\&usabend\;\n/,$report);
53foreach $pair (@pairs) {
54 ($name, $value)= split(/ := /,$pair);
55 #this adds html tags for breaks
56 $value =~ s/\n/\<br\>/g;
57 $reportvals{$name}=$value;
58}
59
60
61
62
63print "<p>Your automatically generated report ID number is: <b>$reportvals{\"report-id\"}</b>";
64delete $reportvals{"report-id"};
65
66print "<h2>The following technical information was automatically collected about your problem:</h2>\n";
67print "<table><width=\"100%\">\n";
68
69make_table_entry("The URL of the page where you were having problems","URL");
70make_table_entry("Time you opened the usability report window","opentime");
71make_table_entry("Time you sent the usability report","sendtime");
72make_table_entry("Time the report was received by the server","time");
73make_table_entry("Your browser as it identifies itself","browser");
74make_table_entry("Your browser as the server identifies it","browser-read-by-server");
75make_table_entry("Your browser's IP number","browser-ip-no");
76make_table_entry("The server's IP number","server-ip-no");
77make_table_entry("Your language as recorded by your browser","language");
78make_table_entry("The resolution of your screen","resolution");
79make_table_entry("The colour of your screen","screencolour");
80make_table_entry("The number of bits per pixel your display uses to represent colour","pixeldepth");
81print"</table>";
82
83print "<h2>You provided us with the following extra information about the problem</h2>\n";
84
85print"<table>\n";
86make_table_entry("How bad the problem was","severity");
87make_table_entry("What kind of problem it was","probtype");
88make_table_entry("Other details","moredetails");
89print "</table>\n";
90
91print "<h2>The following data was automatically collected from the form on the greenstone interface</h2>\n";
92
93print"<table>\n";
94print "<tr><td class=\"sans\"><b>Type of input</b></td><td class=\"sans\"><b>Name of input</b></td><td class=\"sans\"><b>Value of input</b></td></tr>\n";
95
96foreach $key (keys(%reportvals)){
97 $key=~/-/;
98 print "<tr><td>$`</td><td>$'</td><td>$reportvals{$key}</td></tr>\n";
99}
100print "</table>\n";
101
102print "</body></html>";
103
104#This function takes a key into the report values interface, and a desription
105# of what that entry means, and makes a properly formatted html table entry
106sub make_table_entry {
107 local ($desc, $entry) = @_;
108 print "<tr><td class=\"sans\" width=\"50%\"><b>$desc:</b></td>";
109 print "<td>$reportvals{$entry}</td></tr>\n";
110 delete $reportvals{$entry};
111
112}
113
114
115
116
117
118
119
120
121
122
123
124
125
Note: See TracBrowser for help on using the repository browser.