[system] / trunk / pg / macros / AppletObjects.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/AppletObjects.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 5997 Revision 6010
1################################################################################ 1################################################################################
2# WeBWorK Online Homework Delivery System 2# WeBWorK Online Homework Delivery System
3# Copyright 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/ 3# Copyright 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4# $CVSHeader: pg/macros/AppletObjects.pl,v 1.14 2009/02/07 22:53:18 gage Exp $ 4# $CVSHeader: pg/macros/AppletObjects.pl,v 1.16 2009/02/07 23:08:34 gage Exp $
5# 5#
6# This program is free software; you can redistribute it and/or modify it under 6# This program is free software; you can redistribute it and/or modify it under
7# the terms of either: (a) the GNU General Public License as published by the 7# the terms of either: (a) the GNU General Public License as published by the
8# Free Software Foundation; either version 2, or (at your option) any later 8# Free Software Foundation; either version 2, or (at your option) any later
9# version, or (b) the "Artistic License" which comes with this package. 9# version, or (b) the "Artistic License" which comes with this package.
37# Add basic functionality to the header of the question 37# Add basic functionality to the header of the question
38# 38#
39# don't reload this file 39# don't reload this file
40######################################################################### 40#########################################################################
41 41
42sub _AppletObjects_init { 42sub _AppletObjects_init {
43
44 43
45main::HEADER_TEXT(<<'END_HEADER_TEXT'); 44main::HEADER_TEXT(<<'END_HEADER_TEXT');
46 <script language="javascript">AC_FL_RunContent = 0;</script> 45 <script language="javascript">AC_FL_RunContent = 0;</script>
47 <script src="/webwork2_files/applets/AC_RunActiveContent.js" language="javascript"> 46 <script src="/webwork2_files/applets/AC_RunActiveContent.js" language="javascript">
48 </script> 47 </script>
163 > 162 >
164 !; 163 !;
165 my $state_input_element = ($self->debug == 1) ? $debug_input_element : 164 my $state_input_element = ($self->debug == 1) ? $debug_input_element :
166 qq!\n<input type="hidden" name = "$appletStateName" value ="$base_64_encoded_answer_value">!; 165 qq!\n<input type="hidden" name = "$appletStateName" value ="$base_64_encoded_answer_value">!;
167 my $reset_button_str = ($reset_button) ? 166 my $reset_button_str = ($reset_button) ?
168 qq!<br/><input type='button' value='set applet state empty' onClick="setEmptyState('$appletName')"> 167 qq!<br/><input type='button' value='set applet state to restart' onClick="setAppletStateToRestart('$appletName')">
169 <input type="button" value="reinitialize applet" onClick="getQE('$appletStateName').value='$base64_initialState'"/>! 168 <input type="button" value="reinitialize applet" onClick="getQE('$appletStateName').value='$base64_initialState'"/><br/>!
170 : '' 169 : ''
171 ; 170 ;
172 # always base64 encode the hidden answer value to prevent problems with quotes. 171 # always base64 encode the hidden answer value to prevent problems with quotes.
173 # 172 #
174 $state_storage_html_code = 173 $state_storage_html_code =
177 qq!<input type="hidden" name="previous_$appletStateName" value = "$base_64_encoded_answer_value">!; 176 qq!<input type="hidden" name="previous_$appletStateName" value = "$base_64_encoded_answer_value">!;
178 $state_storage_html_code = qq!<input type="hidden" name="previous_$appletStateName" value = "$base_64_encoded_answer_value">! 177 $state_storage_html_code = qq!<input type="hidden" name="previous_$appletStateName" value = "$base_64_encoded_answer_value">!
179 . $reset_button_str 178 . $reset_button_str
180 . $state_input_element 179 . $state_input_element
181 ; 180 ;
181 $answerBox_code = qq!<br/><input type="input" name="answerBox" value="" size =50><br/>
182 <input type="button" value="get Answer from applet" onClick="eval(ww_applet_list['$appletName'].submitActionScript )"/>
183 <br/>
184 !;
185 $answerBox_code = ($self->debug == 1) ? $answerBox_code : "";
182 ####### 186 #######
183 # insert header material 187 # insert header material
184 ####### 188 #######
185 main::HEADER_TEXT($self->insertHeader()); 189 main::HEADER_TEXT($self->insertHeader());
186 return main::MODES(TeX=>' {\bf applet } ', HTML=>$self->insertObject.$main::BR.$state_storage_html_code); 190 return main::MODES(TeX=>' {\bf applet } ', HTML=>$self->insertObject.$main::BR.$state_storage_html_code.$answerBox_code);
187} 191}
188 192
189=head3 Example problem 193=head3 Example problem
190 194
191 195

Legend:
Removed from v.5997  
changed lines
  Added in v.6010

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9