Skip to content
Closed
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 bin/OPL-update
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ for my $tableinfo (@create_tables) {
my $tabinit = $tableinfo->[1];
my $query = "DROP TABLE IF EXISTS `$tabname`";
$dbh->do($query);
$query = "CREATE TABLE `$tabname` ( $tabinit ) ENGINE=$db_storage_engine";
$query = "CREATE TABLE `$tabname` ( $tabinit ) ENGINE=$db_storage_engine CHARACTER SET latin1";
$dbh->do($query);
if($lib eq 'OPL') {
$old_tabname = $tabname;
Expand Down
2 changes: 1 addition & 1 deletion conf/defaults.config
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ $ConfigValues = [

{ var => 'pg{options}{displayMode}',
doc => 'The default display mode',
doc2 => 'Enter one of the allowed display mode types above. See \'display modes entry\' for descriptions.',
doc2 => 'Enter one of the allowed display mode types above. See \'display modes entry\' for descriptions.',
min => 1,
values => [qw(MathJax images plainText)],
type => 'popuplist'
Expand Down
42 changes: 17 additions & 25 deletions conf/snippets/ASimpleCombinedHeaderFile.pg
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# ASimpleCombinedHeaderFile.pg
# This header file can be used for both the screen and hardcopy output
# Ce fichier en-tête peut être utilisé pour l'interface web ou pour la copie papier du devoir


DOCUMENT();

loadMacros(
"PG.pl",
"PGbasicmacros.pl",
"PGcourse.pl",

);

TEXT($BEGIN_ONE_COLUMN);

####################################################
#
# The item below printed out only when a hardcopy is made.
# La section ci-dessous apparaîtra seulement lorsqu'une copie papier
# du devoir sera créée.
#
####################################################

Expand All @@ -25,61 +26,52 @@ TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>""));
\noindent {\large \bf $studentName}
\hfill
{\large \bf {\{protect_underbar($courseName)\}}}
% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX
% Décommenter la ligne ci-dessous s'il existe plusieurs groupes dans ce cours. Notez que ceci est un commentaire en LaTeX car cette section est compilée seulement par LaTeX
% {\large \bf { Section: \{protect_underbar($sectionName)\} } }
\par
\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formatedDueDate}}
\par\noindent \bigskip
% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode.
%See the course web page for information http://yoururl/yourcourse

\noindent{\large \bf {Date de remise de \{protect_underbar($setNumber)\} : \{protect_underbar($DueDateDay)\} \{protect_underbar($DueDateMonthWord)\} \{protect_underbar($DueDateYear4Digit)\} à \{protect_underbar(${DueDateHour24})\}h\{protect_underbar($DueDateMinute)\}}}
EOT

####################################################
#
# End of hardcopy only output.
# Fin de la section copie papier
#
####################################################


####################################################
#
# The items below are printed out only when set is displayed on screen
# La section ci-dessous apparaît sur la page principale du devoir,
# dans l'interface web de WeBWorK
#
####################################################
TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT')));

$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : $formattedDueDate. $EBOLD
$BBOLD Ce devoir WeBWorK \{ protect_underbar($setNumber) \} doit être remis le $DueDateDay $DueDateMonthWord $DueDateYear4Digit à ${DueDateHour24}:$DueDateMinute. $EBOLD
$PAR
Here's the list of
\{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \}
which WeBWorK understands.
Un résumé des commandes et notations que WeBWorK reconnaît est $BBOLD <a href="http://mathema-tic.ca/medias/formations_et_tutoriels/pour_les_etudiants/tutoriel_webwork/Didacticiel_WebWorK.pdf" target="_blank">disponible ici</a>$EBOLD.
$BR

EOT

####################################################
# Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode.
# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it.
#TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT')));
#See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \}
#EOT
####################################################

####################################################
#
# End of screen only output.
# Fin de la section interface web
#
####################################################

####################################################
#
# Anything between the BEGIN_TEXT AND END_TEXT lines
# will be printed in both screen and hardcopy output
# Toutes les lignes entre les balises BEGIN_TEXT et END_TEXT
# apparaîtront autant sur la copie papier que sur l'interface web.
#
####################################################

BEGIN_TEXT



END_TEXT


Expand Down
12 changes: 6 additions & 6 deletions htdocs/js/apps/SetMaker/setmaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ function togglepaths() {
$('#toggle_path_current').val('hide');
$("[id*=filepath]").each(function() {
// If showing, trigger
if(this.textContent.match('^Show')) {
this.click();
if(this.textContent.match(show_string)) {
this.click();
}
});
} else {
new_text = $('#showtext')[0].value;
$('#toggle_path_current').val('show');
$("[id*=filepath]").each(function() {
// If hidden, trigger
if(! this.textContent.match('^Show')) {
if(! this.textContent.match(show_string)) {
this.click();
}
});
Expand Down Expand Up @@ -197,11 +197,11 @@ function capFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}

function addme(path, who) {
function addme(path, who, selectsetstring) {
nomsg();
var target = $('[name="local_sets"] option:selected').val();
if(target == 'Select a Set from this Course') {
alert('You need to pick a target set above so we know what set to which we should add this problem.');
if(target == selectsetstring) {
alert(maketext("You need to pick a target set above so we know what set to which we should add this problem."));
return true;
}
var mydefaultRequestObject = init_webservice('addProblem');
Expand Down
2 changes: 1 addition & 1 deletion lib/Apache/WeBWorK.pm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sub handler($) {

# We set the bimode for print to utf8 because some language options
# use utf8 characters
binmode(STDOUT, ":utf8");
# binmode(STDOUT, ":utf8");

# the warning handler accumulates warnings in $r->notes("warnings") for
# later cumulative reporting
Expand Down
5 changes: 3 additions & 2 deletions lib/WeBWorK/ContentGenerator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -654,11 +654,12 @@ sub links {
# experimental subroutine for generating links, to clean up the rest of the
# code. ignore for now. (this is a closure over $self.)
my $makelink = sub {
use utf8;
my ($module, %options) = @_;

my $urlpath_args = $options{urlpath_args} || {};
my $systemlink_args = $options{systemlink_args} || {};
my $text = HTML::Entities::encode_entities($options{text});
my $text = HTML::Entities::encode_entities($options{text},"<>&");
my $active = $options{active};
my %target = ($options{target} ? (target => $options{target}) : ());

Expand Down Expand Up @@ -768,7 +769,7 @@ sub links {
}


print CGI::li(&$makelink("${pfx}Options", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args));
print CGI::li(&$makelink("${pfx}Options", text=>$r->maketext("User Settings"), urlpath_args=>{%args}, systemlink_args=>\%systemlink_args));

print CGI::li(&$makelink("${pfx}Grades", urlpath_args=>{%args}, systemlink_args=>\%systemlink_args));

Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/ContentGenerator/Grades.pm
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ sub displayStudentStats {
next;
} else {
push( @rows, CGI::Tr({}, CGI::td(WeBWorK::ContentGenerator::underscore2sp($setID)),
CGI::td({colspan=>($max_problems+2)}, CGI::em("No versions of this assignment have been taken."))) );
CGI::td({colspan=>($max_problems+2)}, CGI::em($r->maketext("No versions of this assignment have been taken.")))) );
next;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/ContentGenerator/Hardcopy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ sub display_form {
# we change the text a little bit depending on whether the user has multiuser privileges
my $ss = $perm_multiuser ? "s" : "";
my $aa = $perm_multiuser ? " " : " a ";
my $phrase_for_privileged_users = $perm_multiuser ? "to privileged users or" : "";
my $phrase_for_privileged_users = $perm_multiuser ? $r->maketext("to privileged users or") : "";
my $button_label = $perm_multiuser ? $r->maketext("Generate hardcopy for selected sets and selected users") : $r->maketext("Generate Hardcopy");

# print CGI::start_p();
Expand Down
28 changes: 15 additions & 13 deletions lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use File::Path;
use File::Copy;
use File::Spec;
use String::ShellQuote;
use utf8;

=head1 NAME

Expand Down Expand Up @@ -160,7 +161,7 @@ sub body {
elsif($action eq "Rename" || $action eq $r->maketext("Rename")) {$self->Rename;}
elsif($action eq "Delete" || $action eq $r->maketext("Delete")) {$self->Delete;}
elsif($action eq "Make Archive" || $action eq $r->maketext("Make Archive")) {$self->MakeArchive;}
elsif($action eq "Unpack" || $action eq $r->maketext("Unpack")) {$self->UnpackArchive;}
elsif($action eq "Unpack Archive" || $action eq $r->maketext("Unpack Archive")) {$self->UnpackArchive;}
elsif($action eq "New Folder" || $action eq $r->maketext("New Folder")) {$self->NewFolder;}
elsif($action eq "New File" || $action eq $r->maketext("New File")) {$self->NewFile;}
elsif($action eq "Upload" || $action eq $r->maketext("Upload")) {$self->Upload;}
Expand Down Expand Up @@ -287,11 +288,12 @@ sub Refresh {
}
function checkArchive(files,disabled) {
var button = document.getElementById('MakeArchive');
//button.value = 'Make Archive';
button.value = 'Make Archive';
if (disabled) return;
if (!files.childNodes[files.selectedIndex].value.match(/\\.(tar|tar\\.gz|tgz)\$/)) return;
if (!files[files.selectedIndex].value.match(/\\.(tar|tar\\.gz|tgz)\$/))
return;
for (var i = files.selectedIndex+1; i < files.length; i++)
{if (files.childNodes[i].selected) return}
{if (files[i].selected) return;}
button.value = 'Unpack Archive';
}
EOF
Expand Down Expand Up @@ -454,7 +456,7 @@ sub View {
my $fileManagerPage = $urlpath->newFromModule($urlpath->module, $r, courseID => $self->{courseName});
my $fileManagerURL = $self->systemLink($fileManagerPage, params => {download => $filename, pwd => $pwd});
print CGI::div({style=>"float:right"},
CGI::a({href=>$fileManagerURL},"Download"));
CGI::a({href=>$fileManagerURL},$r->maketext("Download")));
print CGI::p(),CGI::b($name),CGI::p();
print CGI::hr();

Expand All @@ -469,7 +471,7 @@ sub View {
print CGI::img({src=>$fileManagerURL, border=>0});
} else {
print CGI::div({class=>"ResultsWithError"},
"The file does not appear to be a text file.");
$r->maketext("The file does not appear to be a text file."));
}
}

Expand Down Expand Up @@ -510,7 +512,7 @@ sub Edit {
}
my $data = readFile($file);
if (!isText($data)) {
$self->addbadmessage($r->maketext("The file does not appear to be a text file"));
$self->addbadmessage($r->maketext("The file does not appear to be a text file."));
$self->Refresh; return;
}

Expand Down Expand Up @@ -734,14 +736,14 @@ sub Delete {
CGI::p({style=>"color:red"},$r->maketext("There is no undo for deleting files or directories!")),
CGI::p($r->maketext("Really delete the items listed above?")),
CGI::div({style=>"float:left; padding-left:3ex"},
CGI::input({type=>"submit",name=>"action",value=>"Cancel"})),
CGI::input({type=>"submit",name=>"action",value=>$r->maketext("Cancel")})),
CGI::div({style=>"float:right; padding-right:3ex"},
CGI::input({type=>"submit",name=>"action",value=>"Delete"})),
CGI::input({type=>"submit",name=>"action",value=>$r->maketext("Delete")})),
),
);
print CGI::end_table();

print CGI::hidden({name=>"confirmed",value=>"Delete"});
print CGI::hidden({name=>"confirmed",value=>$r->maketext("Delete")});
foreach my $file (@files) {print CGI::hidden({name=>"files",value=>$file})}
$self->HiddenFlags;
}
Expand All @@ -767,7 +769,7 @@ sub MakeArchive {
@files = readpipe $tar." 2>&1";
if ($? == 0) {
my $n = scalar(@files);
$self->addgoodmessage($r->maketext("Archive '[_1]' created successfully ([quant, _2, file])",$archive, $n));
$self->addgoodmessage($r->maketext("Archive '[_1]' created successfully ([quant,_2,file])",$archive, $n));
} else {
$self->addbadmessage($r->maketext("Can't create archive '[_1]': command returned [_2]",$archive,systemError($?)));
}
Expand Down Expand Up @@ -903,7 +905,7 @@ sub Upload {

$self->Confirm($r->maketext("File <b>[_1]</b> already exists. Overwrite it, or rename it as:",$name).CGI::p(),uniqueName($dir,$name),$r->maketext("Rename"),$r->maketext("Overwrite"));
#$self->Confirm("File ".CGI::b($name)." already exists. Overwrite it, or rename it as:".CGI::p(),uniqueName($dir,$name),"Rename","Overwrite");
print CGI::hidden({name=>"action",value=>"Upload"});
print CGI::hidden({name=>"action",value=>$r->maketext("Upload")});
print CGI::hidden({name=>"file",value=>$fileIDhash});
return;
}
Expand Down Expand Up @@ -932,7 +934,7 @@ sub Upload {
}

if (-e $file) {
$self->addgoodmessage($r->maketext("File '[_2]' uploaded successfully",$name));
$self->addgoodmessage($r->maketext("File '[_1]' uploaded successfully",$name));
if ($name =~ m/\.(tar|tar\.gz|tgz)$/ && $self->getFlag('unpack')) {
if ($self->unpack($name) && $self->getFlag('autodelete')) {
if (unlink($file)) {$self->addgoodmessage($r->maketext("Archive '[_1]' deleted", $name))}
Expand Down
30 changes: 15 additions & 15 deletions lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,10 @@ sub title {
my $problemNumber = $r->urlpath->arg("problemID");
my $file_type = $self->{'file_type'} || '';

return "Set Header for set $setID" if ($file_type eq 'set_header');
return "Hardcopy Header for set $setID" if ($file_type eq 'hardcopy_header');
return "Course Information for course $courseName" if ($file_type eq 'course_info');
return "Options Information" if ($file_type eq 'options_info');
return $r->maketext("Set Header for set [_1]", $setID) if ($file_type eq 'set_header');
return $r->maketext("Hardcopy Header for set [_1]", $setID) if ($file_type eq 'hardcopy_header');
return $r->maketext("Course Information for course [_1]", $courseName) if ($file_type eq 'course_info');
return $r->maketext("Options Information") if ($file_type eq 'options_info');

if ($setID) {
my $set = $r->db->getGlobalSet($setID);
Expand Down Expand Up @@ -600,14 +600,14 @@ sub body {

my $file_type = $self->{file_type};
my %titles = (
problem => CGI::b("set $fullSetName/problem $prettyProblemNumber"),
blank_problem => "blank problem",
set_header => "header file",
hardcopy_header => "hardcopy header file",
course_info => "course information",
options_info => "options information",
'' => 'Unknown file type',
source_path_for_problem_file => " unassigned problem file: ".CGI::b("set $setName/problem $prettyProblemNumber"),
problem => CGI::b($r->maketext("set [_1]/problem [_2]", $fullSetName, $prettyProblemNumber)),
blank_problem => $r->maketext("blank problem"),
set_header => $r->maketext("header file"),
hardcopy_header => $r->maketext("hardcopy header file"),
course_info => $r->maketext("course information"),
options_info => $r->maketext("options information"),
'' => $r->maketext("Unknown file type"),
source_path_for_problem_file => $r->maketext(" unassigned problem file: ").CGI::b($r->maketext("set [_1]/problem [_2]",$setName, $prettyProblemNumber)),
);
my $header = CGI::i($r->maketext("Editing [_1] in file '[_2]'",$titles{$file_type}, $self->shortPath($inputFilePath)));
$header = ($self->isTempEditFilePath($inputFilePath) ) ? CGI::div({class=>'temporaryFile'},$header) : $header; # use colors if temporary file
Expand Down Expand Up @@ -1380,9 +1380,9 @@ sub add_problem_form {
$allSetNames[$j] =~ s|\.def||;
}
my $labels = {
problem => 'problem',
set_header => 'set header',
hardcopy_header => 'hardcopy header',
problem => $r->maketext('problem'),
set_header => $r->maketext('set header'),
hardcopy_header => $r->maketext('hardcopy header'),
};
return "" if $self->{file_type} eq 'course_info' || $self->{file_type} eq 'options_info';
return join(" ",
Expand Down
8 changes: 4 additions & 4 deletions lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ use constant FIELD_PROPERTIES => {
type => "choose",
override => "all",
choices => [qw( default gateway proctored_gateway jitar)],
labels => { default => "homework",
gateway => "gateway/quiz",
proctored_gateway => "proctored gateway/quiz",
jitar => "just-in-time"
labels => { default => x("homework"),
gateway => x("gateway/quiz"),
proctored_gateway => x("proctored gateway/quiz"),
jitar => x("just-in-time")
},
},
version_time_limit => {
Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ sub create_handler {
# Assign set to current active user
my $userName = $r->param('user'); # FIXME possible security risk
$self->assignSetToUser($userName, $newSetRecord); # cures weird date error when no-one assigned to set
$self->addgoodmessage("Set $newSetID was assigned to $userName."); # not currently used
$self->addgoodmessage($r->maketext("Set [_1] was assigned to [_2].", $newSetID,$userName)); # not currently used

push @{ $self->{visibleSetIDs} }, $newSetID;
push @{ $self->{allSetIds} }, $newSetID;
Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ sub print_form {
print CGI::table( { -border=>2,-cellpadding=>4},
CGI::Tr( {},
CGI::td({}, CGI::submit(-name=>'sendEmail', -id=>"sendEmail_id", -value=>$r->maketext('Send Email')) ), "\n",
CGI::td({}, CGI::submit(-name=>'saveMessage', -value=>$r->maketext('Save')),' ',$r->maketext('to'),' ',$output_file), " \n",
CGI::td({}, CGI::submit(-name=>'saveMessage', -value=>$r->maketext('Save')),' ',$r->maketext('to '),$output_file), " \n",
CGI::td({}, CGI::submit(-name=>'saveAs', -value=>$r->maketext('Save as').":"),
CGI::textfield(-name=>'savefilename', -size => 20, -value=> "$output_file", -override=>1)
), "\n",
Expand Down
Loading