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: Sam H. v. a. <act...@de...> - 2005-01-28 00:07:36
|
Log Message: ----------- HEAD backport: Modifications to make sure that problems with weight 0 print weight as 0 rather than as a blank. This addresses bug #730 (gage) Tags: ---- rel-2-1-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetDetail.pm Revision Data ------------- Index: ProblemSetDetail.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm -u -r1.13 -r1.13.2.1 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm @@ -268,9 +268,10 @@ my $choose = ($properties{type} eq "choose") && ($properties{override} ne "none"); my $globalValue = $globalRecord->{$field}; - $globalValue = $globalValue ? ($labels{$globalValue || ""} || $globalValue) : ""; + # use defined instead of value in order to allow 0 to printed, e.g. for the 'value' field + $globalValue = (defined($globalValue)) ? ($labels{$globalValue || ""} || $globalValue) : ""; my $userValue = $userRecord->{$field}; - $userValue = $userValue ? ($labels{$userValue || ""} || $userValue) : ""; + $userValue = (defined($userValue)) ? ($labels{$userValue || ""} || $userValue) : ""; if ($field =~ /_date/) { $globalValue = $self->formatDateTime($globalValue) if $globalValue; |
From: Sam H. v. a. <act...@de...> - 2005-01-28 00:07:31
|
Log Message: ----------- HEAD backport: Changed comment to This answer is the same as the one you just submitted or previewed. This addreses bug #557 (gage) Tags: ---- rel-2-1-patches Modified Files: -------------- pg/macros: PGanswermacros.pl Revision Data ------------- Index: PGanswermacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGanswermacros.pl,v retrieving revision 1.26.2.1 retrieving revision 1.26.2.2 diff -Lmacros/PGanswermacros.pl -Lmacros/PGanswermacros.pl -u -r1.26.2.1 -r1.26.2.2 --- macros/PGanswermacros.pl +++ macros/PGanswermacros.pl @@ -2000,7 +2000,7 @@ sub { my $rh_ans = shift; if ( defined($rh_ans->{'ans_equals_prev_ans'}) and $rh_ans->{'ans_equals_prev_ans'} and $rh_ans->{score}==0) { - $rh_ans->{ans_message} = "This answer is the same as the one you just submitted."; + $rh_ans->{ans_message} = "This answer is the same as the one you just submitted or previewed."; } $rh_ans; } |
From: Sam H. v. a. <act...@de...> - 2005-01-28 00:07:26
|
Log Message: ----------- HEAD backport: Make sure that $r->param("user") is only called in scalar context. (gage) Tags: ---- rel-2-1-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: Scoring.pm Revision Data ------------- Index: Scoring.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Scoring.pm,v retrieving revision 1.36 retrieving revision 1.36.2.1 diff -Llib/WeBWorK/ContentGenerator/Instructor/Scoring.pm -Llib/WeBWorK/ContentGenerator/Instructor/Scoring.pm -u -r1.36 -r1.36.2.1 --- lib/WeBWorK/ContentGenerator/Instructor/Scoring.pm +++ lib/WeBWorK/ContentGenerator/Instructor/Scoring.pm @@ -125,10 +125,10 @@ # Check permissions return CGI::div({class=>"ResultsWithError"}, "You are not authorized to access the Instructor tools.") - unless $authz->hasPermissions($r->param("user"), "access_instructor_tools"); + unless $authz->hasPermissions($user, "access_instructor_tools"); return CGI::div({class=>"ResultsWithError"}, "You are not authorized to score sets.") - unless $authz->hasPermissions($r->param("user"), "score_sets"); + unless $authz->hasPermissions($user, "score_sets"); print join("", CGI::start_form(-method=>"POST", -action=>$scoringURL),"\n", |
From: Sam H. v. a. <act...@de...> - 2005-01-28 00:07:23
|
Log Message: ----------- HEAD backport: make sure that $r->param("users") is only used in a scalar context. (gage) Tags: ---- rel-2-1-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: AddUsers.pm Revision Data ------------- Index: AddUsers.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm,v retrieving revision 1.15 retrieving revision 1.15.4.1 diff -Llib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm -Llib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm -u -r1.15 -r1.15.4.1 --- lib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm +++ lib/WeBWorK/ContentGenerator/Instructor/AddUsers.pm @@ -114,10 +114,10 @@ # Check permissions return CGI::div({class=>"ResultsWithError"}, "You are not authorized to access the Instructor tools.") - unless $authz->hasPermissions($r->param("user"), "access_instructor_tools"); + unless $authz->hasPermissions($user, "access_instructor_tools"); return CGI::div({class=>"ResultsWithError"}, "You are not authorized to modify student data.") - unless $authz->hasPermissions($r->param("user"), "modify_student_data"); + unless $authz->hasPermissions($user, "modify_student_data"); return join("", |
From: Sam H. v. a. <act...@de...> - 2005-01-28 00:07:16
|
Log Message: ----------- HEAD backport: Call $r->param("user") only in scalar context (gage) Tags: ---- rel-2-1-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator/Instructor: Assigner.pm Revision Data ------------- Index: Assigner.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Assigner.pm,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -Llib/WeBWorK/ContentGenerator/Instructor/Assigner.pm -Llib/WeBWorK/ContentGenerator/Instructor/Assigner.pm -u -r1.25 -r1.25.2.1 --- lib/WeBWorK/ContentGenerator/Instructor/Assigner.pm +++ lib/WeBWorK/ContentGenerator/Instructor/Assigner.pm @@ -46,13 +46,15 @@ my $db = $r->db; my $authz = $r->authz; my $ce = $r->ce; - + + my $user = $r->param('user'); + # Check permissions return CGI::div({class=>"ResultsWithError"}, "You are not authorized to access the Instructor tools.") - unless $authz->hasPermissions($r->param("user"), "access_instructor_tools"); + unless $authz->hasPermissions($user, "access_instructor_tools"); return CGI::div({class=>"ResultsWithError"}, "You are not authorized to assign problem sets.") - unless $authz->hasPermissions($r->param("user"), "assign_problem_sets"); + unless $authz->hasPermissions($user, "assign_problem_sets"); print CGI::p("Select one or more sets and one or more users below to assign/unassign" |
From: dpvc v. a. <act...@de...> - 2005-01-28 00:07:13
|
Log Message: ----------- Bring jsMath up to version 1.7e. Version 1.7 introduced improved alignment in arrays, and the quality of stretchable delimiters in some browsers. It also fixed a couple of bugs. Most of the sub-versions were work-arrounds for bugs in MSIE. Finally, there is support for controlling the style used for displayed equations. (Normally they are centered, but that can now be controlled using the div.typeset CSS style.) A number of minor spacing problems on the PC also were corrected. Modified Files: -------------- webwork-modperl/htdocs/jsMath: jsMath-fallback-mac.js jsMath-fallback-pc.js jsMath.js Revision Data ------------- Index: jsMath.js =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/htdocs/jsMath/jsMath.js,v retrieving revision 1.13 retrieving revision 1.14 diff -Lhtdocs/jsMath/jsMath.js -Lhtdocs/jsMath/jsMath.js -u -r1.13 -r1.14 --- htdocs/jsMath/jsMath.js +++ htdocs/jsMath/jsMath.js @@ -2,7 +2,7 @@ * * jsMath: Mathematics on the Web * - * Version: 1.6b-ww + * Version: 1.7e-ww * * This jsMath package makes it possible to display mathematics in HTML pages * that are viewable by a wide range of browsers on both the Mac and the IBM PC, @@ -12,7 +12,7 @@ * * for the latest version, and for documentation on how to use jsMath. * - * Copyright (c) 2004 by Davide P. Cervone. + * Copyright (c) 2004-2005 by Davide P. Cervone. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -167,8 +167,9 @@ renameOK: 1, // tells if brower will find a tag whose name // has been set via setAttributes separateNetgativeSkips: 0, // MSIE doesn't do negative left margins + separateSkips: 0, // Netscape doesn't combine skips well noEmptySpans: 0, // empty spans are/aren't allowed - lineH: 1, // for MSIE span height adjustments + msieSpaceFix: '', // for MSIE spacing bug fix delay: 1, // delay for asynchronous math processing @@ -209,6 +210,8 @@ '.normal': 'font-family: serif; font-style: normal; font-size: 133%', '.math': 'font-family: serif; font-style: normal; color: grey33; font-size: 75%', '.typeset': 'font-family: serif; font-style: normal; font-size: 133%', + 'span.typeset': 'font-family: serif; font-style: normal', + 'div.typeset': 'font-family: serif; font-style: normal; text-align: center; margin-top: 1em; margin-bottom: 1em', '.mathlink': 'text-decoration: none', '.mathHD': 'border-width: 0; width: 1px; margin-right: -1px', @@ -272,7 +275,6 @@ if (n == null) {n = 124}; if (factor == null) {factor = 2} var wh1 = this.BBoxFor('<SPAN STYLE="font-family: '+name+', serif">'+this.TeX[name][n].c+'</SPAN>'); var wh2 = this.BBoxFor('<SPAN STYLE="font-family: serif">'+this.TeX[name][n].c+'</SPAN>'); -//alert([wh1.w,wh1.h,wh2.w,wh2.h,factor,wh1.w>factor*wh2.w && wh1.h != 0]); return (wh1.w > factor*wh2.w && wh1.h != 0); }, @@ -280,7 +282,6 @@ if (n == null) {n = 124}; if (factor == null) {factor = 2} var wh1 = this.BBoxFor('<SPAN STYLE="font-family: '+name+', serif">'+this.TeX[name][n].c+'</SPAN>'); var wh2 = this.BBoxFor('<SPAN STYLE="font-family: serif">'+this.TeX[name][n].c+'</SPAN>'); -//alert([this.TeX[name][n].c,wh1.w,wh1.h,wh2.w,wh2.h,factor,wh2.w > factor*wh1.w && wh1.h != 0]); return (wh2.w > factor*wh1.w && wh1.h != 0); }, @@ -349,7 +350,6 @@ this.h = (h-d)/this.em; this.d = d/this.em; this.hd = this.h + this.d; this.ph = h-d; this.pd = d; - if (this.lineH == null) {this.lineH = this.h} this.InitTeXfonts(); @@ -446,16 +446,18 @@ cmbx10: {'10': {c: '<B>Ω</B>', tclass: 'normal'}} }); this.allowAbsoluteDelim = 1; - this.separateNegativeSkips = 1; - this.lineH = 1.03; + this.separateSkips = 1; this.msieFontBug = 1; this.msieIntegralBug = 1; - jsMath.Macro('joinrel','\\mathrel{\\kern-5mu}'), + this.msieSpaceFix = '<IMG SRC="'+jsMath.blank+'" CLASS="mathHD">'; + jsMath.Macro('joinrel','\\mathrel{\\kern-5mu}'), + jsMath.Macro('mapsto','\\mapstochar\\kern-.54em\\rightarrow'); jsMath.Macro('longmapsto','\\mapstochar\\kern-.54em\\char{cmsy10}{0}\\joinrel\\rightarrow'); } else if (navigator.platform == 'MacPPC') { document.writeln('<SCRIPT SRC="'+this.root+'jsMath-msie-mac.js"></SCRIPT>'); + jsMath.Parser.prototype.macros.angle = ['Replace','ord','<FONT FACE="Symbol">‹</FONT>','normal']; + jsMath.msieAbsoluteBug = 1; } jsMath.Macro('not','\\mathrel{\\rlap{\\kern3mu/}}'); - jsMath.Parser.prototype.macros.angle = ['Replace','ord','<FONT FACE="Symbol">‹</FONT>','normal']; } // @@ -539,7 +541,7 @@ {if (this.TeX.fam[i] != '') {this.TeX[this.TeX.fam[i]].dh = .1}} this.absoluteOffsetY = -.05; this.TeX.axis_height += .05; -// this.allowAbsoluteDelim = ! this.oldSafari; + this.allowAbsoluteDelim = ! this.oldSafari; } // @@ -547,8 +549,10 @@ // if (this.allowAbsoluteDelim) { jsMath.Box.DelimExtend = jsMath.Box.DelimExtendAbsolute; + jsMath.Box.Layout = jsMath.Box.LayoutAbsolute; } else { jsMath.Box.DelimExtend = jsMath.Box.DelimExtendRelative; + jsMath.Box.Layout = jsMath.Box.LayoutRelative; } if (this.separateNegativeSkips) { @@ -1499,7 +1503,8 @@ */ Spacer: function (w) { if (w == 0) {return ''}; - return '<SPAN STYLE="margin-left: '+this.Em(w)+'"></SPAN>'; + return jsMath.msieSpaceFix + + '<SPAN STYLE="margin-left: '+this.Em(w)+'"></SPAN>'; }, /* @@ -1526,27 +1531,6 @@ + 'vertical-align: '+this.Em(y)+'; left: '+this.Em(x)+'; ' + 'width:'+this.Em(w)+'; height: '+this.Em(h)+'; ' + 'border-color: '+c+'; border-style: solid; border-width: 1px;">'; - -// if (!c) {c = 'black'}; -// if (pos) {pos = 'absolute;'} else -// {pos = 'relative; margin-right: '+this.Em(-w-.1)+'; '} -// return '<IMG SRC="blank.gif" STYLE="position:' + pos -// + 'vertical-align: '+this.Em(y)+'; left: '+this.Em(x)+'; ' -// + 'width:'+this.Em(w)+'; height: '+this.Em(h)+'; ' -// + 'border-color: '+c+'; border-style: solid; border-width: 1px;">'; - - /* - * h = Math.round(h*jsMath.em)-2; // use pixels to compensate for border size - * w = Math.round(w*jsMath.em)-2; - * y = Math.round(y*jsMath.em)-1; - * if (!c) {c = 'black'}; - * if (pos) {pos = 'absolute;'} else - * {pos = 'relative; margin-right: '+(-w-2)+'px; '} - * return '<IMG SRC="'+jsMath.blank+'" STYLE="position:' + pos - * + 'vertical-align: '+y+'px; left: '+this.Em(x)+'; ' - * + 'width:'+w+'px; height: '+h+'px; ' - * + 'border-color: '+c+'; border-style: solid; border-width: 1px;">'; - */ }, /* @@ -1626,7 +1610,10 @@ if (y) {span += ' top:'+this.Em(-y)+';'} html = span + '">' + html + '</SPAN>'; } - if (x < 0) {html = '<SPAN STYLE="margin-left:'+this.Em(x)+';"></SPAN>' + html} + if (x < 0) { + html = jsMath.msieSpaceFix + + '<SPAN STYLE="margin-left:'+this.Em(x)+';"></SPAN>' + html; + } return html; }, @@ -1638,7 +1625,44 @@ if (Math.abs(y) < .0001) {y = 0} if (y) {html = '<SPAN STYLE="position: relative; top:'+this.Em(-y)+';' + '">' + html + '</SPAN>'} - if (x) {html = '<SPAN STYLE="margin-left:'+this.Em(x)+';"></SPAN>' + html} + if (x) {html = jsMath.msieSpaceFix + + '<SPAN STYLE="margin-left:'+this.Em(x)+';"></SPAN>' + html} + return html; + }, + + /* + * Place a SPAN with absolute coordinates + */ + PlaceAbsolute: function (html,x,y) { + if (Math.abs(x) < .0001) {x = 0} + if (Math.abs(y) < .0001) {y = 0} + html = '<SPAN STYLE="position: absolute; left:'+this.Em(x)+'; ' + + 'top:'+this.Em(y)+';">' + html + ' </SPAN>'; + // space normalizes line height + return html; + }, + + Absolute: function(html,w,h,d,y,H) { + var align = ""; + if (d) {align = ' vertical-align: '+jsMath.HTML.Em(-d)+';'} + if (y != "none") { + if (Math.abs(y) < .0001) {y = 0} + html = '<SPAN STYLE="position: absolute; ' + + 'top:'+jsMath.HTML.Em(y)+'; left: 0em;">' + + html + ' ' // space normalizes line height in script styles + + '</SPAN>'; + } + html += '<IMG SRC="'+jsMath.blank+'" STYLE="width: '+jsMath.HTML.Em(w)+'; ' + + 'height: '+jsMath.HTML.Em(h)+';'+align+'">'; + if (jsMath.msieAbsoluteBug) {// for MSIE (Mac) + html = '<SPAN STYLE="position: relative;">' + html + '</SPAN>'; + } + html = '<SPAN STYLE="position: relative;' + + ' width: '+jsMath.HTML.Em(w)+';' // for MSIE + + ' height: '+jsMath.HTML.Em(H)+';' // for MSIE + + '">' + + html + + '</SPAN>'; return html; } @@ -1747,7 +1771,7 @@ var c = jsMath.TeX[font][code]; if (c.tclass == null) {c.tclass = font} if (!c.computedW) { - c.w = jsMath.EmBoxFor(jsMath.HTML.Class(c.tclass,c.c)).w; + c.w = jsMath.EmBoxFor(jsMath.Typeset.AddClass(c.tclass,c.c)).w; if (c.h == null) {c.h = jsMath.defaultH}; if (c.d == null) {c.d = 0} c.computedW = 1; } @@ -1787,7 +1811,7 @@ var top = this.GetChar(C.delim.top? C.delim.top: C.delim.rep,font); var rep = this.GetChar(C.delim.rep,font); var bot = this.GetChar(C.delim.bot? C.delim.bot: C.delim.rep,font); - var ext = jsMath.HTML.Class(rep.tclass,rep.c); + var ext = jsMath.Typeset.AddClass(rep.tclass,rep.c); var w = rep.w; var h = rep.h+rep.d var y; var dx; if (C.delim.mid) {// braces @@ -1795,9 +1819,9 @@ var n = Math.ceil((H-(top.h+top.d)-(mid.h+mid.d)-(bot.h+bot.d))/(2*(rep.h+rep.d))); H = 2*n*(rep.h+rep.d) + (top.h+top.d) + (mid.h+mid.d) + (bot.h+bot.d); if (nocenter) {y = 0} else {y = H/2+a}; var Y = y; - var html = jsMath.HTML.Place(jsMath.HTML.Class(top.tclass,top.c),0,y-top.h) - + jsMath.HTML.Place(jsMath.HTML.Class(bot.tclass,bot.c),-(top.w+bot.w)/2,y-(H-bot.d)) - + jsMath.HTML.Place(jsMath.HTML.Class(mid.tclass,mid.c),-(bot.w+mid.w)/2,y-(H+mid.h-mid.d)/2); + var html = jsMath.HTML.Place(jsMath.Typeset.AddClass(top.tclass,top.c),0,y-top.h) + + jsMath.HTML.Place(jsMath.Typeset.AddClass(bot.tclass,bot.c),-(top.w+bot.w)/2,y-(H-bot.d)) + + jsMath.HTML.Place(jsMath.Typeset.AddClass(mid.tclass,mid.c),-(bot.w+mid.w)/2,y-(H+mid.h-mid.d)/2); dx = (w-mid.w)/2; if (Math.abs(dx) < .0001) {dx = 0} if (dx) {html += jsMath.HTML.Spacer(dx)} y -= top.h+top.d + rep.h; @@ -1810,12 +1834,12 @@ if (top.h+top.d < .9*(rep.h+rep.d)) {n = Math.max(1,n)} H = n*(rep.h+rep.d) + (top.h+top.d) + (bot.h+bot.d); if (nocenter) {y = 0} else {y = H/2+a}; var Y = y; - var html = jsMath.HTML.Place(jsMath.HTML.Class(top.tclass,top.c),0,y-top.h) + var html = jsMath.HTML.Place(jsMath.Typeset.AddClass(top.tclass,top.c),0,y-top.h) dx = (w-top.w)/2; if (Math.abs(dx) < .0001) {dx = 0} if (dx) {html += jsMath.HTML.Spacer(dx)} y -= top.h+top.d + rep.h; for (var i = 0; i < n; i++) {html += jsMath.HTML.Place(ext,-w,y-i*h)} - html += jsMath.HTML.Place(jsMath.HTML.Class(bot.tclass,bot.c),-(w+bot.w)/2,Y-(H-bot.d)); + html += jsMath.HTML.Place(jsMath.Typeset.AddClass(bot.tclass,bot.c),-(w+bot.w)/2,Y-(H-bot.d)); } if (nocenter) {h = top.h} else {h = H/2+a} var box = new jsMath.Box('html',html,rep.w,h,H-h); @@ -1835,51 +1859,35 @@ var top = this.GetChar(C.delim.top? C.delim.top: C.delim.rep,font); var rep = this.GetChar(C.delim.rep,font); var bot = this.GetChar(C.delim.bot? C.delim.bot: C.delim.rep,font); - rep.h = 0; // fix adjusted heights if (C.delim.mid) {// braces var mid = this.GetChar(C.delim.mid,font); - var n = Math.ceil((H-(top.h+top.d)-(mid.h+mid.d)-(bot.h+bot.d))/(2*(rep.h+rep.d))); - H = 2*n*(rep.h+rep.d) + (top.h+top.d) + (mid.h+mid.d) + (bot.h+bot.d); + var n = Math.ceil((H-(top.h+top.d)-(mid.h+mid.d-.05)-(bot.h+bot.d-.05))/(2*(rep.h+rep.d-.05))); + H = 2*n*(rep.h+rep.d-.05) + (top.h+top.d) + (mid.h+mid.d-.05) + (bot.h+bot.d-.05); - html = jsMath.HTML.Place(jsMath.HTML.Class(top.tclass,top.c),0,-top.h); - var h = rep.h+rep.d - Font.hd; var y = -(top.h+top.d + rep.h-.05) + Font.hd; - var ext = jsMath.HTML.Class(font,rep.c) - for (var i = 0; i < n; i++) {html += '<BR>'+jsMath.HTML.Place(ext,0,y-i*h)} - html += '<BR>' + jsMath.HTML.Place(jsMath.HTML.Class(mid.tclass,mid.c),0,y-i*h); - y -= i*h+mid.h+mid.d - Font.hd; - for (var i = 0; i < n; i++) {html += '<BR>'+jsMath.HTML.Place(ext,0,y-i*h)} - html += '<BR>' + jsMath.HTML.Place(jsMath.HTML.Class(bot.tclass,bot.c),0,y-i*h); + html = jsMath.HTML.PlaceAbsolute(jsMath.Typeset.AddClass(top.tclass,top.c),0,0); + var h = rep.h+rep.d - .05; var y = top.d-.05 + rep.h; + var ext = jsMath.Typeset.AddClass(font,rep.c) + for (var i = 0; i < n; i++) {html += jsMath.HTML.PlaceAbsolute(ext,0,y+i*h)} + html += jsMath.HTML.PlaceAbsolute(jsMath.Typeset.AddClass(mid.tclass,mid.c),0,y+n*h-rep.h+mid.h); + y += n*h + mid.h+mid.d - .05; + for (var i = 0; i < n; i++) {html += jsMath.HTML.PlaceAbsolute(ext,0,y+i*h)} + html += jsMath.HTML.PlaceAbsolute(jsMath.Typeset.AddClass(bot.tclass,bot.c),0,y+n*h-rep.h+bot.h); } else {// all others - var n = Math.ceil((H - (top.h+top.d) - (bot.h+bot.d))/(rep.h+rep.d-.1)); - H = n*(rep.h+rep.d-.1) + (top.h+top.d) + (bot.h+bot.d); + var n = Math.ceil((H - (top.h+top.d) - (bot.h+bot.d-.05))/(rep.h+rep.d-.05)); + H = n*(rep.h+rep.d-.05) + (top.h+top.d) + (bot.h+bot.d-.05); - html = jsMath.HTML.Place(jsMath.HTML.Class(top.tclass,top.c),0,-top.h); - var h = rep.h+rep.d-.1 - Font.hd; var y = -(top.h+top.d + rep.h-.05) + Font.hd; - var ext = jsMath.HTML.Class(rep.tclass,rep.c) - for (var i = 0; i < n; i++) {html += '<BR>'+jsMath.HTML.Place(ext,0,y-i*h)} - html += '<BR>' + jsMath.HTML.Place(jsMath.HTML.Class(bot.tclass,bot.c),0,y-i*h); + html = jsMath.HTML.PlaceAbsolute(jsMath.Typeset.AddClass(top.tclass,top.c),0,0); + var h = rep.h+rep.d-.05; var y = top.d-.05 + rep.h; + var ext = jsMath.Typeset.AddClass(rep.tclass,rep.c); + for (var i = 0; i < n; i++) {html += jsMath.HTML.PlaceAbsolute(ext,0,y+i*h)} + html += jsMath.HTML.PlaceAbsolute(jsMath.Typeset.AddClass(bot.tclass,bot.c),0,y+n*h-rep.h+bot.h); } - var w = top.w; h = Font.h; - if (nocenter) {y = top.h} else {y = (H/2 + a) - top.h} - if (jsMath.isSafari) {y -= .2} - html = '<SPAN STYLE="position: relative; ' - + 'width: '+jsMath.HTML.Em(w)+'; ' // for MSIE - + 'height: '+jsMath.HTML.Em(top.h)+'; ' //for MSIE - + '">' - + '<SPAN STYLE="position: absolute; ' - + 'top: '+jsMath.HTML.Em(-y)+'; ' - + 'left: 0;">' - + html - + '</SPAN>' - + '<IMG SRC="'+jsMath.blank+'" STYLE="width: '+jsMath.HTML.Em(w)+'; ' - + 'height: '+jsMath.HTML.Em(h)+';">' - + '</SPAN>'; - - if (nocenter) {h = top.h} else {h = H/2+a} + var w = top.w; + if (nocenter) {h = top.h; y = 0} else {h = H/2 + a; y = h - top.h} + html = jsMath.HTML.Absolute(html,w,Font.h,"none",-y,top.h); var box = new jsMath.Box('html',html,rep.w,h,H-h); - box.bh = top.h; box.bd = top.d; box.bh = jsMath.TeX[font].h; box.bd = jsMath.TeX[font].d; return box; }, @@ -1914,10 +1922,20 @@ var font = jsMath.TeX.fam[(code&0xF00)>>8]; var Font = jsMath.TeX[font]; var c = Font[code & 0xFF]; - if (c.w == null) {c.w = jsMath.EmBoxFor(jsMath.HTML.Class(c.tclass,c.c)).w} - if (c.tclass == null) {c.tclass = font} + if (c.w == null) {c.w = jsMath.EmBoxFor(jsMath.Typeset.AddClass(c.tclass,c.c)).w} + if (c.font == null) {c.font = font} return c; }, + + /* + * Add the class to the html, and use the font if there isn't one + * specified already + */ + + AddClass: function (tclass,html,font) { + if (tclass == null) {tclass = font} + return jsMath.Typeset.AddClass(tclass,html); + }, /* * Create a horizontally stretchable "delimiter" (like over- and @@ -1933,15 +1951,12 @@ var lmid = this.GetCharCode(leader.lmid); var rmid = this.GetCharCode(leader.rmid); w = (W - left.w - right.w - lmid.w - rmid.w)/2 - .1; h = .4; d = .3; - if (w > 0) { - html = jsMath.HTML.Class(left.tclass,left.c) - + jsMath.HTML.Rule(w,left.h) - + jsMath.HTML.Class(lmid.tclass,lmid.c+rmid.c) - + jsMath.HTML.Rule(w,right.h) - + jsMath.HTML.Class(right.tclass,right.c); - } else { - html = jsMath.HTML.Class(left.tclass,left.c + lmid.c + rmid.c + right.c); - } + if (w < 0) {w = 0} + html = this.AddClass(left.tclass,left.c,left.font) + + jsMath.HTML.Rule(w,left.h) + + this.AddClass(lmid.tclass,lmid.c+rmid.c,lmid.font) + + jsMath.HTML.Rule(w,right.h) + + this.AddClass(right.tclass,right.c,right.font); } else { //arrows font = jsMath.TeX.fam[(leader.rep &0xF00) >> 8]; var left = this.GetCharCode(leader.left? leader.left: leader.rep); @@ -1951,14 +1966,14 @@ w = (W - left.w - right.w + .4 - n*(rep.w - .3)); if (leader.left) {h = left.h; d = left.d} else {h = right.h; d = right.d} if (d == null) {d = 0}; if (h == null) {h = 0} - var html = jsMath.HTML.Class(left.tclass,left.c); var m = Math.floor(n/2); + var html = this.AddClass(left.tclass,left.c,left.font); var m = Math.floor(n/2); var ext = jsMath.HTML.Place(rep.c,-.3,0); var ehtml = ''; for (var i = 0; i < m; i++) {ehtml += ext}; - html += jsMath.HTML.Class(rep.tclass,ehtml) + jsMath.HTML.Spacer(w); + html += this.AddClass(rep.tclass,ehtml,rep.font) + jsMath.HTML.Spacer(w); ehtml = ''; for (var i = m; i < n; i++) {ehtml += ext}; - html += jsMath.HTML.Class(rep.tclass,ehtml); + html += this.AddClass(rep.tclass,ehtml,rep.font); if (jsMath.msieFontBug) {html += '<SPAN STYLE="display: none">x</SPAN>'} - html += jsMath.HTML.Place(jsMath.HTML.Class(right.tclass,right.c),-.4,0); + html += jsMath.HTML.Place(this.AddClass(right.tclass,right.c,right.font),-.4,0); } w = jsMath.EmBoxFor(html).w; if (w != W) { @@ -1980,7 +1995,7 @@ * ### still need to allow users to specify row and column attributes, * and do things like \span and \multispan ### */ - Layout: function (size,table,align,cspacing) { + LayoutRelative: function (size,table,align,cspacing) { if (align == null) {align = []} if (cspacing == null) {cspacing = []} @@ -2004,7 +2019,7 @@ if (bh == unset) {bh = 0}; if (bd == unset) {bd = 0} // lay out the columns - var HD = (jsMath.hd-.1)*scale; + var HD = (jsMath.hd-.01)*scale; var html = ''; var pW = 0; var cW = 0; var w; var h; var y; var box; var mlist; var entry; @@ -2031,20 +2046,86 @@ } // get the full width and height - w = -cspacing[W.length-1]; + w = -cspacing[W.length-1]; y = (H.length-1)*scale/10; for (i = 0; i < W.length; i++) {w += W[i] + cspacing[i]} - h = jsMath.TeX.axis_height-y/2; + for (i = 0; i < H.length; i++) {y += Math.max(HD,H[i]+D[i])} + h = y/2 + jsMath.TeX.axis_height; var d = y-h; // adjust the final row width, and vcenter the table // (add 1/6em at each side for the \,) html += jsMath.HTML.Spacer(cW-cspacing[W.length-1] + scale/6); html = jsMath.HTML.Place(html,scale/6,h); - box = new jsMath.Box('html',html,w+scale/3,h,-y-h); + box = new jsMath.Box('html',html,w+scale/3,h,d); box.bh = bh; box.bd = bd; return box; }, /* + * Create the HTML for an alignment (e.g., array or matrix) + * Use absolute position for elements in the array. + * + * ### still need to allow users to specify row and column attributes, + * and do things like \span and \multispan ### + */ + LayoutAbsolute: function (size,table,align,cspacing) { + if (align == null) {align = []} + if (cspacing == null) {cspacing = []} + + // get row and column maximum dimensions + var scale = jsMath.sizes[size]/100; + var HD = (jsMath.hd-.01)*scale; + var W = []; var H = []; var D = []; + var w = 0; var h; var x; var y; + var i; var j; var row; + for (i = 0; i < table.length; i++) { + row = table[i]; + H[i] = jsMath.h*scale; D[i] = jsMath.d*scale; + for (j = 0; j < row.length; j++) { + row[j] = row[j].Remeasured(); + if (row[j].h > H[i]) {H[i] = row[j].h} + if (row[j].d > D[i]) {D[i] = row[j].d} + if (j >= W.length) {W[j] = row[j].w} + else if (row[j].w > W[j]) {W[j] = row[j].w} + } + } + + // get the height and depth of the centered table + y = (H.length-1)*scale/6; + for (i = 0; i < H.length; i++) {y += Math.max(HD,H[i]+D[i])} + h = y/2 + jsMath.TeX.axis_height; var d = y - h; + + // lay out the columns + var html = ''; var entry; w = scale/6; + for (j = 0; j < W.length; j++) { + y = H[0]-h; + for (i = 0; i < table.length; i++) { + entry = table[i][j]; + if (entry && entry.format != 'null') { + if (align[j] == 'l') {x = 0} else + if (align[j] == 'r') {x = W[j] - entry.w} else + {x = (W[j] - entry.w)/2} + html += jsMath.HTML.PlaceAbsolute(entry.html,w+x, + y-Math.max(0,entry.bh-jsMath.h*scale)); + } + if (i == table.length-1) {y += D[i]} + else {y += Math.max(HD,D[i]+H[i+1]) + scale/6} + } + if (cspacing[j] == null) cspacing[j] = scale; + w += W[j] + cspacing[j]; + } + + // get the full width + w = -cspacing[W.length-1]+scale/3; + for (i = 0; i < W.length; i++) {w += W[i] + cspacing[i]} + + html = jsMath.HTML.Spacer(scale/6)+html+jsMath.HTML.Spacer(scale/6); + if (jsMath.spanHeightVaries) {y = h-jsMath.h} else {y = 0} + html = jsMath.HTML.Absolute(html,w,h+d,d,y,H[0]); + var box = new jsMath.Box('html',html,w+scale/3,h,d); + return box; + }, + + /* * Look for math within \hbox and other non-math text */ InternalMath: function (text,size) { @@ -2956,8 +3037,7 @@ * Add the font class, if needed */ AddClass: function (tclass,html) { - if (tclass != '' && tclass != 'normal') - {html = '<SPAN CLASS="'+tclass+'">'+html+'</SPAN>'} + if (tclass != '' && tclass != 'normal') {html = jsMath.HTML.Class(tclass,html)} return html; } @@ -3158,8 +3238,9 @@ {item.html = '<SPAN STYLE="position: relative; top:'+jsMath.HTML.Em(-item.y)+';' + '">' + item.html + '</SPAN>'} if (item.x) - {item.html = '<SPAN STYLE="margin-left:'+jsMath.HTML.Em(item.x)+';' - + '"></SPAN>' + item.html} + {item.html = jsMath.msieSpaceFix + + '<SPAN STYLE="margin-left:'+jsMath.HTML.Em(item.x)+';">' + + '</SPAN>' + item.html} item.h += item.y; item.d -= item.y; item.x = 0; item.y = 0; } @@ -3695,7 +3776,7 @@ matrix: 'Matrix', array: 'Matrix', // ### still need to do alignment options ### - pmatrix: ['Matrix','(',')'], + pmatrix: ['Matrix','(',')','c'], cases: ['Matrix','\\{','.',['l','l']], cr: 'HandleRow', '\\': 'HandleRow', @@ -4398,9 +4479,11 @@ if (c == '\\') {text += c + data[0].charAt(i++)} else if (c == '#') { c = data[0].charAt(i++); - if (!c.match(/[0-9]/) || c > args.length) - {this.Error("Illegal macro argument reference"); return} - text += args[c-1]; + if (c == "#") {text += c} else { + if (!c.match(/[1-9]/) || c > args.length) + {this.Error("Illegal macro argument reference"); return} + text += args[c-1]; + } } else {text += c} } } @@ -4526,7 +4609,6 @@ if (this.macros[cmd]) { var macro = this.macros[cmd]; if (typeof(macro) == "string") {macro = [macro]} -// var args = macro.slice(1); if (args.length == 1) {args = args[0]} this[macro[0]](cmd,macro.slice(1)); return; } if (this.mathchardef[cmd]) { @@ -4662,34 +4744,22 @@ box.Styled().Remeasured(); var isSmall = 0; var isBig = 0; var w = box.w; var h = box.bh; var d = box.bd; - if (box.bh > box.h && box.bh > jsMath.h+.001) {isSmall = 1; h = box.h;} - if (box.bd > box.d && box.bd > jsMath.d+.001) {isSmall = 1; d = box.d;} - if (box.h > jsMath.h) {isBig = 1; h = Math.max(h,box.h);} - if (box.d > jsMath.d) {isBig = 1; d = Math.max(d,box.d);} + if (box.bh > box.h && box.bh > jsMath.h+.001) {isSmall = 1} + if (box.bd > box.d && box.bd > jsMath.d+.001) {isSmall = 1} + if (box.h > jsMath.h) {isBig = 1; h = box.h} + if (box.d > jsMath.d) {isBig = 1; d = box.d} if (jsMath.show.BBox) {rules += jsMath.HTML.Frame(0,-box.d,w,box.h+box.d,'green')} if (jsMath.show.Top) {rules += jsMath.HTML.Line(0,box.h,w,'red')} if (jsMath.show.Baseline) {rules += jsMath.HTML.Line(0,0,w,'blue')} - html = box.html; var y = jsMath.absoluteOffsetY; - if (jsMath.absoluteHeightVaries || box.bh > jsMath.h+.001) {y += (jsMath.h - box.bh)} - if (jsMath.spanHeightVaries) {y = 1-box.bh} // for MSIE + html = box.html; if (isSmall) {// hide the extra size if (jsMath.allowAbsolute) { - html = '<SPAN STYLE="position: relative;' - + ' width: '+jsMath.HTML.Em(w)+';' // for MSIE - + ' height: '+jsMath.HTML.Em(jsMath.lineH)+';' // for MSIE - + '">' - + '<SPAN STYLE="position: relative;">' // for MSIE (Mac) - + '<SPAN STYLE="position: absolute; ' - + 'top:'+jsMath.HTML.Em(y)+'; left:0;">' - + html + ' ' // space normalizes line height in script styles - + '</SPAN>' - + '<IMG SRC="'+jsMath.blank+'" STYLE="width: '+jsMath.HTML.Em(w)+'; ' - + 'height: '+jsMath.HTML.Em(jsMath.h)+';">' - + '</SPAN>' // for MSIE (Mac) - + '</SPAN>'; - isBig = 1; + var y = jsMath.absoluteOffsetY; + if (jsMath.absoluteHeightVaries || box.bh > jsMath.h+.001) {y += (jsMath.h - box.bh)} + html = jsMath.HTML.Absolute(html,w,jsMath.h,0,y,jsMath.h); + isBig = 1; h = box.h; d = box.d; } else {// remove line height and try to hide the depth var dy = jsMath.HTML.Em(Math.max(0,box.bd-jsMath.hd)/3); html = '<SPAN STYLE="line-height: 0;' @@ -4700,10 +4770,11 @@ } } html = '<NOBR>' + rules + html; - if (isBig) {// add height and depth to the line + if (isBig) {// add height and depth to the line (force a little + // extra to separate lines if needed) html += '<IMG SRC="'+jsMath.blank+'" CLASS="mathHD" ' - + 'STYLE="height: '+jsMath.HTML.Em(h+d)+'; ' - + 'vertical-align: '+jsMath.HTML.Em(-d)+';">' + + 'STYLE="height: '+jsMath.HTML.Em(h+d+.2)+'; ' + + 'vertical-align: '+jsMath.HTML.Em(-d-.1)+';">' } html += '<NOBR>' return html; @@ -4797,7 +4868,6 @@ var parse = jsMath.Parse(s,null,null,'D'); parse.Atomize(); var html = parse.Typeset(); - html = '<p align="CENTER">' + html + '</p>' return html; }, Index: jsMath-fallback-mac.js =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/htdocs/jsMath/jsMath-fallback-mac.js,v retrieving revision 1.2 retrieving revision 1.3 diff -Lhtdocs/jsMath/jsMath-fallback-mac.js -Lhtdocs/jsMath/jsMath-fallback-mac.js -u -r1.2 -r1.3 --- htdocs/jsMath/jsMath-fallback-mac.js +++ htdocs/jsMath/jsMath-fallback-mac.js @@ -467,8 +467,8 @@ {c: '}', h: 0.04, d: 1.16, n: 111, tclass: 'delim1'}, {c: '〈', h: 0.04, d: 1.16, n: 68, tclass: 'delim1c'}, {c: '〉', h: 0.04, d: 1.16, n: 69, tclass: 'delim1c'}, - {c: '|', h:.7, d:.1, delim: {rep: 12}, tclass: 'vertical2'}, - {c: '||', h:.7, d:.1, delim: {rep: 13}, tclass: 'vertical2'}, + {c: '|', h:.7, d:.15, delim: {rep: 12}, tclass: 'vertical1'}, + {c: '||', h:.7, d:.15, delim: {rep: 13}, tclass: 'vertical1'}, {c: '∕', h: 0.04, d: 1.16, n: 46, tclass: 'delim1b'}, {c: '∖', h: 0.04, d: 1.16, n: 47, tclass: 'delim1b'}, // 10 - 1F @@ -506,27 +506,27 @@ {c: '∕', h: 0.04, d: 1.76, n: 30, tclass: 'delim2b'}, {c: '∖', h: 0.04, d: 1.76, n: 31, tclass: 'delim2b'}, // 30 - 3F - {c: '', h: .8, d: .15, delim: {top: 48, bot: 64, rep: 66}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {top: 49, bot: 65, rep: 67}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {top: 50, bot: 52, rep: 54}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {top: 51, bot: 53, rep: 55}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {bot: 52, rep: 54}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {bot: 53, rep: 55}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {top: 50, rep: 54}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {top: 51, rep: 55}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {top: 56, mid: 60, bot: 58, rep: 62}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {top: 57, mid: 61, bot: 59, rep: 62}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {top: 56, bot: 58, rep: 62}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {top: 57, bot: 59, rep: 62}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {rep: 63}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {rep: 119}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {rep: 62}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 48, bot: 64, rep: 66}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 49, bot: 65, rep: 67}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 50, bot: 52, rep: 54}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 51, bot: 53, rep: 55}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {bot: 52, rep: 54}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {bot: 53, rep: 55}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 50, rep: 54}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 51, rep: 55}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 56, mid: 60, bot: 58, rep: 62}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 57, mid: 61, bot: 59, rep: 62}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 56, bot: 58, rep: 62}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 57, bot: 59, rep: 62}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {rep: 63}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {rep: 119}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {rep: 62}, tclass: 'normal'}, {c: '|', h: .7, d: .15, delim: {top: 120, bot: 121, rep: 63}, tclass: 'vertical2'}, // 40 - 4F - {c: '', h: .8, d: .15, delim: {top: 56, bot: 59, rep: 62}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {top: 57, bot: 58, rep: 62}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {rep: 66}, tclass: 'normal'}, - {c: '', h: .8, d: .15, delim: {rep: 67}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 56, bot: 59, rep: 62}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {top: 57, bot: 58, rep: 62}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {rep: 66}, tclass: 'normal'}, + {c: '', h: .85, d: .2, delim: {rep: 67}, tclass: 'normal'}, {c: '〈', h: 0.04, d: 1.76, n: 28, tclass: 'delim2c'}, {c: '〉', h: 0.04, d: 1.76, n: 29, tclass: 'delim2c'}, {c: '⊔', h: 0, d: 1, n: 71, tclass: 'bigop1'}, @@ -581,15 +581,15 @@ {c: '<SPAN STYLE="font-size: 400%; position:relative; top:.92em">√</SPAN>', h: 0.1, d: 3.75, n: 117, tclass: 'root'}, {c: '<SPAN STYLE="font-size: 500%; position:relative; top:.9em">√</SPAN>', h: .12, d: 4.5, n: 118, tclass: 'root'}, {c: '<SPAN STYLE="font-size: 625%; position:relative; top:.9em">√</SPAN>', h: .14, d: 5.7, tclass: 'root'}, - {c: '<SPAN STYLE="margin:.1em">||</SPAN>', h:.65, d:.15, delim: {top: 126, bot: 127, rep: 119}, tclass: 'vertical2'}, - {c: '▵', h:.45, delim: {top: 120, rep: 63}, tclass: 'arrow1b'}, - {c: '▿', h:.45, delim: {bot: 121, rep: 63}, tclass: 'arrow1b'}, + {c: '||', h:.65, d:.15, delim: {top: 126, bot: 127, rep: 119}, tclass: 'vertical2'}, + {c: '▵', h:.4, delim: {top: 120, rep: 63}, tclass: 'arrow1b'}, + {c: '▿', h:.38, delim: {bot: 121, rep: 63}, tclass: 'arrow1b'}, {c: '<SPAN STYLE="font-size: 67%; position:relative; top:.35em; margin-left:-.5em">╭</SPAN>', h:.1, tclass: 'symbol'}, {c: '<SPAN STYLE="font-size: 67%; position:relative; top:.35em; margin-right:-.5em">╮</SPAN>', h:.1, tclass: 'symbol'}, {c: '<SPAN STYLE="font-size: 67%; position:relative; top:.35em; margin-left:-.5em">╰</SPAN>', h:.1, tclass: 'symbol'}, {c: '<SPAN STYLE="font-size: 67%; position:relative; top:.35em; margin-right:-.5em">╯</SPAN>', h:.1, tclass: 'symbol'}, - {c: '▵', h:.5, d:-.1, delim: {top: 126, rep: 119}, tclass: 'arrow2b'}, - {c: '▿', h:.5, d:-.1, delim: {bot: 127, rep: 119}, tclass: 'arrow2b'} + {c: '▵', h:.5, delim: {top: 126, rep: 119}, tclass: 'arrow2b'}, + {c: '▿', h:.6, d:-.1, delim: {bot: 127, rep: 119}, tclass: 'arrow2b'} ], cmti10: [ @@ -938,7 +938,8 @@ '.delim4b': 'font-family: Hiragino Mincho Pro; font-size: 325%; position:relative; top:.8em; margin: -.1em', '.delim4c': 'font-family: Symbol; font-size: 300%; position:relative; top:.8em;', '.vertical': 'font-family: Copperplate', - '.vertical2': 'font-family: Copperplate; font-size: 85%', + '.vertical1': 'font-family: Copperplate; font-size: 85%; margin: .15em;', + '.vertical2': 'font-family: Copperplate; font-size: 85%; margin: .17em;', '.greek': 'font-family: Symbol', '.bigop1': 'font-family: Hiragino Mincho Pro; font-size: 133%; position: relative; top: .85em; margin:-.05em', '.bigop1a': 'font-family: Baskerville; font-size: 100%; position: relative; top: .775em;', @@ -1050,7 +1051,6 @@ jsMath.Macro('not','\\mathrel{\\rlap{\\kern 4mu/}}'); -jsMath.Box.DelimExtend = jsMath.Box.DelimExtendRelative; jsMath.absoluteHeightVaries = 1; jsMath.defaultH = 0.8; Index: jsMath-fallback-pc.js =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/htdocs/jsMath/jsMath-fallback-pc.js,v retrieving revision 1.2 retrieving revision 1.3 diff -Lhtdocs/jsMath/jsMath-fallback-pc.js -Lhtdocs/jsMath/jsMath-fallback-pc.js -u -r1.2 -r1.3 --- htdocs/jsMath/jsMath-fallback-pc.js +++ htdocs/jsMath/jsMath-fallback-pc.js @@ -559,9 +559,9 @@ // 60 - 6F {c: '∐', h: 0, d: 1, n: 97, tclass: 'bigop1a'}, {c: '∐', h: 0.1, d: 1.5, tclass: 'bigop2a'}, - {c: '⁀', h: 0.722, w: .58, n: 99, tclass: 'wide1'}, - {c: '⁀', h: 0.85, w: 1.0, n: 100, tclass: 'wide2'}, - {c: '⁀', h: 0.99, w: 1.7, tclass: 'wide3'}, + {c: '︿', h: 0.722, w: .65, n: 99, tclass: 'wide1'}, + {c: '︿', h: 0.85, w: 1.1, n: 100, tclass: 'wide2'}, + {c: '︿', h: 0.99, w: 1.65, tclass: 'wide3'}, {c: '~', h: 0.722, w: .5, n: 102, tclass: 'wide1a'}, {c: '~', h: 0.8, w: .8, n: 103, tclass: 'wide2a'}, {c: '~', h: 0.99, w: 1.3, tclass: 'wide3a'}, @@ -581,13 +581,13 @@ {c: '<SPAN STYLE="font-size: 490%; position:relative; top:.8em; margin-right:-.03em">√</SPAN>', h: 0.1, d: 3.75, n: 117, tclass: 'root'}, {c: '<SPAN STYLE="font-size: 580%; position:relative; top:.775em; margin-right:-.04em">√</SPAN>', h: .12, d: 4.5, n: 118, tclass: 'root'}, {c: '<SPAN STYLE="font-size: 750%; position:relative; top:.775em;margin-right:-.04em">√</SPAN>', h: .14, d: 5.7, tclass: 'root'}, - {c: '<SPAN STYLE="margin-right:.125em">||</SPAN>', h:.8, d:0, delim: {top: 126, bot: 127, rep: 119}, tclass: 'normal'}, + {c: '<SPAN STYLE="margin-left:.02em">|</SPAN><SPAN STYLE="margin-left:.08em; margin-right:.125em">|</SPAN>', h:.8, d:0, delim: {top: 126, bot: 127, rep: 119}, tclass: 'normal'}, {c: '↑', h:.7, d:0, delim: {top: 120, rep: 63}, tclass: 'arrow1a'}, {c: '↓', h:.65, d:0, delim: {bot: 121, rep: 63}, tclass: 'arrow1a'}, - {c: '<SPAN STYLE="margin-left:-.1em"></SPAN><SPAN STYLE="position:relative; top:.6em; margin-right:-.3em">◜</SPAN>', h: 0.05, tclass: 'symbol'}, - {c: '<SPAN STYLE="margin-left:-.3em"></SPAN><SPAN STYLE="position:relative; top:.6em; margin-right:-.1em">◝</SPAN>', h: 0.05, tclass: 'symbol'}, - {c: '<SPAN STYLE="margin-left:-.1em"></SPAN><SPAN STYLE="position:relative; top:.2em; margin-right:-.3em">◟</SPAN>', h: 0.05, tclass: 'symbol'}, - {c: '<SPAN STYLE="margin-left:-.3em"></SPAN><SPAN STYLE="position:relative; top:.2em; margin-right:-.1em">◞</SPAN>', h: 0.05, tclass: 'symbol'}, + {c: '<SPAN STYLE="margin-left:-.1em"></SPAN><SPAN STYLE="position:relative; top:.55em; margin-right:-.3em">◜</SPAN>', h: 0.05, tclass: 'symbol'}, + {c: '<SPAN STYLE="margin-left:-.3em"></SPAN><SPAN STYLE="position:relative; top:.55em; margin-right:-.1em">◝</SPAN>', h: 0.05, tclass: 'symbol'}, + {c: '<SPAN STYLE="margin-left:-.1em"></SPAN><SPAN STYLE="position:relative; top:.15em; margin-right:-.3em">◟</SPAN>', h: 0.05, tclass: 'symbol'}, + {c: '<SPAN STYLE="margin-left:-.3em"></SPAN><SPAN STYLE="position:relative; top:.15em; margin-right:-.1em">◞</SPAN>', h: 0.05, tclass: 'symbol'}, {c: '⇑', h: .7, d:0, delim: {top: 126, rep: 119}, tclass: 'arrow1a'}, {c: '⇓', h: .7, d:0, delim: {bot: 127, rep: 119}, tclass: 'arrow1a'} ], @@ -874,7 +874,7 @@ /* * We need to replace the jsMath.Box.TeX function in order to use the - * different font metrics in thie tables above, and to handle the + * different font metrics in the tables above, and to handle the * scaling better. */ @@ -943,14 +943,14 @@ '.bigop2a': 'font-family: Arial unicode MS; font-size: 185%; position: relative; top: .75em', '.bigop2b': 'font-family: Arial unicode MS; font-size: 275%; position: relative; top: .55em', '.bigop2c': 'font-family: Arial unicode MS; font-size: 185%; position: relative; top: 1em; margin-right:-.1em', - '.wide1': 'font-family: Arial unicode MS; font-size: 75%; position: relative; top:-.1em', - '.wide2': 'font-family: Arial unicode MS; font-size: 133%; position: relative; top:.25em', - '.wide3': 'font-family: Arial unicode MS; font-size: 200%; position: relative; top:.35em', + '.wide1': 'font-size: 67%; position: relative; top:-.5em;', + '.wide2': 'font-size: 110%; position: relative; top:-.2em;', + '.wide3': 'font-size: 175%;', '.wide1a': 'font-family: Times New Roman; font-size: 75%; position: relative; top:-.5em', '.wide2a': 'font-family: Times New Roman; font-size: 133%; position: relative; top:-.2em', '.wide3a': 'font-family: Times New Roman; font-size: 200%; position: relative; top:-.1em', '.root': 'font-family: Arial unicode MS; margin-right:-.075em', - '.accent': 'font-family: Arial unicode MS; position:relative; top:.05em; left:.22em' + '.accent': 'font-family: Arial unicode MS; position:relative; top:.05em; left:.15em' }); // @@ -959,29 +959,41 @@ if (jsMath.hidden.ATTRIBUTE_NODE) { jsMath.UpdateTeXfonts({ cmex10: { - '48': {c: '(', d:0}, - '49': {c: ')', d:0}, - '50': {c: '[', d:0}, - '51': {c: ']', d:0}, - '52': {c: '[', d:0}, - '53': {c: ']', d:0}, - '54': {c: '<SPAN STYLE="margin:.075em">|</SPAN>', d:0}, - '55': {c: '<SPAN STYLE="margin:.075em">|</SPAN>', d:0}, - '56': {c: '{', d:0}, - '57': {c: '}', d:0}, - '58': {c: '{', d:0}, - '59': {c: '}', d:0}, - '60': {c: '{', d:0}, - '61': {c: '}', d:0}, - '62': {c: '<SPAN STYLE="margin:.075em">|</SPAN>', d:0}, - '64': {c: '(', d:0}, - '65': {c: ')', d:0}, - '66': {c: '<SPAN STYLE="margin:.075em">|</SPAN>', d:0}, - '67': {c: '<SPAN STYLE="margin:.075em">|</SPAN>', d:0} + '48': {c: ''}, + '49': {c: ''}, + '50': {c: ''}, + '51': {c: ''}, + '52': {c: ''}, + '53': {c: ''}, + '54': {c: ''}, + '55': {c: ''}, + '56': {c: ''}, + '57': {c: ''}, + '58': {c: ''}, + '59': {c: ''}, + '60': {c: ''}, + '61': {c: ''}, + '62': {c: ''}, + '64': {c: ''}, + '65': {c: ''}, + '66': {c: ''}, + '67': {c: ''} } }); jsMath.UpdateStyles({ - '.delimx': 'font-family: serif' + '.accent': 'font-family: Arial unicode MS; position:relative; top:.05em; left:.05em' + }); +} + +// +// adjust for MSIE +// +if (jsMath.browser == "MSIE") { + jsMath.UpdateTeXfonts({ + cmex10: { + '63': {c: '<SPAN STYLE="position:relative; left:.125em; margin-right:.125em">|</SPAN>'}, + '119': {c: '<SPAN STYLE="position:relative; left:.02em; margin-right=.08em">|</SPAN><SPAN STYLE="margin-right:.125em">|</SPAN>'} + } }); } @@ -1000,7 +1012,6 @@ jsMath.Macro('not','\\mathrel{\\rlap{\\kern 3mu/}}'); jsMath.Macro('bowtie','\\mathrel\\triangleright\\kern-6mu\\mathrel\\triangleleft'); -jsMath.Box.DelimExtend = jsMath.Box.DelimExtendRelative; jsMath.absoluteHeightVaries = 1; jsMath.defaultH = 0.8; |
From: Sam H. v. a. <we...@ma...> - 2005-01-28 00:07:11
|
Log Message: ----------- Moved stylesheet into a separate file. Created new htdocs/css directory, added stylesheet to that directory (ur.css). Include stylesheet in ur.template with new "url" template escape: <!--#url type="webwork" name="stylesheet"--> This is 132 lines that Template.pm doesn't have to parse and 4368 bytes that don't have to get sent to the client with every request. Modified Files: -------------- webwork2/conf/templates: ur.template webwork2/lib/WeBWorK: ContentGenerator.pm Added Files: ----------- webwork2/htdocs/css: ur.css Revision Data ------------- --- /dev/null +++ htdocs/css/ur.css @@ -0,0 +1,132 @@ +/* hack to get around MSIE peekaboo bug */ +* {zoom: 1;} + +/********************/ +/* template classes */ +/********************/ + +body { margin: 0px; } + +/* left table cell, contains logo and menus */ +td.LeftPanel { background-color: #003366; color: white; white-space: nowrap; width: 1em; } +td.LeftPanel a:link, +td.LeftPanel a:visited { color: #FF9933; } + +div.Logo { } +div.Links { font-size: small; } +div.Siblings { font-size: small; } +div.Options { font-size: small; } + +/* top table cell, contains login message and path */ +td.TopPanel { background-color: #003366; color: white; height: 1; } +td.TopPanel a:link, +td.TopPanel a:visited { color: #FF9933; } + + +*.LoginStatus { text-align: right; font-size: small; position:absolute; right: 0; } +td.Timestamp { text-align: left; font-size: small; font-style: italic; } + +*.Path { } + +/* main content panel, contains body */ +td.ContentPanel { background-color: white; color: black; } +td.ContentPanel a:link, +td.ContentPanel a:visited { color: blue; } +td.ContentPanel a:active { color: red; } + +/* contains info */ +td.InfoPanel { background-color: #DDDDDD; color: black; width: 30% } +td.InfoPanel a:link, +td.InfoPanel a:visited { color: blue; } +td.InfoPanel a:active { color: red; } + +div.Info { } +div.Nav { } +div.Title { font-size: 16pt; } +div.SubmitError { color: red; font-style: italic; } +div.Message { font-style: italic; } +div.Body { } +div.Warnings { } + +/* background colors for success and failure messages */ +div.ResultsWithoutError { background-color: #66ff99 } /* light green */ +div.ResultsWithError { background-color: #ffcccc } /* light red */ + +div.NoFontMessage {padding: 10; border-style: solid; border-width:3; + border-color: #DD0000; background-color: #FFF8F8; + width: 75%; text-align: left; margin: 10px auto 10px 12%;} + +/* text colors for published and unpublished sets */ +font.Published { font-style: normal; font-weight: normal; color: #000000; } /* black */ +font.Unpublished { font-style: italic; font-weight: normal; color: #aaaaaa; } /* light grey */ + +/* styles used when editing a temporary file */ +div.temporaryFile { background-color: #ff9900 ; font-style: italic; } +p.temporaryFile { background-color: #ff9900 ; font-style: italic; } + + + +/* text colors for Auditing, Current, and Dropped students */ +div.Audit { font-style: normal; color: purple; } +div.Enrolled { font-weight: normal; color: black; } +div.Drop { font-style: italic; color: grey; } + +/*******************/ +/* general classes */ +/*******************/ + +p.emphasis { font-style:italic; } + +/************************/ +/* new standard classes */ +/************************/ + +/* tables used for laying out form fields shouldn't have a border */ +table.FormLayout { border: 0; } +table.FormLayout tr { vertical-align: top; } +table.FormLayout th.LeftHeader { text-align: right; white-space: nowrap; } +table.FormLayout tr.ButtonRow { text-align: left; } +table.FormLayout tr.ButtonRowCenter { text-align: center; } + +/* for problems which are rendered by themselves, e.g., by Set Maker */ +div.RenderSolo { background-color: #E0E0E0; color: black; } + +/* minimal style for lists of links (generated by the links escape) */ +ul.LinksMenu { list-style: none; margin-left: 0; padding-left: 0; } +ul.LinksMenu ul { list-style: none; margin-left: 0.5em; padding-left: 0; } + +/*************************/ +/* WeBWorK::HTML widgets */ +/*************************/ + +/* WeBWorK::HTML::ScrollingRecordList */ +div.ScrollingRecordList { padding: 1em; white-space: nowrap; border: thin solid gray; } +div.ScrollingRecordList select.ScrollingRecordList { width: 99%; } + +/*************************************************************************/ +/* classes used in Problem.pm (replace these with new standard classes?) */ +/*************************************************************************/ + +table.attemptResults { + border-style: outset; + border-width: 1px; + margin: 0px 10pt; + border-spacing: 1px; +} +table.attemptResults td, +table.attemptResults th { + border-style: inset; + border-width: 1px; + text-align: center; +# width: 15ex; + padding: 2px 5px 2px 5px; + background-color: #DDDDDD; +} +table.attemptResults td.Message { + text-align: left; + padding: 2px 5px 2px 5px; + width: auto; +} +div.problemHeader { float: left; } +div.problem { clear: both; background-color: #E0E0E0; color: black; } +.parsehilight { background-color:yellow; } Index: ur.template =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/templates/ur.template,v retrieving revision 1.37 retrieving revision 1.38 diff -Lconf/templates/ur.template -Lconf/templates/ur.template -u -r1.37 -r1.38 --- conf/templates/ur.template +++ conf/templates/ur.template @@ -25,142 +25,7 @@ <head> <title><!--#path style="text" text=" : " textonly="1"--></title> <!--#head--> -<style type="text/css"> - -/* hack to get around MSIE peekaboo bug */ -* {zoom: 1;} - -/********************/ -/* template classes */ -/********************/ - -body { margin: 0px; } - -/* left table cell, contains logo and menus */ -td.LeftPanel { background-color: #003366; color: white; white-space: nowrap; width: 1em; } -td.LeftPanel a:link, -td.LeftPanel a:visited { color: #FF9933; } - -div.Logo { } -div.Links { font-size: small; } -div.Siblings { font-size: small; } -div.Options { font-size: small; } - -/* top table cell, contains login message and path */ -td.TopPanel { background-color: #003366; color: white; height: 1; } -td.TopPanel a:link, -td.TopPanel a:visited { color: #FF9933; } - - -*.LoginStatus { text-align: right; font-size: small; position:absolute; right: 0; } -td.Timestamp { text-align: left; font-size: small; font-style: italic; } - -*.Path { } - -/* main content panel, contains body */ -td.ContentPanel { background-color: white; color: black; } -td.ContentPanel a:link, -td.ContentPanel a:visited { color: blue; } -td.ContentPanel a:active { color: red; } - -/* contains info */ -td.InfoPanel { background-color: #DDDDDD; color: black; width: 30% } -td.InfoPanel a:link, -td.InfoPanel a:visited { color: blue; } -td.InfoPanel a:active { color: red; } - -div.Info { } -div.Nav { } -div.Title { font-size: 16pt; } -div.SubmitError { color: red; font-style: italic; } -div.Message { font-style: italic; } -div.Body { } -div.Warnings { } - -/* background colors for success and failure messages */ -div.ResultsWithoutError { background-color: #66ff99 } /* light green */ -div.ResultsWithError { background-color: #ffcccc } /* light red */ - -div.NoFontMessage {padding: 10; border-style: solid; border-width:3; - border-color: #DD0000; background-color: #FFF8F8; - width: 75%; text-align: left; margin: 10px auto 10px 12%;} - -/* text colors for published and unpublished sets */ -font.Published { font-style: normal; font-weight: normal; color: #000000; } /* black */ -font.Unpublished { font-style: italic; font-weight: normal; color: #aaaaaa; } /* light grey */ - -/* styles used when editing a temporary file */ -div.temporaryFile { background-color: #ff9900 ; font-style: italic; } -p.temporaryFile { background-color: #ff9900 ; font-style: italic; } - - - -/* text colors for Auditing, Current, and Dropped students */ -div.Audit { font-style: normal; color: purple; } -div.Enrolled { font-weight: normal; color: black; } -div.Drop { font-style: italic; color: grey; } - -/*******************/ -/* general classes */ -/*******************/ - -p.emphasis { font-style:italic; } - -/************************/ -/* new standard classes */ -/************************/ - -/* tables used for laying out form fields shouldn't have a border */ -table.FormLayout { border: 0; } -table.FormLayout tr { vertical-align: top; } -table.FormLayout th.LeftHeader { text-align: right; white-space: nowrap; } -table.FormLayout tr.ButtonRow { text-align: left; } -table.FormLayout tr.ButtonRowCenter { text-align: center; } - -/* for problems which are rendered by themselves, e.g., by Set Maker */ -div.RenderSolo { background-color: #E0E0E0; color: black; } - -/* minimal style for lists of links (generated by the links escape) */ -ul.LinksMenu { list-style: none; margin-left: 0; padding-left: 0; } -ul.LinksMenu ul { list-style: none; margin-left: 0.5em; padding-left: 0; } - -/*************************/ -/* WeBWorK::HTML widgets */ -/*************************/ - -/* WeBWorK::HTML::ScrollingRecordList */ -div.ScrollingRecordList { padding: 1em; white-space: nowrap; border: thin solid gray; } -div.ScrollingRecordList select.ScrollingRecordList { width: 99%; } - -/*************************************************************************/ -/* classes used in Problem.pm (replace these with new standard classes?) */ -/*************************************************************************/ - -table.attemptResults { - border-style: outset; - border-width: 1px; - margin: 0px 10pt; - border-spacing: 1px; -} -table.attemptResults td, -table.attemptResults th { - border-style: inset; - border-width: 1px; - text-align: center; -# width: 15ex; - padding: 2px 5px 2px 5px; - background-color: #DDDDDD; -} -table.attemptResults td.Message { - text-align: left; - padding: 2px 5px 2px 5px; - width: auto; -} -div.problemHeader { float: left; } -div.problem { clear: both; background-color: #E0E0E0; color: black; } -.parsehilight { background-color:yellow; } - -</style> +<style type="text/css" media="all">@import "<!--#url type="webwork" name="stylesheet"-->";</style> </head> <body> <table width="100%" cellpadding="10" cellspacing="0" border="0"> Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.131 retrieving revision 1.132 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.131 -r1.132 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -958,6 +958,33 @@ $self->helpMacro($name); } +=item url($args) + +Defined in this package. + +Returns the specified URL from either %webworkURLs or %courseURLs in the course +environment. $args is a reference to a hash containing the following fields: + + type => type of URL: webwork|course + name => name of URL (key in URL hash) + +=cut + +sub url { + my ($self, $args) = @_; + my $ce = $self->r->ce; + my $type = $args->{type}; + my $name = $args->{name}; + + if ($type eq "webwork") { + return $ce->{webworkURLs}->{$name}; + } elsif ($type eq "course") { + return $ce->{courseURLs}->{$name}; + } else { + warn __PACKAGE__."::url: unrecognized type '$type'.\n"; + } +} + =back =cut |
From: Sam H. v. a. <we...@ma...> - 2005-01-28 00:06:41
|
Update of /webwork/cvs/system/webwork2/htdocs/css In directory devel.webwork.rochester.edu:/home/sh002i/work/webwork2_HEAD/htdocs/css Log Message: Directory /webwork/cvs/system/webwork2/htdocs/css added to the repository |
From: dpvc v. a. <we...@ma...> - 2005-01-28 00:05:06
|
Log Message: ----------- Added Text/Binary/Automatic buttons for conversion of line-breaks on file uploads. (Downloaded files are not modified, since we don't know the user's platform. Could try to use the HTTP_USERAGENT environment variable to determine this.) Also produce a warning message if a file is put in the wrong directory (e.g., .def files should be put in templates). Fixed some incorrect indenting. 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.7 retrieving revision 1.8 diff -Llib/WeBWorK/ContentGenerator/Instructor/FileManager.pm -Llib/WeBWorK/ContentGenerator/Instructor/FileManager.pm -u -r1.7 -r1.8 --- lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm +++ lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm @@ -32,6 +32,18 @@ use warnings; use CGI; +# +# The list of file extensions and the directories they usually go in. +# +my %uploadDir = ( + csv => 'scoring', + lst => 'templates', + pg => 'templates/.*', + pl => 'templates/macros', + def => 'templates', + html => 'html/.*', +); + ################################################## # # Check that the user is authorized, and then @@ -257,9 +269,12 @@ print CGI::Tr([ CGI::td(), CGI::td({colspan=>3}, - CGI::input({type=>"submit",name=>"action",style=>"width:7em",value=>"Upload:",id=>"Upload"}), - CGI::input({type=>"file",name=>"file",id=>"file",size=>40,onChange=>"checkFile()"}), - ), + CGI::input({type=>"submit",name=>"action",style=>"width:7em",value=>"Upload:",id=>"Upload"}), + CGI::input({type=>"file",name=>"file",id=>"file",size=>40,onChange=>"checkFile()"}), + CGI::br(), + CGI::small(join(' ',"Format:", + CGI::radio_group('format',['Text','Binary','Automatic'],'Automatic'))), + ), ]); # @@ -385,7 +400,7 @@ if (open(OUTFILE,">$file")) { eval {print OUTFILE $data; close(OUTFILE)}; if ($@) {$self->addbadmessage("Failed to save: $@")} - else {$self->addgoodmessage("File saved")} + else {$self->addgoodmessage("File saved")} } else {$self->addbadmessage("Can't write to file: $!")} } else {$data = ""; $self->addbadmessage("Error: no file data was submitted!")} @@ -456,8 +471,8 @@ my $newfile = $self->r->param('name'); if ($newfile = $self->verifyPath($newfile,$original)) { if (copy($oldfile, $newfile)) { - $self->addgoodmessage("File successfully copied"); - $self->Refresh; return; + $self->addgoodmessage("File successfully copied"); + $self->Refresh; return; } else {$self->addbadmessage("Can't copy file: $!")} } } @@ -511,14 +526,14 @@ # foreach my $file (@files) { if (defined checkPWD("$pwd/$file",1)) { - if (-d "$dir/$file") { - my $removed = eval {rmtree("$dir/$file",0,1)}; - if ($removed) {$self->addgoodmessage("Directory '$file' removed (items deleted: $removed)")} - else {$self->addbadmessage("Directory '$file' not removed: $!")} - } else { - if (unlink("$dir/$file")) {$self->addgoodmessage("File '$file' successfully removed")} - else {$self->addbadmessage("File '$file' not removed: $!")} - } + if (-d "$dir/$file") { + my $removed = eval {rmtree("$dir/$file",0,1)}; + if ($removed) {$self->addgoodmessage("Directory '$file' removed (items deleted: $removed)")} + else {$self->addbadmessage("Directory '$file' not removed: $!")} + } else { + if (unlink("$dir/$file")) {$self->addgoodmessage("File '$file' successfully removed")} + else {$self->addbadmessage("File '$file' not removed: $!")} + } } else {$self->addbadmessage("Illegal file '$file' specified"); last} } $self->Refresh; @@ -531,18 +546,18 @@ print CGI::start_table({border=>1,cellspacing=>2,cellpadding=>20, style=>"margin: 1em 0 0 5em"}); print CGI::Tr( CGI::td( - CGI::b("Warning:")," You have requested that the following items be deleted\n", - CGI::ul(CGI::li(\@files)), - ((grep { -d "$dir/$_" } @files)? - CGI::p({style=>"width:500"},"Some of these files are directories. ", - "Only delete directories if you really know what you are doing. ", - "You can seriously damage your course if you delete the wrong thing."): ""), - CGI::p({style=>"color:red"},"There is no undo for deleting files or directories!"), - CGI::p("Really delete the items listed above?"), - CGI::div({style=>"float:left; padding-left:3ex"}, - CGI::input({type=>"submit",name=>"action",value=>"Cancel"})), - CGI::div({style=>"float:right; padding-right:3ex"}, - CGI::input({type=>"submit",name=>"action",value=>"Delete"})), + CGI::b("Warning:")," You have requested that the following items be deleted\n", + CGI::ul(CGI::li(\@files)), + ((grep { -d "$dir/$_" } @files)? + CGI::p({style=>"width:500"},"Some of these files are directories. ", + "Only delete directories if you really know what you are doing. ", + "You can seriously damage your course if you delete the wrong thing."): ""), + CGI::p({style=>"color:red"},"There is no undo for deleting files or directories!"), + CGI::p("Really delete the items listed above?"), + CGI::div({style=>"float:left; padding-left:3ex"}, + CGI::input({type=>"submit",name=>"action",value=>"Cancel"})), + CGI::div({style=>"float:right; padding-right:3ex"}, + CGI::input({type=>"submit",name=>"action",value=>"Delete"})), ), ); print CGI::end_table(); @@ -563,9 +578,9 @@ my $name = $self->r->param('name'); if (my $file = $self->verifyName($name,"file")) { if (open(NEWFILE,">$file")) { - close(NEWFILE); - $self->RefreshEdit("",$name); - return; + close(NEWFILE); + $self->RefreshEdit("",$name); + return; } else {$self->addbadmessage("Can't create file: $!")} } } @@ -584,8 +599,8 @@ my $name = $self->r->param('name'); if (my $dir = $self->verifyName($name,"directory")) { if (mkdir $dir, 0750) { - $self->{pwd} .= '/'.$name; - $self->Refresh; return; + $self->{pwd} .= '/'.$name; + $self->Refresh; return; } else {$self->addbadmessage("Can't create directory: $!")} } } @@ -634,9 +649,29 @@ $upload->dispose; return; } + $self->checkFileLocation($name,$self->{pwd}); + + my $type = $self->r->param('format') || 'automatic'; + my $data; + + # + # Check if we need to convert linebreaks + # + if ($type ne 'Binary') { + my $fh = $upload->fileHandle; + my @lines = <$fh>; $data = join('',@lines); + if ($type eq 'Automatic') {$type = isText($data) ? 'Text' : 'Binary'} + } + if ($type eq 'Text') { + $data =~ s/\r\n?/\n/g; + open(UPLOAD,">$dir/$name") || $self->addbadmessage("Can't create file '$name'"); + print UPLOAD $data; close(UPLOAD); + $upload->dispose(); + } else { + $upload->disposeTo("$dir/$name"); + } - $upload->disposeTo("$dir/$name"); - $self->addgoodmessage("File '$name' uploaded successfully"); + $self->addgoodmessage("$type file '$name' uploaded successfully"); $self->Refresh; } @@ -653,15 +688,15 @@ print CGI::start_table({border=>1,cellspacing=>2,cellpadding=>20, style=>"margin: 1em 0 0 3em"}); print CGI::Tr( CGI::td( - $message, - CGI::input({type=>"text",name=>"name",size=>50}), - CGI::p(), - CGI::div({style=>"float:right; padding-right:3ex"}, - CGI::input({type=>"submit",name=>"action",value=>$button})), # this will be the default - CGI::div({style=>"float:left; padding-left:3ex"}, - CGI::input({type=>"submit",name=>"action",value=>"Cancel"})), - ), - ); + $message, + CGI::input({type=>"text",name=>"name",size=>50}), + CGI::p(), + CGI::div({style=>"float:right; padding-right:3ex"}, + CGI::input({type=>"submit",name=>"action",value=>$button})), # this will be the default + CGI::div({style=>"float:left; padding-left:3ex"}, + CGI::input({type=>"submit",name=>"action",value=>"Cancel"})), + ), + ); print CGI::end_table(); print CGI::hidden({name=>"confirmed",value=>1}); print CGI::script("window.document.FileManager.name.focus()"); @@ -751,7 +786,7 @@ my $original = $pwd; $pwd =~ s!(^|/)\.!$1_!g; # don't enter hidden directories $pwd =~ s!^/!!; # remove leading / - $pwd =~ s![^-_./a-zA-Z0-9 ]!_!g; # no illegal characters + $pwd =~ s![^-_./A-Z0-9~ ]!_!gi; # no illegal characters return if $renameError && $original ne $pwd; $pwd = '.' if $pwd eq ''; @@ -773,6 +808,20 @@ ################################################## # +# Check that a file is uploaded to the correct directory +# +sub checkFileLocation { + my $self = shift; + my $extension = shift; $extension =~ s/.*\.//; + my $dir = shift; + return unless defined($uploadDir{$extension}); + return if $dir =~ m/^$uploadDir{$extension}$/; + $dir = $uploadDir{$extension}; $dir =~ s!/.*!!; + $self->addbadmessage("Files with extension '.$extension' usually belong in '$dir'"); +} + +################################################## +# # Get a unique name (in case it already exists) # sub uniqueName { @@ -795,11 +844,11 @@ if ($name) { unless ($name =~ m!/!) { unless ($name =~ m!^\.!) { - unless ($name =~ m![^-_.a-zA-Z0-9 ]!) { - my $file = "$self->{courseRoot}/$self->{pwd}/$name"; - return $file unless (-e $file); - $self->addbadmessage("A file with that name already exists"); - } else {$self->addbadmessage("Your $object name contains illegal characters")} + unless ($name =~ m![^-_.a-zA-Z0-9 ]!) { + my $file = "$self->{courseRoot}/$self->{pwd}/$name"; + return $file unless (-e $file); + $self->addbadmessage("A file with that name already exists"); + } else {$self->addbadmessage("Your $object name contains illegal characters")} } else {$self->addbadmessage("Your $object name may not begin with a dot")} } else {$self->addbadmessage("Your $object name may not contain a path component")} } else {$self->addbadmessage("You must specify a $object name")} @@ -816,13 +865,13 @@ if ($path) { unless ($path =~ m![^-_.a-zA-Z0-9 /]!) { unless ($path =~ m!^/!) { - $path = checkPWD($self->{pwd}.'/'.$path,1); - if ($path) { - $path = $self->{courseRoot}.'/'.$path; - $path .= '/'.$name if -d $path && $name; - return $path unless (-e $path); - $self->addbadmessage("A file with that name already exists"); - } else {$self->addbadmessage("You have specified an illegal path")} + $path = checkPWD($self->{pwd}.'/'.$path,1); + if ($path) { + $path = $self->{courseRoot}.'/'.$path; + $path .= '/'.$name if -d $path && $name; + return $path unless (-e $path); + $self->addbadmessage("A file with that name already exists"); + } else {$self->addbadmessage("You have specified an illegal path")} } else {$self->addbadmessage("You can not specify an absolute path")} } else {$self->addbadmessage("Your file name contains illegal characters")} } else {$self->addbadmessage("You must specify a file name")} @@ -834,12 +883,12 @@ # Make HTML symbols printable # sub showHTML { - my $string = shift; - return '' unless defined $string; - $string =~ s/&/\&/g; - $string =~ s/</\</g; - $string =~ s/>/\>/g; - $string; + my $string = shift; + return '' unless defined $string; + $string =~ s/&/\&/g; + $string =~ s/</\</g; + $string =~ s/>/\>/g; + $string; } ################################################## |
From: Mike G. v. a. <act...@de...> - 2005-01-16 01:08:36
|
Log Message: ----------- Undoing some of the temporary changes I made to the warn message. This may break what happens with xmlrpc however. (sigh) Modified Files: -------------- pg/lib/WeBWorK/PG: Translator.pm Revision Data ------------- Index: Translator.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/WeBWorK/PG/Translator.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -Llib/WeBWorK/PG/Translator.pm -Llib/WeBWorK/PG/Translator.pm -u -r1.10 -r1.11 --- lib/WeBWorK/PG/Translator.pm +++ lib/WeBWorK/PG/Translator.pm @@ -794,8 +794,10 @@ unless defined( $self->{envir} ); # reset the error detection my $save_SIG_warn_trap = $SIG{__WARN__}; -# $SIG{__WARN__} = sub {&$save_SIG_warn_trap(PG_errorMessage('message',@_))}; - $SIG{__WARN__} = sub {CORE::die(PG_errorMessage('message',@_))}; + #FIXME -- this may not work with the xmlrpc access + # this formats the error message within the existing warn message. + $SIG{__WARN__} = sub {&$save_SIG_warn_trap(PG_errorMessage('message',@_))}; + #$SIG{__WARN__} = sub {CORE::warn(PG_errorMessage('message',@_))}; my $save_SIG_die_trap = $SIG{__DIE__}; $SIG{__DIE__} = sub {CORE::die(PG_errorMessage('traceback',@_))}; |
From: Mike G. v. a. <act...@de...> - 2005-01-16 00:11:54
|
Log Message: ----------- modified the way we attempt to find out the referring page. Modified Files: -------------- webwork-modperl/lib/WeBWorK: ContentGenerator.pm Revision Data ------------- Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.130 retrieving revision 1.131 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.130 -r1.131 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -1504,7 +1504,7 @@ my $user = $r->param("user"); $r->param(user => $user); @values = ($user); - warn "requesting page is ", $r->headers_in('Referer'); + warn "requesting page is ", $r->headers_in->{'Referer'}; warn "Parameters are ", join("|",$r->param()); } |
From: Mike G. v. a. <act...@de...> - 2005-01-15 21:40:14
|
Log Message: ----------- modified code for checking multiple user names. We'll see if we can track down the problem. --Mike Modified Files: -------------- webwork-modperl/lib/WeBWorK: ContentGenerator.pm Revision Data ------------- Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.129 retrieving revision 1.130 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.129 -r1.130 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -1499,7 +1499,16 @@ @values = $r->param($name); } #FIXME -- evntually we'd like to catch where this happens - croak "internal error -- user has been multiply defined!" if $name eq 'user' and @values >1; + if ($name eq 'user' and @values >1 ) { + warn "internal error -- user has been multiply defined!"; + my $user = $r->param("user"); + $r->param(user => $user); + @values = ($user); + warn "requesting page is ", $r->headers_in('Referer'); + warn "Parameters are ", join("|",$r->param()); + + } + if (@values) { if ($first) { $url .= "?"; |
From: Mike G. v. a. <act...@de...> - 2005-01-15 19:02:42
|
Log Message: ----------- Commented out escapeHTML() of warning messages since it prevented using tables when outputing info about answer evaluators. Can someone tell me whether there is another reason why not allowing HTML in warning messages is or would be important? If so we can figure out another way to debug answer evaluators. -- Mike Modified Files: -------------- webwork-modperl/lib/WeBWorK: ContentGenerator.pm Revision Data ------------- Index: ContentGenerator.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator.pm,v retrieving revision 1.128 retrieving revision 1.129 diff -Llib/WeBWorK/ContentGenerator.pm -Llib/WeBWorK/ContentGenerator.pm -u -r1.128 -r1.129 --- lib/WeBWorK/ContentGenerator.pm +++ lib/WeBWorK/ContentGenerator.pm @@ -1607,7 +1607,7 @@ my @warnings = split m/\n+/, $warnings; foreach my $warning (@warnings) { - $warning = escapeHTML($warning); + #$warning = escapeHTML($warning); # this would prevent using tables in output from answer evaluators $warning = CGI::li(CGI::code($warning)); } $warnings = join("", @warnings); |
From: Robert V. D. v. a. <act...@de...> - 2005-01-14 03:31:16
|
Log Message: ----------- new regexp matching can now match on permission level too Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: UserList.pm Revision Data ------------- Index: UserList.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm,v retrieving revision 1.61 retrieving revision 1.62 diff -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -Llib/WeBWorK/ContentGenerator/Instructor/UserList.pm -u -r1.61 -r1.62 --- lib/WeBWorK/ContentGenerator/Instructor/UserList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/UserList.pm @@ -622,6 +622,12 @@ my @userIDs; foreach my $record (@userRecords) { next unless $record; + + # add permission level to user record hash so we can match it if necessary + if ($field eq "permission") { + my $permissionLevel = $db->getPermissionLevel($record->user_id); + $record->{permission} = $permissionLevel->permission; + } push @userIDs, $record->user_id if $record->{$field} =~ /^$regex/i; } $self->{visibleUserIDs} = \@userIDs; |
From: Sam H. v. a. <act...@de...> - 2005-01-13 22:54:53
|
Log Message: ----------- HEAD backport: added "login" permission, handling code. also fixed some heinous formatting. (sam) Tags: ---- rel-2-1-patches Modified Files: -------------- webwork2/conf: global.conf.dist webwork2/lib: WeBWorK.pm webwork2/lib/WeBWorK: Authen.pm Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.111.2.3 retrieving revision 1.111.2.4 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.111.2.3 -r1.111.2.4 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -417,6 +417,7 @@ my $nobody = undef; %permissionLevels = ( + login => $student, report_bugs => $student, submit_feedback => $student, change_password => $student, Index: WeBWorK.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK.pm,v retrieving revision 1.68 retrieving revision 1.68.2.1 diff -Llib/WeBWorK.pm -Llib/WeBWorK.pm -u -r1.68 -r1.68.2.1 --- lib/WeBWorK.pm +++ lib/WeBWorK.pm @@ -223,19 +223,19 @@ debug("hashDatabaseOK() returned $dbOK -- leaving displayModule as-is\n"); } + debug("Create an authz object (Authen needs it to check login permission)...\n"); + $authz = new WeBWorK::Authz($r, $ce, $db); + debug("(here's the authz object: $authz)\n"); + $r->authz($authz); + debug("...and now we can authenticate the remote user...\n"); my $authen = new WeBWorK::Authen($r); my $authenOK = $authen->verify; if ($authenOK) { - debug("Hi, ", $r->param("user"), ", glad you made it.\n"); - - debug("Authentication succeeded, so it makes sense to create an authz object...\n"); - $authz = new WeBWorK::Authz($r, $ce, $db); - debug("(here's the authz object: $authz)\n"); - $r->authz($authz); + my $userID = $r->param("user"); + debug("Hi, $userID, glad you made it.\n"); debug("Now we deal with the effective user:\n"); - my $userID = $r->param("user"); my $eUserID = $r->param("effectiveUser") || $userID; debug("userID=$userID eUserID=$eUserID\n"); my $su_authorized = $authz->hasPermissions($userID, "become_student", $eUserID); Index: Authen.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Authen.pm,v retrieving revision 1.35.2.1 retrieving revision 1.35.2.2 diff -Llib/WeBWorK/Authen.pm -Llib/WeBWorK/Authen.pm -u -r1.35.2.1 -r1.35.2.2 --- lib/WeBWorK/Authen.pm +++ lib/WeBWorK/Authen.pm @@ -188,6 +188,7 @@ my $r = $self->{r}; my $ce = $r->ce; my $db = $r->db; + my $authz = $r->authz; my $practiceUserPrefix = $ce->{practiceUserPrefix}; my $debugPracticeUser = $ce->{debugPracticeUser}; @@ -257,18 +258,16 @@ $error = "You must specify a username."; last VERIFY; } - ######################################################## + # Make sure user is in the database - ######################################################## - - my $userRecord = $db->getUser($user); - unless (defined $userRecord) { # checked + my $userRecord = $db->getUser($user); # checked + unless (defined $userRecord) { + # FIXME too much information! $error = "There is no account for $user in this course."; last VERIFY; } - ######################################################## - # Make sure the user's status is defined. - ######################################################## + + # fix invalid status values (FIXME this should be in DB!) unless (defined $userRecord->status and defined($ce->{siteDefaults}->{status}->{$userRecord->status}) ) { @@ -277,13 +276,22 @@ $db->putUser($userRecord); warn "Setting status for user $user to C. It was previously undefined or miss defined."; } + + # make sure the user hasn't been dropped from the course if ($ce->{siteDefaults}->{status}->{$userRecord->status} eq "Drop") { - $error = "The user $user has been dropped from this course. "; + # FIXME too much information! + $error = "The user $user has been dropped from this course."; last VERIFY; } - ######################################################## + + # make sure the user is allowed to login + unless ($authz->hasPermissions($user, "login")) { + # FIXME too much information? + $error = "The user $user is not allowed to log in."; + last VERIFY; + } + # it's a practice user. - ######################################################## if ($practiceUserPrefix and $user =~ /^$practiceUserPrefix/) { # we're not interested in a practice user's password $r->param("passwd", ""); |
From: Mike G. v. a. <act...@de...> - 2005-01-11 23:02:04
|
Log Message: ----------- Fixing an error in defining $ENV{WEBWORK_ROOT}. Now it points to the generic '/opt/webwork2' Modified Files: -------------- webwork-modperl/conf: webwork.apache-config.dist Revision Data ------------- Index: webwork.apache-config.dist =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/conf/webwork.apache-config.dist,v retrieving revision 1.5 retrieving revision 1.6 diff -Lconf/webwork.apache-config.dist -Lconf/webwork.apache-config.dist -u -r1.5 -r1.6 --- conf/webwork.apache-config.dist +++ conf/webwork.apache-config.dist @@ -26,7 +26,7 @@ <Perl> # Set this variable to the path to your WeBWorK installation. -my $webwork_dir = "/home/gage/webwork/webwork-modperl"; +my $webwork_dir = "/opt/webwork2"; $ENV{WEBWORK_ROOT} = $webwork_dir; #allows the XMLRPC modules to find # the webwork root directory |
From: dpvc v. a. <act...@de...> - 2005-01-08 16:57:38
|
Log Message: ----------- Fixed a bug with the file editor that did not process the file name correctly in the top-level directory. Fixed a bug in uploading a file where the name was given a sequence number even when one was not needed. 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.6 retrieving revision 1.7 diff -Llib/WeBWorK/ContentGenerator/Instructor/FileManager.pm -Llib/WeBWorK/ContentGenerator/Instructor/FileManager.pm -u -r1.6 -r1.7 --- lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm +++ lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm @@ -373,7 +373,8 @@ my $pwd = $self->{pwd}; if ($filename) { $pwd = substr($filename,length($self->{courseRoot})+1); - $pwd =~ s!/([^/]*)$!!; $filename = $1; + $pwd =~ s!(/|^)([^/]*)$!!; $filename = $2; + $pwd = '.' if $pwd eq ''; } else { $filename = $self->getFile("save"); return unless $filename; } @@ -776,6 +777,7 @@ # sub uniqueName { my $dir = shift; my $name = shift; + return $name unless (-e "$dir/$name"); my $type = ""; my $n = -1; $type = $1 if ($name =~ s/(\.[^.]*)$//); $n = $1 if ($name =~ s/(\d+)$//); |
From: Sam H. v. a. <act...@de...> - 2005-01-08 00:15:49
|
Log Message: ----------- HEAD backport: removed FIXME comment that is no longer needed. (toenail) Tags: ---- rel-2-1-patches Modified Files: -------------- webwork2/lib/WeBWorK: Authen.pm Revision Data ------------- Index: Authen.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Authen.pm,v retrieving revision 1.35 retrieving revision 1.35.2.1 diff -Llib/WeBWorK/Authen.pm -Llib/WeBWorK/Authen.pm -u -r1.35 -r1.35.2.1 --- lib/WeBWorK/Authen.pm +++ lib/WeBWorK/Authen.pm @@ -273,7 +273,7 @@ defined($ce->{siteDefaults}->{status}->{$userRecord->status}) ) { $userRecord-> status('C'); - #FIXME -- still need to save this value to the database. + # need to save this value to the database. $db->putUser($userRecord); warn "Setting status for user $user to C. It was previously undefined or miss defined."; } |
From: Sam H. v. a. <act...@de...> - 2005-01-07 21:12:03
|
Log Message: ----------- back out of mistakenly double-applied backport Tags: ---- rel-2-1-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.111.2.2 retrieving revision 1.111.2.3 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.111.2.2 -r1.111.2.3 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -581,11 +581,6 @@ missingFontMessage => undef, # set to an HTML string to use for the missing font message }; -$pg{displayModeOptions}{jsMath} = { - reportMissingFonts => 1, # set to 0 to prevent the missing font message - missingFontMessage => undef, # set to an HTML string to use for the missing font message -}; - ##### Directories used by PG # The root of the PG directory tree (from pg_root in Apache config). |
From: Sam H. v. a. <act...@de...> - 2005-01-07 20:57:36
|
Log Message: ----------- HEAD backport: Defined some variables that were causing warning messages. (gage) Tags: ---- rel-2-1-patches Modified Files: -------------- pg/lib: AlgParser.pm Revision Data ------------- Index: AlgParser.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/AlgParser.pm,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -Llib/AlgParser.pm -Llib/AlgParser.pm -u -r1.6 -r1.6.2.1 --- lib/AlgParser.pm +++ lib/AlgParser.pm @@ -536,6 +536,7 @@ return ($args[0] . $p1 . $args[1]->tolatex() . $p2); }; /binop2/ && do { + my ($p1, $p2, $p3, $p4)=('','','',''); my ($lop,$rop) = ($args[1]->tolatex,$args[2]->tolatex); if ($args[0] eq '/'){ return('\frac{'.$lop.'}{'.$rop.'}'); |
From: Sam H. v. a. <act...@de...> - 2005-01-07 20:56:15
|
Log Message: ----------- HEAD backport: Avoids some name collisions for images converted from gif to png in hardcopy (jj) Tags: ---- rel-2-1-patches Modified Files: -------------- pg/macros: dangerousMacros.pl Revision Data ------------- Index: dangerousMacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/dangerousMacros.pl,v retrieving revision 1.31 retrieving revision 1.31.2.1 diff -Lmacros/dangerousMacros.pl -Lmacros/dangerousMacros.pl -u -r1.31 -r1.31.2.1 --- macros/dangerousMacros.pl +++ macros/dangerousMacros.pl @@ -986,7 +986,7 @@ my $gifFileName = fileFromPath($gifFilePath); $gifFileName =~ /^(.*)\.gif$/; - my $pngFilePath = surePathToTmpFile("${tempDirectory}png/$1.png"); + my $pngFilePath = surePathToTmpFile("${tempDirectory}png/$probNum-$1.png"); my $returnCode = system "$envir{externalGif2PngPath} $gifFilePath $pngFilePath"; if ($returnCode or not -e $pngFilePath) { |
From: Sam H. v. a. <act...@de...> - 2005-01-07 20:54:25
|
Log Message: ----------- HEAD backport: relative tolerence was not being used correctly. Fixed this. (apizer) Tags: ---- rel-2-1-patches Modified Files: -------------- pg/macros: PGcomplexmacros.pl Revision Data ------------- Index: PGcomplexmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGcomplexmacros.pl,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -Lmacros/PGcomplexmacros.pl -Lmacros/PGcomplexmacros.pl -u -r1.7 -r1.7.2.1 --- macros/PGcomplexmacros.pl +++ macros/PGcomplexmacros.pl @@ -122,7 +122,7 @@ my $mode = $cplx_params{'mode'}; if( $cplx_params{tolType} eq 'relative' ) { - $cplx_params{'tolerance'} = .01*$cplx_params{'tolerance'}; + $cplx_params{'tolerance'} = .01*$cplx_params{'relTol'}; } my $formattedCorrectAnswer; @@ -303,7 +303,7 @@ if( $mult_params{tolType} eq 'relative' ) { - $mult_params{'tolerance'} = .01*$mult_params{'tolerance'}; + $mult_params{'tolerance'} = .01*$mult_params{'relTol'}; } if( $mult_params{ 'compare' } eq 'cplx' ){ @@ -766,7 +766,7 @@ my $mode = $cplx_params{'mode'}; if( $cplx_params{tolType} eq 'relative' ) { - $cplx_params{'tolerance'} = .01*$cplx_params{'tolerance'}; + $cplx_params{'tolerance'} = .01*$cplx_params{'relTol'}; } my $formattedCorrectAnswer; @@ -954,7 +954,7 @@ my $mode = $cplx_params{'mode'}; if( $cplx_params{tolType} eq 'relative' ) { - $cplx_params{'tolerance'} = .01*$cplx_params{'tolerance'}; + $cplx_params{'tolerance'} = .01*$cplx_params{'relTol'}; } my $formattedCorrectAnswer; |
From: Sam H. v. a. <act...@de...> - 2005-01-07 20:53:13
|
Log Message: ----------- HEAD backport: Fixed a bug in processing absolute values with implicit multiplication. (dpvc) Tags: ---- rel-2-1-patches Modified Files: -------------- pg/lib: Parser.pm Revision Data ------------- Index: Parser.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser.pm,v retrieving revision 1.22 retrieving revision 1.22.2.1 diff -Llib/Parser.pm -Llib/Parser.pm -u -r1.22 -r1.22.2.1 --- lib/Parser.pm +++ lib/Parser.pm @@ -111,7 +111,7 @@ return if ($self->{error}); } $self->Close('start'); return if ($self->{error}); - $self->{tree} = $self->{stack}->[0]->{value}; + $self->{tree} = $self->{stack}[0]{value}; } @@ -119,7 +119,7 @@ # sub top { my $self = shift; my $i = shift || 0; - return $self->{stack}->[$i-1]; + return $self->{stack}[$i-1]; } sub prev {(shift)->top(-1)} @@ -267,8 +267,15 @@ my $self = shift; my $type = shift; my $paren = $self->{context}{parens}{$type}; if ($self->state eq 'operand') { - if ($type eq $paren->{close}) - {$self->Close($type,$self->{ref}); return} else {$self->ImplicitMult()} + if ($type eq $paren->{close}) { + my $stack = $self->{stack}; my $i = scalar(@{$stack})-1; + while ($i >= 0 && $stack->[$i]{type} ne "open") {$i--} + if ($i >= 0 && $stack->[$i]{value} eq $type) { + $self->Close($type,$self->{ref}); + return; + } + } + $self->ImplicitMult(); } $self->push({type => 'open', value => $type, ref => $self->{ref}}); } |
From: Sam H. v. a. <act...@de...> - 2005-01-07 20:48:47
|
Log Message: ----------- backport from HEAD: Added ability to control the "Missing TeX Fonts" message generated by jsMath. (dpvc) Tags: ---- rel-2-1-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.111.2.1 retrieving revision 1.111.2.2 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.111.2.1 -r1.111.2.2 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -581,6 +581,11 @@ missingFontMessage => undef, # set to an HTML string to use for the missing font message }; +$pg{displayModeOptions}{jsMath} = { + reportMissingFonts => 1, # set to 0 to prevent the missing font message + missingFontMessage => undef, # set to an HTML string to use for the missing font message +}; + ##### Directories used by PG # The root of the PG directory tree (from pg_root in Apache config). |
From: Sam H. v. a. <act...@de...> - 2005-01-07 20:34:26
|
Log Message: ----------- HEAD -> rel-2-1-patches backport: "Fixed an error where any plane is accepted if the d is 0 in ax + by + cz = 0." (dpvc) Tags: ---- rel-2-1-patches Modified Files: -------------- pg/macros: parserImplicitPlane.pl Revision Data ------------- Index: parserImplicitPlane.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/parserImplicitPlane.pl,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -Lmacros/parserImplicitPlane.pl -Lmacros/parserImplicitPlane.pl -u -r1.2 -r1.2.2.1 --- macros/parserImplicitPlane.pl +++ macros/parserImplicitPlane.pl @@ -137,6 +137,11 @@ if ($flag) {my $tmp = $l; $l = $r; $r = $tmp} my ($lN,$ld) = ($l->{N},$l->{d}); my ($rN,$rd) = ($r->{N},$r->{d}); + if ($rd == 0 || $ld == 0) { + return $rd <=> $ld unless $ld == $rd; + return $lN <=> $rN unless (areParallel $lN $rN); + return 0; + } return $rd*$lN <=> $ld*$rN; } |