/
Survey.pm
32 lines (27 loc) · 892 Bytes
/
Survey.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package Survey::Perl::Controller::Survey;
use Moose;
use Config::Any;
BEGIN { extends 'Catalyst::Controller' }
sub survey_base :Chained("/") :PathPart("survey") :CaptureArgs(0) {
my ($self, $c) = @_;
# if (! $c->user) {
# if ($c->req->params->{'dest'} && ! $c->session->{human}) {
# $c->forward('/recaptcha/test_user');
# }
# elsif (! $c->session->{human}) {
# $c->detach('/recaptcha/test_user');
# }
# }
}
sub get_root :Chained("survey_base") :PathPart("") :Args(0) {
my ($self, $c) = @_;
my $questions = do($c->path_to('survey/en.pl'));
$c->stash(sections => $questions,
template => 'survey/index.tt');
}
sub finish_survey :Chained("survey_base") :PathPart("finish") :Args(0) {
my ($self, $c) = @_;
my $user = $c->session->{human};
$c->res->body($c->sessionid);
}
1;