File:  [LON-CAPA] / loncom / interface / spreadsheet / lonspreadsheet.pm
Revision 1.58: download - view: text, annotated - select for diffs
Fri Dec 3 21:33:56 2010 UTC (13 years, 7 months ago) by www
Branches: MAIN
CVS tags: HEAD
Work-in-progress: Grading

    1: #
    2: # $Id: lonspreadsheet.pm,v 1.58 2010/12/03 21:33:56 www Exp $
    3: #
    4: # Copyright Michigan State University Board of Trustees
    5: #
    6: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
    7: #
    8: # LON-CAPA is free software; you can redistribute it and/or modify
    9: # it under the terms of the GNU General Public License as published by
   10: # the Free Software Foundation; either version 2 of the License, or
   11: # (at your option) any later version.
   12: #
   13: # LON-CAPA is distributed in the hope that it will be useful,
   14: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   15: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   16: # GNU General Public License for more details.
   17: #
   18: # You should have received a copy of the GNU General Public License
   19: # along with LON-CAPA; if not, write to the Free Software
   20: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   21: #
   22: # /home/httpd/html/adm/gpl.txt
   23: #
   24: # http://www.lon-capa.org/
   25: #
   26: # The LearningOnline Network with CAPA
   27: # Spreadsheet/Grades Display Handler
   28: #
   29: # POD required stuff:
   30: 
   31: =head1 NAME
   32: 
   33: lonspreadsheet
   34: 
   35: =head1 SYNOPSIS
   36: 
   37: Spreadsheet interface to internal LON-CAPA data
   38: 
   39: =head1 DESCRIPTION
   40: 
   41: Lonspreadsheet provides course coordinators the ability to manage their
   42: students grades online.  The students are able to view their own grades, but
   43: not the grades of their peers.  The spreadsheet is highly customizable,
   44: offering the ability to use Perl code to manipulate data, as well as many
   45: built-in functions.
   46: 
   47: =head2 Functions available to user of lonspreadsheet
   48: 
   49: =over 4
   50: 
   51: =cut
   52: 
   53: 
   54: package Apache::lonspreadsheet;
   55:             
   56: use strict;
   57: use warnings FATAL=>'all';
   58: no warnings 'uninitialized';
   59: use Apache::classcalc();
   60: use Apache::studentcalc();
   61: use Apache::assesscalc();
   62: use Apache::Constants qw(:common :http);
   63: use Apache::lonnet;
   64: use Apache::lonhtmlcommon;
   65: use Apache::lonlocal;
   66: use Apache::loncoursedata();
   67: use Apache::lonquickgrades();
   68: use HTML::Entities();
   69: 
   70: ##
   71: ## HTML utility subroutines really should go in lonhtmlcommon
   72: ##
   73: 
   74: sub textfield {
   75:     my ($title,$name,$value)=@_;
   76:     return "\n<p><b>$title:</b><br />".
   77:         '<input type="text" name="'.$name.'" size="80" value="'.$value.'" />';
   78: }
   79: 
   80: sub hiddenfield {
   81:     my ($name,$value)=@_;
   82:     return '<input type="hidden" name="'.$name.'" value="'.$value.'" />'."\n";
   83: }
   84: 
   85: sub selectbox {
   86:     my ($title,$name,$value,%options)=@_;
   87:     my $selout="\n<p><b>$title:</b><br />".'<select name="'.$name.'">';
   88:     foreach (sort keys(%options)) {
   89:         $selout.='<option value="'.$_.'"';
   90:         if ($_ eq $value) { $selout.=' selected="selected"'; }
   91:         $selout.='>'.&mt($options{$_}).'</option>';
   92:     }
   93:     return $selout.'</select>';
   94: }
   95: 
   96: sub file_dialogs {
   97:     my ($spreadsheet) = @_;
   98:     my $bgcolor = "#FFFFFF";
   99:     my $sheettype = $spreadsheet->{'type'};
  100:     my $result = '';
  101:     my $message = '';
  102:     ##
  103:     ## Deal with saving the spreadsheet
  104:     $spreadsheet->check_formulas_loaded();
  105:     if ((exists($env{'form.save'}) || exists($env{'form.makedefault'})) && 
  106:         exists($env{'form.savefilename'})) {
  107:         $spreadsheet->filename($env{'form.savefilename'});
  108:         my $save_status = $spreadsheet->save();
  109:         if ($save_status ne 'ok') {
  110:             $message .= "An error occurred while saving the spreadsheet".
  111:                 "There error is:".$save_status;
  112:         } else {
  113:             $message .= "Spreadsheet saved as ".$spreadsheet->filename();
  114:         }
  115:     } elsif (exists($env{'form.newformula'}) && 
  116:              exists($env{'form.cell'})       && 
  117:              $env{'form.cell'} ne '' ) {
  118:         ##
  119:         ## Make any requested modifications to the spreadsheet
  120:         $spreadsheet->modify_cell($env{'form.cell'},
  121:                                   $env{'form.newformula'});
  122:         $spreadsheet->save_tmp();
  123:         # output that we are dealing with a temporary file
  124:         $result .=&hiddenfield('workcopy',$sheettype);
  125:         if ($env{'form.newformula'} !~ /^\s*$/) {
  126:             $message .='<table><tr>'.
  127:               '<td valign="top"><pre>'.&mt('Cell').' '.$env{'form.cell'}.' = </pre></td>'.
  128:               '<td><pre>'.$env{'form.newformula'}."</pre></td></tr></table>\n";
  129:         } else {
  130:             $message .= &mt('Deleted contents of cell').' '.$env{'form.cell'}.'.';
  131:         }
  132:     }
  133:     ##
  134:     ## Editing code
  135:     $result .=&hiddenfield('cell','').
  136:               &hiddenfield('newformula','');
  137:     ##
  138:     ## Create the save and load dialogs
  139:     my $filename = $spreadsheet->filename();
  140:     my $truefilename = $filename;
  141:     if ($spreadsheet->is_default()) {
  142:         $filename = 'Default';
  143:     }
  144:     my $save_dialog = '<span class="LC_nobreak">'.
  145:         '<input type="submit" name="save" value="'.&mt('Save as').'" /> '.
  146:         '<input type="text" name="savefilename" size="30" value="'.
  147:         $truefilename.'" />'.
  148:         '</span>';
  149:     my $makedefault_dialog = '<input type="submit" name="makedefault" '.
  150:         'value="'.&mt('Save as &amp; Make This Sheet the Default').'"/>';
  151:     #
  152:     my $link = '<a href="javascript:openbrowser'.
  153:         "('sheet','loadfilename','spreadsheet')\">".&mt('Select Spreadsheet File')."</a>";
  154:     my $load=&mt('Load:');
  155:     my $load_dialog = <<END;
  156: <table bgcolor="$bgcolor">
  157: <tr><td><input type="submit" name="load" value="$load" /></td>
  158:     <td><span class="LC_nobreak">
  159:         <input type="text" name="loadfilename" size="20" value="$filename" />
  160:         $link</span>
  161:     </td></tr>
  162: <tr><td>&nbsp;</td><td>
  163:     <select name="fileselect" onchange="document.sheet.loadfilename.value=document.sheet.fileselect.value" >
  164: END
  165:     my $default_filename_set = 0;
  166:     foreach my $sheetfilename ($spreadsheet->othersheets()) {
  167:         $load_dialog .= '    <option value="'.$sheetfilename.'"';
  168:         if ($filename eq $sheetfilename) {
  169:             $load_dialog .= ' selected="selected"';
  170:             $default_filename_set = 1;
  171:         }
  172:         $load_dialog .= '>'.$sheetfilename."</option>\n";
  173:     }
  174:     $load_dialog .= "</select>\n</td><td>&nbsp;</td></tr>\n</table>\n";
  175:         #
  176:     my $headline = &mt('File Dialogs');
  177:     $result .=<<END;
  178: <!-- 
  179:     <fieldset title="File Dialogs" >
  180:     <legend>$headline</legend>
  181:   -->
  182: <!-- load / save dialogs -->
  183: <table cellspacing="2">
  184: <tr>
  185:     <td>$load_dialog</td>
  186:     <td>
  187:         <table bgcolor="$bgcolor">
  188:         <tr><td>$save_dialog</td></tr>
  189:         <tr><td align="center">$makedefault_dialog</td></tr>
  190:         </table>
  191:     </td>
  192: </tr>
  193: </table>
  194: <!--
  195:     </fieldset>
  196:   -->
  197: END
  198:     return ($result,$message);
  199: }
  200: 
  201: sub handler {
  202:     my $r=shift;
  203:     #
  204:     # HTML Header
  205:     #
  206:     if ($r->header_only) {
  207:         &Apache::loncommon::content_type($r,'text/html');
  208:         $r->send_http_header;
  209:         return OK;
  210:     }
  211:     #
  212:     # Roles Checking
  213:     #
  214:     # Needs to be in a course
  215:     if (! $env{'request.course.fn'}) { 
  216:         # Not in a course, or not allowed to modify parms
  217:         $env{'user.error.msg'}=
  218:             $r->uri.":opa:0:0:Cannot modify spreadsheet";
  219:         return HTTP_NOT_ACCEPTABLE; 
  220:     }
  221:     my $courseid = $env{'request.course.id'};
  222:     #
  223:     # Do not allow students to continue if standard or external grading is in
  224:     # effect.
  225:     #
  226:     if ($env{'request.role'} =~ /^st\./) {
  227:         if ($env{'course.'.$courseid.'.grading'} eq 'standard' ||
  228: 	    $env{'course.'.$courseid.'.grading'} eq 'external' ) {
  229:             return HTTP_NOT_ACCEPTABLE;
  230:         }
  231:     }
  232:     #
  233:     # Get query string for limited number of parameters
  234:     #
  235:     &Apache::loncommon::get_unprocessed_cgi
  236:         ($ENV{'QUERY_STRING'},['sname','sdomain','usymb','filename','recalc',
  237:                                'output_format','not_first_run']);
  238:     #
  239:     # Deal with restricted student permissions 
  240:     #
  241:     if ($env{'request.role'} =~ /^st\./) {
  242:         delete $env{'form.cell'}       if (exists($env{'form.cell'}));
  243:         delete $env{'form.newformula'} if (exists($env{'form.newformula'}));
  244:     }
  245:     #
  246:     # Determine basic information about the spreadsheet
  247:     my ($sheettype) = ($r->uri=~/\/(\w+)$/);
  248:     #
  249:     my $symb   = undef;
  250:     $symb = $env{'form.usymb'} if (exists($env{'form.usymb'}));
  251:     my $name   = $env{'user.name'};
  252:     my $domain = $env{'user.domain'};
  253:     if (exists($env{'form.sname'}) && $env{'form.sname'} ne '') {
  254:         $name   = $env{'form.sname'};
  255:         $domain = $env{'form.sdomain'};
  256:     }
  257:     $env{'form.sname'} = $name;
  258:     $env{'form.sdomain'} = $domain;
  259:     my $section = &Apache::lonnet::getsection($domain,$name,
  260: 					      $env{'request.course.id'});
  261:     my @groups;
  262:     if (($env{'user.name'} eq $name) && ($env{'user.domain'} eq $domain)) {
  263:         @groups = &Apache::lonnet::sort_course_groups($env{'request.course.id'},
  264:                                     split(':',$env{'request.course.groups'}));
  265:     } else {
  266:         @groups = &Apache::lonnet::get_users_groups($domain,$name,
  267:                                                     $env{'request.course.id'});
  268:     }
  269: 
  270:     ##
  271:     ## Check permissions
  272:     my $allowed_to_edit = &Apache::lonnet::allowed('mgr',
  273:                                                 $env{'request.course.id'});
  274:     # Only those instructors/tas/whatevers with complete access
  275:     # (not section restricted) are able to modify spreadsheets.
  276:     my $allowed_to_view =  &Apache::lonnet::allowed('vgr',
  277:                                                 $env{'request.course.id'});
  278:     if (! $allowed_to_view) {
  279:         $allowed_to_view = &Apache::lonnet::allowed('vgr',
  280:                     $env{'request.course.id'}.'/'.$env{'request.course.sec'});
  281:         # Those who are restricted by section are allowed to view.
  282:         # The routines in lonstatistics which decide which students' 
  283:         # will be shown take care of the restriction by section.
  284:     }
  285:     #
  286:     # Only those able to view others grades will be allowed to continue 
  287:     # if they are not requesting their own.
  288:     if ($sheettype eq 'classcalc') {
  289:         if (! $allowed_to_view) {
  290: 	    $env{'user.error.msg'}=
  291: 		$r->uri.":vgr:0:0:Access Permission Denied";
  292: 	    return HTTP_NOT_ACCEPTABLE; 
  293: 	}
  294:     }
  295:     if ((($name   ne $env{'user.name'} ) ||
  296:          ($domain ne $env{'user.domain'})) && $sheettype ne 'classcalc') {
  297:         # Check that the student is in their section?
  298:         if (exists($env{'request.course.sec'}) && 
  299:             $env{'request.course.sec'} ne '' ) {
  300:             my $stu_sec = &Apache::lonnet::getsection($domain,$name,
  301: 						    $env{'request.course.id'});
  302:             if ($stu_sec ne $env{'request.course.sec'}) {
  303: 		$env{'user.error.msg'}=
  304: 		    $r->uri.":vgr:0:0:Requested student not in your section.";
  305: 		return HTTP_NOT_ACCEPTABLE; 
  306:             }
  307:         }
  308:     }
  309: 
  310:     #
  311:     # Open page, try to prevent browser cache.
  312:     #
  313:     &Apache::loncommon::content_type($r,'text/html');
  314:     &Apache::loncommon::no_cache($r);
  315:     $r->send_http_header;
  316: 
  317:     #
  318:     # Header....
  319:     #
  320:     my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
  321:     ##
  322:     ## Spit out the javascript required for editing
  323:     ##
  324:     my $js;
  325:     if ($allowed_to_edit) {
  326: 	my %lt=(
  327: 		'ce' => 'Cell',
  328: 		'ac' => 'Accept',
  329: 		'dc' => 'Discard Changes'
  330: 	);
  331:         my $extra_javascript = 
  332:             &Apache::loncommon::browser_and_searcher_javascript();
  333: 	
  334: 	my $cell_extra_js   = &Apache::loncommon::resize_textarea_js();
  335: 	my $cell_edit_start = 
  336: 	    &Apache::loncommon::start_page('Cell Edit Window',$cell_extra_js,
  337: 					   {'only_body' => 1,
  338: 					    'js_ready'  => 1,
  339: 					    'add_entries'  => {
  340: 						'onresize' => "resize_textarea('LC_newformula','LC_aftertextarea')",
  341: 						'onload'   => "resize_textarea('LC_newformula','LC_aftertextarea')",
  342: 					    }});
  343: 	my $cell_edit_end = 
  344: 	    &Apache::loncommon::end_page({'js_ready'  => 1,});
  345: 
  346:         $js = <<ENDSCRIPT;
  347: <script type="text/javascript">
  348: //<!--
  349:     $extra_javascript
  350: 
  351:     var editwin;
  352: 
  353:     function celledit(cellname,cellformula) {
  354:         var edit_text = '';
  355:         // cellformula may contain less-than and greater-than symbols, so
  356:         // we need to escape them?  
  357:         edit_text +='$cell_edit_start';
  358:         edit_text += '<form name="editwinform">';
  359:         edit_text += '<center><h3>$lt{'ce'} '+cellname+'</h3>';
  360:         edit_text += '<textarea id="LC_newformula" name="newformula" ';
  361:         edit_text += ' cols="60" rows="12"; wrap="off" style="width:100%">';
  362: 	edit_text += cellformula+'</textarea>';
  363:         edit_text += '<div id="LC_aftertextarea"><br />';
  364:         edit_text += '<input type="button" name="accept" value="$lt{'ac'}"';
  365:         edit_text += ' onClick=\\\'javascript:';
  366:         edit_text += 'opener.document.sheet.cell.value=';
  367:         edit_text +=     '"'+cellname+'";';
  368:         edit_text += 'opener.document.sheet.newformula.value=';
  369:         edit_text +=     'document.editwinform.newformula.value;';
  370:         edit_text += 'opener.document.sheet.submit();';
  371:         edit_text += 'self.close()\\\' />';
  372:         edit_text += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
  373:         edit_text += '<input type="button" name="abort" ';
  374:         edit_text +=     'value="$lt{'dc'}"';
  375:         edit_text += ' onClick="javascript:self.close()" />';
  376:         edit_text += '</center></div></form>$cell_edit_end';
  377: 
  378:         if (editwin != null && !(editwin.closed) ) {
  379:             editwin.close();
  380:         }
  381: 
  382:         editwin = window.open($nothing,'CellEditWin','height=280,width=480,scrollbars=no,resizable=yes,alwaysRaised=yes,dependent=yes',true);
  383:         editwin.document.write(edit_text);
  384:         editwin.document.close();
  385:     }
  386: //-->
  387: </script>
  388: ENDSCRIPT
  389:     }
  390:     &Apache::lonhtmlcommon::clear_breadcrumbs();
  391:     &Apache::lonhtmlcommon::add_breadcrumb
  392:         ({href  => $r->uri,
  393:           title => 'Spreadsheet',
  394:           text  => 'Spreadsheet',
  395:           faq   => 134,
  396:           bug   => 'Spreadsheet'});
  397:     $r->print(&Apache::loncommon::start_page('Grades Spreadsheet',$js).
  398:               &Apache::lonhtmlcommon::breadcrumbs('Spreadsheet',
  399: 						  'Spreadsheet_About'));
  400: 
  401:     #
  402:     # Tabs
  403:     # 
  404:     &Apache::lonquickgrades::startGradeScreen($r,'spreadsheet');
  405: 
  406:     #
  407:     # Open the form
  408:     # 
  409:     $r->print('<form action="'.$r->uri.'" name="sheet" method="post">');
  410:     $r->print(&hiddenfield('sname'  ,$env{'form.sname'}).
  411:               &hiddenfield('sdomain',$env{'form.sdomain'}).
  412:               &hiddenfield('usymb'  ,$env{'form.usymb'}));
  413:     $r->rflush();
  414:     ##
  415:     ## Determine the filename to use
  416:     my $filename = undef;
  417:     if ($allowed_to_edit) {
  418:         $filename = $env{'form.filename'} if (exists($env{'form.filename'}));
  419:         #
  420:         if (exists($env{'form.load'}) && exists($env{'form.loadfilename'})) {
  421:             $filename = $env{'form.loadfilename'};
  422:             $env{'form.workcopy'} = 'no';
  423:         }
  424:     }
  425:     ##
  426:     ## Take care of "backdoor" spreadsheet expiration / recalc stuff
  427:     if ($allowed_to_edit && exists($env{'form.recalc'})) {
  428:         if (exists($env{'form.recalc'})) {
  429:             &Apache::loncoursedata::delete_caches($env{'requres.course.id'});
  430:         }
  431:         if ($env{'form.recalc'} eq 'expireallsheets') {
  432:             &Apache::lonnet::logthis('spreadsheet expired: entire course');
  433:             # expire ALL spreadsheets
  434:             &Apache::lonnet::expirespread('','','studentcalc');
  435:             &Apache::lonnet::expirespread('','','assesscalc');
  436:             $r->print('<h3>'.
  437:                       &mt('Expired spreadsheet caches for all students').
  438:                       '</h3>');
  439:         } elsif ($env{'form.recalc'} =~ /^symb:/) {
  440:             # expire for all students on this symb
  441:             my ($symb) = ($env{'form.recalc'} =~ /^symb:(.*)$/);
  442:             &Apache::lonnet::logthis('spreadsheet expired: symb = '.$symb);
  443:             &Apache::lonnet::expirespread('','','assesscalc',$symb);
  444:             &Apache::lonnet::expirespread('','','studentcalc');
  445:             $r->print('<h3>'.
  446:               &mt('Expired spreadsheet caches for all students for symb  [_1]',
  447:                   $symb).
  448:                       '</h3>');
  449:         } elsif ($env{'form.recalc'} =~ /^student:/) {
  450:             # expire all assessment spreadsheets for this user
  451:             my ($sname,$sdom) = ($env{'form.recalc'}=~/^student:(.*):(.*)$/);
  452:             &Apache::lonnet::logthis('spreadsheet expired: student = '.
  453:                                      $sname.'@'.$sdom);
  454:             if (defined($sname) && defined($sdom)) {
  455:                 &Apache::lonnet::expirespread($sname,$sdom,'assesscalc');
  456:                 &Apache::lonnet::expirespread($sname,$sdom,'studentcalc');
  457:                 $r->print('<h3>'.
  458:                           &mt('Expired spreadsheet caches for student [_1]',
  459:                               $sname.'@'.$sdom).
  460:                           '</h3>');
  461:             }
  462:         }
  463:     }
  464:     ##
  465:     ## Make the spreadsheet
  466:     &Apache::Spreadsheet::initialize_spreadsheet_package();
  467:     my $spreadsheet = undef;
  468:     if ($sheettype eq 'classcalc') {
  469:         $spreadsheet = Apache::classcalc->new($name,$domain,$filename,undef,
  470: 					      $section,\@groups);
  471:     } elsif ($sheettype eq 'studentcalc') {
  472:         $spreadsheet = Apache::studentcalc->new($name,$domain,$filename,undef,
  473: 						$section,\@groups);
  474:     } elsif ($sheettype eq 'assesscalc' && 
  475:              defined($symb) && 
  476:              $allowed_to_edit) {
  477:         $spreadsheet = Apache::assesscalc->new($name,$domain,$filename,$symb,
  478: 					       $section,\@groups);
  479:     } else {
  480:         return HTTP_NOT_ACCEPTABLE;
  481:     }
  482:     if (! defined($spreadsheet)) {
  483:         # error error - run in circles, scream and shout
  484:         return;
  485:     }
  486:     $spreadsheet->initialize();
  487:     #
  488:     # Output selector
  489:     ##
  490:     ## Editing/loading/saving
  491:     if ($allowed_to_edit) {
  492:         my ($html,$action_message) = &file_dialogs($spreadsheet);
  493:         if ($env{'form.makedefault'}) {
  494:             $spreadsheet->make_default();
  495:             if ($action_message) {
  496:                 $action_message .= '<br />';
  497:             }
  498:             $action_message .= &mt('Made this spreadsheet the default');
  499:             if ($sheettype eq 'classcalc') {
  500:                 $action_message .= ' '.&mt('for the course');
  501:             } elsif ($sheettype eq 'studentcalc') {
  502:                 $action_message .= ' '.&mt('for all students');
  503:             } elsif ($sheettype eq 'assesscalc') {
  504:                 $action_message .= ' '.&mt('for all assessments');
  505:             }
  506:             $action_message .= '.';
  507:         }
  508:         $r->print('<table><tr><td valign="top">'.
  509:                   $spreadsheet->html_header().
  510:                   '</td>'.
  511:                   '<td valign="center">'.$html."</td></tr></table>\n");
  512:         if ($action_message ne '') {
  513:             $r->print(<<END);
  514: <table>
  515: <tr><td valign="top"><b>Last Action:</b></td>
  516:     <td>&nbsp;</td>
  517:     <td>$action_message</td>
  518: </tr>
  519: </table>
  520: END
  521:         }
  522:         $r->rflush();
  523:     } else {
  524:         $r->print('<table><tr><td>'.$spreadsheet->html_header().
  525:                   "</td></tr></table>\n");
  526:     }
  527:     $r->rflush();
  528:     #
  529:     $r->print("<table><tr>");
  530:     $r->print('<td><input type="submit" value="'.
  531:               &mt('Generate Spreadsheet').'" />'.
  532:               '</td>');
  533:     if ($allowed_to_view) {
  534:         $r->print('<td>'.
  535:                   &Apache::loncommon::help_open_topic("Spreadsheet_About",
  536:                                                       'Spreadsheet Help').
  537:                   '</td>');
  538:     }
  539:     if ($allowed_to_edit) {
  540:         $r->print('<td>'.
  541:                   &Apache::loncommon::help_open_topic("Spreadsheet_Editing",
  542:                                                       'Editing Help').
  543:                   '</td>');
  544:     }
  545:     $r->print('</tr></table>');
  546:     #
  547:     # Keep track of the filename
  548:     $r->print(&hiddenfield('filename',$filename));
  549:     #
  550:     # Keep track of the number of times we have been called, sort of.
  551:     $r->print(&hiddenfield('not_first_run','1'));
  552:     #
  553:     if (exists($env{'form.not_first_run'}) || $sheettype ne 'classcalc') {
  554:         $r->print($spreadsheet->get_html_title());
  555:         if ($allowed_to_view || $allowed_to_edit) {
  556:             $r->print($spreadsheet->parent_link());
  557:         }
  558:         $r->rflush();
  559:         $spreadsheet->display($r);
  560:     }
  561:     $r->print('</form>');
  562:     &Apache::lonquickgrades::endGradeScreen($r);
  563:     $r->print(&Apache::loncommon::end_page());
  564:     $spreadsheet->clear_package();
  565:     return OK;
  566: }
  567: 
  568: 1;
  569: 
  570: __END__
  571: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>