--- loncom/interface/statistics/lonstathelpers.pm 2005/04/07 07:34:52 1.47
+++ loncom/interface/statistics/lonstathelpers.pm 2006/02/14 16:05:46 1.52
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstathelpers.pm,v 1.47 2005/04/07 07:34:52 albertel Exp $
+# $Id: lonstathelpers.pm,v 1.52 2006/02/14 16:05:46 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -132,7 +132,7 @@ Skips 'survey' problems.
####################################################
####################################################
sub problem_selector {
- my ($AcceptedResponseTypes) = @_;
+ my ($AcceptedResponseTypes,$sequence_addendum) = @_;
my $Str;
$Str = "\n
\n";
my $rb_count =0;
@@ -179,8 +179,15 @@ sub problem_selector {
}
}
if ($seq_str ne '') {
- $Str .= '  | '.$seq->compTitle.' | '.
+ $Str .= '
  | '.
+ ''.$seq->compTitle.' | '.
"
\n".$seq_str;
+ if (defined($sequence_addendum)) {
+ $Str .= ''.
+ ('  | 'x2).
+ ''.$sequence_addendum.' | '.
+ "
\n";
+ }
}
}
$Str .= "
\n";
@@ -338,9 +345,10 @@ sub new_accumulator {
sub get_selected_symbs {
my ($inputfield) = @_;
my $field = 'form.'.$inputfield;
- my @Symbs = &Apache::loncommon::get_env_multiple($field);
- @Symbs = (map {&Apache::lonnet::unescape($_);} @{$env{$field}});
- return @Symbs;
+ my @symbs = (map {
+ &Apache::lonnet::unescape($_);
+ } &Apache::loncommon::get_env_multiple($field));
+ return @symbs;
}
####################################################
@@ -423,7 +431,7 @@ current resource.
Inputs: $target (see &Apache::lonstathelpers::get_target_from_id())
$AcceptableResponseTypes, regular expression matching acceptable
response types,
- $granularity, either 'part', 'response', or 'part_survey'
+ $granularity, either 'part', 'response', 'part_survey', or 'part_task'
Returns: three hash references, $prev, $curr, $next, which refer to the
preceeding, current, or following problem parts or responses, depending
@@ -459,6 +467,12 @@ sub get_prev_curr_next {
part => $part,
resource => $res,
} );
+ } elsif ($res->is_task($part) && ($granularity eq 'part_task')){
+ push (@Resource,
+ { symb => $res->symb,
+ part => $part,
+ resource => $res,
+ } );
} elsif ($granularity eq 'part') {
push (@Resource,
{ symb => $res->symb,
@@ -491,7 +505,7 @@ sub get_prev_curr_next {
my $curr_idx;
for ($curr_idx=0;$curr_idx<$#Resource;$curr_idx++) {
my $curr_item = $Resource[$curr_idx];
- if ($granularity eq 'part' || $granularity eq 'part_survey') {
+ if ($granularity =~ /^(part|part_survey|part_task)$/) {
if ($curr_item->{'symb'} eq $target->{'symb'} &&
$curr_item->{'part'} eq $target->{'part'}) {
last;
@@ -506,7 +520,7 @@ sub get_prev_curr_next {
}
}
my $curr_item = $Resource[$curr_idx];
- if ($granularity eq 'part' || $granularity eq 'part_survey') {
+ if ($granularity =~ /^(part|part_survey|part_task)$/) {
if ($curr_item->{'symb'} ne $target->{'symb'} ||
$curr_item->{'part'} ne $target->{'part'}) {
# bogus symb - return nothing
@@ -1127,8 +1141,8 @@ sub get_problem_data {
}
}
# End of logging code
- next if ($key !~ /^$part/);
- $key =~ s/^$part\.//;
+ next if ($key !~ /^\Q$part\E/);
+ $key =~ s/^\Q$part\E\.//;
if (ref($value) eq 'ARRAY') {
if ($key eq 'options') {
$Partdata{$part}->{'_Options'}=$value;
@@ -1251,7 +1265,7 @@ sub limit_by_time_form {
}
$timecheckbox .= 'OnChange="javascript:toggle_limitby_activity(this.checked);" ';
$timecheckbox .= ' />';
- $Str .= '';
+ $Str .= '';
$Str .= &mt('Start Time: [_1]',$startdateform).'
';
$Str .= &mt(' End Time: [_1]',$enddateform).'
';
$Str .= '';