--- make_poll.pl 2003/09/24 20:35:48 1.9 +++ make_poll.pl 2003/10/11 11:40:36 1.10 @@ -59,6 +59,13 @@ # polls to be conducted by just publishing URL to them. my $without_invitation=0; +# This will remove numbers before answers. That enables you to have +# answers written like: +# 1.1 red +# 1.2 black +# and users will see just "red" and "black" +my $remove_nrs_in_answers=0; + #------------------------------------------------------------------ sub suck_file { @@ -603,7 +610,7 @@ if (defined $text) { chomp $text; $text=~s/^\s*//g; - $text=~s/^[\d\.\s]+//g; + $text=~s/^[\d\.\s]+//g if ($remove_nrs_in_answers); $text=~s/\s*$//g; push @dropdown_data,x($text) if ($text ne ""); } else { @@ -671,7 +678,7 @@ if (defined $text) { chomp $text; $text=~s/^\s*//g; - $text=~s/^[\d\.\s]+//g; + $text=~s/^[\d\.\s]+//g if ($remove_nrs_in_answers); $text=~s/\s*$//g; push @radiobuttons_data,x($text) if ($text ne ""); } else { @@ -716,7 +723,7 @@ if (defined $text) { chomp $text; $text=~s/^\s*//g; - $text=~s/^[\d\.\s]+//g; + $text=~s/^[\d\.\s]+//g if ($remove_nrs_in_answers); $text=~s/\s*$//g; push @checkboxes_data,x($text) if ($text ne ""); } else { @@ -769,7 +776,10 @@ my ($xp, $text) = @_; $db_user=x($attref->{db_user}); $prefix=x($attref->{prefix}); - $without_invitation=x($attref->{without_invitation}); + $without_invitation=x($attref->{without_invitation}) && + print "Pool is without need for unique ID (and invitation URLs).\n"; + $remove_nrs_in_answers=x($attref->{$remove_nrs_in_answers}) && + print "Numbers before answers will be removed.\n"; } }