Annotation of loncom/homework/functionplotresponse.pm, revision 1.1

1.1     ! www         1: # LearningOnline Network with CAPA
        !             2: # option list style responses
        !             3: #
        !             4: # $Id: optionresponse.pm,v 1.172 2010/09/05 20:46:58 www Exp $
        !             5: #
        !             6: # Copyright Michigan State University Board of Trustees
        !             7: #
        !             8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
        !             9: #
        !            10: # LON-CAPA is free software; you can redistribute it and/or modify
        !            11: # it under the terms of the GNU General Public License as published by
        !            12: # the Free Software Foundation; either version 2 of the License, or
        !            13: # (at your option) any later version.
        !            14: #
        !            15: # LON-CAPA is distributed in the hope that it will be useful,
        !            16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
        !            17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        !            18: # GNU General Public License for more details.
        !            19: #
        !            20: # You should have received a copy of the GNU General Public License
        !            21: # along with LON-CAPA; if not, write to the Free Software
        !            22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
        !            23: #
        !            24: # /home/httpd/html/adm/gpl.txt
        !            25: #
        !            26: # http://www.lon-capa.org/
        !            27: #
        !            28: 
        !            29: package Apache::functionplotresponse;
        !            30: use strict;
        !            31: use Apache::response();
        !            32: use Apache::lonlocal;
        !            33: use Apache::lonnet;
        !            34: 
        !            35: BEGIN {
        !            36:   &Apache::lonxml::register('Apache::functionplotresponse',('functionplotresponse'));
        !            37: }
        !            38: 
        !            39: sub geogebra_startcode {
        !            40:     return (<<ENDSTARTCODE);
        !            41: <applet name="ggbApplet" code="geogebra.GeoGebraApplet" archive="geogebra.jar"
        !            42:          codebase="/adm/geogebra/"  width="714" height="447" MAYSCRIPT>
        !            43:        <param name="java_arguments" value="-Xmx512m -Djnlp.packEnabled=true"/>
        !            44: ENDSTARTCODE
        !            45: }
        !            46: 
        !            47: sub geogebra_endcode {
        !            48:     return "\n</applet>\n";
        !            49: }
        !            50: 
        !            51: sub start_functionplotresponse {
        !            52:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
        !            53:   my $result='';
        !            54:   #when in a option response use these
        !            55: #  &Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil','conceptgroup','drawoptionlist'));
        !            56:   push (@Apache::lonxml::namespace,'optionresponse');
        !            57:   my $id = &Apache::response::start_response($parstack,$safeeval);
        !            58:   if ($target eq 'web') {
        !            59:      $result.=&geogebra_startcode();
        !            60:   }
        !            61:   return $result;
        !            62: }
        !            63: 
        !            64: sub end_functionplotresponse {
        !            65:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
        !            66:   &Apache::response::end_response;
        !            67:   pop @Apache::lonxml::namespace;
        !            68: #  &Apache::lonxml::deregister('Apache::optionresponse',('foilgroup','foil','conceptgroup','drawoptionlist'));
        !            69:   my $result;
        !            70: #  if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
        !            71:   if ($target eq 'web') {
        !            72:      $result.=&geogebra_endcode();
        !            73:   }
        !            74:   return $result;
        !            75: }
        !            76: 
        !            77: 1;
        !            78: 
        !            79: __END__
        !            80:  
        !            81: =head1 NAME
        !            82: 
        !            83: Apache::functionplotresponse.pm;
        !            84: 
        !            85: =head1 SYNOPSIS
        !            86: 
        !            87: Handles tags associated with accepting function plots.
        !            88: 
        !            89: This is part of the LearningOnline Network with CAPA project
        !            90: described at http://www.lon-capa.org.
        !            91: 
        !            92: =head1 HANDLER SUBROUTINE
        !            93: 
        !            94: start_functionplotresponse()
        !            95: 
        !            96: =head1 OTHER SUBROUTINES
        !            97: 
        !            98: =over
        !            99: 
        !           100: =item end_functionplotresponse()
        !           101: 
        !           102: =back
        !           103: 
        !           104: =cut

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