--- loncom/homework/inputtags.pm 2001/08/18 07:56:51 1.44 +++ loncom/homework/inputtags.pm 2001/12/04 15:17:56 1.47 @@ -1,5 +1,30 @@ # The LearningOnline Network with CAPA # input definitons +# +# $Id: inputtags.pm,v 1.47 2001/12/04 15:17:56 albertel Exp $ +# +# Copyright Michigan State University Board of Trustees +# +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). +# +# LON-CAPA is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LON-CAPA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LON-CAPA; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# /home/httpd/html/adm/gpl.txt +# +# http://www.lon-capa.org/ +# # 2/19 Guy package Apache::inputtags; @@ -23,11 +48,13 @@ sub initialize_inputtags { @Apache::inputtags::previous=(); # id of current part, 0 means that no part is current (inside only $Apache::inputtags::part=''; - # list of problem date statuses, the first element is for - #if there is a second element it is for the current + # list of problem date statuses, the first element is for + # if there is a second element it is for the current @Apache::inputtags::status=(); - #hash of defined params for the current response + # hash of defined params for the current response %Apache::inputtags::params=(); + # list of all ids, for , these get join()ed and prepended + @Apache::inputtags::import=(); } sub start_input { @@ -54,8 +81,12 @@ sub start_textarea { if ( $cols eq '') { $cols = 80; } my $rows = &Apache::lonxml::get_param('rows',$parstack,$safeeval); if ( $rows eq '') { $rows = 10; } - $result= '"; - } + if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { + return ""; + } + } &end_input; return ''; } @@ -83,8 +116,12 @@ sub start_textline { my $id=$Apache::inputtags::response['-1']; my $oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"}; - $result= ''; + if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { + $result= ''; + } else { + $result=''.$oldresponse.''; + } } elsif ($target eq 'edit') { $result=&Apache::edit::tag_start($target,$token, &Apache::lonxml::description($token));