--- loncom/interface/statistics/lonstathelpers.pm 2004/09/15 21:07:34 1.21 +++ loncom/interface/statistics/lonstathelpers.pm 2004/09/16 21:54:22 1.23 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstathelpers.pm,v 1.21 2004/09/15 21:07:34 matthew Exp $ +# $Id: lonstathelpers.pm,v 1.23 2004/09/16 21:54:22 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -169,7 +169,7 @@ sub ProblemSelector { =pod -=item &MultpleProblemSelector($navmap,$ResponseTypes,$selected,$inputname) +=item &MultpleProblemSelector($navmap,$selected,$inputname) Generate HTML with checkboxes for problem selection. @@ -178,10 +178,6 @@ Input: $navmap: a navmap object. If undef, navmaps will be called to create a new object. -$ResponseTypes: scalar containing regular expression which matches response -types. Only those problems which contain the given response type will be -shown. - $selected: Scalar, Array, or hash reference of currently selected items. $inputname: The name of the form elements to use for the checkboxs. @@ -194,7 +190,7 @@ and their contents. A checkbox is provi #################################################### #################################################### sub MultipleProblemSelector { - my ($navmap,$ReponseTypes,$inputname,$formname)=@_; + my ($navmap,$inputname,$formname)=@_; my $cid = $ENV{'request.course.id'}; my $Str; # Massage the input as needed. @@ -284,14 +280,15 @@ sub new_accumulator { sub { if (@_) { my ($res,$checked) = @_; - $target.=''. + $target.=''. ''.$/; } else { if (defined($target)) { @@ -602,6 +599,16 @@ keys $partid.'.'.$respid.'.answer'. ##################################################### sub analyze_problem_as_student { my ($resource,$sname,$sdom,$partid,$respid) = @_; + if (ref($resource) ne 'HASH') { + my $res = $resource; + $resource = { 'src' => $res->src, + 'symb' => $res->symb, + 'parts' => $res->parts }; + foreach my $part (@{$resource->{'parts'}}) { + $resource->{'partdata'}->{$part}->{'ResponseIds'}= + [$res->responseIds($part)]; + } + } my $returnvalue; my $url = $resource->{'src'}; my $symb = $resource->{'symb'}; @@ -1234,7 +1241,7 @@ Returns: An array of scalars containing #################################################### #################################################### sub manage_caches { - my ($r,$formname,$inputname) = @_; + my ($r,$formname,$inputname,$update_message) = @_; &Apache::loncoursedata::clear_internal_caches(); my $sectionkey = join(',', @@ -1251,8 +1258,12 @@ sub manage_caches { (exists($ENV{'form.prevenrollstatus'}) && $ENV{'form.prevenrollstatus'} ne $statuskey) ) { + if (defined($update_message)) { + $r->print($update_message); + } &Apache::lonstatistics::Gather_Full_Student_Data($r,$formname, $inputname); + } # my @Buttons =