version 1.55, 2004/01/16 15:35:04
|
version 1.56, 2004/01/16 20:19:33
|
Line 159 sub BuildProblemAnalysisPage {
|
Line 159 sub BuildProblemAnalysisPage {
|
'.'. |
'.'. |
$current_problem->{'respid'}}; |
$current_problem->{'respid'}}; |
if ($current_problem->{'resptype'} eq 'option') { |
if ($current_problem->{'resptype'} eq 'option') { |
&OptionResponseAnalysis($r,$resource, |
&OptionResponseAnalysis($r,$current_problem, |
$current_problem->{'respid'}, |
|
$ProblemData, |
$ProblemData, |
\@Students); |
\@Students); |
} elsif ($current_problem->{'resptype'} eq 'radiobutton') { |
} elsif ($current_problem->{'resptype'} eq 'radiobutton') { |
&RadioResponseAnalysis($r,$resource, |
&RadioResponseAnalysis($r,$current_problem, |
$current_problem->{'part'}, |
|
$current_problem->{'respid'}, |
|
$ProblemData, |
$ProblemData, |
\@Students); |
\@Students); |
} else { |
} else { |
Line 183 sub BuildProblemAnalysisPage {
|
Line 180 sub BuildProblemAnalysisPage {
|
} |
} |
} |
} |
|
|
=pod |
|
|
|
Removed code: |
|
|
|
######################################################### |
######################################################### |
######################################################### |
######################################################### |
Line 195 Removed code:
|
Line 189 Removed code:
|
######################################################### |
######################################################### |
######################################################### |
######################################################### |
sub RadioResponseAnalysis { |
sub RadioResponseAnalysis { |
my ($r,$resource,$part,$respid,$ProblemData,$Students) = @_; |
my ($r,$problem,$ProblemData,$Students) = @_; |
|
my ($resource,$respid) = ($problem->{'resource'}, |
|
$problem->{'respid'}); |
my $analysis_html; |
my $analysis_html; |
my $PerformanceData = |
my $PerformanceData = |
&Apache::loncoursedata::get_response_data |
&Apache::loncoursedata::get_response_data |
Line 209 sub RadioResponseAnalysis {
|
Line 205 sub RadioResponseAnalysis {
|
return; |
return; |
} |
} |
if (exists($ENV{'form.ExcelOutput'})) { |
if (exists($ENV{'form.ExcelOutput'})) { |
$analysis_html .= &RR_Excel_output($r,$resource,$PerformanceData, |
$analysis_html .= &RR_Excel_output($r,$problem->{'resource'}, |
$ProblemData); |
$PerformanceData,$ProblemData); |
} elsif ($ENV{'form.AnalyzeOver'} eq 'Tries') { |
} elsif ($ENV{'form.AnalyzeOver'} eq 'Tries') { |
$analysis_html .= &RR_Tries_Analysis($r,$resource,$PerformanceData, |
$analysis_html .= &RR_Tries_Analysis($r,$problem->{'resource'}, |
$ProblemData); |
$PerformanceData,$ProblemData); |
} elsif ($ENV{'form.AnalyzeOver'} eq 'Time') { |
} elsif ($ENV{'form.AnalyzeOver'} eq 'Time') { |
$analysis_html .= &RR_Time_Analysis($r,$resource,$PerformanceData, |
$analysis_html .= &RR_Time_Analysis($r,$problem->{'resource'}, |
$ProblemData); |
$PerformanceData,$ProblemData); |
} else { |
} else { |
$analysis_html .= '<h2>'. |
$analysis_html .= '<h2>'. |
&mt('The analysis you have selected is not supported at this time'). |
&mt('The analysis you have selected is not supported at this time'). |
Line 225 sub RadioResponseAnalysis {
|
Line 221 sub RadioResponseAnalysis {
|
$r->print($analysis_html); |
$r->print($analysis_html); |
} |
} |
|
|
|
|
sub RR_Excel_output { |
sub RR_Excel_output { |
my ($r,$PerformanceData,$ProblemData) = @_; |
my ($r,$PerformanceData,$ProblemData) = @_; |
return '<h1>No!</h1>'; |
return '<h1>No!</h1>'; |
Line 246 sub RR_Tries_Analysis {
|
Line 241 sub RR_Tries_Analysis {
|
} |
} |
$analysis_html .= $table; |
$analysis_html .= $table; |
my @TryData = &RR_tries_data_analysis($r,$PerformanceData); |
my @TryData = &RR_tries_data_analysis($r,$PerformanceData); |
if ($ENV{'form.AnalyzeAs'} eq 'Foils') { |
# if ($ENV{'form.AnalyzeAs'} eq 'Foils') { |
$analysis_html = &RR_Tries_Foil_Analysis($mintries,$maxtries,$Foils, |
$analysis_html .= &RR_Tries_Foil_Analysis($mintries,$maxtries,$Foils, |
\@TryData,$ProblemData); |
\@TryData,$ProblemData); |
} else { |
# } else { |
$analysis_html = &RR_Tries_Concept_Analysis($mintries,$maxtries, |
# $analysis_html = &RR_Tries_Concept_Analysis($mintries,$maxtries, |
$Concepts, |
# $Concepts, |
\@TryData, |
# \@TryData, |
$ProblemData); |
# $ProblemData); |
} |
# } |
return $analysis_html; |
return $analysis_html; |
} |
} |
|
|
Line 284 sub RR_Tries_Foil_Analysis {
|
Line 279 sub RR_Tries_Foil_Analysis {
|
my @PlotData_Correct; |
my @PlotData_Correct; |
my @PlotData_Incorrect; |
my @PlotData_Incorrect; |
next if ($try > scalar(@{$TryData})); |
next if ($try > scalar(@{$TryData})); |
next if (! defined($TryData->[$try-1])); |
next if (! defined($TryData->[$try])); |
my %DataSet = %{$TryData->[$try-1]}; |
my %DataSet = %{$TryData->[$try]}; |
my $total = 0; |
my $total = 0; |
foreach my $foilid (@$Foils) { |
foreach my $foilid (@$Foils) { |
$total += $DataSet{$foilid}; |
$total += $DataSet{$foilid}; |
Line 316 sub RR_Tries_Foil_Analysis {
|
Line 311 sub RR_Tries_Foil_Analysis {
|
\@PlotData_Correct, |
\@PlotData_Correct, |
\@PlotData_Incorrect); |
\@PlotData_Incorrect); |
} |
} |
&Apache::lonnet::logthis('plot = '.$html); |
|
return $html; |
return $html; |
} |
} |
|
|
Line 339 sub RR_Time_Concept_Analysis {
|
Line 333 sub RR_Time_Concept_Analysis {
|
} |
} |
|
|
|
|
|
|
sub get_Radio_problem_data { |
sub get_Radio_problem_data { |
my ($url) = @_; |
my ($url) = @_; |
my $Answ=&Apache::lonnet::ssi($url,('grade_target' => 'analyze')); |
my $Answ=&Apache::lonnet::ssi($url,('grade_target' => 'analyze')); |
(my $garbage,$Answ)=split('_HASH_REF__',$Answ,2); |
(my $garbage,$Answ)=split('_HASH_REF__',$Answ,2); |
my %Answer = &Apache::lonnet::str2hash($Answ); |
my %Answer = &Apache::lonnet::str2hash($Answ); |
my %Partdata; |
my %Partdata; |
&Apache::lonnet::logthis('url = '.$url); |
|
foreach my $part (@{$Answer{'parts'}}) { |
foreach my $part (@{$Answer{'parts'}}) { |
while (my($key,$value) = each(%Answer)) { |
while (my($key,$value) = each(%Answer)) { |
# if (ref($value) eq 'ARRAY') { |
# if (ref($value) eq 'ARRAY') { |
Line 372 sub get_Radio_problem_data {
|
Line 364 sub get_Radio_problem_data {
|
return %Partdata; |
return %Partdata; |
} |
} |
|
|
=cut |
|
|
|
|
|
######################################################### |
######################################################### |
######################################################### |
######################################################### |
## |
## |
Line 383 sub get_Radio_problem_data {
|
Line 372 sub get_Radio_problem_data {
|
######################################################### |
######################################################### |
######################################################### |
######################################################### |
sub OptionResponseAnalysis { |
sub OptionResponseAnalysis { |
my ($r,$resource,$respid,$ProblemData,$Students) = @_; |
my ($r,$problem,$ProblemData,$Students) = @_; |
|
my ($resource,$respid) = ($problem->{'resource'}, |
|
$problem->{'respid'}); |
|
# Note: part data is not needed. |
my $PerformanceData = |
my $PerformanceData = |
&Apache::loncoursedata::get_response_data |
&Apache::loncoursedata::get_response_data |
($Students,$resource->{'symb'},$respid); |
($Students,$resource->{'symb'},$respid); |
Line 1517 sub ProblemSelector {
|
Line 1509 sub ProblemSelector {
|
for (my $i=0;$i<scalar(@{$partdata->{'ResponseTypes'}});$i++){ |
for (my $i=0;$i<scalar(@{$partdata->{'ResponseTypes'}});$i++){ |
my $respid = $partdata->{'ResponseIds'}->[$i]; |
my $respid = $partdata->{'ResponseIds'}->[$i]; |
my $resptype = $partdata->{'ResponseTypes'}->[$i]; |
my $resptype = $partdata->{'ResponseTypes'}->[$i]; |
if ($resptype eq 'option' ){ |
# if ($resptype eq 'option' ){ |
# if ($resptype eq 'option' || $resptype eq 'radiobutton') { |
if ($resptype eq 'option' || $resptype eq 'radiobutton') { |
my $value = &make_target_id({symb=>$res->{'symb'}, |
my $value = &make_target_id({symb=>$res->{'symb'}, |
part=>$part, |
part=>$part, |
respid=>$respid, |
respid=>$respid, |
Line 1533 sub ProblemSelector {
|
Line 1525 sub ProblemSelector {
|
} |
} |
$seq_str .= '<tr><td>'. |
$seq_str .= '<tr><td>'. |
'<input type="radio" name="problemchoice" value="'.$value.'" '.$checked.'/>'. |
'<input type="radio" name="problemchoice" value="'.$value.'" '.$checked.'/>'. |
'</td><td>'. |
'</td><td>'. |
|
#.$resptype.'</td><td>'. |
'<a href="'.$res->{'src'}.'">'.$title.'</a> '; |
'<a href="'.$res->{'src'}.'">'.$title.'</a> '; |
# '<a href="'.$res->{'src'}.'">'.$resptype.' '.$res->{'title'}.'</a> '; |
# '<a href="'.$res->{'src'}.'">'.$resptype.' '.$res->{'title'}.'</a> '; |
if ($partdata->{'option'} > 1) { |
if ($partdata->{'option'} > 1) { |
Line 1594 sub get_prev_curr_next {
|
Line 1587 sub get_prev_curr_next {
|
for (my $i=0;$i<scalar(@{$partdata->{'ResponseTypes'}});$i++){ |
for (my $i=0;$i<scalar(@{$partdata->{'ResponseTypes'}});$i++){ |
my $respid = $partdata->{'ResponseIds'}->[$i]; |
my $respid = $partdata->{'ResponseIds'}->[$i]; |
my $resptype = $partdata->{'ResponseTypes'}->[$i]; |
my $resptype = $partdata->{'ResponseTypes'}->[$i]; |
next if ($resptype ne 'option'); |
next if ($resptype ne 'option' && |
|
$resptype ne 'radiobutton'); |
push (@Resource, |
push (@Resource, |
{ symb => $res->{symb}, |
{ symb => $res->{symb}, |
part => $part, |
part => $part, |