Unable to tie database.');
+ my ($r,$c)=@_;
+ $r->print('
'.&mt('Option Response Problem Analysis').'
');
+ if (exists($ENV{'form.problemchoice'})) {
+ # This is me getting around my own cleverness:
+ &Apache::lonstatistics::MapSelect('Maps','multiple,all',5,
+ undef);
+ #
+ my ($symb,$id) = &get_problem_symb(
+ &Apache::lonnet::unescape($ENV{'form.problemchoice'})
+ );
+ $r->print('');
+ my $resource = &get_resource_from_symb($symb);
+ if (defined($resource)) {
+ $r->print('
'.
+ # Oh this is dumb! Need to rewrite relative links
+ # otherwise images (for example) will not show.
+ &Apache::lonnet::ssi_body($resource->{'src'}).
+ '
');
+ } else {
+ $r->print('resource is undefined');
+ }
+ $r->print('');
+ $r->print("render problem\n");
+ $r->print("image tag for plot\n");
+ $r->print("plot key\n");
+ $r->print('');
+ $r->print("
\nProblem choice = $symb $id\n
\n");
+ $r->print('');
+ }
+ $r->print('');
+ $r->print(&CreateInterface());
+ if (! exists($ENV{'form.analysisfirstcall'})) {
return;
}
-
- $r->print(&IntervalOptions($cache{'Interval'}));
- $r->rflush();
- $r->print(&OptionResponseTable($cache{'OptionResponses'}, \%cache));
-
- untie(%cache);
-
- return;
+ # Okay, they asked for data, so make sure we get the latest data.
+ &Apache::lonnet::logthis('got here for some reason');
+# &Apache::lonstatistics::Gather_Full_Student_Data($r);
+ $r->print(&OptionResponseProblemSelector());
}
-sub BuildAnalyzePage {
- my ($cacheDB, $students, $courseID,$r)=@_;
-
- $jr = $r;
- my $c = $r->connection;
-
- my $Str = '';
- my %cache;
- if(&Apache::loncoursedata::DownloadStudentCourseDataSeparate($students, 'true',
- $cacheDB, 'true',
- 'true', $courseID,
- $r, $c) ne 'OK') {
- $r->print($Str);
- return;
- }
-
-
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
- $Str .= 'Unable to tie database.';
- $r->print($Str);
- return;
- }
-
- my ($problemId, $part, $responseId)=split(':',$cache{'AnalyzeInfo'});
- my $uri = $cache{$problemId.':source'};
- my $problem = $cache{$problemId.':problem'};
- my $title = $cache{$problemId.':title'};
- my $interval = $cache{'Interval'};
-
- my %ConceptData;
- $ConceptData{"Interval"} = $interval;
-
- #Initialize the option response true answers
- my ($analyzeData) = &InitAnalysis($uri, $part, $responseId, $problem,
- $students->[0], $courseID);
- if(defined($analyzeData->{'error'})) {
- $Str .= $analyzeData->{'error'}.' Incorrect part requested. ';
- $r->print($Str);
- return;
- }
-
- $r->print($Str);
- $Str = '';
- if($c->aborted()) { untie(%cache); return; }
-
- #compute the intervals
- &Interval($part, $problem, $interval, $analyzeData->{'concepts'},
- \%ConceptData);
-
- $title =~ s/\ /"_"/eg;
- $Str .= ' '.$uri.'';
-
- $r->print($Str);
- $Str = '';
- if($c->aborted()) { untie(%cache); return; }
-
- #Java script Progress window
- for(my $index=0; $index<(scalar @$students); $index++) {
- if($c->aborted()) { untie(%cache); return; }
- &OpStatus($problemId, $students->[$index], \%ConceptData,
- $analyzeData->{'foil_to_concept'}, $analyzeData, \%cache);
- }
-
- $Str .= ' ';
- for (my $k=0; $k<$interval; $k++ ) {
- if($c->aborted()) { untie(%cache); return $Str; }
- $Str .= &DrawGraph($k, $title, $analyzeData->{'concepts'},
- \%ConceptData);
- $r->print($Str);
- $Str = '';
- }
- for (my $k=0; $k<$interval; $k++ ) {
- if($c->aborted()) { untie(%cache); return $Str; }
- $Str .= &DrawTable($k, $analyzeData->{'concepts'}, \%ConceptData);
- $r->print($Str);
- $Str = '';
- }
- my $Answ=&Apache::lonnet::ssi($uri);
- $Str .= ' Here you can see the Problem: '.$Answ;
- $Str .= '