Skip to content

Commit 21d6bf3

Browse files
author
gage
committed
Forward ports from rel-2-4-patches
git-svn-id: http://svn.webwork.maa.org/system/trunk/webwork2@5932 c0722133-6baf-4dd8-8699-98d999cd4f06
1 parent 393c81d commit 21d6bf3

File tree

14 files changed

+84
-39
lines changed

14 files changed

+84
-39
lines changed

conf/global.conf.dist

+16-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
################################################################################
33
# WeBWorK Online Homework Delivery System
44
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
5-
# $CVSHeader: webwork2/conf/global.conf.dist,v 1.208 2008/06/27 15:25:15 apizer Exp $
5+
# $CVSHeader: webwork2/conf/global.conf.dist,v 1.211 2008/07/24 14:47:36 gage Exp $
66
#
77
# This program is free software; you can redistribute it and/or modify it under
88
# the terms of either: (a) the GNU General Public License as published by the
@@ -448,6 +448,11 @@ $default_status = "Enrolled";
448448

449449
# these variables are used by database.conf. we define them here so that editing
450450
# database.conf isn't necessary.
451+
452+
# required permissions
453+
# GRANT SELECT ON webwork.* TO webworkRead@localhost IDENTIFIED BY 'passwordRO';
454+
# GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, LOCK TABLES ON webwork.* TO webworkWrite@localhost IDENTIFIED BY 'passwordRW';
455+
451456
$database_dsn = "dbi:mysql:webwork";
452457
$database_username = "webworkWrite";
453458
$database_password = "";
@@ -477,9 +482,8 @@ $dbLayoutName = "sql_single";
477482
################################################################################
478483

479484
# For configuration instructions, see:
480-
# http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/DatabaseProblemLibrary
481-
482-
# The directory containing the problem library files. Set to "" if no problem
485+
# http://webwork.maa.org/wiki/National_Problem_Library
486+
# The directory containing the natinal problem library files. Set to "" if no problem
483487
# library is installed.
484488
$problemLibrary{root} = "";
485489

@@ -836,6 +840,10 @@ $pg{directories}{macrosPath} = [
836840
".", # search the problem file's directory
837841
$courseDirs{macros},
838842
$pg{directories}{macros},
843+
"$courseDirs{templates}/Library/macros/Dartmouth",
844+
"$courseDirs{templates}/Library/macros/Union",
845+
"$courseDirs{templates}/Library/macros/NAU",
846+
"$courseDirs{templates}/Library/macros/Michigan",
839847
];
840848

841849
# The applet search path. If a full URL is given, it is used unmodified. If an
@@ -845,6 +853,7 @@ $pg{directories}{macrosPath} = [
845853
# and the local server is "https://math.yourschool.edu",
846854
# then the URL "https://math.yourschool.edu/math/applets" will be used.
847855
#
856+
848857
$pg{directories}{appletPath} = [ # paths to search for applets (requires full url)
849858
"$webworkURLs{htdocs}/applets",
850859
"$courseURLs{html}/applets",
@@ -921,8 +930,9 @@ ${pg}{modules} = [
921930
[qw(Parser Value)],
922931
[qw(Parser::Legacy)],
923932
# [qw(SaveFile)],
924-
# [qw(Chromatic)],
925-
[qw(Applet FlashApplet)],
933+
# [qw(Chromatic)], # for Northern Arizona graph problems
934+
# # -- follow instructions at libraries/nau_problib/lib/README to install
935+
[qw(Applet FlashApplet JavaApplet)],
926936
];
927937

928938
##### Answer evaluatior defaults

conf/templates/math/system.template

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
################################################################################
77
# WeBWorK Online Homework Delivery System
88
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
9-
# $CVSHeader: webwork2/conf/templates/math/system.template,v 1.9 2008/06/24 22:54:04 gage Exp $
9+
# $CVSHeader: webwork2/conf/templates/math/system.template,v 1.10 2008/06/26 14:56:50 gage Exp $
1010
#
1111
# This program is free software; you can redistribute it and/or modify it under
1212
# the terms of either: (a) the GNU General Public License as published by the
@@ -19,7 +19,9 @@
1919
# Artistic License for more details.
2020
################################################################################
2121
-->
22-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
22+
23+
24+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
2325
<head>
2426
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
2527
<link rel="stylesheet" type="text/css" href="<!--#url type="webwork" name="htdocs"-->/css/math.css"/>

conf/webwork.apache2-config.dist

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
################################################################################
22
# WeBWorK Online Homework Delivery System
33
# Copyright � 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4-
# $CVSHeader: webwork2/conf/webwork.apache2-config.dist,v 1.11 2007/08/10 01:02:17 sh002i Exp $
4+
# $CVSHeader: webwork2/conf/webwork.apache2-config.dist,v 1.12 2007/08/13 22:59:51 sh002i Exp $
55
#
66
# This program is free software; you can redistribute it and/or modify it under
77
# the terms of either: (a) the GNU General Public License as published by the
@@ -27,6 +27,18 @@
2727
# FollowSymlinksOption from working when specified
2828
# in a <Perl> section. See below for workaround.
2929

30+
31+
# Uncomment the ScriptAliasMatch to allow access to show-source.cgi
32+
# This allows the "show source" button to work for demonstration "courses"
33+
# See for example Davide Cervone's Knoxville lectures on math objects
34+
# It requires that a show-source.cgi script be customized and placed in
35+
# the myCourse/html directory of the course
36+
# The "show source" button is most useful for webwork "courses" used to train new authors
37+
# It is not desirable to expose the code of regular homework questions to students
38+
39+
# ScriptAliasMatch /webwork2_course_files/([^/]*)/show-source.cgi/(.*) /opt/webwork/courses/$1/html/show-source.cgi/$2
40+
41+
3042
PerlModule mod_perl2
3143

3244
<Perl>
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
this information is written in the file:
12

3+
[coursesDirectory]/courseName/templates/course_info.txt

doc/parser/docs/UsingParser.pod

+15-7
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ variable by another formula, if you wish. To make
5050
this easier, substitute will apply Formula() to
5151
any string values automatically. E.g.,
5252
Formula("x-1")->substitute(x=>"y")
53+
5354
returns "y-1" as a formula.
5455

5556
=item $f->string
@@ -353,7 +354,7 @@ Similarly, you can add a named constant via
353354
and can change, remove or list the constants via methods like those
354355
used for variables above. The command
355356

356-
$M = $constant->constants->get('M');
357+
$M = $context->constants->get('M');
357358

358359
will return the value of the consant M. (See the
359360
pg/lib/Value/Context/Data.pm file for more information on the methods
@@ -362,16 +363,23 @@ you can call for the various types of context data.)
362363
To add new predefined words (like 'NONE' and 'DNE'), use something
363364
like
364365

365-
$constant->strings->add(TRUE=>{},FALSE=>{});
366+
$context->strings->add(TRUE=>{},FALSE=>{});
367+
368+
Strings are case-insensitive, unless you say otherwise. To mark a
369+
string as being case-senstive, use
370+
371+
$context->strings->add(TRUE => {caseSensitive=>1});
366372

367-
Note that strings are case-sensitive, so you might want to add
373+
You may want to privide several forms for the same word; to do so,
374+
make the additional words into aliases:
368375

369-
$constant->strings->add(
370-
true => {alias=>'TRUE'},
371-
false => {alias=>'FALSE'},
376+
$context->strings->add(
377+
T => {alias=>'TRUE'},
378+
F => {alias=>'FALSE'},
372379
);
373380

374-
so that either "TRUE" or "true" will be interpreted as TRUE.
381+
so that either "TRUE" or "T" will be interpreted as TRUE, and
382+
similarly for "FALSE" and "F";
375383

376384
There are a number of values stored in the context that control things
377385
like the tolerance used when comparing numbers, and so on. You

htdocs/helpFiles/InstructorUserList.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
################################################################################
77
# WeBWorK Online Homework Delivery System
88
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
9-
# $CVSHeader: webwork2/htdocs/helpFiles/InstructorUserList.html,v 1.3 2006/01/25 23:13:50 sh002i Exp $
9+
# $CVSHeader: webwork2/htdocs/helpFiles/InstructorUserList.html,v 1.4 2007/08/13 22:59:53 sh002i Exp $
1010
#
1111
# This program is free software; you can redistribute it and/or modify it under
1212
# the terms of either: (a) the GNU General Public License as published by the
@@ -52,7 +52,7 @@ <h4>How to:</h4>
5252
<dd> Click the "Add x student(s)" radio button and then click "Take action". This will take you to a new page where the data can be entered for one or more students. It is also possible to assign the student to one or more problem sets as they are being entered: simply select the homework sets from the list below the data entry table. Use 'command' or 'control' click to select more than one homework set.</dd>
5353

5454
<dt>Add many students to a course from a class list.</dt>
55-
<dd>This is most easily done by importing a class list. The class list can be uploaded from your workstation to the server using the File Manager page. The class list must be a file ending in .lst and must have a specific <a href="http://webhost.math.rochester.edu/webworkdocs/discuss/msgReader$59#2397">format</a>. Once the file has been uploaded to the server the file will appear in the import action pop-up list (5th action). demoCourse.lst is available for most courses and adds the "practice users" which activate guest logins to the class list .</dd>
55+
<dd>This is most easily done by importing a class list. The class list can be uploaded from your workstation to the server using the File Manager page. The class list must be a file ending in .lst and must have a specific <a href="http://webwork.maa.org/wiki/Classlist_Files#Format_of_classlist_files">format</a>. Once the file has been uploaded to the server the file will appear in the import action pop-up list (5th action). demoCourse.lst is available for most courses and adds the "practice users" which activate guest logins to the class list .</dd>
5656

5757
<dt>Add a TA or an instructor (change permission level of user)</dt>
5858
<dd>This is done by first entering the user as a student and then changing the permission level of the user. First edit the user by clicking on the pencil next to their name (or using the technique above for several users), then change their permssion level -- an entry blank at the far right of the screen, you may have to scroll to see it. The permission levels are

lib/WeBWorK/Constants.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
################################################################################
22
# WeBWorK Online Homework Delivery System
33
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4-
# $CVSHeader: webwork2/lib/WeBWorK/Constants.pm,v 1.56 2008/01/08 14:44:04 gage Exp $
4+
# $CVSHeader: webwork2/lib/WeBWorK/Constants.pm,v 1.57 2008/06/24 03:39:39 gage Exp $
55
#
66
# This program is free software; you can redistribute it and/or modify it under
77
# the terms of either: (a) the GNU General Public License as published by the
@@ -144,7 +144,7 @@ specifies a unified look and feel for the WeBWorK course web pages.',
144144
type => 'number'},
145145
{ var => 'siteDefaults{timezone}',
146146
doc => 'Timezone for the course',
147-
doc2 => 'Some servers handle courses taking place in different timezones. If this course is not showing the correct timezone, enter the correct value here. The format consists of unix times, such as "America/Chicago", "America/Phoenix", "America/Los_Angeles", "America/New_York", or "America/Denver".',
147+
doc2 => 'Some servers handle courses taking place in different timezones. If this course is not showing the correct timezone, enter the correct value here. The format consists of unix times, such as "America/New_York","America/Chicago", "America/Denver", "America/Phoenix" or "America/Los_Angeles". Complete list: <a href="http://cpan.uwinnipeg.ca/dist/DateTime-TimeZone">TimeZoneFiles</a>',
148148
type => 'text'},],
149149
['Permissions',
150150
{ var => 'permissionLevels{login}',

lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
################################################################################
22
# WeBWorK Online Homework Delivery System
33
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4-
# $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v 1.91 2007/08/13 22:59:55 sh002i Exp $
4+
# $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v 1.92 2008/06/25 14:43:16 glarose Exp $
55
#
66
# This program is free software; you can redistribute it and/or modify it under
77
# the terms of either: (a) the GNU General Public License as published by the
@@ -578,7 +578,14 @@ EOF
578578
CGI::a({-href=>'http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/PGmacrosByFile',-target=>"manpage_window"},
579579
'&nbsp;macro list&nbsp;',
580580
)," | ",
581-
CGI::a({-href=>'http://devel.webwork.rochester.edu/doc/cvs/pg_HEAD/',-target=>"manpage_window"},
581+
CGI::a({-href=>'http://webwork.maa.org/wiki/Category:Authors',-target=>"wiki_window"},
582+
'&nbsp;authoring&nbsp;info&nbsp;&amp; help&nbsp;',
583+
)," | ",
584+
CGI::a({-href=>'http://hosted2.webwork.rochester.edu/webwork2/wikiExamples/MathObjectsLabs2/2/?login_practice_user=true',-target=>"lab_window",
585+
},
586+
'&nbsp;testing&nbsp;lab&nbsp;'
587+
)," | ",
588+
CGI::a({-href=>'http://devel.webwork.rochester.edu/doc/cvs/pg_HEAD/',-target=>"doc_window"},
582589
'&nbsp;pod docs&nbsp;',
583590
)," | ",
584591
CGI::a({-href=>$BUGZILLA,-target=>"bugs_window"},

lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
################################################################################
22
# WeBWorK Online Homework Delivery System
33
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4-
# $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v 1.84 2008/06/24 03:40:48 gage Exp $
4+
# $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v 1.85 2008/07/01 13:18:52 glarose Exp $
55
#
66
# This program is free software; you can redistribute it and/or modify it under
77
# the terms of either: (a) the GNU General Public License as published by the
@@ -733,7 +733,7 @@ sub make_top_row {
733733
my $library_selected = $self->{current_library_set};
734734
my $set_selected = $r->param('local_sets');
735735
my (@dis1, @dis2, @dis3, @dis4) = ();
736-
@dis1 = (-disabled=>1) if($browse_which eq 'browse_library');
736+
@dis1 = (-disabled=>1) if($browse_which eq 'browse_npl_library');
737737
@dis2 = (-disabled=>1) if($browse_which eq 'browse_local');
738738
@dis3 = (-disabled=>1) if($browse_which eq 'browse_mysets');
739739
@dis4 = (-disabled=>1) if($browse_which eq 'browse_setdefs');
@@ -786,7 +786,7 @@ sub make_top_row {
786786

787787
print CGI::Tr(CGI::td({-class=>"InfoPanel", -align=>"center"},
788788
"Browse ",
789-
CGI::submit(-name=>"browse_library", -value=>"National Problem Library", -style=>$these_widths, @dis1),
789+
CGI::submit(-name=>"browse_npl_library", -value=>"National Problem Library", -style=>$these_widths, @dis1),
790790
CGI::submit(-name=>"browse_local", -value=>"Local Problems", -style=>$these_widths, @dis2),
791791
CGI::submit(-name=>"browse_mysets", -value=>"From This Course", -style=>$these_widths, @dis3),
792792
CGI::submit(-name=>"browse_setdefs", -value=>"Set Definition Files", -style=>$these_widths, @dis4),
@@ -800,7 +800,7 @@ sub make_top_row {
800800
$self->browse_local_panel($library_selected);
801801
} elsif ($browse_which eq 'browse_mysets') {
802802
$self->browse_mysets_panel($library_selected, $list_of_local_sets);
803-
} elsif ($browse_which eq 'browse_library') {
803+
} elsif ($browse_which eq 'browse_npl_library') {
804804
$self->browse_library_panel();
805805
} elsif ($browse_which eq 'browse_setdefs') {
806806
$self->browse_setdef_panel($library_selected);
@@ -862,7 +862,7 @@ sub make_data_row {
862862
$problem_output .= $pg->{flags}->{comment} if($pg->{flags}->{comment});
863863

864864

865-
#if($self->{r}->param('browse_which') ne 'browse_library') {
865+
#if($self->{r}->param('browse_which') ne 'browse_npl_library') {
866866
my $problem_seed = $self->{'problem_seed'} || 1234;
867867
my $edit_link = CGI::a({href=>$self->systemLink(
868868
$urlpath->newFromModule("WeBWorK::ContentGenerator::Instructor::PGProblemEditor",
@@ -997,7 +997,7 @@ sub pre_header_initialize {
997997

998998
############# Default of which problem selector to display
999999

1000-
my $browse_which = $r->param('browse_which') || 'browse_library';
1000+
my $browse_which = $r->param('browse_which') || 'browse_npl_library';
10011001

10021002

10031003

@@ -1012,16 +1012,16 @@ sub pre_header_initialize {
10121012

10131013
########### Start the logic through if elsif elsif ...
10141014
debug("browse_lib", $r->param("$browse_lib"));
1015-
debug("browse_library", $r->param("browse_library"));
1015+
debug("browse_npl_library", $r->param("browse_npl_library"));
10161016
debug("browse_mysets", $r->param("browse_mysets"));
10171017
debug("browse_setdefs", $r->param("browse_setdefs"));
10181018
##### Asked to browse certain problems
10191019
if ($browse_lib ne '') {
10201020
$browse_which = $browse_lib;
10211021
$self->{current_library_set} = "";
10221022
$use_previous_problems = 0; @pg_files = (); ## clear old problems
1023-
} elsif ($r->param('browse_library')) {
1024-
$browse_which = 'browse_library';
1023+
} elsif ($r->param('browse_npl_library')) {
1024+
$browse_which = 'browse_npl_library';
10251025
$self->{current_library_set} = "";
10261026
$use_previous_problems = 0; @pg_files = (); ## clear old problems
10271027
} elsif ($r->param('browse_local')) {

lib/WeBWorK/ContentGenerator/ProblemSet.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
################################################################################
22
# WeBWorK Online Homework Delivery System
33
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4-
# $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/ProblemSet.pm,v 1.89 2007/08/13 22:59:55 sh002i Exp $
4+
# $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/ProblemSet.pm,v 1.90 2008/04/26 23:13:59 gage Exp $
55
#
66
# This program is free software; you can redistribute it and/or modify it under
77
# the terms of either: (a) the GNU General Public License as published by the
@@ -385,7 +385,7 @@ sub problemListRow($$$) {
385385

386386
my $interactive = CGI::a({-href=>$interactiveURL}, "Problem $problemID");
387387
my $attempts = $problem->num_correct + $problem->num_incorrect;
388-
my $remaining = $problem->max_attempts < 0
388+
my $remaining = (($problem->max_attempts||-1) < 0) #a blank yields 'infinite' because it evaluates as false with out giving warnings about comparing non-numbers
389389
? "unlimited"
390390
: $problem->max_attempts - $attempts;
391391
my $rawStatus = $problem->status || 0;

lib/WeBWorK/DB/Schema/NewSQL/Std.pm

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
################################################################################
22
# WeBWorK Online Homework Delivery System
33
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4-
# $CVSHeader: webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm,v 1.16 2007/08/25 18:16:34 sh002i Exp $
4+
# $CVSHeader: webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm,v 1.17 2008/07/23 03:22:27 gage Exp $
55
#
66
# This program is free software; you can redistribute it and/or modify it under
77
# the terms of either: (a) the GNU General Public License as published by the
@@ -228,7 +228,8 @@ sub dump_table {
228228
my $exit = $? >> 8;
229229
my $signal = $? & 127;
230230
my $core = $? & 128;
231-
warn "Failed to dump table '".$self->sql_table_name."' with command '$dump_cmd' (exit=$exit signal=$signal core=$core): $dump_out\n";
231+
warn "Warning: Failed to dump table '".$self->sql_table_name."' with command '$dump_cmd' (exit=$exit signal=$signal core=$core): $dump_out\n";
232+
warn "This can be expected if the course was created with an earlier version of WeBWorK.";
232233
}
233234

234235
return 1;
@@ -249,7 +250,7 @@ sub restore_table {
249250
my $exit = $? >> 8;
250251
my $signal = $? & 127;
251252
my $core = $? & 128;
252-
die "Failed to restore table '".$self->sql_table_name."' with command '$restore_cmd' (exit=$exit signal=$signal core=$core): $restore_out\n";
253+
warn "Failed to restore table '".$self->sql_table_name."' with command '$restore_cmd' (exit=$exit signal=$signal core=$core): $restore_out\n";
253254
}
254255

255256
return 1;

lib/WeBWorK/File/Classlist.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
################################################################################
22
# WeBWorK Online Homework Delivery System
33
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4-
# $CVSHeader: webwork2/lib/WeBWorK/File/Classlist.pm,v 1.9 2006/09/15 17:53:34 sh002i Exp $
4+
# $CVSHeader: webwork2/lib/WeBWorK/File/Classlist.pm,v 1.10 2007/08/13 22:59:58 sh002i Exp $
55
#
66
# This program is free software; you can redistribute it and/or modify it under
77
# the terms of either: (a) the GNU General Public License as published by the

0 commit comments

Comments
 (0)