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: Anonymous C. A. v. a. <we...@ma...> - 2005-08-05 06:31:58
|
Update of /webwork/cvs/system/webwork In directory devel.webwork.rochester.edu:/tmp/cvs-serv52311 Log Message: . Status: Vendor Tag: INITIAL_IMPORT_VENDOR_TAG Release Tags: INITIAL_IMPORT_RELEASE_TAG No conflicts created by this import |
From: Anonymous C. A. v. a. <we...@ma...> - 2005-08-05 06:29:29
|
Update of /webwork/cvs/system/webwork In directory devel.webwork.rochester.edu:/tmp/cvs-serv52207 Log Message: Hi Status: Vendor Tag: INITIAL_IMPORT_VENDOR_TAG Release Tags: INITIAL_IMPORT_RELEASE_TAG No conflicts created by this import |
From: Sam H. v. a. <we...@ma...> - 2005-08-04 23:28:26
|
Log Message: ----------- add special case for no problems, closing bug #811. 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.63 retrieving revision 1.64 diff -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -Llib/WeBWorK/ContentGenerator/ProblemSet.pm -u -r1.63 -r1.64 --- lib/WeBWorK/ContentGenerator/ProblemSet.pm +++ lib/WeBWorK/ContentGenerator/ProblemSet.pm @@ -286,23 +286,28 @@ print CGI::p(CGI::a({href=>$hardcopyURL}, "Download a hardcopy of this homework set.")); - print CGI::start_table(); - print CGI::Tr( - CGI::th("Name"), - CGI::th("Attempts"), - CGI::th("Remaining"), - CGI::th("Worth"), - CGI::th("Status"), - ); - my @problemNumbers = $db->listUserProblems($effectiveUser, $setName); - foreach my $problemNumber (sort { $a <=> $b } @problemNumbers) { - my $problem = $db->getMergedProblem($effectiveUser, $setName, $problemNumber); # checked - die "problem $problemNumber in set $setName for user $effectiveUser not found." unless $problem; - print $self->problemListRow($set, $problem); - } - print CGI::end_table(); + if (@problemNumbers) { + print CGI::start_table(); + print CGI::Tr( + CGI::th("Name"), + CGI::th("Attempts"), + CGI::th("Remaining"), + CGI::th("Worth"), + CGI::th("Status"), + ); + + foreach my $problemNumber (sort { $a <=> $b } @problemNumbers) { + my $problem = $db->getMergedProblem($effectiveUser, $setName, $problemNumber); # checked + die "problem $problemNumber in set $setName for user $effectiveUser not found." unless $problem; + print $self->problemListRow($set, $problem); + } + + print CGI::end_table(); + } else { + print CGI::p("This homework set contains no problems."); + } ## feedback form #my $ce = $self->{ce}; |
From: Sam H. v. a. <we...@ma...> - 2005-08-04 22:43:34
|
Log Message: ----------- fix bug #803: corrected typo that prevented course renaming from working. 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.22 retrieving revision 1.23 diff -Llib/WeBWorK/Utils/CourseManagement.pm -Llib/WeBWorK/Utils/CourseManagement.pm -u -r1.22 -r1.23 --- lib/WeBWorK/Utils/CourseManagement.pm +++ lib/WeBWorK/Utils/CourseManagement.pm @@ -383,7 +383,7 @@ delete $deleteDBOptions{old_database}; } - my $deleteHelperResult = deleteCourseHelper($oldCourseID, $newCE, $dbLayoutName, %dbOptions); + my $deleteHelperResult = deleteCourseHelper($oldCourseID, $oldCE, $dbLayoutName, %dbOptions); die "$oldCourseID: course database creation failed.\n" unless $deleteHelperResult; } |
From: Sam H. v. a. <we...@ma...> - 2005-08-04 21:33:33
|
Log Message: ----------- cosmetic changes, disable experimental components by default. Modified Files: -------------- webwork2/conf: webwork.apache-config.dist Revision Data ------------- Index: webwork.apache-config.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/webwork.apache-config.dist,v retrieving revision 1.8 retrieving revision 1.9 diff -Lconf/webwork.apache-config.dist -Lconf/webwork.apache-config.dist -u -r1.8 -r1.9 --- conf/webwork.apache-config.dist +++ conf/webwork.apache-config.dist @@ -44,15 +44,6 @@ my $webwork_courses_dir = $ce->{webwork_courses_dir}; eval "use lib '$pg_dir/lib'"; die $@ if $@; -########################################## -# allows Webservice access to WeBWorK -########################################## - -eval "use WebworkWebservice";die $@ if $@; #FIXME, is there another way to initialize this? -eval "use RQP"; die $@ if $@; - -########################################## - $WeBWorK::SeedCE{webwork_dir} = $webwork_dir; # Between the line below and the "EOF" line are the three configuration stanzas @@ -102,42 +93,56 @@ AllowOverride None </Directory> - ########## XMLRPC installation ########## -<Location /mod_xmlrpc> - SetHandler perl-script - PerlHandler Apache::XMLRPC::Lite - PerlSetVar dispatch_to "WebworkXMLRPC" - PerlSetVar options "compress_threshold => 10000" - Order Allow,Deny - Allow from All -</Location> - ########## RQP installation ########## - -#<Location /rqp> -# SetHandler perl-script -# PerlHandler Apache::SOAP -# PerlSetVar dispatch_to "RQP" -# PerlSetVar options "compress_threshold => 10000" -# Order Allow,Deny -# Allow from All +EOF + +# The following stanzas can be uncommented to enable various experimental +# WeBWorK web services. These are still in testing and have not been audited +# for security. + +# load packages necessary for WeBWorK web services +#eval "use WebworkWebservice";die $@ if $@; +#eval "use RQP"; die $@ if $@; + +$PerlConfig .= <<EOF; + +# XMLRPC installation +# +#<Location /mod_xmlrpc> +# SetHandler perl-script +# PerlHandler Apache::XMLRPC::Lite +# PerlSetVar dispatch_to "WebworkXMLRPC" +# PerlSetVar options "compress_threshold => 10000" +# Order Allow,Deny +# Allow from All #</Location> -<Location /rqp> - SetHandler perl-script - PerlHandler MySOAP - Order Allow,Deny - Allow from All -</Location> +# RQP installation +# +##<Location /rqp> +## SetHandler perl-script +## PerlHandler Apache::SOAP +## PerlSetVar dispatch_to "RQP" +## PerlSetVar options "compress_threshold => 10000" +## Order Allow,Deny +## Allow from All +##</Location> +#<Location /rqp> +# SetHandler perl-script +# PerlHandler MySOAP +# Order Allow,Deny +# Allow from All +#</Location> -########## SOAP installation ############ -<Location /mod_soap> - SetHandler perl-script - PerlHandler Apache::SOAP - PerlSetVar dispatch_to "WebworkXMLRPC" - PerlSetVar options "compress_threshold => 10000" - Order Allow,Deny - Allow from All -</Location> +# SOAP installation +# +#<Location /mod_soap> +# SetHandler perl-script +# PerlHandler Apache::SOAP +# PerlSetVar dispatch_to "WebworkXMLRPC" +# PerlSetVar options "compress_threshold => 10000" +# Order Allow,Deny +# Allow from All +#</Location> EOF |
From: dpvc v. a. <we...@ma...> - 2005-08-04 00:56:37
|
Log Message: ----------- Can't separate the form into two separate forms (as in the previous update) otherwise the values of the checkboxes in the lower section are lost when a button in the upper section is clicked. So we'll have to assume that if a user selects a file, he really wants it to be uploaded. (He can always use the BACK button on the browser to back out of it if necessary.) Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: FileManager.pm Revision Data ------------- Index: FileManager.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -Llib/WeBWorK/ContentGenerator/Instructor/FileManager.pm -Llib/WeBWorK/ContentGenerator/Instructor/FileManager.pm -u -r1.12 -r1.13 --- lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm +++ lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm @@ -314,25 +314,6 @@ ), ); - print CGI::end_table(); - print CGI::hidden({name=>'pwd',value=>$self->{pwd}}); - print CGI::hidden({name=>'formAction'}); - print CGI::end_multipart_form(); - - my $fileManagerPage = $self->r->urlpath->newFromModule($self->r->urlpath->module, courseID => $self->{courseName}); - my $fileManagerURL = $self->systemLink($fileManagerPage, authen => 0); - - print CGI::start_multipart_form( - -method=>"POST", - -action=>$fileManagerURL, - -id=>"FileManager", - -name=>"FileManager", - -style=>"margin:0", - ); - print $self->hidden_authen_fields; - - print CGI::start_table({border=>0,cellpadding=>0,cellspacing=>3, style=>"margin:0 0 0 3em"}); - # # Upload button and checkboxes # |
From: Sam H. v. a. <we...@ma...> - 2005-08-03 22:23:32
|
Log Message: ----------- test Modified Files: -------------- webwork2: README Revision Data ------------- Index: README =================================================================== RCS file: /webwork/cvs/system/webwork2/README,v retrieving revision 1.11 retrieving revision 1.12 diff -LREADME -LREADME -u -r1.11 -r1.12 --- README +++ README @@ -1,4 +1,3 @@ -this is a test WeBWorK Online Homework Delivery System Version 2.1 |
From: jj v. a. <we...@ma...> - 2005-08-03 22:18:14
|
Log Message: ----------- Added problem count to basic library panel, and text chapters/sections to advanced library panel. Modified Files: -------------- webwork-modperl/lib/WeBWorK/Utils: ListingDB.pm webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: SetMaker.pm Revision Data ------------- Index: ListingDB.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/Utils/ListingDB.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -Llib/WeBWorK/Utils/ListingDB.pm -Llib/WeBWorK/Utils/ListingDB.pm -u -r1.12 -r1.13 --- lib/WeBWorK/Utils/ListingDB.pm +++ lib/WeBWorK/Utils/ListingDB.pm @@ -18,6 +18,16 @@ use strict; use DBI; +use constant LIBRARY_STRUCTURE => { + textbook => { select => 'tbk.textbook_id,tbk.title,tbk.author,tbk.edition', + name => 'library_textbook', where => 'tbk.textbook_id'}, + textchapter => { select => 'tc.name', name=>'library_textchapter', + where => 'tc.name'}, + textsection => { select => 'ts.name', name=>'library_textsection', + where => 'ts.name'}, + problem => { select => 'prob.name' }, + }; + BEGIN { require Exporter; @@ -46,48 +56,110 @@ return($dbh); } -=item getDBTextbooks($r) -Returns an array of Textbook names consistent with the subject, chapter, -section selected +=item kwtidy($s) and keywordcleaner($s) +Both take a string and perform utility functions related to keywords. +keywordcleaner splits a string, and uses kwtidy to regularize punctuation +and case for an individual entry. -$r is a Apache request object so we can extract whatever parameters we want +=cut + +sub kwtidy { + my $s = shift; + $s =~ s/\'//g; + $s =~ s/\"//g; + $s =~ s/\#//g; + $s = lc($s); + return($s); +} + +sub keywordCleaner { + my $string = shift; + my @spl1 = split /\s*,\s*/, $string; + my @spl2 = map(kwtidy($_), @spl1); + return(@spl2); +} + +sub makeKeywordWhere { + my $kwstring = shift; + my @kwlist = keywordCleaner($kwstring); + @kwlist = map { "kw.keyword = \"$_\"" } @kwlist; + my $where = join(" OR ", @kwlist); + return "AND ( $where )"; +} + + +=item getDBTextbooks($r) +Returns textbook dependent entries. +$r is a Apache request object so we can extract whatever parameters we want + +$thing is a string of either 'textbook', 'textchapter', or 'textsection' to +specify what to return. + +If we are to return textbooks, then return an array of textbook names +consistent with the DB subject, chapter, section selected. + =cut sub getDBTextbooks { my $r = shift; + my $thing = shift || 'textbook'; my $dbh = getDB($r->ce); - # there aren't many, so first get a list of all texts, and then remove - # the ones which aren't ok - my ($sectstring, $chapstring, $subjstring) = ('','',''); + my $extrawhere = ''; + # Handle DB* restrictions my $subj = $r->param('library_subjects') || ""; my $chap = $r->param('library_chapters') || ""; my $sec = $r->param('library_sections') || ""; if($subj) { $subj =~ s/'/\\'/g; - $subjstring = " AND t.name = \'$subj\'\n"; + $extrawhere .= " AND t.name = \'$subj\'\n"; } if($chap) { $chap =~ s/'/\\'/g; - $chapstring = " AND c.name = \'$chap\' AND c.DBsubject_id=t.DBsubject_id\n"; + $extrawhere .= " AND c.name = \'$chap\' AND c.DBsubject_id=t.DBsubject_id\n"; } if($sec) { $sec =~ s/'/\\'/g; - $sectstring = " AND s.name = \'$sec\' AND s.DBchapter_id = c.DBchapter_id AND s.DBsection_id=pgf.DBsection_id"; + $extrawhere .= " AND s.name = \'$sec\' AND s.DBchapter_id = c.DBchapter_id AND s.DBsection_id=pgf.DBsection_id"; + } + my $textextrawhere = ''; + my $textid = $r->param('library_textbook') || ''; + if($textid and $thing ne 'textbook') { + $textextrawhere .= " AND tbk.textbook_id=\"$textid\" "; + } else { + return([]) if($thing ne 'textbook'); + } + + my $textchap = $r->param('library_textchapter') || ''; + if($textchap and $thing eq 'textsection') { + $textextrawhere .= " AND tc.name=\"$textchap\" "; + } else { + return([]) if($thing eq 'textsection'); } - my $query = "SELECT DISTINCT tbk.textbook_id,tbk.title,tbk.author, - tbk.edition - FROM textbook tbk, problem p, pgfile_problem pg, pgfile pgf, - DBsection s, DBchapter c, DBsubject t, chapter cc, section ss - WHERE ss.section_id=p.section_id AND p.problem_id=pg.problem_id AND - s.DBchapter_id=c.DBchapter_id AND c.DBsubject_id=t.DBsubject_id - AND pgf.DBsection_id=s.DBsection_id AND pgf.pgfile_id=pg.pgfile_id - AND ss.chapter_id=cc.chapter_id AND cc.textbook_id=tbk.textbook_id - $chapstring $subjstring $sectstring "; + + my $selectwhat = LIBRARY_STRUCTURE->{$thing}{select}; + + my $query = "SELECT DISTINCT $selectwhat + FROM textbook tbk, problem prob, pgfile_problem pg, pgfile pgf, + DBsection s, DBchapter c, DBsubject t, chapter tc, section ts + WHERE ts.section_id=prob.section_id AND + prob.problem_id=pg.problem_id AND + s.DBchapter_id=c.DBchapter_id AND + c.DBsubject_id=t.DBsubject_id AND + pgf.DBsection_id=s.DBsection_id AND + pgf.pgfile_id=pg.pgfile_id AND + ts.chapter_id=tc.chapter_id AND + tc.textbook_id=tbk.textbook_id + $extrawhere $textextrawhere "; my $text_ref = $dbh->selectall_arrayref($query); my @texts = @{$text_ref}; - @texts = grep { $_->[1] =~ /\S/ } @texts; - return(\@texts); + if( $thing eq 'textbook') { + @texts = grep { $_->[1] =~ /\S/ } @texts; + return(\@texts); + } else { + @texts = grep { $_->[0] =~ /\S/ } @texts; + return(\@texts); + } } =item getAllDBsubjects($r) @@ -172,9 +244,15 @@ my $subj = $r->param('library_subjects') || ""; my $chap = $r->param('library_chapters') || ""; my $sec = $r->param('library_sections') || ""; - my $text = $r->param('library_textbook') || ""; - my $textchap = $r->param('library_textbook_chapter') || ""; - my $textsec = $r->param('library_textbook_section') || ""; + my $keywords = $r->param('library_keywords') || ""; + my ($kw1, $kw2) = ('',''); + if($keywords) { + $kw1 = ", keyword kw, pgfile_keyword pgkey"; + $kw2 = " AND kw.keyword_id=pgkey.keyword_id AND + pgkey.pgfile_id=pgf.pgfile_id ". + makeKeywordWhere($keywords) + ; + } my $dbh = getDB($ce); @@ -191,9 +269,13 @@ $sec =~ s/'/\\'/g; $extrawhere .= " AND dbsc.name=\"$sec\" "; } - if($text) { - $text =~ s/'/\\'/g; - $extrawhere .= " AND t.textbook_id=\"$text\" "; + my $textextrawhere = ''; + for my $j (qw( textbook textchapter textsection )) { + my $foo = $r->param(LIBRARY_STRUCTURE->{$j}{name}) || ''; + if($foo) { + $foo =~ s/'/\\'/g; + $textextrawhere .= " AND ".LIBRARY_STRUCTURE->{$j}{where}."=\"$foo\" "; + } } my $selectwhat = 'DISTINCT pgf.pgfile_id'; @@ -201,15 +283,18 @@ my $query = "SELECT $selectwhat from pgfile pgf, DBsection dbsc, DBchapter dbc, DBsubject dbsj, pgfile_problem pgp, - problem p, textbook t , chapter cc, section ss + problem prob, textbook tbk , chapter tc, section ts $kw1 WHERE dbsj.DBsubject_id = dbc.DBsubject_id AND dbc.DBchapter_id = dbsc.DBchapter_id AND dbsc.DBsection_id = pgf.DBsection_id AND pgf.pgfile_id = pgp.pgfile_id AND - pgp.problem_id = p.problem_id AND - cc.textbook_id = t.textbook_id AND - ss.chapter_id = cc.chapter_id AND - p.section_id = ss.section_id \n $extrawhere"; + pgp.problem_id = prob.problem_id AND + tc.textbook_id = tbk.textbook_id AND + ts.chapter_id = tc.chapter_id AND + prob.section_id = ts.section_id \n $extrawhere \n $textextrawhere + $kw2"; +#$query =~ s/\n/ /g; +#warn $query; my $pg_id_ref = $dbh->selectall_arrayref($query); my @pg_ids = map { $_->[0] } @{$pg_id_ref}; if($amcounter) { Index: SetMaker.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v retrieving revision 1.47 retrieving revision 1.48 diff -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -u -r1.47 -r1.48 --- lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm +++ lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm @@ -47,12 +47,15 @@ use constant ALL_SECTIONS => 'All Sections'; use constant ALL_TEXTBOOKS => 'All Textbooks'; -#use constant LIB2_DATA => [ - #[qw(dbchapter library_chapters), ALL_CHAPTERS], - #[qw(dbsection library_sections), ALL_SECTIONS], - #[qw(dbsubject library_subjects), ALL_SUBJECT], - #[qw(textbook library_textbook), ALL_TEXTBOOKS], - #]; +use constant LIB2_DATA => { + 'dbchapter' => {name => 'library_chapters', all => 'All Chapters'}, + 'dbsection' => {name => 'library_sections', all =>'All Sections' }, + 'dbsubject' => {name => 'library_subjects', all => 'All Subjects' }, + 'textbook' => {name => 'library_textbook', all => 'All Textbooks'}, + 'textchapter' => {name => 'library_textchapter', all => 'All Chapters'}, + 'textsection' => {name => 'library_textsection', all => 'All Sections'}, + 'keywords' => {name => 'library_keywords', all => '' }, + }; ## Flags for operations on files @@ -414,16 +417,17 @@ my $ce = $r->ce; my @chaps = WeBWorK::Utils::ListingDB::getAllChapters($r->{ce}); - unshift @chaps, ALL_CHAPTERS; - my $chapter_selected = $r->param('library_chapters') || ALL_CHAPTERS; + unshift @chaps, LIB2_DATA->{dbchapter}{all}; + my $chapter_selected = $r->param('library_chapters') || LIB2_DATA->{dbchapter}->{all}; my @sects=(); - if ($chapter_selected ne ALL_CHAPTERS) { + if ($chapter_selected ne LIB2_DATA->{dbchapter}{all}) { @sects = WeBWorK::Utils::ListingDB::getAllSections($r->{ce}, $chapter_selected); } unshift @sects, ALL_SECTIONS; - my $section_selected = $r->param('library_sections') || ALL_SECTIONS; + my $section_selected = $r->param('library_sections') || LIB2_DATA->{dbsection}{all}; + my $view_problem_line = view_problems_line('lib_view', 'View Problems', $self->r); print CGI::Tr(CGI::td({-class=>"InfoPanel", -align=>"left"}, @@ -455,21 +459,28 @@ my $ce = $r->ce; my @subjs = WeBWorK::Utils::ListingDB::getAllDBsubjects($r); - unshift @subjs, ALL_SUBJECTS; + unshift @subjs, LIB2_DATA->{dbsubject}{all}; my @chaps = WeBWorK::Utils::ListingDB::getAllDBchapters($r); - unshift @chaps, ALL_CHAPTERS; + unshift @chaps, LIB2_DATA->{dbchapter}{all}; my @sects=(); @sects = WeBWorK::Utils::ListingDB::getAllDBsections($r); - unshift @sects, ALL_SECTIONS; + unshift @sects, LIB2_DATA->{dbsection}{all}; - my $subject_selected = $r->param('library_subjects') || ALL_SUBJECTS; - my $chapter_selected = $r->param('library_chapters') || ALL_CHAPTERS; - my $section_selected = $r->param('library_sections') || ALL_SECTIONS; + my $subject_selected = $r->param('library_subjects') || LIB2_DATA->{dbsubject}{all}; + my $chapter_selected = $r->param('library_chapters') || LIB2_DATA->{dbchapter}{all}; + my $section_selected = $r->param('library_sections') || LIB2_DATA->{dbsection}{all}; my $view_problem_line = view_problems_line('lib_view', 'View Problems', $self->r); + my $count_line = WeBWorK::Utils::ListingDB::countDBListings($r); + if($count_line==0) { + $count_line = "There are no matching pg files"; + } else { + $count_line = "There are $count_line matching WeBWorK problem files"; + } + print CGI::Tr(CGI::td({-class=>"InfoPanel", -align=>"left"}, CGI::hidden(-name=>"library_is_basic", -default=>[1]), CGI::start_table({-width=>"100%"}), @@ -497,10 +508,12 @@ CGI::td(["Section:", CGI::popup_menu(-name=> 'library_sections', -values=>\@sects, - -default=> $section_selected + -default=> $section_selected, + -onchange=>"submit();return true" )]), ), CGI::Tr(CGI::td({-colspan=>3}, $view_problem_line)), + CGI::Tr(CGI::td({-colspan=>3, -align=>"center"}, $count_line)), CGI::end_table(), )); @@ -516,19 +529,19 @@ if(! grep { $_ eq $r->param('library_subjects') } @subjs) { $r->param('library_subjects', ''); } - unshift @subjs, ALL_SUBJECTS; + unshift @subjs, LIB2_DATA->{dbsubject}{all}; my @chaps = WeBWorK::Utils::ListingDB::getAllDBchapters($r); if(! grep { $_ eq $r->param('library_chapters') } @chaps) { $r->param('library_chapters', ''); } - unshift @chaps, ALL_CHAPTERS; + unshift @chaps, LIB2_DATA->{dbchapter}{all}; my @sects = WeBWorK::Utils::ListingDB::getAllDBsections($r); if(! grep { $_ eq $r->param('library_sections') } @sects) { $r->param('library_sections', ''); } - unshift @sects, ALL_SECTIONS; + unshift @sects, LIB2_DATA->{dbsection}{all}; my $texts = WeBWorK::Utils::ListingDB::getDBTextbooks($r); my @textarray = map { $_->[0] } @{$texts}; @@ -539,19 +552,34 @@ if(! grep { $_ eq $r->param('library_textbook') } @textarray) { $r->param('library_textbook', ''); } - unshift @textarray, ALL_TEXTBOOKS; - my $atb = ALL_TEXTBOOKS; $textlabels{$atb} = ALL_TEXTBOOKS; + unshift @textarray, LIB2_DATA->{textbook}{all}; + my $atb = LIB2_DATA->{textbook}{all}; $textlabels{$atb} = LIB2_DATA->{textbook}{all}; - my $section_selected = $r->param('library_sections') || ALL_SECTIONS; - my $chapter_selected = $r->param('library_chapters') || ALL_CHAPTERS; - my $subject_selected = $r->param('library_subjects') || ALL_SUBJECTS; - my $textbook_selected = $r->param('library_textbook') || ALL_TEXTBOOKS; + my $textchap_ref = WeBWorK::Utils::ListingDB::getDBTextbooks($r, 'textchapter'); + my @textchaps = map { $_->[0] } @{$textchap_ref}; + if(! grep { $_ eq $r->param('library_textchapter') } @textchaps) { + $r->param('library_textchapter', ''); + } + unshift @textchaps, LIB2_DATA->{textchapter}{all}; + + my $textsec_ref = WeBWorK::Utils::ListingDB::getDBTextbooks($r, 'textsection'); + my @textsecs = map { $_->[0] } @{$textsec_ref}; + if(! grep { $_ eq $r->param('library_textsection') } @textsecs) { + $r->param('library_textsection', ''); + } + unshift @textsecs, LIB2_DATA->{textsection}{all}; + + my %selected = (); + for my $j (qw( dbsection dbchapter dbsubject textbook textchapter textsection )) { + $selected{$j} = $r->param(LIB2_DATA->{$j}{name}) || LIB2_DATA->{$j}{all}; + } my $text_popup = CGI::popup_menu(-name => 'library_textbook', -values =>\@textarray, -labels => \%textlabels, - -default=>$textbook_selected, + -default=>$selected{textbook}, -onchange=>"submit();return true"); + my $library_keywords = $r->param('library_keywords') || ''; @@ -573,7 +601,7 @@ CGI::td(["Subject:", CGI::popup_menu(-name=> 'library_subjects', -values=>\@subjs, - -default=> $subject_selected, + -default=> $selected{dbsubject}, -onchange=>"submit();return true" )]), CGI::td({-colspan=>2, -align=>"right"}, @@ -583,7 +611,7 @@ CGI::td(["Chapter:", CGI::popup_menu(-name=> 'library_chapters', -values=>\@chaps, - -default=> $chapter_selected, + -default=> $selected{dbchapter}, -onchange=>"submit();return true" )]), CGI::td({-colspan=>2, -align=>"right"}, @@ -594,7 +622,7 @@ CGI::td(["Section:", CGI::popup_menu(-name=> 'library_sections', -values=>\@sects, - -default=> $section_selected, + -default=> $selected{dbsection}, -onchange=>"submit();return true" )]), CGI::td({-colspan=>2, -align=>"right"}, @@ -604,6 +632,22 @@ CGI::Tr( CGI::td(["Textbook:", $text_popup]), ), + CGI::Tr( + CGI::td(["Text chapter:", + CGI::popup_menu(-name=> 'library_textchapter', + -values=>\@textchaps, + -default=> $selected{textchapter}, + -onchange=>"submit();return true" + )]), + ), + CGI::Tr( + CGI::td(["Text section:", + CGI::popup_menu(-name=> 'library_textsection', + -values=>\@textsecs, + -default=> $selected{textsection}, + -onchange=>"submit();return true" + )]), + ), CGI::Tr(CGI::td("Keywords:"),CGI::td({-colspan=>2}, CGI::textfield(-name=>"library_keywords", -default=>$library_keywords, @@ -1114,8 +1158,15 @@ @past_marks = map {1} @past_marks; } elsif ($r->param('library_basic')) { $library_basic = 1; + for my $jj (qw(textchapter textsection textbook)) { + $r->param('library_'.$jj,''); + } } elsif ($r->param('library_advanced')) { $library_basic = 2; + } elsif ($r->param('library_reset')) { + for my $jj (qw(chapters sections subjects textbook keywords)) { + $r->param('library_'.$jj,''); + } } elsif ($r->param('select_none')) { @past_marks = (); |
From: Sam H. v. a. <we...@ma...> - 2005-08-01 22:01:36
|
Log Message: ----------- fixed indentation (see crabby reminder below). The code I just fixed was using four spaces for one level of indentation and a tab character for two levels of indentation. apparently, this is a variation on the "use spaces for indentation" philosophy that also replaces any run of eight spaces with a tab. this is NOT the way we've been doing things in webwork, and consistency is important (I think). ===> the webwork indentation policy <=== We use the TAB character to indicate a level of indentation, and SPACE characters to line things up in lists. I understand there is some debate as to whether is it appropriate to use "hard" tabs in text files. We do it because some of the WeBWorK developers prefer to view the code with wider indentation (say, eight columns) and some prefer narrower indentation (say, three or four columns). Thus, we use hard tabs for initial indentation and let each developer chose a tab width using their editor. Here in an example of when to use tabs and spaces. ---> represents a tab character. my %errors = ( --->not_found => "The record was not found.", --->invalid_id => "The record ID is invalid.", --->undefined_or_unknown => "The record was undefined or unknown.", ); sub bar { --->my ($self, @recs) = @_; --->foreach my $rec (@recs) { --->--->my $Rec = $self->getRec($rec); --->--->if ($Rec->error) { --->--->--->warn $errors{$Rec->error}; --->--->} else { --->--->--->foo($Rec->a, $Rec->b); --->--->--->baz( --->--->--->--->origin => $Rec->origin, --->--->--->--->destination => $Rec->destination, --->--->--->--->widgets_per_second => $Rec->widgets_per_second, --->--->--->--->score => $Rec->score, --->--->--->--->email_address => $Rec->email_address, --->--->--->); --->--->} --->} } As you can see, indentation that is used to "line up" elements on adjacent lines uses spaces, while indentation that is used to indicate some structural heirarchy in the code uses tabs. 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.141 retrieving revision 1.142 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.141 -r1.142 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -1414,12 +1414,12 @@ =cut sub hidden_proctor_authen_fields { - my $self = shift; - if ( $self->r->param('proctor_user') ) { - return $self->hidden_fields("proctor_user", "proctor_key"); - } else { - return ''; - } + my $self = shift; + if ( $self->r->param('proctor_user') ) { + return $self->hidden_fields("proctor_user", "proctor_key"); + } else { + return ''; + } } =item url_args(@fields) |
From: dpvc v. a. <we...@ma...> - 2005-08-01 19:21:51
|
Log Message: ----------- Added a hack to get around Netscape 7.1 bug with onChange event handler not being called when an upload file has been selected. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: FileManager.pm Revision Data ------------- Index: FileManager.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -Llib/WeBWorK/ContentGenerator/Instructor/FileManager.pm -Llib/WeBWorK/ContentGenerator/Instructor/FileManager.pm -u -r1.11 -r1.12 --- lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm +++ lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm @@ -122,7 +122,8 @@ -method=>"POST", -action=>$fileManagerURL, -id=>"FileManager", - -name=>"FileManager" + -name=>"FileManager", + -style=>"margin:0", ); print $self->hidden_authen_fields; @@ -229,6 +230,11 @@ } function checkFile() { var file = window.document.getElementById('file'); + if (navigator.vendor && navigator.vendorSub && navigator.vendor == "Netscape") { + if (navigator.vendorSub.match(/(\\d+)\.(\\d+)/)) { + if (RegExp.\$1 < 7 || (RegExp.\$1 == 7 && RegExp.\$2 < 2)) return; + } + } var state = (file.value == ""); disableButton('Upload',state); } @@ -308,6 +314,25 @@ ), ); + print CGI::end_table(); + print CGI::hidden({name=>'pwd',value=>$self->{pwd}}); + print CGI::hidden({name=>'formAction'}); + print CGI::end_multipart_form(); + + my $fileManagerPage = $self->r->urlpath->newFromModule($self->r->urlpath->module, courseID => $self->{courseName}); + my $fileManagerURL = $self->systemLink($fileManagerPage, authen => 0); + + print CGI::start_multipart_form( + -method=>"POST", + -action=>$fileManagerURL, + -id=>"FileManager", + -name=>"FileManager", + -style=>"margin:0", + ); + print $self->hidden_authen_fields; + + print CGI::start_table({border=>0,cellpadding=>0,cellspacing=>3, style=>"margin:0 0 0 3em"}); + # # Upload button and checkboxes # |
From: dpvc v. a. <we...@ma...> - 2005-08-01 15:12:12
|
Log Message: ----------- Fixed a bug that would cause step() to produce an error when called on a constant value. Also, added fact() function that was defined in Algparser but not in Parser (which uses x! notation). Modified Files: -------------- pg/lib/Parser/Legacy: Numeric.pm Revision Data ------------- Index: Numeric.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Legacy/Numeric.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -Llib/Parser/Legacy/Numeric.pm -Llib/Parser/Legacy/Numeric.pm -u -r1.1 -r1.2 --- lib/Parser/Legacy/Numeric.pm +++ lib/Parser/Legacy/Numeric.pm @@ -1,19 +1,28 @@ ########################################################## # -# Implements a context in which the "step" function -# is defined. This was defined in the old AlgParser, -# but not in the Parser's standard Numeric context. +# Implements a context in which the "step" and "fact" +# functions are defined. These were defined in the old +# AlgParser, but are not in the Parser's standard +# Numeric context. +# +# Warning: since step and fact already are defined in +# PGauxiliarymacros.pl we can't redefine them here, so you +# can't use step(formula) or fact(formula) to automatically +# generate Formula objects, as you can with all the other +# functions. Since this context is for compatibility with +# old problems that didn't know about Formula objects +# anyway, that should not be a problem. # -# Warning: since step is already defined in PGauxiliarymacros.pl -# we can't redefine it here, so you can't use step(formula) to -# automatically generate Formula objects, as you can with -# all the other functions. package Parser::Legacy::Numeric; our @ISA = qw(Parser::Function::numeric); -sub step {shift; main::step((shift)->value)} +sub step {shift; do_step(shift)}; sub do_step {Value::pgCall('step',@_)} +sub fact {shift; do_fact(shift)}; sub do_fact {Value::pgCall('fact',@_)} my $context = $Parser::Context::Default::context{Numeric}->copy; $Parser::Context::Default::context{LegacyNumeric} = $context; -$context->functions->add(step => {class => 'Parser::Legacy::Numeric'}); +$context->functions->add( + step => {class => 'Parser::Legacy::Numeric', perl => 'Parser::Legacy::Numeric::do_step'}, + fact => {class => 'Parser::Legacy::Numeric', perl => 'Parser::Legacy::Numeric::do_fact'}, +); |
From: dpvc v. a. <we...@ma...> - 2005-08-01 14:18:10
|
Log Message: ----------- Added missing "step" function that was defined in the AlgParser but not in the Parser. Be sure to copy the updated PGanswermacros.pl to the pg/macros directory. Modified Files: -------------- pg/lib/Parser: Legacy.pm pg/lib/Parser/Legacy: PGanswermacros.pl Added Files: ----------- pg/lib/Parser/Legacy: Numeric.pm Revision Data ------------- Index: Legacy.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Legacy.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -Llib/Parser/Legacy.pm -Llib/Parser/Legacy.pm -u -r1.1 -r1.2 --- lib/Parser/Legacy.pm +++ lib/Parser/Legacy.pm @@ -4,5 +4,6 @@ use Parser::Legacy::NumberWithUnits; use Parser::Legacy::LimitedNumeric; +use Parser::Legacy::Numeric; 1; Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Legacy/PGanswermacros.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -Llib/Parser/Legacy/PGanswermacros.pl -Llib/Parser/Legacy/PGanswermacros.pl -u -r1.6 -r1.7 --- lib/Parser/Legacy/PGanswermacros.pl +++ lib/Parser/Legacy/PGanswermacros.pl @@ -1050,7 +1050,7 @@ last; }; /^arith$/i and do { - $context = &$Context("Numeric")->copy; + $context = &$Context("LegacyNumeric")->copy; $context->functions->disable('All'); last; }; @@ -1060,7 +1060,7 @@ }; # default - $context = &$Context("Numeric")->copy; + $context = &$Context("LegacyNumeric")->copy; } $context->{format}{number} = $num_params{'format'}; $context->strings->clear; @@ -1931,7 +1931,7 @@ # # Initialize the context for the formula # - my $context = &$Context("Numeric")->copy; + my $context = &$Context("LegacyNumeric")->copy; $context->flags->set( tolerance => $func_params{'tolerance'}, tolType => $func_params{'tolType'}, --- /dev/null +++ lib/Parser/Legacy/Numeric.pm @@ -0,0 +1,19 @@ +########################################################## +# +# Implements a context in which the "step" function +# is defined. This was defined in the old AlgParser, +# but not in the Parser's standard Numeric context. +# +# Warning: since step is already defined in PGauxiliarymacros.pl +# we can't redefine it here, so you can't use step(formula) to +# automatically generate Formula objects, as you can with +# all the other functions. + +package Parser::Legacy::Numeric; +our @ISA = qw(Parser::Function::numeric); +sub step {shift; main::step((shift)->value)} + +my $context = $Parser::Context::Default::context{Numeric}->copy; +$Parser::Context::Default::context{LegacyNumeric} = $context; +$context->functions->add(step => {class => 'Parser::Legacy::Numeric'}); + |
From: dpvc v. a. <we...@ma...> - 2005-08-01 13:08:48
|
Log Message: ----------- Make List("1,2,3") work like List("1","2","3") rather than produce a list with one element that is a list. Modified Files: -------------- pg/lib/Value: List.pm Revision Data ------------- Index: List.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/List.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -Llib/Value/List.pm -Llib/Value/List.pm -u -r1.15 -r1.16 --- lib/Value/List.pm +++ lib/Value/List.pm @@ -25,6 +25,7 @@ sub new { my $self = shift; my $class = ref($self) || $self; my $p = shift; my $isFormula = 0; + my $isSingleton = (scalar(@_) == 0 && !(Value::isValue($p) && $p->class eq 'List')); $p = $p->data if (Value::isValue($p) && $p->class eq 'List' && scalar(@_) == 0); $p = [$p,@_] if (ref($p) ne 'ARRAY' || scalar(@_) > 0); my $type; @@ -36,6 +37,7 @@ else {$type = 'unknown' unless $type eq $x->type} } else {$type = 'unknown'} } + return $p->[0] if ($isSingleton && $type eq 'List' && !$p->[0]{open}); return $self->formula($p) if $isFormula; bless {data => $p, type => $type}, $class; } |
From: dpvc v. a. <we...@ma...> - 2005-08-01 12:40:20
|
Log Message: ----------- Added postfilter to Parser-based implementation of NUM_CMP so that the student's answer is updated to be the result of evaluating the answer (when there is no error in evaluating the answer). This correctly reflects the behaviour of the original NUM_CMP. Modified Files: -------------- pg/lib/Parser/Legacy: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Legacy/PGanswermacros.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -Llib/Parser/Legacy/PGanswermacros.pl -Llib/Parser/Legacy/PGanswermacros.pl -u -r1.5 -r1.6 --- lib/Parser/Legacy/PGanswermacros.pl +++ lib/Parser/Legacy/PGanswermacros.pl @@ -1124,6 +1124,12 @@ $rh_ans->{original_correct_ans} = $rh_ans->{correct_ans}; return $rh_ans; }); + $cmp->install_post_filter(sub { + my $rh_ans = shift; + $rh_ans->{student_ans} = $rh_ans->{student_value}->string + if ref($rh_ans->{student_value}); + return $rh_ans; + }); $cmp->{debug} = $num_params{debug}; &$Context($oldContext); |
From: dpvc v. a. <we...@ma...> - 2005-08-01 12:35:39
|
Log Message: ----------- Fixed typo that caused hilighting of the position of errors to be lost. Modified Files: -------------- pg/lib/Value: Context.pm Revision Data ------------- Index: Context.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Context.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -Llib/Value/Context.pm -Llib/Value/Context.pm -u -r1.5 -r1.6 --- lib/Value/Context.pm +++ lib/Value/Context.pm @@ -120,7 +120,7 @@ $message .= sprintf($more,$pos->[0]+1) if $more; $error->{message} = $message; $error->{string} = $string; - $error->{pos} = $string; + $error->{pos} = $pos; $error->{flag} = 1; } |
From: dpvc v. a. <we...@ma...> - 2005-08-01 12:02:22
|
Log Message: ----------- Updates to make mode=>'frac' properly emulate the original num_cmp behavior (it now allows decimals and fractions instead of requiring a fraction). There is also a new LimitedNumeric-StrictFraction context (not currently used) that disallows decimals and requires fractions. Modified Files: -------------- pg/lib/Parser: Number.pm pg/lib/Parser/Legacy: LimitedNumeric.pm Revision Data ------------- Index: Number.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Number.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -Llib/Parser/Number.pm -Llib/Parser/Number.pm -u -r1.10 -r1.11 --- lib/Parser/Number.pm +++ lib/Parser/Number.pm @@ -15,9 +15,10 @@ return $equation->{context}{parser}{Complex}->new($equation,$value,$ref) if (ref($value) eq 'ARRAY'); $value = $value->value while Value::isReal($value); - $value = $value + 0; # format the value as a number, just in case $num = bless { - value => $value, type => $Value::Type{number}, isConstant => 1, + value => $value + 0, # format the value as a number, just in case + value_string => $value, # for decimal checking, etc. + type => $Value::Type{number}, isConstant => 1, ref => $ref, equation => $equation, }, $class; my $x = Value::Real->make($value); @@ -79,7 +80,7 @@ sub _NoDecimals { my $self = shift; $self->Error("You are not allowed to type decimal numbers in this problem") - unless $self->{value} =~ m/^[-+]?[0-9]+$/; + unless $self->{value_string} =~ m/^[-+]?[0-9]+$/; } Index: LimitedNumeric.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Legacy/LimitedNumeric.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/Parser/Legacy/LimitedNumeric.pm -Llib/Parser/Legacy/LimitedNumeric.pm -u -r1.2 -r1.3 --- lib/Parser/Legacy/LimitedNumeric.pm +++ lib/Parser/Legacy/LimitedNumeric.pm @@ -10,6 +10,12 @@ # Context("LimiteNumeric"); # Context("LimitedNumeric-Fraction"); # +# There is also a third version, which is a strict fraction +# mode (not in the original num_cmp) where ONLY fractions +# can be entered (not decimals). +# +# Context("LimitedNumeric-StrictFraction"); +# # @@ -23,7 +29,7 @@ $self->SUPER::_check; my $uop = $self->{def}{string} || $self->{uop}; $self->Error("You can only use '%s' with (non-negative) numbers",$uop) - unless $self->{op}->class =~ /Number|DIVIDE/; + unless $self->{op}->class =~ /Number|INTEGER|DIVIDE/; } sub class {'MINUS'}; @@ -40,13 +46,25 @@ my $self = shift; $self->SUPER::_check; my $bop = $self->{def}{string} || $self->{bop}; - $self->Error("You can only use '%s' between (non-negative) numbers",$bop) - unless $self->{lop}->class =~ /Number|MINUS/ && - $self->{rop}->class eq 'Number'; + $self->Error("You can only use '%s' between (non-negative) integers",$bop) + unless $self->{lop}->class =~ /INTEGER|MINUS/ && + $self->{rop}->class eq 'INTEGER'; } sub class {'DIVIDE'}; +# +# Distinguish integers from decimals +# +package Parser::Legacy::LimitedNumeric::Number; +our @ISA = qw(Parser::Number); + +sub class { + my $self = shift; + return "INTEGER" if $self->{value_string} =~ m/^[-+]?[0-9]+$/; + return "Number"; +} + package Parser::Legacy::LimitedNumeric; @@ -66,7 +84,7 @@ # # For the Fraction versions, allow the modified division, and -# make sure numbers are just integers +# make sure numbers used in fractions are just integers # $context = $Parser::Context::Default::context{Numeric}->copy; $Parser::Context::Default::context{'LimitedNumeric-Fraction'} = $context; @@ -82,6 +100,13 @@ ); $context->parens->undefine('|','{','['); $context->functions->disable('All'); +$context->{parser}{Number} = "Parser::Legacy::LimitedNumeric::Number"; + +# +# For strict fractions, don't allow decimal numbers +# +$context = $context->copy; +$Parser::Context::Default::context{'LimitedNumeric-StrictFraction'} = $context; Parser::Number::NoDecimals($context); 1; |
From: dpvc v. a. <we...@ma...> - 2005-08-01 11:59:47
|
Log Message: ----------- Folded in Mike's changes for status messages. Modified Files: -------------- pg/lib/Parser/Legacy: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Legacy/PGanswermacros.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -Llib/Parser/Legacy/PGanswermacros.pl -Llib/Parser/Legacy/PGanswermacros.pl -u -r1.4 -r1.5 --- lib/Parser/Legacy/PGanswermacros.pl +++ lib/Parser/Legacy/PGanswermacros.pl @@ -4614,6 +4614,9 @@ $problem_state{num_of_correct_ans}++ if $allAnswersCorrectQ == 1; $problem_state{num_of_incorrect_ans}++ if $allAnswersCorrectQ == 0; + + $problem_state{state_summary_msg} = ''; # an HTML formatted message printed at the bottom of the problem page + (\%problem_result, \%problem_state); } @@ -4713,6 +4716,8 @@ if ($record_problem_attempt == 1) { $problem_state{num_of_correct_ans}++ if $allAnswersCorrectQ == 1; $problem_state{num_of_incorrect_ans}++ if $allAnswersCorrectQ == 0; + $problem_state{state_summary_msg} = ''; # an HTML formatted message printed at the bottom of the problem page + } else { $problem_result{show_partial_correct_answers} = 0 ; # prevent partial correct answers from being shown for syntax errors. @@ -4786,6 +4791,9 @@ $problem_state{num_of_correct_ans}++ if $total == $count; $problem_state{num_of_incorrect_ans}++ if $total < $count ; + + $problem_state{state_summary_msg} = ''; # an HTML formatted message printed at the bottom of the problem page + warn "Error in grading this problem the total $total is larger than $count" if $total > $count; (\%problem_result, \%problem_state); } |
From: jj v. a. <we...@ma...> - 2005-07-31 19:47:45
|
Log Message: ----------- Update to match revision in database structure (chapter and section tables). Modified Files: -------------- webwork-modperl/lib/WeBWorK/Utils: ListingDB.pm Revision Data ------------- Index: ListingDB.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/Utils/ListingDB.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -Llib/WeBWorK/Utils/ListingDB.pm -Llib/WeBWorK/Utils/ListingDB.pm -u -r1.11 -r1.12 --- lib/WeBWorK/Utils/ListingDB.pm +++ lib/WeBWorK/Utils/ListingDB.pm @@ -78,10 +78,11 @@ my $query = "SELECT DISTINCT tbk.textbook_id,tbk.title,tbk.author, tbk.edition FROM textbook tbk, problem p, pgfile_problem pg, pgfile pgf, - DBsection s, DBchapter c, DBsubject t - WHERE tbk.textbook_id=p.textbook_id AND p.problem_id=pg.problem_id AND + DBsection s, DBchapter c, DBsubject t, chapter cc, section ss + WHERE ss.section_id=p.section_id AND p.problem_id=pg.problem_id AND s.DBchapter_id=c.DBchapter_id AND c.DBsubject_id=t.DBsubject_id AND pgf.DBsection_id=s.DBsection_id AND pgf.pgfile_id=pg.pgfile_id + AND ss.chapter_id=cc.chapter_id AND cc.textbook_id=tbk.textbook_id $chapstring $subjstring $sectstring "; my $text_ref = $dbh->selectall_arrayref($query); my @texts = @{$text_ref}; @@ -166,6 +167,7 @@ sub getDBListings { my $r = shift; + my $amcounter = shift; my $ce = $r->ce; my $subj = $r->param('library_subjects') || ""; my $chap = $r->param('library_chapters') || ""; @@ -194,17 +196,25 @@ $extrawhere .= " AND t.textbook_id=\"$text\" "; } - my $query = "SELECT DISTINCT pgf.pgfile_id from pgfile pgf, + my $selectwhat = 'DISTINCT pgf.pgfile_id'; + $selectwhat = 'COUNT(' . $selectwhat . ')' if ($amcounter); + + my $query = "SELECT $selectwhat from pgfile pgf, DBsection dbsc, DBchapter dbc, DBsubject dbsj, pgfile_problem pgp, - problem p, textbook t + problem p, textbook t , chapter cc, section ss WHERE dbsj.DBsubject_id = dbc.DBsubject_id AND dbc.DBchapter_id = dbsc.DBchapter_id AND dbsc.DBsection_id = pgf.DBsection_id AND pgf.pgfile_id = pgp.pgfile_id AND pgp.problem_id = p.problem_id AND - p.textbook_id = t.textbook_id \n $extrawhere"; + cc.textbook_id = t.textbook_id AND + ss.chapter_id = cc.chapter_id AND + p.section_id = ss.section_id \n $extrawhere"; my $pg_id_ref = $dbh->selectall_arrayref($query); my @pg_ids = map { $_->[0] } @{$pg_id_ref}; + if($amcounter) { + return(@pg_ids[0]); + } my @results=(); for my $pgid (@pg_ids) { $query = "SELECT path, filename FROM pgfile pgf, path p @@ -216,48 +226,9 @@ return @results; } - sub countDBListings { my $r = shift; - my $ce = $r->ce; - my $subj = $r->param('library_subjects') || ""; - my $chap = $r->param('library_chapters') || ""; - my $sec = $r->param('library_sections') || ""; - my $text = $r->param('library_textbook') || ""; - my $textchap = $r->param('library_textbook_chapter') || ""; - my $textsec = $r->param('library_textbook_section') || ""; - - my $dbh = getDB($ce); - - my $extrawhere = ''; - if($subj) { - $subj =~ s/'/\\'/g; - $extrawhere .= " AND dbsj.name=\"$subj\" "; - } - if($chap) { - $chap =~ s/'/\\'/g; - $extrawhere .= " AND dbc.name=\"$chap\" "; - } - if($sec) { - $sec =~ s/'/\\'/g; - $extrawhere .= " AND dbsc.name=\"$sec\" "; - } - if($text) { - $text =~ s/'/\\'/g; - $extrawhere .= " AND t.textbook_id=\"$text\" "; - } - - my $query = "SELECT COUNT(DISTINCT pgf.pgfile_id) from pgfile pgf, - DBsection dbsc, DBchapter dbc, DBsubject dbsj, pgfile_problem pgp, - problem p, textbook t - WHERE dbsj.DBsubject_id = dbc.DBsubject_id AND - dbc.DBchapter_id = dbsc.DBchapter_id AND - dbsc.DBsection_id = pgf.DBsection_id AND - pgf.pgfile_id = pgp.pgfile_id AND - pgp.problem_id = p.problem_id AND - p.textbook_id = t.textbook_id \n $extrawhere"; - my $pg_id_ref = $dbh->selectrow_arrayref($query); - return($pg_id_ref->[0]) + return (getDBListings($r,1)); } ############################################################################## @@ -435,7 +406,7 @@ my $r = shift; my $ce = $r->ce; my $version = $ce->{problemLibrary}->{version} || 1; - if($version == 2) { return(getDBListings($r))} + if($version == 2) { return(getDBListings($r, 0))} my $subj = $r->param('library_subjects') || ""; my $chap = $r->param('library_chapters') || ""; my $sec = $r->param('library_sections') || ""; |
From: Mike G. v. a. <we...@ma...> - 2005-07-31 18:11:42
|
Log Message: ----------- Sort course names without regard to case. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator: Home.pm Revision Data ------------- Index: Home.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Home.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -Llib/WeBWorK/ContentGenerator/Home.pm -Llib/WeBWorK/ContentGenerator/Home.pm -u -r1.7 -r1.8 --- lib/WeBWorK/ContentGenerator/Home.pm +++ lib/WeBWorK/ContentGenerator/Home.pm @@ -61,7 +61,7 @@ print CGI::start_ul(); - foreach my $courseID (sort @courseIDs) { + foreach my $courseID (sort {lc($a) cmp lc($b) } @courseIDs) { next if $courseID eq "admin"; # done already above my $urlpath = $r->urlpath->newFromModule("WeBWorK::ContentGenerator::ProblemSets", courseID => $courseID); print CGI::li(CGI::a({href=>$self->systemLink($urlpath, authen => 0)}, $courseID)); |
From: Mike G. v. a. <we...@ma...> - 2005-07-31 17:25:13
|
Log Message: ----------- Updating the user interface. The checkbox to include webwork administrators in s a course is now on by default. The default templates course to copy when creating a new course can now be set in global.conf. This is the course that automatically comes up by default in the pop-up menu. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator: CourseAdmin.pm Revision Data ------------- Index: CourseAdmin.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v retrieving revision 1.38 retrieving revision 1.39 diff -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -u -r1.38 -r1.39 --- lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -38,8 +38,8 @@ our @DB_LAYOUT_ORDER = qw/sql_single gdbm sql/; our %DB_LAYOUT_DESCRIPTIONS = ( - gdbm => "Deprecated. Uses GDBM databases to record WeBWorK data. Use this layout if the course must be used with WeBWorK 1.x.", - sql => "Deprecated. Uses a separate SQL database to record WeBWorK data for each course.", + gdbm => CGI::i("Deprecated. Uses GDBM databases to record WeBWorK data. Use this layout if the course must be used with WeBWorK 1.x."), + sql => CGI::i("Deprecated. Uses a separate SQL database to record WeBWorK data for each course."), sql_single => "Uses a single SQL database to record WeBWorK data for all courses using this layout. This is the recommended layout for new courses.", ); @@ -238,7 +238,12 @@ print CGI::p({style=>"text-align: center"}, - CGI::a({href=>$self->systemLink($urlpath, params=>{subDisplay=>"add_course"})}, "Add Course"), + CGI::a({href=>$self->systemLink($urlpath, params=>{subDisplay=>"add_course",add_admin_users=>1, + add_dbLayout=>'sql_single', + add_templates_course => $ce->{siteDefaults}->{default_templates_course} ||""} + )}, + "Add Course" + ), " | ", CGI::a({href=>$self->systemLink($urlpath, params=>{subDisplay=>"rename_course"})}, "Rename Course"), " | ", @@ -405,8 +410,8 @@ ); print CGI::p("To add the WeBWorK administrators to the new course (as instructors) check the box below."); - - print CGI::p(CGI::checkbox("add_admin_users", $add_admin_users, "on", "Add WeBWorK administrators to new course")); + my $checked = ($add_admin_users) ?"checked": ""; # workaround because CGI::checkbox seems to have a bug -- it won't default to checked. + print CGI::p(CGI::input({-type=>'checkbox', -name=>"add_admin_users", $checked=>'' }, "Add WeBWorK administrators to new course")); print CGI::p("To add an additional instructor to the new course, specify user information below. The user ID may contain only numbers, letters, hyphens, and underscores."); @@ -487,7 +492,10 @@ print CGI::td(); # for indentation :( print CGI::start_td(); + if ($dbLayout eq "sql") { + + print CGI::p({style=>'font-style:italic'},"The following information is only required for the deprecated sql database format:"); print CGI::start_table({class=>"FormLayout"}); print CGI::Tr(CGI::td({colspan=>2}, "Enter the user ID and password for an SQL account with sufficient permissions to create a new database." @@ -543,6 +551,7 @@ ); print CGI::end_table(); } elsif ($dbLayout eq "gdbm") { + print CGI::p({style=>"font-style: italic"},"The following information is only required for the deprecated gdbm database format:"); print CGI::start_table({class=>"FormLayout"}); print CGI::Tr( CGI::th({class=>"LeftHeader"}, "GDBM Global User ID:"), |
From: Mike G. v. a. <we...@ma...> - 2005-07-31 17:22:42
|
Log Message: ----------- Make "modelCourse" the default course to use as a model when creating a new course. The contents of the templates directory of modelCourse is copied into the templates directory of the new course. Modified Files: -------------- webwork-modperl/conf: global.conf.dist Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/conf/global.conf.dist,v retrieving revision 1.125 retrieving revision 1.126 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.125 -r1.126 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -433,6 +433,11 @@ # $siteDefaults{timezone} = ""; +# The default_templates_course is used by default to create a new course. +# The contents of the templates directory are copied from this course +# to the new course being created. +$siteDefaults{default_templates_course} ="modelCourse"; + ################################################################################ # Frontend options ################################################################################ |
From: Mike G. v. a. <we...@ma...> - 2005-07-31 15:31:49
|
Log Message: ----------- Changed unordered list to ordered list. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator: CourseAdmin.pm Revision Data ------------- Index: CourseAdmin.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v retrieving revision 1.37 retrieving revision 1.38 diff -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -u -r1.37 -r1.38 --- lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -273,7 +273,7 @@ print CGI::h2("Courses"); - print CGI::start_ul(); + print CGI::start_ol(); my @courseIDs = listCourses($ce); foreach my $courseID (sort {lc($a) cmp lc($b) } @courseIDs) { @@ -295,7 +295,7 @@ } - print CGI::end_ul(); + print CGI::end_ol(); } return ""; } |
From: Mike G. v. a. <we...@ma...> - 2005-07-31 15:24:12
|
Log Message: ----------- User interface changes added. All courses are sorted without regard to case. The main page now lists all available courses and their database type -- finding the database type slows things down a bit, so this might not be a desirable feature when there are many courses. It also discovers missing course.conf files. If the course.conf file is missing then it's more likely that the database type is not accurate. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator: CourseAdmin.pm Revision Data ------------- Index: CourseAdmin.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v retrieving revision 1.36 retrieving revision 1.37 diff -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -u -r1.36 -r1.37 --- lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -269,8 +269,34 @@ if (defined $method_to_call and $method_to_call ne "") { $self->$method_to_call; - } + } else { + + print CGI::h2("Courses"); + print CGI::start_ul(); + + my @courseIDs = listCourses($ce); + foreach my $courseID (sort {lc($a) cmp lc($b) } @courseIDs) { + next if $courseID eq "admin"; # done already above + my $urlpath = $r->urlpath->newFromModule("WeBWorK::ContentGenerator::ProblemSets", courseID => $courseID); + my $tempCE = WeBWorK::CourseEnvironment->new( + $ce->{webworkDirs}->{root}, + $ce->{webworkURLs}->{root}, + $ce->{pg}->{directories}->{root}, + $courseID, + ); + print CGI::li(CGI::a({href=>$self->systemLink($urlpath, authen => 0)}, $courseID), + CGI::code( + $tempCE->{dbLayoutName}, + ), + (-r $tempCE->{courseFiles}->{environment}) ? "" : CGI::i(", missing course.conf"), + + ); + + } + + print CGI::end_ul(); + } return ""; } @@ -353,7 +379,7 @@ }; my @existingCourses = listCourses($ce); - @existingCourses = sort @existingCourses; + @existingCourses = sort { lc($a) cmp lc ($b) } @existingCourses; #make sort case insensitive print CGI::h2("Add Course"); @@ -806,7 +832,7 @@ my $rename_sql_wwhost = $r->param("rename_sql_wwhost") || ""; my @courseIDs = listCourses($ce); - @courseIDs = sort @courseIDs; + @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; my %courseLabels; # records... heh. foreach my $courseID (@courseIDs) { @@ -1052,7 +1078,7 @@ my $delete_sql_database = $r->param("delete_sql_database") || ""; my @courseIDs = listCourses($ce); - @courseIDs = sort @courseIDs; + @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; #make sort case insensitive my %courseLabels; # records... heh. foreach my $courseID (@courseIDs) { @@ -1328,7 +1354,7 @@ @export_tables = @tables unless @export_tables; my @courseIDs = listCourses($ce); - @courseIDs = sort @courseIDs; + @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; #make sort case insensitive my %courseLabels; # records... heh. foreach my $courseID (@courseIDs) { @@ -1512,7 +1538,7 @@ @import_tables = @tables unless @import_tables; my @courseIDs = listCourses($ce); - @courseIDs = sort @courseIDs; + @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; #make sort case insensitive my %courseLabels; # records... heh. |
From: Mike G. v. a. <we...@ma...> - 2005-07-30 17:24:39
|
Log Message: ----------- Added useful links to the macro list and the pod_docs in addition to the incomplete manpages. These are still temporary measures for improving the documentation for those writing problems. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: PGProblemEditor.pm Revision Data ------------- Index: PGProblemEditor.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm,v retrieving revision 1.55 retrieving revision 1.56 diff -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -Llib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm -u -r1.55 -r1.56 --- lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm +++ lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm @@ -646,8 +646,14 @@ 'Mode: ', CGI::popup_menu(-name=>'displayMode', -values=>$mode_list, -default=>$displayMode), CGI::a({-href=>'http://webwork.math.rochester.edu/docs/docs/pglanguage/manpages/',-target=>"manpage_window"}, - 'Manpages', - ) + ' Manpages ', + ), + 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"}, + ' pod docs ', + ), ), CGI::p( CGI::textarea( |
From: Mike G. v. a. <we...@ma...> - 2005-07-30 01:47:57
|
Log Message: ----------- I've changed errorOutput($error,$details) to accept a reference to a string or to an array for $details. These are automatically converted to the proper form. References should be used when the $details points to a large number of bytes, such as the contents of a file. This version is not faster than the original method where $details was always a string, sometimes a very long string. It does seem to save memory however. Further savings in memory could be obtained by print directly, but there are a few instances which call errorOutput and then do further formatting before printing. At the moment it doesn't seem to be worth it to make the change from return to print. Modified Files: -------------- webwork-modperl/lib/WeBWorK: ContentGenerator.pm webwork-modperl/lib/WeBWorK/ContentGenerator: Hardcopy.pm Revision Data ------------- Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.140 retrieving revision 1.141 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.140 -r1.141 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -1671,7 +1671,18 @@ my %headers = $r->headers_in; join("", map { CGI::Tr(CGI::td(CGI::small($_)), CGI::td(CGI::small($headers{$_}))) } keys %headers); }; - + + # if it is a long report pass details by reference rather than by value + # for consistency we automatically convert all forms of $details into + # a reference to an array. + + if (ref($details) =~ /SCALAR/i) { + $details = [$$details]; + } elsif (ref($details) =~/ARRAY/i) { + # no change needed + } else { + $details = [$details]; + } return CGI::h2("WeBWorK Error"), CGI::p(<<EOF), @@ -1681,9 +1692,16 @@ you are a professor, please consult the error output below for more information. EOF CGI::h3("Error messages"), + CGI::p(CGI::code($error)), CGI::h3("Error details"), - CGI::code(CGI::p($details)), + + CGI::start_code(), CGI::start_p(), + @{ $details }, + #CGI::code(CGI::p(@expandedDetails)), + # not using inclusive CGI calls here saves about 30Meg of memory! + CGI::end_p(),CGI::end_code(), + CGI::h3("Request information"), CGI::table({border=>"1"}, CGI::Tr(CGI::td("Time"), CGI::td($time)), @@ -1692,7 +1710,9 @@ CGI::Tr(CGI::td("HTTP Headers"), CGI::td( CGI::table($headers), )), - ); + ), + ; + } =item warningOutput($warnings) Index: Hardcopy.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Hardcopy.pm,v retrieving revision 1.56 retrieving revision 1.57 diff -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -Llib/WeBWorK/ContentGenerator/Hardcopy.pm -u -r1.56 -r1.57 --- lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -47,6 +47,8 @@ use WeBWorK::Utils qw(readFile makeTempDirectory); use Apache::Constants qw(:common REDIRECT); +our $HardcopyTimer = new WeBWorK::Timing if $WeBWorK::Timing::Enabled; + =head1 CONFIGURATION VARIABLES =over @@ -71,6 +73,7 @@ my $authz = $r->authz; my $userID = $r->param("user"); + $HardcopyTimer->start if $WeBWorK::Timing::Enabled;; my $singleSet = $r->urlpath->arg("setID"); my @sets = $r->param("hcSet"); my @users = $r->param("hcUser"); @@ -185,14 +188,19 @@ sub body { my ($self) = @_; + $HardcopyTimer->continue("Hardcopy: printing generation errors") if defined($HardcopyTimer); if ($self->{generationError}) { if (ref $self->{generationError} eq "ARRAY") { my ($disposition, @rest) = @{$self->{generationError}}; if ($disposition eq "PGFAIL") { $self->multiErrorOutput(@{$self->{errors}}); + $HardcopyTimer->continue("Hardcopy: end printing generation errors") if defined($HardcopyTimer); + $HardcopyTimer->save if defined($HardcopyTimer); return ""; } elsif ($disposition eq "FAIL") { print $self->errorOutput(@rest); + $HardcopyTimer->continue("Hardcopy: end printing generation errors") if defined($HardcopyTimer); + $HardcopyTimer->save if defined($HardcopyTimer); return ""; } elsif ($disposition eq "RETRY") { print $self->errorOutput(@rest); @@ -201,9 +209,14 @@ } } else { # not something we were expecting... + $HardcopyTimer->continue("Hardcopy: end printing generation errors") if defined($HardcopyTimer); + $HardcopyTimer->save if defined($HardcopyTimer); die $self->{generationError}; } } + $HardcopyTimer->continue("Hardcopy: end printing generation errors") if defined($HardcopyTimer); + $HardcopyTimer->save if defined($HardcopyTimer); + if (@{$self->{warnings}}) { # FIXME: this code will only be reached if there was also a # generation error, because otherwise the module will send @@ -441,7 +454,9 @@ my $pdfFileURL = undef; if ($self->{hardcopy_format} eq 'pdf' ) { my $errors = ''; + $HardcopyTimer->continue("begin latex2pdf") if defined($HardcopyTimer); $pdfFileURL = eval { $self->latex2pdf($tex, $tempDir, $fileName) }; + $HardcopyTimer->continue("end latex2pdf") if defined($HardcopyTimer); if ($@) { $errors = $@; #$errors =~ s/\n/<br>/g; # make this readable on HTML FIXME make this a Utils. filter (Error2HTML) @@ -546,30 +561,43 @@ # Alert the world that the tex file did not process perfectly. if ($pdflatexResult) { # something bad happened - my $textErrorMessage = "Call to $pdflatex failed: $!\n".CGI::br(); - + my @textErrorMessage = (); + push @textErrorMessage , "Call to $pdflatex failed: $!\n",CGI::br(); + if (-e $wd) { + push @textErrorMessage , "Working directory preserved at '$wd'.\n", + CGI::p("Investigating the contents of the working directory can be useful for debugging ", + "errors which arise while processing the tex file, but it requires direct access to the server.\n" + ); + } else { + push @textErrorMessage, "Working directory $wd was not created.\n",CGI::br() ; + } if (-e $hardcopyFilePath ) { # FIXME Misuse of html tags!!! - $textErrorMessage.= "<h4>Some pdf output was produced and is available ". CGI::a({-href=>$hardcopyFileURL},"here.</h4>").CGI::hr(); + push @textErrorMessage, CGI::h4("<h4>Some pdf output was produced and is available ", + CGI::a({-href=>$hardcopyFileURL},"here. ")),CGI::p("Looking at these + fragments of typeset output can help with debugging."), CGI::hr(); } # report logfile if (-e $logFile) { - $textErrorMessage .= "pdflatex ran, but did not succeed. This suggests an error in the TeX\n".CGI::br(); - $textErrorMessage .= "version of one of the problems, or a problem with the pdflatex system.\n".CGI::br(); + push @textErrorMessage , "pdflatex ran, but did not succeed. This suggests an error in the TeX\n", CGI::br(); + push @textErrorMessage , "version of one of the problems, or a problem with the pdflatex system.\n",CGI::br(); + $HardcopyTimer->continue("Hardcopy: read log file") if defined($HardcopyTimer); my $logFileContents = eval { readTexErrorLog($logFile) }; $logFileContents .= CGI::hr().CGI::hr(); + $HardcopyTimer->continue("Hardcopy: format log file") if defined($HardcopyTimer); $logFileContents .= eval { formatTexFile($texFile) }; + $HardcopyTimer->continue("Hardcopy: end processing log file") if defined($HardcopyTimer); if ($@) { - $textErrorMessage .= "Additionally, the pdflatex log file could not be read, though it exists.\n".CGI::br(); + push @textErrorMessage, "Additionally, the pdflatex log file could not be read, though it exists.\n", CGI::br(); } else { - $textErrorMessage .= "The essential contents of the TeX log are as follows:\n".CGI::hr().CGI::br(); - $textErrorMessage .= "$logFileContents\n".CGI::br().CGI::br(); + push @textErrorMessage, "The essential contents of the TeX log are as follows:\n",CGI::hr(),CGI::br(); + push @textErrorMessage, $logFileContents, CGI::br(), CGI::br(); } } else { - $textErrorMessage .= "No log file was created, suggesting that pdflatex never ran. Check the WeBWorK\n".CGI::br(); - $textErrorMessage .= "configuration to ensure that the path to pdflatex is correct.\n".CGI::br(); + push @textErrorMessage, "No log file was created, suggesting that pdflatex never ran. Check the WeBWorK\n",CGI::br(); + push @textErrorMessage, "configuration to ensure that the path to pdflatex is correct.\n", CGI::br(); } - die $textErrorMessage; + die \@textErrorMessage; } @@ -717,7 +745,7 @@ } sub getProblemTeX { - $WeBWorK::timer1 ->continue("hardcopy: begin processing problem") if defined($WeBWorK::timer1); + $HardcopyTimer ->continue("hardcopy: begin processing problem") if defined($HardcopyTimer); my ($self, $effectiveUser, $setName, $problemNumber, $pgFile) = @_; my $r = $self->r; my $ce = $r->ce; @@ -852,7 +880,7 @@ $pg->{body_text} .= $correctTeX; } } - $WeBWorK::timer1 ->continue("hardcopy: end processing problem") if defined($WeBWorK::timer1); + $HardcopyTimer ->continue("hardcopy: end processing problem") if defined($HardcopyTimer); return $pg->{body_text}; } |