You can now copy sections and questions. And if I correctly understand how to bundle asset packages, all the new template changes are included.

This commit is contained in:
Kaleb Murphy 2008-10-20 16:17:25 +00:00
parent 5b8a1df90e
commit 5afae6de85
4 changed files with 50 additions and 3 deletions

View file

@ -178,6 +178,8 @@ sub update{
$object->{$key} = $ref->{$key} if(defined $$ref{$key});
}
}
#determine what to add and add it.
# ref should contain all the information for the new
sub insertObject{
@ -193,6 +195,25 @@ $self->log("Inserting ".join(',',@$address));
$self->log("Finished inserting ");
}
sub copy{
my ($self,$address) = @_;
if(@$address == 1){
my %newSection = %{$self->section($address)};
push(@{$self->sections}, \%newSection);
return [$#{$self->sections}];
$self->log("copying here $$address[0] :".$#{$self->sections});
}elsif(@$address == 2){
$self->log("copying question $$address[0] $$address[1]");
my %newQuestion = %{$self->question($address)};
push( @{$self->questions($address)}, \%newQuestion);
$$address[1] = $#{$self->questions($address)};
$self->log("to $$address[0] $$address[1]");
return $address;
}
}
sub remove{
my ($self,$address,$movingOverride) = @_;
if(@$address == 1){