version 1.40, 2003/10/16 13:23:13
|
version 1.41, 2003/10/16 15:24:49
|
Line 49 sub BuildProblemAnalysisPage {
|
Line 49 sub BuildProblemAnalysisPage {
|
# |
# |
my @Students = @Apache::lonstatistics::Students; |
my @Students = @Apache::lonstatistics::Students; |
# |
# |
if (exists($ENV{'form.updatecaches'}) || |
if (exists($ENV{'form.ClearCache'}) || |
|
exists($ENV{'form.updatecaches'}) || |
(exists($ENV{'form.firstanalysis'}) && |
(exists($ENV{'form.firstanalysis'}) && |
$ENV{'form.firstanalysis'} ne 'no')) { |
$ENV{'form.firstanalysis'} ne 'no')) { |
&Apache::lonstatistics::Gather_Full_Student_Data($r); |
&Apache::lonstatistics::Gather_Full_Student_Data($r); |
Line 85 sub BuildProblemAnalysisPage {
|
Line 86 sub BuildProblemAnalysisPage {
|
# |
# |
my $resource = &get_resource_from_symb($symb); |
my $resource = &get_resource_from_symb($symb); |
if (defined($resource)) { |
if (defined($resource)) { |
|
$r->print('<h3>'.$resource->{'src'}.'</h3>'); |
my %Data = &get_problem_data($resource->{'src'}); |
my %Data = &get_problem_data($resource->{'src'}); |
my $ORdata = $Data{$part.'.'.$resid}; |
my $ORdata = $Data{$part.'.'.$resid}; |
## |
## |
Line 149 sub BuildProblemAnalysisPage {
|
Line 151 sub BuildProblemAnalysisPage {
|
######################################################### |
######################################################### |
sub build_foil_index { |
sub build_foil_index { |
my ($ORdata) = @_; |
my ($ORdata) = @_; |
|
return if (! exists($ORdata->{'Foils'})); |
my %Foildata = %{$ORdata->{'Foils'}}; |
my %Foildata = %{$ORdata->{'Foils'}}; |
my @Foils = sort(keys(%Foildata)); |
my @Foils = sort(keys(%Foildata)); |
my %Concepts; |
my %Concepts; |
Line 264 sub build_option_index {
|
Line 267 sub build_option_index {
|
my $table = "<table>\n"; |
my $table = "<table>\n"; |
my $optionindex = 0; |
my $optionindex = 0; |
my @Rows; |
my @Rows; |
foreach my $option ('correct',@{$ORdata->{'Options'}}) { |
foreach my $option (&mt('correct option chosen'),@{$ORdata->{'Options'}}) { |
push (@Rows, |
push (@Rows, |
'<tr>'. |
'<tr>'. |
'<td bgcolor="'.$plotcolors->[$optionindex++].'">'. |
'<td bgcolor="'.$plotcolors->[$optionindex++].'">'. |
Line 307 sub tries_analysis {
|
Line 310 sub tries_analysis {
|
if ($ENV{'form.AnalyzeAs'} eq 'Foils') { |
if ($ENV{'form.AnalyzeAs'} eq 'Foils') { |
$extrakey = &build_option_index($ORdata); |
$extrakey = &build_option_index($ORdata); |
$xlabel = 'Foil Number'; |
$xlabel = 'Foil Number'; |
$ylabel = 'Option Chosen'; |
$ylabel = 'Percent Choosing Option'; |
foreach my $foilid (@$Foils) { |
foreach my $foilid (@$Foils) { |
for (my $i=$mintries;$i<=$maxtries;$i++) { |
for (my $i=$mintries;$i<=$maxtries;$i++) { |
foreach my $option ('_correct',@{$ORdata->{'Options'}}) { |
foreach my $option ('_correct',@{$ORdata->{'Options'}}) { |
Line 415 sub analyze_option_data_by_tries {
|
Line 418 sub analyze_option_data_by_tries {
|
for (my $i=0;$i<=$#Foilgrades;$i++) { |
for (my $i=0;$i<=$#Foilgrades;$i++) { |
my ($foilid,$correct) = split('=',$Foilgrades[$i]); |
my ($foilid,$correct) = split('=',$Foilgrades[$i]); |
my (undef,$submission) = split('=',$Foilsubs[$i]); |
my (undef,$submission) = split('=',$Foilsubs[$i]); |
$submission = &HTML::Entities::decode($submission); |
$submission = &Apache::lonnet::unescape($submission); |
$submission =~ s/\%20/ /g; |
|
if ($correct) { |
if ($correct) { |
$Trydata{$foilid}->[$numtries]->{'_correct'}++; |
$Trydata{$foilid}->[$numtries]->{'_correct'}++; |
} else { |
} else { |
Line 765 sub get_problem_data {
|
Line 767 sub get_problem_data {
|
$key =~ s/^$part\.//; |
$key =~ s/^$part\.//; |
if (ref($value) eq 'ARRAY') { |
if (ref($value) eq 'ARRAY') { |
if ($key eq 'options') { |
if ($key eq 'options') { |
for(my $i=0;$i<scalar(@$value);$i++) { |
|
$value->[$i]=~ s/(\s*$|^\s*)//g; |
|
} |
|
$Partdata{$part}->{'Options'}=$value; |
$Partdata{$part}->{'Options'}=$value; |
} elsif ($key eq 'concepts') { |
} elsif ($key eq 'concepts') { |
$Partdata{$part}->{'Concepts'}=$value; |
$Partdata{$part}->{'Concepts'}=$value; |
} elsif ($key =~ /^concept\.(.*)$/) { |
} elsif ($key =~ /^concept\.(.*)$/) { |
my $concept = $1; |
my $concept = $1; |
foreach my $foil (@$value) { |
foreach my $foil (@$value) { |
$foil =~ s/(\s*$|^\s*)//g; |
|
$Partdata{$part}->{'Foils'}->{$foil}->{'Concept'}= |
$Partdata{$part}->{'Foils'}->{$foil}->{'Concept'}= |
$concept; |
$concept; |
} |
} |
} |
} |
} else { |
} else { |
$value =~ s/(\s*$|^\s*)//g; |
|
if ($key=~ /^foil\.text\.(.*)$/) { |
if ($key=~ /^foil\.text\.(.*)$/) { |
my $foil = $1; |
my $foil = $1; |
$foil =~ s/(\s*$|^\s*)//g; |
|
$Partdata{$part}->{'Foils'}->{$foil}->{'name'}=$foil; |
$Partdata{$part}->{'Foils'}->{$foil}->{'name'}=$foil; |
$Partdata{$part}->{'Foils'}->{$foil}->{'text'}=$value; |
$Partdata{$part}->{'Foils'}->{$foil}->{'text'}=$value; |
} elsif ($key =~ /^foil\.value\.(.*)$/) { |
} elsif ($key =~ /^foil\.value\.(.*)$/) { |
my $foil = $1; |
my $foil = $1; |
$foil =~ s/(\s*$|^\s*)//g; |
|
$Partdata{$part}->{'Foils'}->{$foil}->{'value'}=$value; |
$Partdata{$part}->{'Foils'}->{$foil}->{'value'}=$value; |
} |
} |
} |
} |