Archived
1
0
This commit is contained in:
Mercier Pierre-Olivier 2014-01-12 05:54:35 +01:00
parent cb9bf00da4
commit e9ea5fc3a5
2 changed files with 5 additions and 5 deletions

View File

@ -134,10 +134,10 @@ sub genIds ($;$)
for my $group (@{ $self->{groups} })
{
my $cur_gid;
if (! $group->{id} || grep { /^\Q$group->{id}\E$/ } @ids)
if (! $group->{id} || grep { $_ == $group->{id} } @ids)
{
do {
$cur_gid = "def".$def_i."g".$grp_i;
$cur_gid = "def_".$def_i."g".$grp_i;
$grp_i += 1;
} while (grep {$_ eq $cur_gid} @ids);
$group->{id} = $cur_gid;
@ -151,7 +151,7 @@ sub genIds ($;$)
for my $question (@{ $group->{questions_list} })
{
my $cur_qid;
if (! $question->{id} || grep { /^\Q$question->{id}\E$/ } @ids)
if (! $question->{id} || grep { $_ == $question->{id} } @ids)
{
do {
$cur_qid = $cur_gid."q".$qst_i;
@ -167,7 +167,7 @@ sub genIds ($;$)
my $ans_i = 0;
for my $answer (@{ $question->{answers} })
{
if (! $answer->{id} || grep { /^\Q$answer->{id}\E$/ } @ids)
if (! $answer->{id} || grep { $_ == $answer->{id} } @ids)
{
my $cur_aid;
do {

View File

@ -168,7 +168,7 @@ sub tag_defense
# Generate questions and answer id
my $defense = Defense->new(\$content);
$defense->genIds();
$defense->genIds($defense_id);
# Send data to intradata
log INFO, "Attente d'un processus de publication...";