From: Mike G. v. a. <we...@ma...> - 2008-10-09 02:48:48
|
Log Message: ----------- Forward ports from rel-2-4-patches Modified Files: -------------- webwork2/conf: global.conf.dist webwork.apache2-config.dist webwork2/conf/templates/math: system.template webwork2/courses.dist/modelCourse/templates: course_info.txt webwork2/doc/parser/docs: UsingParser.pod webwork2/htdocs/helpFiles: InstructorUserList.html webwork2/lib/WeBWorK: Constants.pm PG.pm Utils.pm webwork2/lib/WeBWorK/ContentGenerator: ProblemSet.pm webwork2/lib/WeBWorK/ContentGenerator/Instructor: PGProblemEditor.pm SetMaker.pm webwork2/lib/WeBWorK/DB/Schema/NewSQL: Std.pm webwork2/lib/WeBWorK/File: Classlist.pm Revision Data ------------- Index: UsingParser.pod =================================================================== RCS file: /webwork/cvs/system/webwork2/doc/parser/docs/UsingParser.pod,v retrieving revision 1.1 retrieving revision 1.2 diff -Ldoc/parser/docs/UsingParser.pod -Ldoc/parser/docs/UsingParser.pod -u -r1.1 -r1.2 --- doc/parser/docs/UsingParser.pod +++ doc/parser/docs/UsingParser.pod @@ -50,6 +50,7 @@ this easier, substitute will apply Formula() to any string values automatically. E.g., Formula("x-1")->substitute(x=>"y") + returns "y-1" as a formula. =item $f->string @@ -353,7 +354,7 @@ and can change, remove or list the constants via methods like those used for variables above. The command - $M = $constant->constants->get('M'); + $M = $context->constants->get('M'); will return the value of the consant M. (See the pg/lib/Value/Context/Data.pm file for more information on the methods @@ -362,16 +363,23 @@ To add new predefined words (like 'NONE' and 'DNE'), use something like - $constant->strings->add(TRUE=>{},FALSE=>{}); + $context->strings->add(TRUE=>{},FALSE=>{}); + +Strings are case-insensitive, unless you say otherwise. To mark a +string as being case-senstive, use + + $context->strings->add(TRUE => {caseSensitive=>1}); -Note that strings are case-sensitive, so you might want to add +You may want to privide several forms for the same word; to do so, +make the additional words into aliases: - $constant->strings->add( - true => {alias=>'TRUE'}, - false => {alias=>'FALSE'}, + $context->strings->add( + T => {alias=>'TRUE'}, + F => {alias=>'FALSE'}, ); -so that either "TRUE" or "true" will be interpreted as TRUE. +so that either "TRUE" or "T" will be interpreted as TRUE, and +similarly for "FALSE" and "F"; There are a number of values stored in the context that control things like the tolerance used when comparing numbers, and so on. You Index: InstructorUserList.html =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/helpFiles/InstructorUserList.html,v retrieving revision 1.4 retrieving revision 1.5 diff -Lhtdocs/helpFiles/InstructorUserList.html -Lhtdocs/helpFiles/InstructorUserList.html -u -r1.4 -r1.5 --- htdocs/helpFiles/InstructorUserList.html +++ htdocs/helpFiles/InstructorUserList.html @@ -52,7 +52,7 @@ <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> <dt>Add many students to a course from a class list.</dt> - <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> + <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> <dt>Add a TA or an instructor (change permission level of user)</dt> <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 Index: Utils.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils.pm,v retrieving revision 1.81 retrieving revision 1.82 diff -Llib/WeBWorK/Utils.pm -Llib/WeBWorK/Utils.pm -u -r1.81 -r1.82 --- lib/WeBWorK/Utils.pm +++ lib/WeBWorK/Utils.pm @@ -740,6 +740,7 @@ ## Utility function to trim whitespace off the start and end of its input sub trim_spaces { my $in = shift; + return '' unless $in; # skip blank spaces $in =~ s/^\s*(.*?)\s*$/$1/; return($in); } Index: Constants.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Constants.pm,v retrieving revision 1.57 retrieving revision 1.58 diff -Llib/WeBWorK/Constants.pm -Llib/WeBWorK/Constants.pm -u -r1.57 -r1.58 --- lib/WeBWorK/Constants.pm +++ lib/WeBWorK/Constants.pm @@ -144,7 +144,7 @@ type => 'number'}, { var => 'siteDefaults{timezone}', doc => 'Timezone for the course', - 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".', + 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>', type => 'text'},], ['Permissions', { var => 'permissionLevels{login}', Index: PG.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/PG.pm,v retrieving revision 1.74 retrieving revision 1.75 diff -Llib/WeBWorK/PG.pm -Llib/WeBWorK/PG.pm -u -r1.74 -r1.75 --- lib/WeBWorK/PG.pm +++ lib/WeBWorK/PG.pm @@ -151,6 +151,8 @@ $envir{macrosPath} = $ce->{pg}->{directories}{macrosPath}; $envir{appletPath} = $ce->{pg}->{directories}{appletPath}; $envir{pgDirectories} = $ce->{pg}->{directories}; + $envir{webworkHtmlDirectory} = $ce->{webworkDirs}->{htdocs}."/"; + $envir{webworkHtmlURL} = $ce->{webworkURLs}->{htdocs}."/"; $envir{htmlDirectory} = $ce->{courseDirs}->{html}."/"; $envir{htmlURL} = $ce->{courseURLs}->{html}."/"; $envir{templateDirectory} = $ce->{courseDirs}->{templates}."/"; Index: course_info.txt =================================================================== RCS file: /webwork/cvs/system/webwork2/courses.dist/modelCourse/templates/course_info.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -Lcourses.dist/modelCourse/templates/course_info.txt -Lcourses.dist/modelCourse/templates/course_info.txt -u -r1.1 -r1.2 --- courses.dist/modelCourse/templates/course_info.txt +++ courses.dist/modelCourse/templates/course_info.txt @@ -1 +1,3 @@ +this information is written in the file: +[coursesDirectory]/courseName/templates/course_info.txt Index: ProblemSet.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/ProblemSet.pm,v retrieving revision 1.90 retrieving revision 1.91 diff -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -u -r1.90 -r1.91 --- lib/WeBWorK/ContentGenerator/ProblemSet.pm +++ lib/WeBWorK/ContentGenerator/ProblemSet.pm @@ -385,7 +385,7 @@ my $interactive = CGI::a({-href=>$interactiveURL}, "Problem $problemID"); my $attempts = $problem->num_correct + $problem->num_incorrect; - my $remaining = $problem->max_attempts < 0 + my $remaining = (($problem->max_attempts||-1) < 0) #a blank yields 'infinite' because it evaluates as false with out giving warnings about comparing non-numbers ? "unlimited" : $problem->max_attempts - $attempts; my $rawStatus = $problem->status || 0; Index: PGProblemEditor.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v retrieving revision 1.92 retrieving revision 1.93 diff -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -u -r1.92 -r1.93 --- lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm +++ lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm @@ -578,7 +578,14 @@ CGI::a({-href=>'http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/PGmacrosByFile',-target=>"manpage_window"}, ' macro list ', )," | ", - CGI::a({-href=>'http://devel.webwork.rochester.edu/doc/cvs/pg_HEAD/',-target=>"manpage_window"}, + CGI::a({-href=>'http://webwork.maa.org/wiki/Category:Authors',-target=>"wiki_window"}, + ' authoring info & help ', + )," | ", + CGI::a({-href=>'http://hosted2.webwork.rochester.edu/webwork2/wikiExamples/MathObjectsLabs2/2/?login_practice_user=true',-target=>"lab_window", + }, + ' testing lab ' + )," | ", + CGI::a({-href=>'http://devel.webwork.rochester.edu/doc/cvs/pg_HEAD/',-target=>"doc_window"}, ' pod docs ', )," | ", CGI::a({-href=>$BUGZILLA,-target=>"bugs_window"}, Index: SetMaker.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v retrieving revision 1.85 retrieving revision 1.86 diff -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -u -r1.85 -r1.86 --- lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm +++ lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm @@ -733,7 +733,7 @@ my $library_selected = $self->{current_library_set}; my $set_selected = $r->param('local_sets'); my (@dis1, @dis2, @dis3, @dis4) = (); - @dis1 = (-disabled=>1) if($browse_which eq 'browse_library'); + @dis1 = (-disabled=>1) if($browse_which eq 'browse_npl_library'); @dis2 = (-disabled=>1) if($browse_which eq 'browse_local'); @dis3 = (-disabled=>1) if($browse_which eq 'browse_mysets'); @dis4 = (-disabled=>1) if($browse_which eq 'browse_setdefs'); @@ -786,7 +786,7 @@ print CGI::Tr(CGI::td({-class=>"InfoPanel", -align=>"center"}, "Browse ", - CGI::submit(-name=>"browse_library", -value=>"National Problem Library", -style=>$these_widths, @dis1), + CGI::submit(-name=>"browse_npl_library", -value=>"National Problem Library", -style=>$these_widths, @dis1), CGI::submit(-name=>"browse_local", -value=>"Local Problems", -style=>$these_widths, @dis2), CGI::submit(-name=>"browse_mysets", -value=>"From This Course", -style=>$these_widths, @dis3), CGI::submit(-name=>"browse_setdefs", -value=>"Set Definition Files", -style=>$these_widths, @dis4), @@ -800,7 +800,7 @@ $self->browse_local_panel($library_selected); } elsif ($browse_which eq 'browse_mysets') { $self->browse_mysets_panel($library_selected, $list_of_local_sets); - } elsif ($browse_which eq 'browse_library') { + } elsif ($browse_which eq 'browse_npl_library') { $self->browse_library_panel(); } elsif ($browse_which eq 'browse_setdefs') { $self->browse_setdef_panel($library_selected); @@ -862,7 +862,7 @@ $problem_output .= $pg->{flags}->{comment} if($pg->{flags}->{comment}); - #if($self->{r}->param('browse_which') ne 'browse_library') { + #if($self->{r}->param('browse_which') ne 'browse_npl_library') { my $problem_seed = $self->{'problem_seed'} || 1234; my $edit_link = CGI::a({href=>$self->systemLink( $urlpath->newFromModule("WeBWorK::ContentGenerator::Instructor::PGProblemEditor", @@ -997,7 +997,7 @@ ############# Default of which problem selector to display - my $browse_which = $r->param('browse_which') || 'browse_library'; + my $browse_which = $r->param('browse_which') || 'browse_npl_library'; @@ -1012,7 +1012,7 @@ ########### Start the logic through if elsif elsif ... debug("browse_lib", $r->param("$browse_lib")); - debug("browse_library", $r->param("browse_library")); + debug("browse_npl_library", $r->param("browse_npl_library")); debug("browse_mysets", $r->param("browse_mysets")); debug("browse_setdefs", $r->param("browse_setdefs")); ##### Asked to browse certain problems @@ -1020,8 +1020,8 @@ $browse_which = $browse_lib; $self->{current_library_set} = ""; $use_previous_problems = 0; @pg_files = (); ## clear old problems - } elsif ($r->param('browse_library')) { - $browse_which = 'browse_library'; + } elsif ($r->param('browse_npl_library')) { + $browse_which = 'browse_npl_library'; $self->{current_library_set} = ""; $use_previous_problems = 0; @pg_files = (); ## clear old problems } elsif ($r->param('browse_local')) { Index: Std.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -Llib/WeBWorK/DB/Schema/NewSQL/Std.pm -Llib/WeBWorK/DB/Schema/NewSQL/Std.pm -u -r1.17 -r1.18 --- lib/WeBWorK/DB/Schema/NewSQL/Std.pm +++ lib/WeBWorK/DB/Schema/NewSQL/Std.pm @@ -228,7 +228,8 @@ my $exit = $? >> 8; my $signal = $? & 127; my $core = $? & 128; - warn "Failed to dump table '".$self->sql_table_name."' with command '$dump_cmd' (exit=$exit signal=$signal core=$core): $dump_out\n"; + warn "Warning: Failed to dump table '".$self->sql_table_name."' with command '$dump_cmd' (exit=$exit signal=$signal core=$core): $dump_out\n"; + warn "This can be expected if the course was created with an earlier version of WeBWorK."; } return 1; @@ -249,7 +250,7 @@ my $exit = $? >> 8; my $signal = $? & 127; my $core = $? & 128; - die "Failed to restore table '".$self->sql_table_name."' with command '$restore_cmd' (exit=$exit signal=$signal core=$core): $restore_out\n"; + warn "Failed to restore table '".$self->sql_table_name."' with command '$restore_cmd' (exit=$exit signal=$signal core=$core): $restore_out\n"; } return 1; Index: webwork.apache2-config.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/webwork.apache2-config.dist,v retrieving revision 1.12 retrieving revision 1.13 diff -Lconf/webwork.apache2-config.dist -Lconf/webwork.apache2-config.dist -u -r1.12 -r1.13 --- conf/webwork.apache2-config.dist +++ conf/webwork.apache2-config.dist @@ -27,6 +27,18 @@ # FollowSymlinksOption from working when specified # in a <Perl> section. See below for workaround. + +# Uncomment the ScriptAliasMatch to allow access to show-source.cgi +# This allows the "show source" button to work for demonstration "courses" +# See for example Davide Cervone's Knoxville lectures on math objects +# It requires that a show-source.cgi script be customized and placed in +# the myCourse/html directory of the course +# The "show source" button is most useful for webwork "courses" used to train new authors +# It is not desirable to expose the code of regular homework questions to students + +# ScriptAliasMatch /webwork2_course_files/([^/]*)/show-source.cgi/(.*) /opt/webwork/courses/$1/html/show-source.cgi/$2 + + PerlModule mod_perl2 <Perl> Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.211 retrieving revision 1.212 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.211 -r1.212 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -448,6 +448,11 @@ # these variables are used by database.conf. we define them here so that editing # database.conf isn't necessary. + +# required permissions +# GRANT SELECT ON webwork.* TO webworkRead@localhost IDENTIFIED BY 'passwordRO'; +# GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, LOCK TABLES ON webwork.* TO webworkWrite@localhost IDENTIFIED BY 'passwordRW'; + $database_dsn = "dbi:mysql:webwork"; $database_username = "webworkWrite"; $database_password = ""; @@ -477,9 +482,8 @@ ################################################################################ # For configuration instructions, see: -# http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/DatabaseProblemLibrary - -# The directory containing the problem library files. Set to "" if no problem +# http://webwork.maa.org/wiki/National_Problem_Library +# The directory containing the natinal problem library files. Set to "" if no problem # library is installed. $problemLibrary{root} = ""; @@ -836,6 +840,10 @@ ".", # search the problem file's directory $courseDirs{macros}, $pg{directories}{macros}, + "$courseDirs{templates}/Library/macros/Dartmouth", + "$courseDirs{templates}/Library/macros/Union", + "$courseDirs{templates}/Library/macros/NAU", + "$courseDirs{templates}/Library/macros/Michigan", ]; # The applet search path. If a full URL is given, it is used unmodified. If an @@ -845,6 +853,7 @@ # and the local server is "https://math.yourschool.edu", # then the URL "https://math.yourschool.edu/math/applets" will be used. # + $pg{directories}{appletPath} = [ # paths to search for applets (requires full url) "$webworkURLs{htdocs}/applets", "$courseURLs{html}/applets", @@ -921,8 +930,9 @@ [qw(Parser Value)], [qw(Parser::Legacy)], # [qw(SaveFile)], -# [qw(Chromatic)], - [qw(Applet FlashApplet)], +# [qw(Chromatic)], # for Northern Arizona graph problems +# # -- follow instructions at libraries/nau_problib/lib/README to install + [qw(Applet FlashApplet JavaApplet)], ]; ##### Answer evaluatior defaults Index: system.template =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/templates/math/system.template,v retrieving revision 1.10 retrieving revision 1.11 diff -Lconf/templates/math/system.template -Lconf/templates/math/system.template -u -r1.10 -r1.11 --- conf/templates/math/system.template +++ conf/templates/math/system.template @@ -19,7 +19,9 @@ # Artistic License for more details. ################################################################################ --> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + + +<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="<!--#url type="webwork" name="htdocs"-->/css/math.css"/> |