version 1.6, 2004/03/03 22:58:49
|
version 1.11, 2004/06/04 21:42:18
|
Line 43 my @SubmitButtons = ({ name => 'PrevProb
|
Line 43 my @SubmitButtons = ({ name => 'PrevProb
|
{ name => 'NextProblem', |
{ name => 'NextProblem', |
text => 'Next Problem' }, |
text => 'Next Problem' }, |
{ name => 'break'}, |
{ name => 'break'}, |
{ name => 'ClearCache', |
|
text => 'Clear Caches' }, |
|
{ name => 'updatecaches', |
|
text => 'Update Student Data' }, |
|
{ name => 'SelectAnother', |
{ name => 'SelectAnother', |
text => 'Choose a different Problem' }, |
text => 'Choose a different Problem' }, |
{ name => 'Generate', |
{ name => 'Generate', |
Line 75 sub BuildStudentSubmissionsPage {
|
Line 71 sub BuildStudentSubmissionsPage {
|
$r->print('<h2>There are no students in the sections selected</h2>'); |
$r->print('<h2>There are no students in the sections selected</h2>'); |
} |
} |
# |
# |
&Apache::loncoursedata::clear_internal_caches(); |
my @CacheButtonHTML = |
if (exists($ENV{'form.ClearCache'}) || |
&Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status'); |
exists($ENV{'form.updatecaches'}) || |
|
(exists($ENV{'form.firstanalysis'}) && |
|
$ENV{'form.firstanalysis'} ne 'no')) { |
|
&Apache::lonstatistics::Gather_Full_Student_Data($r); |
|
} |
|
if (! exists($ENV{'form.firstanalysis'})) { |
|
$r->print('<input type="hidden" name="firstanalysis" value="yes" />'); |
|
} else { |
|
$r->print('<input type="hidden" name="firstanalysis" value="no" />'); |
|
} |
|
$r->rflush(); |
$r->rflush(); |
# |
# |
if (exists($ENV{'form.problemchoice'}) && |
if (exists($ENV{'form.problemchoice'}) && |
Line 100 sub BuildStudentSubmissionsPage {
|
Line 86 sub BuildStudentSubmissionsPage {
|
$r->print(' 'x5); |
$r->print(' 'x5); |
} |
} |
} |
} |
|
foreach my $html (@CacheButtonHTML) { |
|
$r->print($html.(' 'x5)); |
|
} |
# |
# |
$r->print('<hr />'); |
$r->print('<hr />'); |
$r->rflush(); |
$r->rflush(); |
Line 153 sub BuildStudentSubmissionsPage {
|
Line 142 sub BuildStudentSubmissionsPage {
|
} |
} |
} |
} |
|
|
|
|
######################################################### |
######################################################### |
######################################################### |
######################################################### |
## |
## |
Line 163 sub BuildStudentSubmissionsPage {
|
Line 151 sub BuildStudentSubmissionsPage {
|
######################################################### |
######################################################### |
sub prepare_excel_output { |
sub prepare_excel_output { |
my ($r,$problem,$ProblemData,$Students) = @_; |
my ($r,$problem,$ProblemData,$Students) = @_; |
|
my $c = $r->connection(); |
my ($resource,$respid,$partid) = ($problem->{'resource'}, |
my ($resource,$respid,$partid) = ($problem->{'resource'}, |
$problem->{'respid'}, |
$problem->{'respid'}, |
$problem->{'part'}); |
$problem->{'part'}); |
Line 170 sub prepare_excel_output {
|
Line 159 sub prepare_excel_output {
|
&mt('Preparing Excel spreadsheet of student responses'). |
&mt('Preparing Excel spreadsheet of student responses'). |
'</h2>'); |
'</h2>'); |
# |
# |
&GetStudentAnswers($r,$problem,$Students); |
&Apache::lonstathelpers::GetStudentAnswers($r,$problem,$Students, |
|
'Statistics','stats_status'); |
# |
# |
|
$r->print('<script>'. |
|
'window.document.Statistics.stats_status.value="'. |
|
'Done computing student answers. Compiling spreadsheet.'. |
|
'";</script>'); |
|
$r->rflush(); |
my @Columns = ( 'username','domain','attempt','time', |
my @Columns = ( 'username','domain','attempt','time', |
'submission','correct', 'grading','awarded','weight', |
'submission','correct', 'grading','awarded','weight', |
'score'); |
'score'); |
Line 209 sub prepare_excel_output {
|
Line 204 sub prepare_excel_output {
|
# |
# |
# Populate the worksheet with the student data |
# Populate the worksheet with the student data |
foreach my $student (@$Students) { |
foreach my $student (@$Students) { |
|
last if ($c->aborted()); |
my $results = &Apache::loncoursedata::get_response_data_by_student |
my $results = &Apache::loncoursedata::get_response_data_by_student |
($student,$resource->{'symb'},$respid); |
($student,$resource->{'symb'},$respid); |
my %row; |
my %row; |
Line 284 sub prepare_excel_output {
|
Line 280 sub prepare_excel_output {
|
$r->print('<p><a href="'.$filename.'">'. |
$r->print('<p><a href="'.$filename.'">'. |
&mt('Your Excel spreadsheet.'). |
&mt('Your Excel spreadsheet.'). |
'</a></p>'."\n"); |
'</a></p>'."\n"); |
} |
$r->print('<script>'. |
|
'window.document.Statistics.stats_status.value="'. |
sub GetStudentAnswers { |
'Done compiling spreadsheet. See link below to download.'. |
my ($r,$problem,$Students) = @_; |
'";</script>'); |
my %Answers; |
|
my ($resource,$partid,$respid) = ($problem->{'resource'}, |
|
$problem->{'part'}, |
|
$problem->{'respid'}); |
|
# Open progress window |
|
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin |
|
($r,'Student Answer Compilation Status', |
|
'Student Answer Compilation Progress', scalar(@$Students)); |
|
$r->print("<table>\n"); |
|
$r->rflush(); |
|
foreach my $student (@$Students) { |
|
my $sname = $student->{'username'}; |
|
my $sdom = $student->{'domain'}; |
|
my $answer = &Apache::lonstathelpers::analyze_problem_as_student |
|
($resource,$sname,$sdom,$partid,$respid); |
|
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, |
|
&mt('last student')); |
|
$student->{'answer'} = $answer; |
|
} |
|
$r->print("</table>\n"); |
|
$r->rflush(); |
$r->rflush(); |
# close progress window |
|
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
|
return; |
|
} |
|
|
|
|
} |
|
|
######################################################### |
######################################################### |
######################################################### |
######################################################### |
Line 328 sub CreateInterface {
|
Line 301 sub CreateInterface {
|
my $Str = ''; |
my $Str = ''; |
$Str .= &Apache::lonhtmlcommon::breadcrumbs |
$Str .= &Apache::lonhtmlcommon::breadcrumbs |
(undef,'Student Submission Reports'); |
(undef,'Student Submission Reports'); |
|
$Str .= '<p>'; |
$Str .= '<table cellspacing="5">'."\n"; |
$Str .= '<table cellspacing="5">'."\n"; |
$Str .= '<tr>'; |
$Str .= '<tr>'; |
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>'; |
$Str .= '<td align="center"> </td>'; |
|
$Str .= '</tr>'."\n"; |
$Str .= '</tr>'."\n"; |
## |
# |
## |
|
$Str .= '<tr><td align="center">'."\n"; |
$Str .= '<tr><td align="center">'."\n"; |
$Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); |
$Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); |
$Str .= '</td>'; |
$Str .= '</td>'; |
Line 344 sub CreateInterface {
|
Line 316 sub CreateInterface {
|
$Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); |
$Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); |
$Str .= '</td>'; |
$Str .= '</td>'; |
# |
# |
$Str .= '<td>'.&Apache::lonstathelpers::limit_by_time_form().'</td>'; |
|
# |
|
my $only_seq_with_assessments = sub { |
|
my $s=shift; |
|
if ($s->{'num_assess'} < 1) { |
|
return 0; |
|
} else { |
|
return 1; |
|
} |
|
}; |
|
## |
|
## |
|
$Str .= '</tr>'."\n"; |
$Str .= '</tr>'."\n"; |
$Str .= '</table>'."\n"; |
$Str .= '</table>'."\n"; |
# |
# |
# We do this to make sure the sequence information is initialized |
$Str .= '<nobr>'.&mt('Status: [_1]', |
&Apache::lonstatistics::MapSelect('Maps','multiple,all',5, |
'<input type="text" '. |
$only_seq_with_assessments); |
'name="stats_status" size="60" value="" />'). |
|
'</nobr>'.'</p>'; |
# |
## |
return $Str; |
return $Str; |
} |
} |
|
|