Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hover Messages #40

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Online Homework Delivery System
Version 2.5.*

Copyright 2000-2012, The WeBWorK Project
Copyright 2000-2013, The WeBWorK Project
All rights reserved.

This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

http://webwork.maa.org/wiki/Category:Release_Notes

Copyright 2000-2012, The WeBWorK Project
Copyright 2000-2013, The WeBWorK Project
http://webwork.maa.org
All rights reserved.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$PG_VERSION ='2.5.1';
$PG_COPYRIGHT_YEARS = '1996-2012';
$PG_COPYRIGHT_YEARS = '1996-2013';
1;
34 changes: 27 additions & 7 deletions macros/PGessaymacros.pl
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,20 @@ sub essay_cmp {

sub NAMED_ESSAY_BOX {
my($name,$row,$col) = @_;
$row = 10 unless defined($row);
$col = 80 unless defined($col);
$row = 8 unless defined($row);
$col = 75 unless defined($col);

my $height = .07*$row;
my $answer_value = '';
$answer_value = $inputs_ref->{$name} if defined( $inputs_ref->{$name} );
$name = RECORD_ANS_NAME($name, $answer_value);
$answer_value =~ tr/$@`//d; #`## make sure student answers can not be interpolated by e.g. EV3
$answer_value =~ tr/$@//d; #`## make sure student answers can not be interpolated by e.g. EV3

#### Answer Value needs to be sanitized, it could contain badness!
#### Answer Value needs to have special characters replaced by the html codes
$answer_value =~ s/\\/\&\#92;/g;
$answer_value =~ s/</\&lt;/g;
$answer_value =~ s/>/\&gt;/g;
$answer_value =~ s/`/&#96;/g;

# Get rid of tabs since they mess up the past answer db
$answer_value =~ s/\t/\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;/;
Expand All @@ -121,19 +122,38 @@ sub essay_cmp {
Latex2HTML => qq!\\begin{rawhtml}<TEXTAREA NAME="$name" id="$name" ROWS="$row" COLS="$col" >$answer_value</TEXTAREA>\\end{rawhtml}!,
HTML => qq!
<TEXTAREA NAME="$name" id="$name" ROWS="$row" COLS="$col"
WRAP="VIRTUAL">$answer_value</TEXTAREA>
WRAP="VIRTUAL" title="Enclose LaTeX expressions with &#92;( and &#92;).">$answer_value</TEXTAREA>
<INPUT TYPE=HIDDEN NAME="previous_$name" VALUE = "$answer_value">
!
);

$out;
}

sub essay_help {

my $out = MODES(
TeX => '',
Latex2HTML => '',
HTML => qq!
<P> This is an essay answer text box. You can type your answer in here and, after you hit submit,
it will be saved so that your instructor can grade it at a later date. If your instructor makes
any comments on your answer those comments will appear on this page after the question has been
graded. You can use LaTeX to make your math equations look pretty.
LaTeX expressions should be enclosed using the parenthesis notation and not dollar signs.
</P>
!
);

$out;
}


sub essay_box {
my $row = shift;
my $col =shift;
$row = 12 unless $row;
$col = 120 unless $col;
$row = 8 unless $row;
$col = 75 unless $col;
my $name = NEW_ANS_NAME();
NAMED_ESSAY_BOX($name ,$row,$col);

Expand Down