You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(53) |
Feb
(56) |
Mar
|
Apr
|
May
(30) |
Jun
(78) |
Jul
(121) |
Aug
(155) |
Sep
(77) |
Oct
(61) |
Nov
(45) |
Dec
(94) |
2006 |
Jan
(116) |
Feb
(33) |
Mar
(11) |
Apr
(23) |
May
(60) |
Jun
(89) |
Jul
(130) |
Aug
(109) |
Sep
(124) |
Oct
(63) |
Nov
(82) |
Dec
(45) |
2007 |
Jan
(31) |
Feb
(35) |
Mar
(123) |
Apr
(36) |
May
(18) |
Jun
(134) |
Jul
(133) |
Aug
(241) |
Sep
(126) |
Oct
(31) |
Nov
(15) |
Dec
(5) |
2008 |
Jan
(11) |
Feb
(6) |
Mar
(16) |
Apr
(29) |
May
(43) |
Jun
(149) |
Jul
(27) |
Aug
(29) |
Sep
(37) |
Oct
(20) |
Nov
(4) |
Dec
(6) |
2009 |
Jan
(34) |
Feb
(30) |
Mar
(16) |
Apr
(6) |
May
(1) |
Jun
(32) |
Jul
(22) |
Aug
(7) |
Sep
(18) |
Oct
(50) |
Nov
(22) |
Dec
(8) |
2010 |
Jan
(17) |
Feb
(15) |
Mar
(10) |
Apr
(9) |
May
(67) |
Jun
(30) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
From: Arnie P. v. a. <we...@ma...> - 2009-08-29 12:55:05
|
Log Message: ----------- Allow users to specify default values for max_attempts and value of a problem Modified Files: -------------- webwork2/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.213 retrieving revision 1.214 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.213 -r1.214 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -936,6 +936,19 @@ [qw(Applet FlashApplet JavaApplet)], ]; +##### Problem creation defaults + +# The default weight (also called value) of a problem to use when using the +# Library Browser, Problem Editor or Hmwk Sets Editor to add problems to a set +# or when this value is left blank in an imported set definition file. +$problemDefaults{value} = 1; + +# The default max_attempts for a problem to use when using the +# Library Browser, Problem Editor or Hmwk Sets Editor to add problems to a set +# or when this value is left blank in an imported set definition file. Note that +# setting this to -1 gives students unlimited attempts. +$problemDefaults{max_attempts} = -1; + ##### Answer evaluatior defaults $pg{ansEvalDefaults} = { |
From: Arnie P. v. a. <we...@ma...> - 2009-08-29 12:51:56
|
Log Message: ----------- Allow users to specify default values for max_attempts and value of a problem Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetList.pm Revision Data ------------- Index: ProblemSetList.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm,v retrieving revision 1.107 retrieving revision 1.108 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -u -r1.107 -r1.108 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm @@ -1574,6 +1574,8 @@ my ($self, $fileName) = @_; my $templateDir = $self->{ce}->{courseDirs}->{templates}; my $filePath = "$templateDir/$fileName"; + my $value_default = $self->{ce}->{problemDefaults}->{value}; + my $max_attempts_default = $self->{ce}->{problemDefaults}->{max_attempts}; my $setName = ''; @@ -1761,10 +1763,10 @@ $name =~ s/\s*//g; $value = "" unless defined($value); $value =~ s/[^\d\.]*//g; - unless ($value =~ /\d+/) {$value = 1;} + unless ($value =~ /\d+/) {$value = $value_default;} $attemptLimit = "" unless defined($attemptLimit); $attemptLimit =~ s/[^\d-]*//g; - unless ($attemptLimit =~ /\d+/) {$attemptLimit = -1;} + unless ($attemptLimit =~ /\d+/) {$attemptLimit = $max_attempts_default;} $continueFlag = "0" unless( defined($continueFlag) && @problemData ); # can't put continuation flag onto the first problem push(@problemData, {source_file => $name, |
From: Arnie P. v. a. <we...@ma...> - 2009-08-29 12:38:10
|
Log Message: ----------- Allow users to specify default values for max_attempts and value of a problem Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Instructor.pm Revision Data ------------- Index: Instructor.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor.pm,v retrieving revision 1.64 retrieving revision 1.65 diff -Llib/WeBWorK/ContentGenerator/Instructor.pm -Llib/WeBWorK/ContentGenerator/Instructor.pm -u -r1.64 -r1.65 --- lib/WeBWorK/ContentGenerator/Instructor.pm +++ lib/WeBWorK/ContentGenerator/Instructor.pm @@ -518,6 +518,9 @@ sub addProblemToSet { my ($self, %args) = @_; my $db = $self->r->db; + my $value_default = $self->{ce}->{problemDefaults}->{value}; + my $max_attempts_default = $self->{ce}->{problemDefaults}->{max_attempts}; + die "addProblemToSet called without specifying the set name." if $args{setName} eq ""; my $setName = $args{setName}; @@ -526,8 +529,8 @@ die "addProblemToSet called without specifying the sourceFile."; # The rest of the arguments are optional - my $value = $args{value} || 1; - my $maxAttempts = $args{maxAttempts} || -1; + my $value = $args{value} || $value_default; + my $maxAttempts = $args{maxAttempts} || $max_attempts_default; my $problemID = $args{problemID}; unless ($problemID) { |
From: Arnie P. v. a. <we...@ma...> - 2009-08-12 17:34:45
|
Log Message: ----------- Patch in the changes Mike made to head which replace %WeBWorK::SeedCE with get_SeedCE($ce) The only difference between this patched verssion and head is that the line use WeBWorK::Utils::DBUpgrage is commented out in this patched version Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/Utils: CourseManagement.pm Revision Data ------------- Index: CourseManagement.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/CourseManagement.pm,v retrieving revision 1.39.2.1.2.3 retrieving revision 1.39.2.1.2.4 diff -Llib/WeBWorK/Utils/CourseManagement.pm -Llib/WeBWorK/Utils/CourseManagement.pm -u -r1.39.2.1.2.3 -r1.39.2.1.2.4 --- lib/WeBWorK/Utils/CourseManagement.pm +++ lib/WeBWorK/Utils/CourseManagement.pm @@ -256,8 +256,8 @@ if (exists $options{templatesFrom}) { my $sourceCourse = $options{templatesFrom}; my $sourceCE = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, - courseName => $sourceCourse, + get_SeedCE($ce), + courseName => $sourceCourse, # override courseName }); my $sourceDir = $sourceCE->{courseDirs}->{templates}; @@ -714,7 +714,7 @@ ##### step 3: read the course environment for this course ##### my $ce2 = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, + get_SeedCE($ce), courseName => $currCourseID, }); @@ -784,7 +784,7 @@ # course environment for before the course is moved my $ce2 = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, + get_SeedCE($ce), courseName => $courseID, }); @@ -803,7 +803,7 @@ # course environment for after the course is moved my $ce3 = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, + get_SeedCE($ce), courseName => $tmpCourseID, }); @@ -1168,6 +1168,14 @@ } - - +sub get_SeedCE { + my $ce = shift; + warn "get_SeedCE needs current Course environment to create seed CE" unless ref($ce) ; + my %seedCE=(); + my @conf_items = qw( webwork_dir webwork_url pg_dir courseName) ; + foreach my $item (@conf_items) { + $seedCE{$item} = $ce->{$item}; + } + return( %seedCE); +} 1; |
From: dpvc v. a. <we...@ma...> - 2009-07-31 15:06:24
|
Log Message: ----------- Make fractions stringify with parentheses properly Modified Files: -------------- pg/macros: contextFraction.pl Revision Data ------------- Index: contextFraction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.6 -r1.7 --- macros/contextFraction.pl +++ macros/contextFraction.pl @@ -771,6 +771,12 @@ return $n; } +sub pdot { + my $self = shift; my $n = $self->string; + $n = '('.$n.')' if $n =~ m![^0-9]!; # add parens if not just a number + return $n; +} + ########################################################################### # # Answer Checker |
From: dpvc v. a. <we...@ma...> - 2009-07-31 02:40:22
|
Log Message: ----------- handle negative fraction reductions Modified Files: -------------- pg/macros: contextFraction.pl Revision Data ------------- Index: contextFraction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.5 -r1.6 --- macros/contextFraction.pl +++ macros/contextFraction.pl @@ -499,6 +499,23 @@ return $self->SUPER::class; } +# +# Handle reductions of negative fractions +# +sub reduce { + my $self = shift; + my $reduce = $self->context->{reduction}; + if ($self->{value}->class eq 'Fraction') { + $self->{value} = $self->{value}->reduce; + if ($reduce->{'-n'} && $self->{value}{data}[0] < 0) { + $self->{value}{data}[0] = -$self->{value}{data}[0]; + return Parser::UOP::Neg($self); + } + return $self; + } + return $self->SUPER::reduce; +} + ########################################################################### package context::Fraction::Real; |
From: dpvc v. a. <we...@ma...> - 2009-07-31 02:37:31
|
Log Message: ----------- make reduce work with negative numbers Modified Files: -------------- pg/macros: contextFraction.pl Revision Data ------------- Index: contextFraction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.4 -r1.5 --- macros/contextFraction.pl +++ macros/contextFraction.pl @@ -476,6 +476,15 @@ $self->SUPER::class; } +# +# make isNeg properly handle the modified class +# +sub isNeg { + my $self = shift; + return ($self->class =~ /UOP|MINUS/ && $self->{uop} eq 'u-' && !$self->{op}->{isInfinite}); + +} + ########################################################################### package context::Fraction::Value; |
From: Mike G. v. a. <we...@ma...> - 2009-07-30 20:55:54
|
Log Message: ----------- replaced %WeBWorK::SeedCE with get_SeedCE($ce) because, if the webwork server hasn't been run recently %WeBWorK::SeedCE might not be defined. and addcourse will fail Modified Files: -------------- webwork2/lib/WeBWorK/Utils: CourseManagement.pm Revision Data ------------- Index: CourseManagement.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/CourseManagement.pm,v retrieving revision 1.46 retrieving revision 1.47 diff -Llib/WeBWorK/Utils/CourseManagement.pm -Llib/WeBWorK/Utils/CourseManagement.pm -u -r1.46 -r1.47 --- lib/WeBWorK/Utils/CourseManagement.pm +++ lib/WeBWorK/Utils/CourseManagement.pm @@ -256,8 +256,8 @@ if (exists $options{templatesFrom}) { my $sourceCourse = $options{templatesFrom}; my $sourceCE = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, - courseName => $sourceCourse, + get_SeedCE($ce), + courseName => $sourceCourse, # override courseName }); my $sourceDir = $sourceCE->{courseDirs}->{templates}; @@ -714,7 +714,7 @@ ##### step 3: read the course environment for this course ##### my $ce2 = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, + get_SeedCE($ce), courseName => $currCourseID, }); @@ -784,7 +784,7 @@ # course environment for before the course is moved my $ce2 = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, + get_SeedCE($ce), courseName => $courseID, }); @@ -803,7 +803,7 @@ # course environment for after the course is moved my $ce3 = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, + get_SeedCE($ce), courseName => $tmpCourseID, }); @@ -1168,6 +1168,14 @@ } - - +sub get_SeedCE { + my $ce = shift; + warn "get_SeedCE needs current Course environment to create seed CE" unless ref($ce) ; + my %seedCE=(); + my @conf_items = qw( webwork_dir webwork_url pg_dir courseName) ; + foreach my $item (@conf_items) { + $seedCE{$item} = $ce->{$item}; + } + return( %seedCE); +} 1; |
From: Mike G. v. a. <we...@ma...> - 2009-07-23 14:07:52
|
Log Message: ----------- Added buttons with onClick javaScript code that will (1) Check all checkboxes in user list or in homework set list or (2) uncheck all the checkboxes in user list or in homework set list Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetList.pm UserList.pm Revision Data ------------- Index: UserList.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm,v retrieving revision 1.92 retrieving revision 1.93 diff -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -u -r1.92 -r1.93 --- lib/WeBWorK/ContentGenerator/Instructor/UserList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UserList.pm @@ -530,9 +530,27 @@ $i++; } - - print CGI::Tr({}, CGI::td({-colspan=>2, -align=>"center"}, - CGI::submit(-value=>"Take Action!")) + my $selectAll =CGI::input({-type=>'button', -name=>'check_all', -value=>'Select all users', + onClick => "for (i in document.userlist.elements) { + if (document.userlist.elements[i].name =='selected_users') { + document.userlist.elements[i].checked = true + } + }" }); + my $selectNone =CGI::input({-type=>'button', -name=>'check_none', -value=>'Unselect all users', + onClick => "for (i in document.userlist.elements) { + if (document.userlist.elements[i].name =='selected_users') { + document.userlist.elements[i].checked = false + } + }" }); + unless ($editMode or $passwordMode) { + print CGI::Tr({}, CGI::td({ colspan=>2, -align=>"center"}, + $selectAll." ". $selectNone + ) + ); + } + print CGI::Tr({}, CGI::td({ colspan=>2, -align=>"center"}, + CGI::submit(-value=>"Take Action!") + ) ); print CGI::end_table(); @@ -805,6 +823,8 @@ return "Users sorted by $names{$primary}, then by $names{$secondary}, then by $names{$ternary}."; } + + sub edit_form { my ($self, $onChange, %actionParams) = @_; Index: ProblemSetList.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm,v retrieving revision 1.106 retrieving revision 1.107 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -u -r1.106 -r1.107 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm @@ -506,6 +506,24 @@ $i++; } + my $selectAll =CGI::input({-type=>'button', -name=>'check_all', -value=>'Select all sets', + onClick => "for (i in document.problemsetlist.elements) { + if (document.problemsetlist.elements[i].name =='selected_sets') { + document.problemsetlist.elements[i].checked = true + } + }" }); + my $selectNone =CGI::input({-type=>'button', -name=>'check_none', -value=>'Unselect all sets', + onClick => "for (i in document.problemsetlist.elements) { + if (document.problemsetlist.elements[i].name =='selected_sets') { + document.problemsetlist.elements[i].checked = false + } + }" }); + unless ($editMode or $exportMode) { + print CGI::Tr({}, CGI::td({ colspan=>2, -align=>"center"}, + $selectAll." ". $selectNone + ) + ); + } print CGI::Tr({}, CGI::td({-colspan=>2, -align=>"center"}, CGI::submit(-value=>"Take Action!")) ); |
From: Mike G. v. a. <we...@ma...> - 2009-07-22 20:56:50
|
Log Message: ----------- set version number to 2.4.7 Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2: LICENSE README webwork2/lib: WeBWorK.pm Revision Data ------------- Index: README =================================================================== RCS file: /webwork/cvs/system/webwork2/README,v retrieving revision 1.17.4.3.2.4 retrieving revision 1.17.4.3.2.5 diff -LREADME -LREADME -u -r1.17.4.3.2.4 -r1.17.4.3.2.5 --- README +++ README @@ -2,7 +2,7 @@ Online Homework Delivery System Version 2.4.7 Branch: rel-2-4-patches - http://webwork.maa.org/wiki/Release_notes_for_WeBWorK_2.4.5 + http://webwork.maa.org/wiki/Release_notes_for_WeBWorK_2.4.7 Copyright 2000-2007, The WeBWorK Project All rights reserved. Index: LICENSE =================================================================== RCS file: /webwork/cvs/system/webwork2/LICENSE,v retrieving revision 1.6.4.3 retrieving revision 1.6.4.3.2.1 diff -LLICENSE -LLICENSE -u -r1.6.4.3 -r1.6.4.3.2.1 --- LICENSE +++ LICENSE @@ -1,9 +1,9 @@ WeBWorK Online Homework Delivery System - Version 2.4.1 + Version 2.4.7 - Copyright 2000-2007, The WeBWorK Project + Copyright 2000-2009, The WeBWorK Project All rights reserved. This program is free software; you can redistribute it and/or modify Index: WeBWorK.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK.pm,v retrieving revision 1.94.4.5.2.1 retrieving revision 1.94.4.5.2.2 diff -Llib/WeBWorK.pm -Llib/WeBWorK.pm -u -r1.94.4.5.2.1 -r1.94.4.5.2.2 --- lib/WeBWorK.pm +++ lib/WeBWorK.pm @@ -34,7 +34,7 @@ =cut -BEGIN { $main::VERSION = "2.4.5"; } +BEGIN { $main::VERSION = "2.4.7"; } use strict; use warnings; |
From: Mike G. v. a. <we...@ma...> - 2009-07-18 03:08:53
|
Log Message: ----------- Aded effectivePermissionLevel to the PG environment -- the permission level of the effectiveUser, the user to which the question has been assigned. Changed the printing of the path to files in beginproblem() so that it is shown if the effectivePermissionLevel is higher than the "PRINT_FILE_NAMES_PERMISSION_LEVEL" value. This responds to user requests that make it easier for an instructor to print hardcopy for the student. Modified Files: -------------- webwork2/lib/WeBWorK: PG.pm webwork2/lib/WeBWorK/ContentGenerator: Problem.pm Revision Data ------------- Index: PG.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/PG.pm,v retrieving revision 1.75 retrieving revision 1.76 diff -Llib/WeBWorK/PG.pm -Llib/WeBWorK/PG.pm -u -r1.75 -r1.76 --- lib/WeBWorK/PG.pm +++ lib/WeBWorK/PG.pm @@ -118,7 +118,9 @@ $envir{studentLogin} = $user->user_id; $envir{studentName} = $user->first_name . " " . $user->last_name; $envir{studentID} = $user->student_id; - $envir{permissionLevel} = $options->{permissionLevel}; + $envir{permissionLevel} = $options->{permissionLevel}; # permission level of actual user + $envir{effectivePermissionLevel} = $options->{effectivePermissionLevel}; # permission level of user assigned to this question + # Answer Information # REMOVED: refSubmittedAnswers Index: Problem.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm,v retrieving revision 1.217 retrieving revision 1.218 diff -Llib/WeBWorK/ContentGenerator/Problem.pm -Llib/WeBWorK/ContentGenerator/Problem.pm -u -r1.217 -r1.218 --- lib/WeBWorK/ContentGenerator/Problem.pm +++ lib/WeBWorK/ContentGenerator/Problem.pm @@ -610,6 +610,7 @@ refreshMath2img => $will{showHints} || $will{showSolutions}, processAnswers => 1, permissionLevel => $db->getPermissionLevel($userName)->permission, + effectivePermissionLevel => $db->getPermissionLevel($effectiveUserName)->permission, }, ); |
From: Mike G. v. a. <we...@ma...> - 2009-07-18 03:05:34
|
Log Message: ----------- added effectivePermissionLevel to the PG environment -- the permission level of the effectiveUser, the user to which the question has been assigned. Changed the printing of the path to files in beginproblem so that it is shown if the effectivePermissionLevel is higher than the "PRINT_FILE_NAMES_PERMISSION_LEVEL" value. This responds to user requests that make it easier for an instructor to print hardcopy for the student. Modified Files: -------------- pg/macros: PGbasicmacros.pl Revision Data ------------- Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.61 retrieving revision 1.62 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.61 -r1.62 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -1007,7 +1007,7 @@ sub hint { my @in = @_; my $out = ''; - my $permissionLevel = PG_restricted_eval(q!$main::envir{permissionLevel}!); + my $permissionLevel = PG_restricted_eval(q!$main::envir{permissionLevel}!); #user permission level my $PRINT_FILE_NAMES_PERMISSION_LEVEL = (PG_restricted_eval(q!defined( $main::envir{'PRINT_FILE_NAMES_PERMISSION_LEVEL'} )!))? PG_restricted_eval(q!$main::envir{'PRINT_FILE_NAMES_PERMISSION_LEVEL'}!) : 10000; # protect against undefined values my $printHintForInstructor = $permissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL; @@ -1811,11 +1811,11 @@ $points = 'pt' if $problemValue == 1; ## Prepare header for the problem grep($inlist{$_}++,@{ $envir->{'PRINT_FILE_NAMES_FOR'} }); - my $permissionLevel = $envir->{permissionLevel}; + my $effectivePermissionLevel = $envir->{effectivePermissionLevel}; # permission level of user assigned to question my $PRINT_FILE_NAMES_PERMISSION_LEVEL = $envir->{'PRINT_FILE_NAMES_PERMISSION_LEVEL'}; my $studentLogin = $envir->{studentLogin}; my $print_path_name_flag = - (defined($permissionLevel) && defined($PRINT_FILE_NAMES_PERMISSION_LEVEL) && $permissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL) + (defined($effectivePermissionLevel) && defined($PRINT_FILE_NAMES_PERMISSION_LEVEL) && $effectivePermissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL) || ( defined($inlist{ $studentLogin }) and ( $inlist{ $studentLogin }>0 ) ) ; if ( $print_path_name_flag ) { |
From: Mike G. v. a. <we...@ma...> - 2009-07-13 00:10:50
|
Log Message: ----------- Added changes to the save modes: prepend the suggested save string with local add the choice of saving this to a new file and adding it on to the end of the current set. Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: PGProblemEditor.pm Revision Data ------------- Index: PGProblemEditor.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v retrieving revision 1.95 retrieving revision 1.96 diff -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -u -r1.95 -r1.96 --- lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm +++ lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm @@ -32,10 +32,12 @@ use WeBWorK::Utils qw(readFile surePathToFile path_is_subdir); use HTML::Entities; use URI::Escape; -use WeBWorK::Utils; +use WeBWorK::Utils qw(has_aux_files not_blank); use File::Copy; use WeBWorK::Utils::Tasks qw(fake_set fake_problem); + + ########################################################### # This editor will edit problem files or set header files or files, such as course_info # whose name is defined in the global.conf database @@ -186,7 +188,7 @@ # inside saveFileChanges $self->{problemSeed} = $r->param('problemSeed') if (defined $r->param('problemSeed')); # Make sure that the problem seed has some value - $self->{problemSeed} = '123456' unless defined $self->{problemSeed} and $self->{problemSeed} =~/\S/; + $self->{problemSeed} = '123456' unless not_blank($self->{problemSeed}); ############################################################################## ############################################################################# @@ -211,7 +213,7 @@ # # If this has not been defined we are dealing with a set header # or regular problem - if (defined($file_type) and ($file_type =~/\S/)) { #file_type is defined and is not blank + if ( not_blank($file_type) ) { #file_type is defined and is not blank # file type is already defined -- do nothing #warn "file type already defined as $file_type" #FIXME debug } else { @@ -222,7 +224,7 @@ # to the screen. # If the problem number is not zero, we are dealing with a real problem ###################################### - if ( defined($r->param('sourceFilePath') and $r->param('sourceFilePath') =~/\S/) ) { + if ( not_blank($r->param('sourceFilePath') ) ) { $file_type ='source_path_for_problem_file'; $file_type = 'set_header' if $r->param('sourceFilePath') =~ m!/headers/|Header\.pg$!; #FIXME this need to be cleaned up } elsif ( defined($problemNumber) ) { @@ -236,7 +238,7 @@ } } - die "The file_type variable has not been defined or is blank." unless defined($file_type) and $file_type =~/\S/; + die "The file_type variable |$file_type| has not been defined or is blank." unless not_blank($file_type); # clean up sourceFilePath, just in case # double check that sourceFilePath is relative to the templates file if ($file_type eq 'source_path_for_problem_file' ) { @@ -326,7 +328,7 @@ # inside saveFileChanges $self->{problemSeed} = $r->param('problemSeed') if (defined $r->param('problemSeed')); # Make sure that the problem seed has some value - $self->{problemSeed} = '123456' unless defined $self->{problemSeed} and $self->{problemSeed} =~/\S/; + $self->{problemSeed} = '123456' unless not_blank( $self->{problemSeed}); ############################################################################## # Return @@ -460,12 +462,12 @@ # $editFilePath =~ m|([^/]*)Library|; #find the path to the file # my $libraryName = $1; # find the library, if any exists in the path name (first library is picked) -# $libraryName ='rochester' unless defined($libraryName) and $libraryName =~/\S/; # default library +# $libraryName ='rochester' unless not_blank($libraryName) ; # default library my $libraryName = ''; if ($editFilePath =~ m|([^/]*)Library|) { #find the path to the file # find the library, if any exists in the path name (first library is picked) my $tempLibraryName = $1; - $libraryName = ( defined($tempLibraryName) and $tempLibraryName =~/\S/ ) ? + $libraryName = ( not_blank($tempLibraryName) ) ? $tempLibraryName : "Library"; # things that start /Library/setFoo/probBar are labeled as component "Library" # which refers to the SQL based problem library. (is nationalLibrary a better name?) @@ -538,7 +540,7 @@ my $uri = $r->uri; my $edit_level = $r->param('edit_level') || 0; - my $force_field = (defined($self->{sourceFilePath}) and $self->{sourceFilePath} ne "") ? + my $force_field = (not_blank( $self->{sourceFilePath}) ) ? # path is a non-blank string CGI::hidden(-name=>'sourceFilePath', -default=>$self->{sourceFilePath}) : ''; @@ -919,7 +921,7 @@ $self->addgoodmessage("the original path to the file is $forcedSourceFile"); #FIXME debug } # bail if no source path for the problem is found ; - die "Cannot find a file path to save to" unless( defined($forcedSourceFile) and ($forcedSourceFile =~ /\S/) ); + die "Cannot find a file path to save to" unless( not_blank($forcedSourceFile) ); $self->{problemSeed} = 1234; $editFilePath .= '/' . $forcedSourceFile; last CASE; @@ -968,14 +970,14 @@ my $r = $self->r; my $ce = $r->ce; - my $action = $self->{action}||'no action'; + my $action = $self->{action}||'no action'; # my $editFilePath = $self->{editFilePath}; # not used?? - my $sourceFilePath = $self->{sourceFilePath}; - my $tempFilePath = $self->{tempFilePath}; + my $sourceFilePath = $self->{sourceFilePath}; + my $tempFilePath = $self->{tempFilePath}; if (defined($problemContents) and ref($problemContents) ) { $problemContents = ${$problemContents}; - } elsif( not defined($problemContents) or $problemContents =~/\S/ ) { + } elsif( ! not_blank($problemContents) ) { # if the problemContents is undefined or empty $problemContents = ${$self->{r_problemContents}}; } ############################################################################## @@ -985,7 +987,7 @@ ############################################################################## - unless (defined($outputFilePath) and $outputFilePath =~/\S/ ) { + unless (not_blank($outputFilePath) ) { $self->addbadmessage("You must specify an file name in order to save a new file."); return ""; } @@ -999,7 +1001,7 @@ ############################################################################## my $writeFileErrors; - if ( defined($outputFilePath) and $outputFilePath =~/\S/ ) { # save file + if ( not_blank($outputFilePath) ) { # save file # Handle the problem of line endings. # Make sure that all of the line endings are of unix type. # Convert \r\n to \n @@ -1060,12 +1062,8 @@ # If things have worked so far determine if the file might be accompanied by auxiliary files # a path ending in foo/foo.pg is assumed to contain auxilliary files # - my $auxiliaryFilesExist = 0; - if (defined($outputFilePath) and $outputFilePath) { - my ($dir, $prob) = $outputFilePath =~ m|([^/]+)/([^/]+)\.pg$|; # must be a problem file ending in .pg - $auxiliaryFilesExist = 1 if (defined($dir) and defined ($prob) and $dir eq $prob); - } - + my $auxiliaryFilesExist = has_aux_files($outputFilePath); + if ($auxiliaryFilesExist and not $do_not_save ) { my $sourceDirectory = $sourceFilePath; my $outputDirectory = $outputFilePath; @@ -1086,7 +1084,7 @@ #warn "copied from $fromPath to $toPath"; #warn "files are different ",system("diff $fromPath $toPath"); } - $self->addbadmessage($writeFileErrors) if defined($writeFileErrors) and $writeFileErrors; + $self->addbadmessage($writeFileErrors) if not_blank($writeFileErrors); } @@ -1215,8 +1213,7 @@ if ( defined($globalSet) && $globalSet->assignment_type =~ /gateway/ ) { $problemPage = $self->r->urlpath->newFromModule("WeBWorK::ContentGenerator::GatewayQuiz", courseID => $courseName, setID => "Undefined_Set"); - # courseID => $courseName, setID => $fullSetName); - } else { + } else { $problemPage = $self->r->urlpath->newFromModule("WeBWorK::ContentGenerator::Problem", courseID => $courseName, setID => $setName, problemID => $problemNumber ); @@ -1573,43 +1570,42 @@ -sub make_local_copy_form { - my ($self, $genericParams, $actionParams, $tableParams) = @_; - my $editFilePath = $self->{editFilePath}; # path to the permanent file to be edited - #warn "editFilePath $editFilePath inputFilePath",$self->{inputFilePath}; - return "" unless -e $editFilePath; - return "" if -w $editFilePath; - return "" unless $self->{file_type} eq 'problem' # need problem structure to make local copy in most cases - or $self->{file_type} eq 'blank_problem' # $editFilePath eq $self->r->cr->{webworkFiles}{screenSnippets}{blankProblem} - or $self->{file_type} eq 'set_header' # $editFilePath eq $self->r->ce->{webworkFiles}->{hardcopySnippets}->{setHeader} # special case to make copy of screen header - or $self->{file_type} eq 'hardcopy_header'; # $editFilePath eq $self->r->ce->{webworkFiles}->{screenSnippets}->{setHeader} ; # special case to make copy of hardcopy header - # or $self->{file_type} eq 'source_path_for_problem_file'; # need setID and problemID to make local copy -- can't be done in this case. - # make sure setID is well defined before allowing local copy - my $setID = $self->{setID}; - my $probNum = ($self->{file_type} eq 'problem')? "/problem $self->{problemID}" : ""; - return "" unless defined($setID) && $setID =~ m/\S/ && $setID ne 'Undefined_Set'; - - return join ("", - "Save local editable copy as: [TMPL]/".($self->determineLocalFilePath($editFilePath)).CGI::br()." and use in ".CGI::b("set $setID$probNum"), - CGI::hidden(-name=>'action.make_local_copy.target_file', -value=>$self->determineLocalFilePath($editFilePath) ), - CGI::hidden(-name=>'action.make_local_copy.source_file', -value=>$editFilePath ), - CGI::hidden(-name=>'action.make_local_copy.file_type',-value=>$self->{file_type}), - CGI::hidden(-name=>'action.make_local_copy.saveMode',-value=>'rename') - ); - -} - - -sub make_local_copy_handler { - my ($self, $genericParams, $actionParams, $tableParams) = @_; - foreach my $key (qw(target_file file_type saveMode source_file)) { - $actionParams->{"action.save_as.$key"}->[0] = $actionParams->{"action.make_local_copy.$key"}->[0]; - #warn "action.make_local_copy.$key", @{$actionParams->{"action.make_local_copy.$key"}} - } - save_as_handler($self, $genericParams, $actionParams, $tableParams); - - -} +# sub make_local_copy_form { +# my ($self, $genericParams, $actionParams, $tableParams) = @_; +# my $editFilePath = $self->{editFilePath}; # path to the permanent file to be edited +# #warn "editFilePath $editFilePath inputFilePath",$self->{inputFilePath}; +# return "" unless -e $editFilePath; +# return "" if -w $editFilePath; +# return "" unless $self->{file_type} eq 'problem' # need problem structure to make local copy in most cases +# or $self->{file_type} eq 'blank_problem' # $editFilePath eq $self->r->cr->{webworkFiles}{screenSnippets}{blankProblem} +# or $self->{file_type} eq 'set_header' # $editFilePath eq $self->r->ce->{webworkFiles}->{hardcopySnippets}->{setHeader} # special case to make copy of screen header +# or $self->{file_type} eq 'hardcopy_header'; # $editFilePath eq $self->r->ce->{webworkFiles}->{screenSnippets}->{setHeader} ; # special case to make copy of hardcopy header +# # or $self->{file_type} eq 'source_path_for_problem_file'; # need setID and problemID to make local copy -- can't be done in this case. +# # make sure setID is well defined before allowing local copy +# my $setID = $self->{setID}; +# my $probNum = ($self->{file_type} eq 'problem')? "/problem $self->{problemID}" : ""; +# return "" unless not_blank($setID) && $setID ne 'Undefined_Set'; +# +# return join ("", +# "Save local editable copy as: [TMPL]/".($self->determineLocalFilePath($editFilePath)).CGI::br()." and use in ".CGI::b("set $setID$probNum"), +# CGI::hidden(-name=>'action.make_local_copy.target_file', -value=>$self->determineLocalFilePath($editFilePath) ), +# CGI::hidden(-name=>'action.make_local_copy.source_file', -value=>$editFilePath ), +# CGI::hidden(-name=>'action.make_local_copy.file_type',-value=>$self->{file_type}), +# CGI::hidden(-name=>'action.make_local_copy.saveMode',-value=>'rename') +# ); +# } +# +# +# sub make_local_copy_handler { +# my ($self, $genericParams, $actionParams, $tableParams) = @_; +# foreach my $key (qw(target_file file_type saveMode source_file)) { +# $actionParams->{"action.save_as.$key"}->[0] = $actionParams->{"action.make_local_copy.$key"}->[0]; +# #warn "action.make_local_copy.$key", @{$actionParams->{"action.make_local_copy.$key"}} +# } +# save_as_handler($self, $genericParams, $actionParams, $tableParams); +# +# +# } sub save_as_form { # calls the save_as_handler my ($self, $onChange, %actionParams) = @_; my $editFilePath = $self->{editFilePath}; @@ -1623,39 +1619,66 @@ my $shortFilePath = $editFilePath; $shortFilePath =~ s|^$templatesDir/||; - $shortFilePath =~ s|^.*/|| if $shortFilePath =~ m|^/|; # if it is still an absolute path don't suggest that you save to it. + $shortFilePath = 'local/'.$shortFilePath unless( $shortFilePath =~m|^local/|); # suggest that modifications be saved to the "local" subdirectory + $shortFilePath =~ s|^.*/|| if $shortFilePath =~ m|^/|; # if it is still an absolute path don't suggest a file path to save to. -### --- old menu-based apparoach --- -# my $allowedActions = (defined($setID) && $setID =~/\S/ && $setID ne 'Undefined_Set') ? ['save_a_copy','rename' ] : ['save_a_copy']; - -# return CGI::popup_menu( -# -name=>'action.save_as.saveMode', -values=>$allowedActions, -# -default=>'rename',-labels=>{save_a_copy=>'Create a copy of file at ', rename=>'Rename file path to'}, -# -onmousedown=>$onChange -# ). " [TMPL]/". -### my $probNum = ($self->{file_type} eq 'problem')? "/problem $self->{problemID}" : ""; my $andRelink = ''; - $andRelink = CGI::br().' and '.CGI::checkbox( - -name => "action.save_as.saveMode", - -value => "rename", - -label => "", - -checked => 1, - -onclick=>$onChange - ). - " use in ".CGI::b("set $fullSetID$probNum") - if defined($setID) && $setID =~ m/\S/ && $setID ne 'Undefined_Set' && - $self->{file_type} ne 'blank_problem'; +# $andRelink = CGI::br().' and '.CGI::checkbox( +# -name => "action.save_as.saveMode", +# -value => "rename", +# -label => "", +# -checked => 1, +# -onclick=>$onChange +# ). +# " use in ".CGI::b("set $fullSetID$probNum") +# if not_blank($setID) && $setID ne 'Undefined_Set' && +# $self->{file_type} ne 'blank_problem'; + + my $can_add_problem_to_set = not_blank($setID) && $setID ne 'Undefined_Set' && $self->{file_type} ne 'blank_problem'; + # don't addor replace problems to sets if the set is the Undefined_Set or if the problem is the blank_problem. + + my $replace_problem_in_set = ($can_add_problem_to_set)? + CGI::input({ + -type => 'radio', + -name => "action.save_as.saveMode", + -value => "rename", + -label => '', + },"and replace ".CGI::b("set $fullSetID$probNum").',') : '' + ; + my $add_problem_to_set = ($can_add_problem_to_set)? + CGI::input({ + -type => 'radio', + -name => "action.save_as.saveMode", + -value => 'add_to_set_as_new_problem', + -label => '', + -onfocus => $onChange, + },"and append to end of set $fullSetID",) : '' + ; + my $rh_new_problem_options = { + -type => 'radio', + -name => "action.save_as.saveMode", + -value => "new_independent_problem.", + -onfocus => $onChange, + }; + $rh_new_problem_options->{checked}=1 unless $can_add_problem_to_set; + my $create_new_problem = CGI::input($rh_new_problem_options,"as a new independent problem"); + + $andRelink = CGI::br(). $replace_problem_in_set . $add_problem_to_set . $create_new_problem; + return 'Save as [TMPL]/'. CGI::textfield( - -name=>'action.save_as.target_file', -size=>60, -value=>"$shortFilePath", #FIXME -- you might not be able to save to this default filepath + -name=>'action.save_as.target_file', -size=>60, -value=>"$shortFilePath", -onfocus=>$onChange - ). + ).",". CGI::hidden(-name=>'action.save_as.source_file', -value=>$editFilePath ). CGI::hidden(-name=>'action.save_as.file_type',-value=>$self->{file_type}). $andRelink; } +# suggestions for improvement +# save as ...... +# ¥replacing foobar (rename) ¥ and add to set (add_new_problem) ¥ as an independent file (new_independent_problem) sub save_as_handler { my ($self, $genericParams, $actionParams, $tableParams) = @_; @@ -1670,7 +1693,7 @@ my $effectiveUserName = $self->r->param('effectiveUser'); my $do_not_save = 0; - my $saveMode = $actionParams->{'action.save_as.saveMode'}->[0] || 'save_a_copy'; + my $saveMode = $actionParams->{'action.save_as.saveMode'}->[0] || 'no_save_mode_selected'; my $new_file_name = $actionParams->{'action.save_as.target_file'}->[0] || ''; my $sourceFilePath = $actionParams->{'action.save_as.source_file'}->[0] || ''; my $file_type = $actionParams->{'action.save_as.file_type'}->[0] || ''; @@ -1760,7 +1783,16 @@ $self->addbadmessage("Unable to change the source file path for set $fullSetName, problem $problemNumber. Unknown error."); } } - } elsif ($saveMode eq 'save_a_copy') { + } elsif ($saveMode eq 'add_to_set_as_new_problem') { + my $targetProblemNumber = 1+ WeBWorK::Utils::max( $self->r->db->listGlobalProblems($setName)); + my $problemRecord = $self->addProblemToSet( + setName => $setName, + sourceFile => $new_file_name, + problemID => $targetProblemNumber, #added to end of set + ); + $self->assignProblemToAllSetUsers($problemRecord); + $self->addgoodmessage("Added $new_file_name to ". $setName. " as problem $targetProblemNumber") ; + } elsif ($saveMode eq 'new_independent_problem') { ################################################# # Don't modify source file path in problem -- just report ################################################# @@ -1782,7 +1814,8 @@ ################################################# my $problemPage; my $new_file_type; - if ($saveMode eq 'save_a_copy' ) { + + if ($saveMode eq 'new_independent_problem' ) { $problemPage = $self->r->urlpath->newFromModule("WeBWorK::ContentGenerator::Instructor::PGProblemEditor", courseID => $courseName, setID => 'Undefined_Set', problemID => 'Undefined_Set' ); @@ -1792,9 +1825,15 @@ courseID => $courseName, setID => $setName, problemID => $problemNumber ); $new_file_type = $file_type; + } elsif ($saveMode eq 'add_to_set_as_new_problem') { + $problemPage = $self->r->urlpath->newFromModule("WeBWorK::ContentGenerator::Instructor::PGProblemEditor", + courseID => $courseName, setID => $setName, problemID => $problemNumber + ); + $new_file_type = $file_type; } else { - $self->addbadmessage("Don't recognize saveMode: |$saveMode|. Unknown error."); - die "Don't recognize saveMode: |$saveMode|. Unknown error." + $self->addbadmessage(" Please use radio buttons to choose the method for saving this file. Can't recognize saveMode: |$saveMode|."); + # can't continue since paths have not been properly defined. + return ""; } #warn "save mode is $saveMode"; @@ -1813,7 +1852,7 @@ ); $self->reply_with_redirect($viewURL); -return ""; # no redirect needed + return ""; # no redirect needed } sub revert_form { my ($self, $onChange, %actionParams) = @_; @@ -1843,122 +1882,4 @@ -# sub make_local_copy_handler { -# my ($self, $genericParams, $actionParams, $tableParams) = @_; -# #$self->addgoodmessage("make_local_copy_handler called"); -# -# my $courseName = $self->{courseID}; -# my $setName = $self->{setID}; -# my $problemNumber = $self->{problemID}; -# -# my $displayMode = $self->{displayMode}; -# my $problemSeed = $self->{problemSeed}; -# my $do_not_save = 0; #error flag -# -# my $new_file_name = $actionParams->{'action.make_local_copy.target_file'}->[0] || ''; -# my $sourceFilePath = $actionParams->{'action.make_local_copy.source_file'}->[0] || ''; -# my $file_type = $actionParams->{'action.make_local_copy.file_type'}->[0] ||''; -# -# my $templatesPath = $self->r->ce->{courseDirs}->{templates}; -# $sourceFilePath =~ s|^$templatesPath/||; # make sure path relative to templates directory -# -# if ( $new_file_name !~ /\S/) { # need a non-blank file name -# # setting $self->{failure} stops saving and any redirects -# $do_not_save = 1; -# #warn "new file name is $new_file_name"; -# $self->addbadmessage(CGI::p("Error: File to save to not specified.")); -# } -# -# ################################################# -# # grab the problemContents from the form in order to save it to a new permanent file -# # later we will unlink (delete) the current temporary file -# ################################################# -# -# my $problemContents = fixProblemContents($self->r->param('problemContents')); -# $self->{r_problemContents} = \$problemContents; -# warn "problem contents is empty" unless $problemContents; -# ################################################# -# # Construct the output file path -# ################################################# -# my $outputFilePath = $self->r->ce->{courseDirs}->{templates} . '/' . -# $new_file_name; -# if (defined $outputFilePath and -e $outputFilePath) { -# # setting $do_not_save stops saving and any redirects -# $do_not_save = 1; -# $self->addbadmessage(CGI::p("File '".$self->shortPath($outputFilePath)."' exists. -# File not saved. No changes have been made. -# You can change the file path for this problem manually from the 'Hmwk Sets Editor' page")); -# } else { -# #$self->addgoodmessage("Saving to file '".$self->shortPath($outputFilePath)."'."); -# } -# -# unless ($do_not_save ) { -# $self->saveFileChanges($outputFilePath); -# ################################################# -# # Modify source file in problem -# ################################################# -# if ($file_type eq 'set_header') { -# my $setRecord = $self->r->db->getGlobalSet($setName); -# $setRecord->set_header($new_file_name); -# if ($self->r->db->putGlobalSet($setRecord)) { -# $self->addgoodmessage("The set header for set $setName has been renamed to '".$self->shortPath($outputFilePath)."'.") ; -# } else { -# $self->addbadmessage("Unable to change the header for set $setName. Unknown error."); -# } -# } else { -# my $problemRecord = $self->r->db->getGlobalProblem($setName,$problemNumber); -# $problemRecord->source_file($new_file_name); -# if ( $self->r->db->putGlobalProblem($problemRecord) ) { -# $self->addgoodmessage("The current source file for problem $problemNumber has been renamed to '".$self->shortPath($outputFilePath)."'.") ; -# } else { -# $self->addbadmessage("Unable to change the source file path for set $setName, problem $problemNumber. Unknown error."); -# } -# } -# -# } -# my $edit_level = $self->r->param("edit_level") || 0; -# $edit_level++; -# ################################################# -# # Set up redirect -# ################################################# -# -# my $problemPage = $self->r->urlpath->newFromModule("WeBWorK::ContentGenerator::Instructor::PGProblemEditor", -# courseID => $courseName, setID => $setName, problemID => $problemNumber -# ); -# my $viewURL = $self->systemLink($problemPage, -# params=>{ -# sourceFilePath => $new_file_name, -# edit_level => $edit_level, -# file_type => $self->{file_type}, -# status_message => uri_escape($self->{status_message}) -# -# } -# ); -# $self->reply_with_redirect($viewURL); -# } - -# sub rename_form { # see the save_as form -# # my ($self, $onChange, %actionParams) = @_; -# # my $problemPath = $self->{editFilePath}; -# # my $templatesDir = $self->r->ce->{courseDirs}->{templates}; -# # #warn "problemPath $problemPath $templatesDir"; -# # $problemPath =~ s|^$templatesDir/||; -# # $problemPath = '' if $problemPath =~ m|^/|; # if it is still an absolute path don't suggest that you save to it. -# # $self->addbadmessage("problem Path is $problemPath"); -# # return join("", -# # "Rename problem file to : [TMPL]/".CGI::textfield(-name=>'action.rename.target_file', -size=>40, -value=>$problemPath), -# # CGI::hidden(-name=>'action.make_local_copy.source_file', -value=>$self->{editFilePath} ), -# # ); -# -# -# } - -# sub rename_handler { -# my ($self, $genericParams, $actionParams, $tableParams) = @_; -# $actionParams->{'action.make_local_copy.target_file'}->[0] = $actionParams->{'action.rename.target_file'}->[0]; -# make_local_copy_handler($self, $genericParams, $actionParams, $tableParams); -# } - - - 1; |
From: Mike G. v. a. <we...@ma...> - 2009-07-13 00:08:27
|
Log Message: ----------- Changed how errors are caught in methodDefined() to prevent unneeded error messages in firefox Made cosmetic corrections to how error messages are reported. Modified Files: -------------- webwork2/htdocs/js: ww_applet_support.js Revision Data ------------- Index: ww_applet_support.js =================================================================== RCS file: /webwork/cvs/system/webwork2/htdocs/js/ww_applet_support.js,v retrieving revision 1.11 retrieving revision 1.12 diff -Lhtdocs/js/ww_applet_support.js -Lhtdocs/js/ww_applet_support.js -u -r1.11 -r1.12 --- htdocs/js/ww_applet_support.js +++ htdocs/js/ww_applet_support.js @@ -189,11 +189,11 @@ return(true); } else { this.debug_add("Method " + methodName + " is not defined in " + appletName); - return(false); + throw("undefined applet method"); } } catch(e) { - var msg = "Error in accessing " + methodName + " in applet " +appletName + "Error: " +e ; - alert(msg); + var msg = "Error in accessing " + methodName + " in applet " +appletName + "\n *Error: " +e ; + this.debug_add(msg); } return(false); } @@ -239,7 +239,7 @@ if (this.methodDefined(getConfigAlias) ) { alert( applet[getConfigAlias]() ); } else { - alert("in getConfig " + debugText); + this.debug_add(" unable to execute " + appletName +"."+ getConfigAlias +"( " + this.configuration + " ) " ); } } catch(e) { var msg = " Error in getting configuration from applet " + appletName + " " + e; @@ -263,10 +263,10 @@ var applet = getApplet(appletName); var setStateAlias = this.setStateAlias; - debug_add("\n++++++++++++++++++++++++++++++++++++++++\nBegin process of setting state for applet " + appletName); + this.debug_add("\n++++++++++++++++++++++++++++++++++++++++\nBegin process of setting state for applet " + appletName); if (state) { - debug_add("Obtain state from calling parameter:\n " + state + "\n"); + this.debug_add("Obtain state from calling parameter:\n " + state + "\n"); } else { this.debug_add("Obtain state from " + appletName +"_state"); @@ -319,7 +319,7 @@ try { if (this.methodDefined(getStateAlias)) { // there may be no state function state = applet[getStateAlias](); // get state in xml format - debug_add(" state has type " + typeof(state)); + this.debug_add(" state has type " + typeof(state)); state = String(state); // geogebra returned an object type instead of a string type // this insures that we can view the state as a string this.debug_add(" state converted to type " + typeof(state)); @@ -424,15 +424,15 @@ if (this.debugMode==0 && this.isReady) {return(1)}; // memorize readiness in non-debug mode - this.debug_add("Test 4 methods to see if the applet " + appletName + " has been loaded: \n"); + this.debug_add("*Test 4 methods to see if the applet " + appletName + " has been loaded: \n"); try { if ( this.methodDefined(this.setConfigAlias) ) { ready = 1; } } catch(e) { - var msg = "Unable to find set configuration command in applet " + appletName; - alert(msg); + var msg = "*Unable to find setConfig command in applet " + appletName+ "\n" +e; + this.debug_add(msg); } try { @@ -440,13 +440,13 @@ ready =1; } } catch(e) { - var msg = "Unable to set State command in applet " + appletName; - alert(msg); + var msg = "*Unable to setState command in applet " + appletName + "\n" +e; + this.debug_add(msg); } if (typeof(this.reportsLoaded) !="undefined" && this.reportsLoaded != 0 ) { - this.debug_add( " " + appletName + " applet self reports that it has completed loading. " ); + this.debug_add( " *" + appletName + " applet self reports that it has completed loading. " ); ready =1; } @@ -455,10 +455,10 @@ if ( this.methodDefined("isActive") ) { if (applet.isActive()) { //this could be zero if applet is loaded, but it is loading auxiliary data. - this.debug_add( "Applet " +appletName + " signals it is active."); + this.debug_add( "*Applet " +appletName + " signals it is active.\n"); ready =1; } else { - this.debug_add( "Applet " + appletName + " signals it is not active. -- \n it may still be loading data."); + this.debug_add( "*Applet " + appletName + " signals it is not active. -- \n it may still be loading data.\n"); ready = "still_loading"; } } @@ -475,15 +475,15 @@ //alert("begin safe_applet_initialize"); var appletName = this.appletName; i--; - this.debug_add(" Try to initialize applet " + appletName + ". Count down: " + i + ".\n" ); + this.debug_add("* Try to initialize applet " + appletName + ". Count down: " + i + ".\n" ); //alert("1 jsDebugMode " + jsDebugMode + " applet debugMode " +this.debugMode); - + this.debug_add("entering checkLoaded subroutine"); var applet_loaded = this.checkLoaded(); - + this.debug_add("returning from checkLoaded subroutine with result " +applet_loaded); if (applet_loaded=="still_loading" && !(i> 0) ) { // it's possible that the isActive() response of the applet is not working properly - alert("The isActive() method of applet " +appletName + " claims it is still loading! We'll ignore this."); + alert("*The isActive() method of applet " +appletName + " reports it is still loading! We'll ignore this.\n"); i=1; applet_loaded=1; } else if (applet_loaded=="still_loading") { @@ -492,7 +492,7 @@ if ( 0 < i && !applet_loaded ) { // wait until applet is loaded - this.debug_add("Applet " + appletName + " is not yet ready try again\n"); + this.debug_add("*Applet " + appletName + " is not yet ready try again\n"); if (this.debugMode>=2) { alert(debugText ); debugText=""; @@ -502,18 +502,21 @@ this.debug_add(" applet is ready = " + applet_loaded ); - this.debug_add("Applet "+ appletName + " initialization completed\n with " + i + this.debug_add("*Applet "+ appletName + " initialization completed\n with " + i + " possible attempts remaining. \n" + "------------------------------\n"); - + if (this.debugMode>=2) { + alert(debugText ); + debugText=""; + } // in-line handler -- configure and initialize //alert("setDebug") try{ this.setDebug((this.debugMode) ? 1:0); - } catch(e) { - var msg = "Unable set debug in " + appletName + " \n " +e; + } catch(e2) { + var msg = "*Unable set debug in " + appletName + " \n " +e2; if (this.debugMode>=2) {this.debug_add(msg);} else {alert(msg)}; } @@ -522,8 +525,8 @@ this.setConfig(); // for applets that require a configuration (which doesn't change for a given WW question - } catch(e) { - var msg = "Unable to configure " + appletName + " \n " +e; + } catch(e4) { + var msg = "*Unable to configure " + appletName + " \n " +e4; if (this.debugMode>=2) {this.debug_add(msg);} else {alert(msg)}; } @@ -534,7 +537,7 @@ this.initializeAction(); // this is often the setState action. } catch(e) { - var msg = "unable to initialize " + appletName + " \n " +e; + var msg = "*unable to initialize " + appletName + " \n " +e; if (this.debugMode>=2) { this.debug_add(msg); } else { @@ -542,11 +545,11 @@ } } if (this.debugMode>=2) { - alert("\nBegin debugmode\n " + debugText ); + alert("\n*Begin debugmode\n " + debugText ); debugText=""; }; } else { - this.debug_add("Error: timed out waiting for applet " +appletName + " to load"); + this.debug_add("*Error: timed out waiting for applet " +appletName + " to load"); //alert("4 jsDebugMode " + jsDebugMode + " applet debugMode " +ww_applet.debugMode + " local debugMode " +debugMode); if (this.debugMode>=2) { alert(" in safe applet " + debugText ); |
From: Mike G. v. a. <we...@ma...> - 2009-07-13 00:07:59
|
Log Message: ----------- Added id tags to most HTML entities defined in PGbasicmacros.pl Modified Files: -------------- pg/macros: PGbasicmacros.pl Revision Data ------------- Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.60 retrieving revision 1.61 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.60 -r1.61 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -311,7 +311,7 @@ MODES( TeX => "\\mbox{\\parbox[t]{${tcol}ex}{\\hrulefill}}", Latex2HTML => qq!\\begin{rawhtml}<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\\end{rawhtml}!, - HTML => qq!<INPUT TYPE=TEXT SIZE=$col NAME="$name" VALUE="$answer_value">!. + HTML => qq!<INPUT TYPE=TEXT SIZE=$col NAME="$name" id="$name" VALUE="$answer_value">!. qq!<INPUT TYPE=HIDDEN NAME="previous_$name" VALUE="$answer_value">! ); } @@ -369,8 +369,8 @@ $tcol = $tcol < 40 ? $tcol : 40; ## get min MODES( TeX => "\\mbox{\\parbox[t]{${tcol}ex}{\\hrulefill}}", - Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\n\\end{rawhtml}\n!, - HTML => qq!<INPUT TYPE=TEXT SIZE=$col NAME = "$name" VALUE = "$answer_value">!. + Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=TEXT SIZE=$col NAME="$name" id="$name" VALUE = " ">\n\\end{rawhtml}\n!, + HTML => qq!<INPUT TYPE=TEXT SIZE=$col NAME = "$name" id="$name" VALUE = "$answer_value">!. qq!<INPUT TYPE=HIDDEN NAME="previous_$name" VALUE = "$answer_value">! ); } @@ -391,11 +391,11 @@ my $answer_value = ''; $answer_value = $inputs_ref->{$name} if defined( $inputs_ref->{$name} ); # $answer_value =~ tr/\\$@`//d; #`## make sure student answers can not be interpolated by e.g. EV3 - my $out = M3( - qq!\\vskip $height in \\hrulefill\\quad !, - qq!\\begin{rawhtml}<TEXTAREA NAME="$name" ROWS="$row" COLS="$col" + my $out = MODES( + TeX => qq!\\vskip $height in \\hrulefill\\quad !, + Latex2HTML => qq!\\begin{rawhtml}<TEXTAREA NAME="$name" id="$name" ROWS="$row" COLS="$col" WRAP="VIRTUAL">$answer_value</TEXTAREA>\\end{rawhtml}!, - qq!<TEXTAREA NAME="$name" ROWS="$row" COLS="$col" + HTML => qq!<TEXTAREA NAME="$name" id="$name" ROWS="$row" COLS="$col" WRAP="VIRTUAL">$answer_value</TEXTAREA> <INPUT TYPE=HIDDEN NAME="previous_$name" VALUE = "$answer_value"> ! @@ -430,8 +430,8 @@ MODES( TeX => qq!\\item{$tag}\n!, - Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=RADIO NAME="$name" VALUE="$value" $checked>\\end{rawhtml}$tag!, - HTML => qq!<INPUT TYPE=RADIO NAME="$name" VALUE="$value" $checked>$tag! + Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=RADIO NAME="$name" id="$name" VALUE="$value" $checked>\\end{rawhtml}$tag!, + HTML => qq!<INPUT TYPE=RADIO NAME="$name" id="$name" VALUE="$value" $checked>$tag! ); } @@ -462,8 +462,8 @@ MODES( TeX => qq!\\item{$tag}\n!, - Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=RADIO NAME="$name" VALUE="$value" $checked>\\end{rawhtml}$tag!, - HTML => qq!<INPUT TYPE=RADIO NAME="$name" VALUE="$value" $checked>$tag! + Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=RADIO NAME="$name" id="$name" VALUE="$value" $checked>\\end{rawhtml}$tag!, + HTML => qq!<INPUT TYPE=RADIO NAME="$name" id="$name" VALUE="$value" $checked>$tag! ); } @@ -573,8 +573,8 @@ MODES( TeX => qq!\\item{$tag}\n!, - Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=CHECKBOX NAME="$name" VALUE="$value" $checked>\\end{rawhtml}$tag!, - HTML => qq!<INPUT TYPE=CHECKBOX NAME="$name" VALUE="$value" $checked>$tag! + Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=CHECKBOX NAME="$name" id="$name" VALUE="$value" $checked>\\end{rawhtml}$tag!, + HTML => qq!<INPUT TYPE=CHECKBOX NAME="$name" id="$name" VALUE="$value" $checked>$tag! ); } @@ -602,8 +602,8 @@ MODES( TeX => qq!\\item{$tag}\n!, - Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=CHECKBOX NAME="$name" VALUE="$value" $checked>\\end{rawhtml}$tag!, - HTML => qq!<INPUT TYPE=CHECKBOX NAME="$name" VALUE="$value" $checked>$tag! + Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=CHECKBOX NAME="$name" id="$name" VALUE="$value" $checked>\\end{rawhtml}$tag!, + HTML => qq!<INPUT TYPE=CHECKBOX NAME="$name" id="$name" VALUE="$value" $checked>$tag! ); } @@ -795,7 +795,7 @@ if ($displayMode eq 'HTML' or $displayMode eq 'HTML_tth' or $displayMode eq 'HTML_dpng' or $displayMode eq 'HTML_img' or $displayMode eq 'HTML_jsMath' or $displayMode eq 'HTML_asciimath' or $displayMode eq 'HTML_LaTeXMathML') { - $out = qq!<SELECT NAME = "$name" SIZE=1> \n!; + $out = qq!<SELECT NAME = "$name" id="$name" SIZE=1> \n!; my $i; foreach ($i=0; $i< @list; $i=$i+2) { my $select_flag = ($list[$i] eq $answer_value) ? "SELECTED" : ""; @@ -803,7 +803,7 @@ }; $out .= " </SELECT>\n"; } elsif ( $displayMode eq "Latex2HTML") { - $out = qq! \\begin{rawhtml}<SELECT NAME = "$name" SIZE=1> \\end{rawhtml} \n !; + $out = qq! \\begin{rawhtml}<SELECT NAME = "$name" id="$name" SIZE=1> \\end{rawhtml} \n !; my $i; foreach ($i=0; $i< @list; $i=$i+2) { my $select_flag = ($list[$i] eq $answer_value) ? "SELECTED" : ""; @@ -887,8 +887,8 @@ $answer_value =~ tr/\\$@`//d; #`## make sure student answers can not be interpolated by e.g. EV3 MODES( TeX => "\\mbox{\\parbox[t]{10pt}{\\hrulefill}}\\hrulefill\\quad ", - Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\n\\end{rawhtml}\n!, - HTML => "<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"$answer_value\">\n" + Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=TEXT SIZE=$col NAME="$name" id="$name" VALUE = "">\n\\end{rawhtml}\n!, + HTML => qq!<INPUT TYPE=TEXT SIZE=$col NAME="$name" id="$name" VALUE = "$answer_value">\n! ); } |
From: Mike G. v. a. <we...@ma...> - 2009-07-13 00:07:31
|
Log Message: ----------- defined not_blank() subroutine to check that string exists and is not blank. Modified Files: -------------- webwork2/lib/WeBWorK: Utils.pm Revision Data ------------- Index: Utils.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils.pm,v retrieving revision 1.82 retrieving revision 1.83 diff -Llib/WeBWorK/Utils.pm -Llib/WeBWorK/Utils.pm -u -r1.82 -r1.83 --- lib/WeBWorK/Utils.pm +++ lib/WeBWorK/Utils.pm @@ -62,11 +62,13 @@ encodeAnswers fisher_yates_shuffle formatDateTime + has_aux_files intDateTime list2hash listFilesRecursive makeTempDirectory max + not_blank parseDateTime path_is_subdir pretty_print_rh @@ -895,6 +897,7 @@ map { defined $_ ? $_ : $_[0] } @_[1..$#_]; } + # shuffle an array in place # Perl Cookbook, Recipe 4.17. Randomizing an Array sub fisher_yates_shuffle { @@ -1000,6 +1003,30 @@ return map{$itemsByIndex{$_}} @sKeys; } +################################################################################ +# Validate strings and labels +################################################################################ +sub not_blank ($) { # check that a string exists and is not blank + my $str = shift; + return( defined($str) and $str =~/\S/ ); +} + +########################################################### + # If things have worked so far determine if the file might be accompanied by auxiliary files + + # +sub has_aux_files ($) { # determine whether a question has auxiliary files + # a path ending in foo/foo.pg is assumed to contain auxilliary files + my $path = shift; + if ( not_blank($path) ) { + my ($dir, $prob) = $path =~ m|([^/]+)/([^/]+)\.pg$|; # must be a problem file ending in .pg + return 1 if (defined($dir) and defined ($prob) and $dir eq $prob); + } else { + warn "This subroutine cannot handle empty paths: |$path|",caller(); + } + return 0; # no aux files with this .pg file + +} 1; |
From: Mike G. v. a. <we...@ma...> - 2009-07-13 00:07:10
|
Log Message: ----------- Added id tags and corrected some "FIXME" items Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: ProblemSet.pm Revision Data ------------- Index: ProblemSet.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/ProblemSet.pm,v retrieving revision 1.91 retrieving revision 1.92 diff -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -u -r1.91 -r1.92 --- lib/WeBWorK/ContentGenerator/ProblemSet.pm +++ lib/WeBWorK/ContentGenerator/ProblemSet.pm @@ -58,10 +58,15 @@ # get result and send to message my $status_message = $r->param("status_message"); $self->addmessage(CGI::p("$status_message")) if $status_message; - + + # $self->{invalidSet} is set by ContentGenerator.pm + return if $self->{invalidSet}; + return unless defined($set); + # Database fix (in case of undefined published values) # this is only necessary because some people keep holding to ww1.9 which did not have a published field # make sure published is set to 0 or 1 + if ($set->published ne "0" and $set->published ne "1") { my $globalSet = $db->getGlobalSet($set->set_id); $globalSet->published("1"); # defaults to published @@ -69,13 +74,12 @@ $set = $db->getMergedSet($effectiveUserName, $set->set_id); } - # $self->{invalidSet} is set by ContentGenerator.pm - return if $self->{invalidSet}; my $publishedText = ($set->published) ? "visible to students." : "hidden from students."; my $publishedClass = ($set->published) ? "Published" : "Unpublished"; $self->addmessage(CGI::span("This set is " . CGI::font({class=>$publishedClass}, $publishedText))) if $authz->hasPermissions($userName, "view_unpublished_sets"); + $self->{userName} = $userName; $self->{user} = $user; $self->{effectiveUser} = $effectiveUser; @@ -131,32 +135,32 @@ $gs->assignment_type() !~ /gateway/} @setIDs; } else { -# @setIDs = grep {my $visible = $db->getGlobalSet( $_)->published; (defined($visible))? $visible : 1} @setIDs = grep {my $gs = $db->getGlobalSet( $_ ); - $gs->assignment_type() !~ /gateway/ && - ( defined($gs->published()) ? $gs->published() : 1 )} - @setIDs; + $gs->assignment_type() !~ /gateway/ && + ( defined($gs->published()) ? $gs->published() : 1 ) + } @setIDs; } print CGI::start_div({class=>"info-box", id=>"fisheye"}); print CGI::h2("Sets"); - #print CGI::start_ul({class=>"LinksMenu"}); - #print CGI::start_li(); - #print CGI::span({style=>"font-size:larger"}, "Homework Sets"); print CGI::start_ul(); - # FIXME: setIDs contain no info on published/unpublished so unpublished sets are still printed - debug("Begin printing sets from listUserSets()"); + debug("Begin printing sets from listUserSets()"); foreach my $setID (@setIDs) { my $setPage = $urlpath->newFromModule("WeBWorK::ContentGenerator::ProblemSet", courseID => $courseID, setID => $setID); my $pretty_set_id = $setID; $pretty_set_id =~ s/_/ /g; - print CGI::li(CGI::a({title=>$pretty_set_id, href=>$self->systemLink($setPage), - params=>{ displayMode => $self->{displayMode}, - showOldAnswers => $self->{will}->{showOldAnswers} - }}, $pretty_set_id) - ) ; + print CGI::li( + CGI::a({ href=>$self->systemLink($setPage, + params=>{ + displayMode => $self->{displayMode}, + showOldAnswers => $self->{will}->{showOldAnswers}, + }, + ), + id=>$pretty_set_id, + }, $pretty_set_id) + ) ; } debug("End printing sets from listUserSets()"); |
From: Mike G. v. a. <we...@ma...> - 2009-07-13 00:07:07
|
Log Message: ----------- Changed how errors are caught in methodDefined() to prevent unneeded error messages in firefox Made cosmetic corrections to how error messages are reported. Modified Files: -------------- pg/macros: AppletObjects.pl Revision Data ------------- Index: AppletObjects.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/AppletObjects.pl,v retrieving revision 1.22 retrieving revision 1.23 diff -Lmacros/AppletObjects.pl -Lmacros/AppletObjects.pl -u -r1.22 -r1.23 --- macros/AppletObjects.pl +++ macros/AppletObjects.pl @@ -163,21 +163,22 @@ <input type="button" value="$getState" onClick="debugText=''; ww_applet_list['$appletName'].getState(); - alert(debugText);" + if (debugText) {alert(debugText)};" > <input type="button" value="$setState" onClick="debugText=''; ww_applet_list['$appletName'].setState(); - alert(debugText);" + if (debugText) {alert(debugText)};" > <input type="button" value="$getConfig" onClick="debugText=''; - ww_applet_list['$appletName'].getConfig()"; " + ww_applet_list['$appletName'].getConfig(); + if (debugText) {alert(debugText)};" > <input type="button" value="$setConfig" onClick="debugText=''; ww_applet_list['$appletName'].setConfig(); - alert(debugText);" + if (debugText) {alert(debugText)};" > !; |
From: Mike G. v. a. <we...@ma...> - 2009-07-13 00:06:38
|
Log Message: ----------- Added id's to links in the left margin Modified Files: -------------- webwork2/lib/WeBWorK: ContentGenerator.pm Revision Data ------------- Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.196 retrieving revision 1.197 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.196 -r1.197 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -590,7 +590,10 @@ my $new_urlpath = $self->r->urlpath->newFromModule($module, %$urlpath_args); my $new_systemlink = $self->systemLink($new_urlpath, %$systemlink_args); - defined $text or $text = $new_urlpath->name; + defined $text or $text = $new_urlpath->name; #too clever + + my $id = $text; + $id =~ s/\W/\_/g; #$text = sp2nbsp($text); # ugly hack to prevent text from wrapping # try to set $active automatically by comparing @@ -615,9 +618,9 @@ my $new_anchor; if ($active) { # add <strong> for old browsers - $new_anchor = CGI::strong(CGI::a({href=>$new_systemlink, class=>"active", %target}, $text)); + $new_anchor = CGI::strong(CGI::a({href=>$new_systemlink, id=>$id, class=>"active", %target}, $text)); } else { - $new_anchor = CGI::a({href=>$new_systemlink, %target}, $text); + $new_anchor = CGI::a({href=>$new_systemlink, id=>$id, %target}, "$text"); } return $new_anchor; @@ -1289,9 +1292,11 @@ while (@siblings) { my $name = shift @siblings; my $url = shift @siblings; + my $id = $name; + $id =~ s/\W/\_/g; push @result, $url - ? CGI::a({-href=>"$url?$auth"}, $name) - : $name; + ? CGI::span( {id=>$id}, CGI::a({-href=>"$url?$auth"}, $name) ) + : CGI::span( {id=>$id},$name ); } return join($sep, @result) . "\n"; |
From: Arnie P. v. a. <we...@ma...> - 2009-07-07 19:35:16
|
Log Message: ----------- uncomment use listcourses Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/Utils: DBUpgrade.pm Revision Data ------------- Index: DBUpgrade.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/DBUpgrade.pm,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -Llib/WeBWorK/Utils/DBUpgrade.pm -Llib/WeBWorK/Utils/DBUpgrade.pm -u -r1.4.2.2 -r1.4.2.3 --- lib/WeBWorK/Utils/DBUpgrade.pm +++ lib/WeBWorK/Utils/DBUpgrade.pm @@ -25,7 +25,7 @@ use strict; use warnings; use WeBWorK::Debug; -#use WeBWorK::Utils::CourseManagement qw/listCourses/; +use WeBWorK::Utils::CourseManagement qw/listCourses/; ################################################################################ |
From: Arnie P. v. a. <we...@ma...> - 2009-07-07 19:31:48
|
Log Message: ----------- comment out use DBUpgrade.pm Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/Utils: CourseManagement.pm Revision Data ------------- Index: CourseManagement.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/CourseManagement.pm,v retrieving revision 1.39.2.1.2.2 retrieving revision 1.39.2.1.2.3 diff -Llib/WeBWorK/Utils/CourseManagement.pm -Llib/WeBWorK/Utils/CourseManagement.pm -u -r1.39.2.1.2.2 -r1.39.2.1.2.3 --- lib/WeBWorK/Utils/CourseManagement.pm +++ lib/WeBWorK/Utils/CourseManagement.pm @@ -33,7 +33,7 @@ use WeBWorK::CourseEnvironment; use WeBWorK::Debug; use WeBWorK::Utils qw(runtime_use readDirectory pretty_print_rh); -use WeBWorK::Utils::DBUpgrade; +#use WeBWorK::Utils::DBUpgrade; our @EXPORT = (); our @EXPORT_OK = qw( |
From: Arnie P. v. a. <we...@ma...> - 2009-07-07 19:22:25
|
Log Message: ----------- syning with head Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.189.2.7.2.11 retrieving revision 1.189.2.7.2.12 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.189.2.7.2.11 -r1.189.2.7.2.12 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -49,7 +49,7 @@ # Paths to external programs ################################################################################ -# system utilities +# system utilties $externalPrograms{mv} = "/bin/mv"; $externalPrograms{cp} = "/bin/cp"; $externalPrograms{rm} = "/bin/rm"; @@ -393,7 +393,8 @@ # $courseFiles{problibs} = { Library => "NPL Directory", -# rochesterLibrary => "Rochester", +# rochesterLibrary => "Rochester", +# unionLibrary =>"Union", # asuLibrary => "Arizona State", # dcdsLibrary => "Detroit CDS", # dartmouthLibrary => "Dartmouth", |
From: Arnie P. v. a. <we...@ma...> - 2009-07-07 19:17:34
|
Log Message: ----------- syning with head Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: CourseAdmin.pm Revision Data ------------- Index: CourseAdmin.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v retrieving revision 1.64.2.2.2.4 retrieving revision 1.64.2.2.2.5 diff -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -u -r1.64.2.2.2.4 -r1.64.2.2.2.5 --- lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -376,6 +376,7 @@ my @courseIDs = listCourses($ce); foreach my $courseID (sort {lc($a) cmp lc($b) } @courseIDs) { next if $courseID eq "admin"; # done already above + next if $courseID eq "modelCourse"; # modelCourse isn't a real course so don't create missing directories, etc my $urlpath = $r->urlpath->newFromModule("WeBWorK::ContentGenerator::ProblemSets", courseID => $courseID); my $tempCE = new WeBWorK::CourseEnvironment({ %WeBWorK::SeedCE, @@ -390,8 +391,8 @@ CGI::code( $tempCE->{dbLayoutName}, ), - ($courseID eq "modelCourse" or $directories_ok) ? "" : CGI::span({style=>"color:red"},"Directory structure or permissions need to be repaired. "), - ($courseID eq "modelCourse" or $tables_ok ) ? CGI::span({style=>"color:green"},"Database tables ok") : CGI::span({style=>"color:red"},"Database tables need updating."), + $directories_ok ? "" : CGI::span({style=>"color:red"},"Directory structure or permissions need to be repaired. "), + $tables_ok ? CGI::span({style=>"color:green"},"Database tables ok") : CGI::span({style=>"color:red"},"Database tables need updating."), ); |
From: Arnie P. v. a. <we...@ma...> - 2009-07-07 18:34:06
|
Log Message: ----------- Skip over modelCourse in initial list of courses. Trying to create missing directories lead to warnings and stating "Database tables ok" is misleading Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: CourseAdmin.pm Revision Data ------------- Index: CourseAdmin.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v retrieving revision 1.85 retrieving revision 1.86 diff -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -u -r1.85 -r1.86 --- lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -376,6 +376,7 @@ my @courseIDs = listCourses($ce); foreach my $courseID (sort {lc($a) cmp lc($b) } @courseIDs) { next if $courseID eq "admin"; # done already above + next if $courseID eq "modelCourse"; # modelCourse isn't a real course so don't create missing directories, etc my $urlpath = $r->urlpath->newFromModule("WeBWorK::ContentGenerator::ProblemSets", courseID => $courseID); my $tempCE = new WeBWorK::CourseEnvironment({ %WeBWorK::SeedCE, @@ -390,8 +391,8 @@ CGI::code( $tempCE->{dbLayoutName}, ), - ($courseID eq "modelCourse" or $directories_ok) ? "" : CGI::span({style=>"color:red"},"Directory structure or permissions need to be repaired. "), - ($courseID eq "modelCourse" or $tables_ok ) ? CGI::span({style=>"color:green"},"Database tables ok") : CGI::span({style=>"color:red"},"Database tables need updating."), + $directories_ok ? "" : CGI::span({style=>"color:red"},"Directory structure or permissions need to be repaired. "), + $tables_ok ? CGI::span({style=>"color:green"},"Database tables ok") : CGI::span({style=>"color:red"},"Database tables need updating."), ); |
From: Arnie P. v. a. <we...@ma...> - 2009-07-07 18:22:59
|
Log Message: ----------- Add Union to the list of commented out problem libraries Modified Files: -------------- webwork2/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.212 retrieving revision 1.213 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.212 -r1.213 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -393,7 +393,8 @@ # $courseFiles{problibs} = { Library => "NPL Directory", -# rochesterLibrary => "Rochester", +# rochesterLibrary => "Rochester", +# unionLibrary =>"Union", # asuLibrary => "Arizona State", # dcdsLibrary => "Detroit CDS", # dartmouthLibrary => "Dartmouth", |