<% $voting->name %>

<% $voting->abstr %>

% my $num = 0; % foreach my $id (1..$question_set->{question_amount}) % { % $num++; % my $question = $question_set->{questions}->[$id-1]; % next unless ($question->{question} && $question->{amount}); % my $question_name = $question->{question}; % my $qimg_src; % if ( $question_name =~ /<%\s*\w+_(\d+)\s*%>/i ) { % my $index = $1; % if ( ref $pictures && exists $pictures->{"image_$index"} ) { % my $img = $pictures->{"image_$index"}; % my $mini = $pictures->{"image_$index"}{mini}; % $qimg_src = ''; % } % $question_name =~ s/<%\s*\w+_(\d+)\s*%>/$qimg_src/i; % }

\ %# if ( $qimg_src ) { %#<% $qimg_src %>
\ %# } % if ( $question_name ) { <% $question_name %>\ % }

% if ($question->{allow_multi}) { %# (можно выбрать несколько вариантов ответа) % } % my $type = "radio"; % $type = "checkbox" if $question->{allow_multi};
% if ( $question->{range} ) { <% map { '' } (1..10) %> % } % my @random; % if ( ref $question->{choices} eq 'ARRAY' ) { % my $i = 1; % map { $_->{id} = $i++; } @{ $question->{choices} }; % @random = grep { $_->{random} } @{ $question->{choices} }; % } % foreach my $choice_id (1..$question->{amount}) { % my $choice; % if ( $question->{choices}->[$choice_id-1]->{random} ) { % ($choice) = splice(@random, int(rand(scalar @random)), 1); % } else { % $choice = $question->{choices}->[$choice_id-1]; % } % my $choice_name = $choice->{choice}; % my $img_src; % if ( $choice_name =~ /<%\s*\w+_(\d+)\s*%>/i ) { % my $index = $1; % if ( ref $pictures && exists $pictures->{"image_$index"} ) { % my $img = $pictures->{"image_$index"}; % my $mini = $pictures->{"image_$index"}{mini}; % $img_src = ''; % } % $choice_name =~ s/<%\s*\w+_(\d+)\s*%>//i; % } % if ( $img_src && $choice_name ) { <% $img_src %>
% } % if ( $question->{range} ) { % for ( 1..$question->{range} ) { \ % } % } else { <% $choice_name || $img_src %>
% } % } % if ( $question->{range} ) {
'.$_.'
<% $choice_name || $img_src %>
% }
% }
% foreach my $id (1..$question_set->{freefields_amount}) {
<% $question_set->{freefields}[1-$id] %>
% }
%# %#
<%args> $voting => undef <%init> return unless ref $voting; my $question_set=$voting->get_image('voting'); my $pictures = $voting->get_image('pictures');