Log Message:
-----------
Minor cosmetic change
Modified Files:
--------------
pg/macros:
AppletObjects.pl
PGbasicmacros.pl
dangerousMacros.pl
Revision Data
-------------
Index: AppletObjects.pl
===================================================================
RCS file: /webwork/cvs/system/pg/macros/AppletObjects.pl,v
retrieving revision 1.16
retrieving revision 1.17
diff -Lmacros/AppletObjects.pl -Lmacros/AppletObjects.pl -u -r1.16 -r1.17
--- macros/AppletObjects.pl
+++ macros/AppletObjects.pl
@@ -39,8 +39,7 @@
# don't reload this file
#########################################################################
-sub _AppletObjects_init {
-
+sub _AppletObjects_init {
main::HEADER_TEXT(<<'END_HEADER_TEXT');
<script language="javascript">AC_FL_RunContent = 0;</script>
@@ -165,8 +164,8 @@
my $state_input_element = ($self->debug == 1) ? $debug_input_element :
qq!\n<input type="hidden" name = "$appletStateName" value ="$base_64_encoded_answer_value">!;
my $reset_button_str = ($reset_button) ?
- qq!<br/><input type='button' value='set applet state empty' onClick="setEmptyState('$appletName')">
- <input type="button" value="reinitialize applet" onClick="getQE('$appletStateName').value='$base64_initialState'"/>!
+ qq!<br/><input type='button' value='set applet state to restart' onClick="setAppletStateToRestart('$appletName')">
+ <input type="button" value="reinitialize applet" onClick="getQE('$appletStateName').value='$base64_initialState'"/><br/>!
: ''
;
# always base64 encode the hidden answer value to prevent problems with quotes.
@@ -179,11 +178,16 @@
. $reset_button_str
. $state_input_element
;
+ $answerBox_code = qq!<br/><input type="input" name="answerBox" value="" size =50><br/>
+ <input type="button" value="get Answer from applet" onClick="eval(ww_applet_list['$appletName'].submitActionScript )"/>
+ <br/>
+ !;
+ $answerBox_code = ($self->debug == 1) ? $answerBox_code : "";
#######
# insert header material
#######
main::HEADER_TEXT($self->insertHeader());
- return main::MODES(TeX=>' {\bf applet } ', HTML=>$self->insertObject.$main::BR.$state_storage_html_code);
+ return main::MODES(TeX=>' {\bf applet } ', HTML=>$self->insertObject.$main::BR.$state_storage_html_code.$answerBox_code);
}
=head3 Example problem
Index: PGbasicmacros.pl
===================================================================
RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v
retrieving revision 1.57
retrieving revision 1.58
diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.57 -r1.58
--- macros/PGbasicmacros.pl
+++ macros/PGbasicmacros.pl
@@ -1014,7 +1014,7 @@
$out = ''; # do nothing since hints are not available for download for students
}
} elsif ($printHintForInstructor) { # always print hints for instructor types
- $out = join(' ', "$BR(Show the student hint after $showHint attempts: )$BR ", @in);
+ $out = join(' ', "$BR( Show the student hint after $showHint attempts: )$BR $BBOLD HINT: $EBOLD ", @in);
} elsif ( $displayHint and ( $attempts > $showHint )) {
## the second test above prevents a hint being shown if a doctored form is submitted
Index: dangerousMacros.pl
===================================================================
RCS file: /webwork/cvs/system/pg/macros/dangerousMacros.pl,v
retrieving revision 1.53
retrieving revision 1.54
diff -Lmacros/dangerousMacros.pl -Lmacros/dangerousMacros.pl -u -r1.53 -r1.54
--- macros/dangerousMacros.pl
+++ macros/dangerousMacros.pl
@@ -387,10 +387,12 @@
$appletLocation = "$server_root_url$appletLocation";
}
my $url = "$appletLocation/$fileName";
- if (check_url($url)) {
- $appletCodebaseLocations{$fileName} = $appletLocation; #update cache
- return $appletLocation # return codebase part of url
- }
+ return $appletLocation; # --hack workaround -- just pick the first location and use that -- no checks
+#hack to workaround conflict between lwp-request and apache2
+# if (check_url($url)) {
+# $appletCodebaseLocations{$fileName} = $appletLocation; #update cache
+# return $appletLocation # return codebase part of url
+# }
}
return "Error: $fileName not found at ". join(", ", @{$appletPath} ); # no file found
}
|