--- loncom/interface/statistics/lonproblemanalysis.pm 2003/10/30 16:24:36 1.47 +++ loncom/interface/statistics/lonproblemanalysis.pm 2003/11/11 22:07:46 1.48 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemanalysis.pm,v 1.47 2003/10/30 16:24:36 matthew Exp $ +# $Id: lonproblemanalysis.pm,v 1.48 2003/11/11 22:07:46 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -24,7 +24,6 @@ # # http://www.lon-capa.org/ # - package Apache::lonproblemanalysis; use strict; @@ -73,6 +72,7 @@ sub render_resource { sub BuildProblemAnalysisPage { my ($r,$c)=@_; + # $r->print('
'.
@@ -1302,8 +1469,11 @@ sub ProblemSelector {
for (my $i=0;$i'.
''.
' | '.
- ''.$resptype.' '.$res->{'title'}.' ';
+ ''.$res->{'title'}.' ';
+# ''.$resptype.' '.$res->{'title'}.' ';
if ($partdata->{'option'} > 1) {
$seq_str .= &mt('response').' '.$respid;
}
@@ -1379,6 +1550,16 @@ sub get_tries_from_row {
return undef;
}
+sub hashify_attempt {
+ my ($row) = @_;
+ my %attempt;
+ $attempt{'tries'} = $row->[&Apache::loncoursedata::RD_tries()];
+ $attempt{'submission'} = $row->[&Apache::loncoursedata::RD_submission()];
+ $attempt{'award'} = $row->[&Apache::loncoursedata::RD_awarddetail()];
+ $attempt{'timestamp'} = $row->[&Apache::loncoursedata::RD_timestamp()];
+ return %attempt;
+}
+
sub Process_OR_Row {
my ($row) = @_;
my %RowData;
@@ -1414,7 +1595,7 @@ sub Process_OR_Row {
## note: we must force each foil and option to not begin or end with
## spaces as they are stored without such data.
##
-sub get_OR_problem_data {
+sub get_problem_data {
my ($url) = @_;
my $Answ=&Apache::lonnet::ssi($url,('grade_target' => 'analyze'));
(my $garbage,$Answ)=split(/_HASH_REF__/,$Answ,2);
@@ -1427,25 +1608,25 @@ sub get_OR_problem_data {
$key =~ s/^$part\.//;
if (ref($value) eq 'ARRAY') {
if ($key eq 'options') {
- $Partdata{$part}->{'Options'}=$value;
+ $Partdata{$part}->{'_Options'}=$value;
} elsif ($key eq 'concepts') {
- $Partdata{$part}->{'Concepts'}=$value;
+ $Partdata{$part}->{'_Concepts'}=$value;
} elsif ($key =~ /^concept\.(.*)$/) {
my $concept = $1;
foreach my $foil (@$value) {
- $Partdata{$part}->{'Foils'}->{$foil}->{'Concept'}=
+ $Partdata{$part}->{'_Foils'}->{$foil}->{'_Concept'}=
$concept;
}
}
} else {
if ($key=~ /^foil\.text\.(.*)$/) {
my $foil = $1;
- $Partdata{$part}->{'Foils'}->{$foil}->{'name'}=$foil;
+ $Partdata{$part}->{'_Foils'}->{$foil}->{'name'}=$foil;
$value =~ s/(\s*$|^\s*)//g;
- $Partdata{$part}->{'Foils'}->{$foil}->{'text'}=$value;
+ $Partdata{$part}->{'_Foils'}->{$foil}->{'text'}=$value;
} elsif ($key =~ /^foil\.value\.(.*)$/) {
my $foil = $1;
- $Partdata{$part}->{'Foils'}->{$foil}->{'value'}=$value;
+ $Partdata{$part}->{'_Foils'}->{$foil}->{'value'}=$value;
}
}
}
@@ -1453,50 +1634,14 @@ sub get_OR_problem_data {
return %Partdata;
}
-#########################################################
-#########################################################
-##
-## Misc Radio Response functions
-##
-#########################################################
-#########################################################
-sub get_Radio_problem_student_data {
- my ($row) = @_;
-}
-
-sub get_Radio_problem_data {
- my ($url) = @_;
- my $Answ=&Apache::lonnet::ssi($url,('grade_target' => 'analyze'));
- (my $garbage,$Answ)=split(/_HASH_REF__/,$Answ,2);
- my %Answer;
- %Answer=&Apache::lonnet::str2hash($Answ);
- my %Partdata;
- &Apache::lonnet::logthis('url = '.$url);
- foreach my $part (@{$Answer{'parts'}}) {
- while (my($key,$value) = each(%Answer)) {
- if (ref($value) eq 'ARRAY') {
- &Apache::lonnet::logthis('is ref part:'.$part.' '.$key.'='.join(',',@$value));
- } else {
- &Apache::lonnet::logthis('notref part:'.$part.' '.$key.'='.$value);
- }
- next if ($key !~ /^$part/);
- $key =~ s/^$part\.//;
- if ($key eq 'foils') {
- $Partdata{$part}->{'_Foils'}=$value;
- } elsif ($key eq 'options') {
- $Partdata{$part}->{'_Options'}=$value;
- } elsif ($key eq 'shown') {
- $Partdata{$part}->{'_Shown'}=$value;
- } elsif ($key =~ /^foil.value.(.*)$/) {
- $Partdata{$part}->{$1}->{'value'}=$value;
- } elsif ($key =~ /^foil.text.(.*)$/) {
- $Partdata{$part}->{$1}->{'text'}=$value;
- }
- }
- }
- return %Partdata;
-}
-
1;
__END__
+
+#####
+# partdata{part}->{_Foils}->{foilid}->{'name'} = $
+# ->{'text'} = $
+# ->{'value'} = $
+# ->{'_Concept'} = $
+# partdata{part}->{_Options} = @
+# partdata{part}->{_Concepts} = @
| |