--- loncom/interface/statistics/lonstathelpers.pm 2004/06/23 20:50:26 1.16
+++ loncom/interface/statistics/lonstathelpers.pm 2004/09/30 13:44:07 1.27
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstathelpers.pm,v 1.16 2004/06/23 20:50:26 matthew Exp $
+# $Id: lonstathelpers.pm,v 1.27 2004/09/30 13:44:07 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,7 +40,6 @@ routines that are needed across multiple
=head1 OVERVIEW
-
=over 4
=cut
@@ -119,6 +118,7 @@ sub ProblemSelector {
my ($AcceptedResponseTypes) = @_;
my $Str;
$Str = "\n
\n";
+ my $rb_count =0;
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess('all')) {
next if ($seq->{'num_assess'}<1);
my $seq_str = '';
@@ -126,7 +126,6 @@ sub ProblemSelector {
next if ($res->{'type'} ne 'assessment');
foreach my $part (@{$res->{'parts'}}) {
my $partdata = $res->{'partdata'}->{$part};
- next if ($partdata->{'Survey'});
for (my $i=0;$i{'ResponseTypes'}});$i++){
my $respid = $partdata->{'ResponseIds'}->[$i];
my $resptype = $partdata->{'ResponseTypes'}->[$i];
@@ -143,16 +142,17 @@ sub ProblemSelector {
if (! defined($title) || $title eq '') {
($title) = ($res->{'src'} =~ m:/([^/]*)$:);
}
- $seq_str .= '
\n";
+ $rb_count++;
}
}
}
@@ -171,6 +171,177 @@ sub ProblemSelector {
=pod
+=item &MultipleProblemSelector($navmap,$selected,$inputname)
+
+Generate HTML with checkboxes for problem selection.
+
+Input:
+
+$navmap: a navmap object. If undef, navmaps will be called to create a
+new object.
+
+$selected: Scalar, Array, or hash reference of currently selected items.
+
+$inputname: The name of the form elements to use for the checkboxs.
+
+Returns: A string containing html for a table which lists the sequences
+and their contents. A checkbox is provided for each problem.
+
+=cut
+
+####################################################
+####################################################
+sub MultipleProblemSelector {
+ my ($navmap,$inputname,$formname)=@_;
+ my $cid = $ENV{'request.course.id'};
+ my $Str;
+ # Massage the input as needed.
+ if (! defined($navmap)) {
+ $navmap = Apache::lonnavmaps::navmap->new();
+ if (! defined($navmap)) {
+ $Str .=
+ '