--- loncom/interface/spreadsheet/studentcalc.pm 2006/03/26 22:48:34 1.36 +++ loncom/interface/spreadsheet/studentcalc.pm 2007/07/06 19:50:00 1.43 @@ -1,5 +1,5 @@ # -# $Id: studentcalc.pm,v 1.36 2006/03/26 22:48:34 bowersj2 Exp $ +# $Id: studentcalc.pm,v 1.43 2007/07/06 19:50:00 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,6 +59,8 @@ use Apache::assesscalc(); use HTML::Entities(); use Time::HiRes; use Apache::lonlocal; +use LONCAPA; + @Apache::studentcalc::ISA = ('Apache::Spreadsheet'); @@ -99,7 +101,7 @@ sub initialize_sequence_cache { my @all_sequences = $navmap->retrieveResources(undef, sub { shift->is_map(); },1,0,1); for my $sequence ($navmap->getById('0.0'), @all_sequences) { - if ($navmap->hasResource($sequence,sub { shift->is_problem(); }, 0)){ + if ($navmap->hasResource($sequence,sub { shift->is_problem(); }, 0,1)){ push(@Sequences,$sequence); &get_resources($sequence); } @@ -115,7 +117,7 @@ sub get_resources { return () if (! defined($navmap) || ! ref($navmap)); my @resources = $navmap->retrieveResources($seq, sub { shift->is_problem(); }, - 0,0,0); + 0,0,1); $res_memoize{$seq->symb()}=\@resources; return @resources; } @@ -292,7 +294,7 @@ END ''.$resource->compTitle.'
'; $row_output .= &assess_file_selector($rownum, $assess_filename, @@ -300,7 +302,7 @@ END ''; } else { $row_output .= 'Go To'; $row_output .= ''.$resource->compTitle.''; } @@ -397,6 +399,8 @@ sub modify_cell { $self->set_formula($cell,$formula); } elsif ($cell !~ /^([A-z](\d+)|template_[A-z])$/) { return; + } else { + $self->set_formula($cell,$formula); } $self->rebuild_stats(); return; @@ -549,7 +553,7 @@ sub compute { } $self->initialize_safe_space(); &Apache::assesscalc::initialize_package($self->{'name'},$self->{'domain'}, - $navmap); + $navmap,$self); my %f = $self->formulas(); # # Process the formulas list - @@ -570,7 +574,9 @@ sub compute { $assessSheet = Apache::assesscalc->new($self->{'name'}, $self->{'domain'}, $assess_filename, - $resource->symb); + $resource->symb, + $self->{'section'}, + $self->{'groups'}); my @exportdata = $assessSheet->export_data($r); # if ($assessSheet->badcalc()) {