/[wopi]/make_poll.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /make_poll.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by dpavlin, Wed Sep 24 20:35:48 2003 UTC revision 1.10 by dpavlin, Sat Oct 11 11:40:36 2003 UTC
# Line 59  my $db_user="dpavlin"; Line 59  my $db_user="dpavlin";
59  # polls to be conducted by just publishing URL to them.  # polls to be conducted by just publishing URL to them.
60  my $without_invitation=0;  my $without_invitation=0;
61    
62    # This will remove numbers before answers. That enables you to have
63    # answers written like:
64    # 1.1 red
65    # 1.2 black
66    # and users will see just "red" and "black"
67    my $remove_nrs_in_answers=0;
68    
69  #------------------------------------------------------------------  #------------------------------------------------------------------
70    
71  sub suck_file {  sub suck_file {
# Line 603  sub dropdown { Line 610  sub dropdown {
610                  if (defined $text) {                  if (defined $text) {
611                          chomp $text;                          chomp $text;
612                          $text=~s/^\s*//g;                          $text=~s/^\s*//g;
613                          $text=~s/^[\d\.\s]+//g;                          $text=~s/^[\d\.\s]+//g if ($remove_nrs_in_answers);
614                          $text=~s/\s*$//g;                          $text=~s/\s*$//g;
615                          push @dropdown_data,x($text) if ($text ne "");                          push @dropdown_data,x($text) if ($text ne "");
616                  } else {                  } else {
# Line 671  sub radiobuttons { Line 678  sub radiobuttons {
678                  if (defined $text) {                  if (defined $text) {
679                          chomp $text;                          chomp $text;
680                          $text=~s/^\s*//g;                          $text=~s/^\s*//g;
681                          $text=~s/^[\d\.\s]+//g;                          $text=~s/^[\d\.\s]+//g if ($remove_nrs_in_answers);
682                          $text=~s/\s*$//g;                          $text=~s/\s*$//g;
683                          push @radiobuttons_data,x($text) if ($text ne "");                          push @radiobuttons_data,x($text) if ($text ne "");
684                  } else {                  } else {
# Line 716  sub checkboxes { Line 723  sub checkboxes {
723                  if (defined $text) {                  if (defined $text) {
724                          chomp $text;                          chomp $text;
725                          $text=~s/^\s*//g;                          $text=~s/^\s*//g;
726                          $text=~s/^[\d\.\s]+//g;                          $text=~s/^[\d\.\s]+//g if ($remove_nrs_in_answers);
727                          $text=~s/\s*$//g;                          $text=~s/\s*$//g;
728                          push @checkboxes_data,x($text) if ($text ne "");                          push @checkboxes_data,x($text) if ($text ne "");
729                  } else {                  } else {
# Line 769  sub config { Line 776  sub config {
776                  my ($xp, $text) = @_;                  my ($xp, $text) = @_;
777                  $db_user=x($attref->{db_user});                  $db_user=x($attref->{db_user});
778                  $prefix=x($attref->{prefix});                  $prefix=x($attref->{prefix});
779                  $without_invitation=x($attref->{without_invitation});                  $without_invitation=x($attref->{without_invitation}) &&
780                            print "Pool is without need for unique ID (and invitation URLs).\n";
781                    $remove_nrs_in_answers=x($attref->{$remove_nrs_in_answers}) &&
782                            print "Numbers before answers will be removed.\n";
783          }          }
784  }  }
785    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.26