-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #814 from openwebwork/PG-2.18
PG 2.18
- Loading branch information
Showing
739 changed files
with
108,482 additions
and
121,874 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
name: Lint Code Base | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
push: | ||
branches-ignore: [main, develop] | ||
pull_request: | ||
|
||
jobs: | ||
perltidy: | ||
name: Run perltidy on Perl Files | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: perl:5.34 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: perl -V | ||
run: perl -V | ||
- name: Install dependencies | ||
run: cpanm -n Perl::Tidy@20220613 | ||
- name: perltidy --version | ||
run: perltidy --version | ||
- name: Run perltidy | ||
shell: bash | ||
run: | | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
shopt -s extglob globstar nullglob | ||
perltidy --pro=./.perltidyrc -b -bext='/' ./**/*.p[lm] ./**/*.t && git diff --exit-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout PG code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Ubuntu dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends --no-install-suggests \ | ||
cpanminus \ | ||
dvipng \ | ||
dvisvgm \ | ||
imagemagick \ | ||
libclass-accessor-perl \ | ||
libclass-tiny-perl \ | ||
libdbi-perl \ | ||
libencode-perl \ | ||
libgd-perl \ | ||
libhtml-parser-perl \ | ||
libjson-perl \ | ||
libjson-xs-perl \ | ||
libtest2-suite-perl \ | ||
libtie-ixhash-perl \ | ||
libuuid-tiny-perl \ | ||
libyaml-libyaml-perl \ | ||
pdf2svg \ | ||
texlive \ | ||
texlive-latex-extra \ | ||
texlive-latex-recommended \ | ||
texlive-plain-generic | ||
- name: Install Perl dependencies | ||
run: cpanm --sudo -fi --notest HTML::TagParser | ||
|
||
- name: Run Perl unit tests | ||
run: | | ||
export PG_ROOT=`pwd` | ||
prove -r t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
lib/chromatic/color | ||
conf/pg_defaults.yml | ||
conf/pg_config.yml | ||
*.bak | ||
cover_db/ | ||
|
||
htdocs/node_modules | ||
htdocs/static-assets.json | ||
htdocs/**/*.min.js | ||
htdocs/**/*.min.css | ||
htdocs/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
# PBP .perltidyrc file | ||
-l=120 # Max line width is 120 cols | ||
-et=4 # Use tabs instead of spaces. | ||
-i=4 # Indent level is 4 cols | ||
-ci=4 # Continuation indent is 4 cols | ||
-b # Write the file inline and create a .bak file | ||
-vt=0 # Minimal vertical tightness | ||
-cti=0 # No extra indentation for closing brackets | ||
-pt=2 # Maximum parenthesis tightness | ||
-bt=1 # Medium brace tightness | ||
-sbt=1 # Medium square bracket tightness | ||
-bbt=1 # Medium block brace tightness | ||
-nsfs # No space before semicolons | ||
-nolq # Don't outdent long quoted strings | ||
-mbl=1 # Do not allow multiple empty lines | ||
-ce # Cuddled else | ||
-cb # Cuddled blocks | ||
-nbbc # Do not add blank lines before full length comments | ||
-nbot # No line break on ternary | ||
-nlop # No logical padding (this causes mixed tabs and spaces) | ||
-wn # Weld nested containers | ||
-xci # Extended continuation indentation | ||
-l=120 # Max line width is 120 cols | ||
-et=4 # Use tabs instead of spaces. | ||
-i=4 # Indent level is 4 cols | ||
-ci=4 # Continuation indent is 4 cols | ||
-b # Write the file inline and create a .bak file | ||
-vt=0 # Minimal vertical tightness | ||
-cti=0 # No extra indentation for closing brackets | ||
-pt=2 # Maximum parenthesis tightness | ||
-bt=1 # Medium brace tightness | ||
-sbt=1 # Medium square bracket tightness | ||
-bbt=1 # Medium block brace tightness | ||
-nsfs # No space before semicolons | ||
-nolq # Don't outdent long quoted strings | ||
-mbl=1 # Do not allow multiple empty lines | ||
-ce # Cuddled else | ||
-cb # Cuddled blocks | ||
-nbbc # Do not add blank lines before full length comments | ||
-nbot # No line break on ternary | ||
-nlop # No logical padding (this causes mixed tabs and spaces) | ||
-wn # Weld nested containers | ||
-xci # Extended continuation indentation | ||
-vxl='q' # No vertical alignment of qw quotes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
WeBWorK | ||
Program Generation Language | ||
Version 2.* | ||
Branch: https://github.com/openwebwork | ||
http://webwork.maa.org/wiki/Category:Release_Notes | ||
Copyright 2000-2022, The WeBWorK Project | ||
WeBWorK | ||
Program Generation Language | ||
Version 2.* | ||
Branch: https://github.com/openwebwork | ||
|
||
|
||
http://webwork.maa.org/wiki/Category:Release_Notes | ||
|
||
Copyright 2000-2023, The WeBWorK Project | ||
http://webwork.maa.org | ||
All rights reserved. | ||
All rights reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
$PG_VERSION ='2.17'; | ||
$PG_COPYRIGHT_YEARS = '1996-2022'; | ||
$PG_VERSION ='2.18'; | ||
$PG_COPYRIGHT_YEARS = '1996-2023'; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
% capa tex macros | ||
|
||
\newcommand{\capa}{{\sl C\kern-.10em\raise-.00ex\hbox{\rm A}\kern-.22em% | ||
{\sl P}\kern-.14em\kern-.01em{\rm A}}} | ||
|
||
\newenvironment{choicelist} | ||
{\begin{list}{} | ||
{\setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in} | ||
\setlength{\topsep}{0.05in}\setlength{\itemsep}{0.022in} | ||
\setlength{\parsep}{0in}\setlength{\belowdisplayskip}{0.04in} | ||
\setlength{\abovedisplayskip}{0.05in} | ||
\setlength{\abovedisplayshortskip}{-0.04in} | ||
\setlength{\belowdisplayshortskip}{0.04in}} | ||
} | ||
{\end{list}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
% definitions for PGML | ||
|
||
\newcount\pgmlCount | ||
\newdimen\pgmlPercent | ||
\newdimen\pgmlPixels | ||
|
||
\pgmlPixels=.5pt | ||
|
||
{\catcode`\^^M=\active% | ||
\gdef\pgmlSetup{% | ||
\pgmlPercent=.01\hsize% | ||
\parskip=0pt% | ||
\def\par{\ifmmode\else\endgraf\fi\ignorespaces}% | ||
\catcode`\^^M=\active% | ||
\def^^M{\ifmmode\else\space\fi\ignorespaces}} | ||
\global\let^^M\par}% | ||
|
||
\def\pgmlIndent{\par\advance\leftskip by 2em \advance\pgmlPercent by .02em \pgmlCount=0}% | ||
\def\pgmlbulletItem{\par\indent\llap{$\bullet$ }\ignorespaces}% | ||
\def\pgmldiscItem{\par\indent\llap{$\bullet$ }\ignorespaces}% | ||
\def\pgmlcircleItem{\par\indent\llap{$\circ$ }\ignorespaces}% | ||
\def\pgmlsquareItem{\par\indent\llap{\vrule height 1ex width .75ex depth -.25ex\ }\ignorespaces}% | ||
\def\pgmlnumericItem{\par\indent\advance\pgmlCount by 1 \llap{\the\pgmlCount. }\ignorespaces}% | ||
\def\pgmlalphaItem{\par\indent{\advance\pgmlCount by `\a \llap{\char\pgmlCount. }}\advance\pgmlCount by 1\ignorespaces}% | ||
\def\pgmlAlphaItem{\par\indent{\advance\pgmlCount by `\A \llap{\char\pgmlCount. }}\advance\pgmlCount by 1\ignorespaces}% | ||
\def\pgmlromanItem{\par\indent\advance\pgmlCount by 1 \llap{\romannumeral\pgmlCount. }\ignorespaces}% | ||
\def\pgmlRomanItem{\par\indent\advance\pgmlCount by 1 \llap{\uppercase\expandafter{\romannumeral\pgmlCount}. }\ignorespaces}% | ||
|
||
\def\pgmlCenter{% | ||
\par \parfillskip=0pt | ||
\advance\leftskip by 0pt plus .5\hsize | ||
\advance\rightskip by 0pt plus .5\hsize | ||
\def\pgmlBreak{\break}% | ||
}% | ||
\def\pgmlRight{% | ||
\par \parfillskip=0pt | ||
\advance\leftskip by 0pt plus \hsize | ||
\def\pgmlBreak{\break}% | ||
}% | ||
|
||
\def\pgmlBreak{\\}% | ||
|
||
\def\pgmlHeading#1{% | ||
\par\bfseries | ||
\ifcase#1 \or\huge \or\LARGE \or\large \or\normalsize \or\footnotesize \or\scriptsize \fi | ||
}% | ||
|
||
\def\pgmlRule#1#2{% | ||
\par\noindent | ||
\hbox{% | ||
\strut% | ||
\dimen1=\ht\strutbox% | ||
\advance\dimen1 by -#2% | ||
\divide\dimen1 by 2% | ||
\advance\dimen2 by -\dp\strutbox% | ||
\raise\dimen1\hbox{\vrule width #1 height #2 depth 0pt}% | ||
}% | ||
\par | ||
}% | ||
|
||
\def\pgmlIC#1{\futurelet\pgmlNext\pgmlCheckIC}% | ||
\def\pgmlCheckIC{\ifx\pgmlNext\pgmlSpace \/\fi}% | ||
{\def\getSpace#1{\global\let\pgmlSpace= }\getSpace{} }% | ||
|
||
{\catcode`\ =12\global\let\pgmlSpaceChar= }% | ||
{\catcode`\^^M=\active% | ||
\gdef\pgmlPreformatted{\par\small\ttfamily\hsize=10\hsize\obeyspaces\catcode`\^^M=\active\let^^M=\pgmlNL\pgmlNL}}% | ||
\def\pgmlNL{\par\bgroup\catcode`\ =12\pgmlTestSpace}% | ||
\def\pgmlTestSpace{\futurelet\next\pgmlTestChar}% | ||
\def\pgmlTestChar{\ifx\next\pgmlSpaceChar\ \pgmlTestNext\fi\egroup}% | ||
\def\pgmlTestNext\fi\egroup#1{\fi\pgmlTestSpace}% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
\NeedsTeXFormat{LaTeX2e} | ||
\ProvidesPackage{pg}[2023/06/26 version 2.18] | ||
|
||
% packages that are needed for some PG macro to function for tex output or that | ||
% support math mode tex macros that could reasonably appear in a PG problem | ||
\usepackage{amsmath, amsfonts, amssymb} % math macros | ||
\usepackage{booktabs, tabularx, colortbl, caption, xcolor} % niceTables.pl | ||
\usepackage{multicol} % DragNDrop.pm | ||
\usepackage[version=4]{mhchem} % chemistry macros | ||
|
||
% some packages need to be handled differently for xelatex vs pdflatex | ||
\usepackage{iftex} | ||
\ifXeTeX | ||
\usepackage{graphicx} % PGbasicmacros.pl, LiveGraphics3D.pl, unionImage.pl | ||
\else | ||
\usepackage[pdftex]{graphicx} % PGbasicmacros.pl, LiveGraphics3D.pl, unionImage.pl | ||
\usepackage{epstopdf} % eps images with pdftex | ||
\usepackage[utf8]{inputenc} | ||
\usepackage{eurosym} % the euro symbol | ||
\DeclareUnicodeCharacter{20AC}{\euro} % allow direct use of the UTF-8 euro symbol in problems | ||
\fi | ||
|
||
% PG macro collections | ||
\input{CAPA.tex} | ||
\input{PGML.tex} | ||
|
||
% The macro alternatives for < should be used in math in PG problems to help | ||
% avoid issus with a bare < in HMTL or XML output. The alternatives for > are | ||
% provided for parity. | ||
\newcommand{\lt}{<} | ||
\newcommand{\gt}{>} | ||
\newcommand{\less}{<} | ||
\newcommand{\grt}{>} | ||
|
||
% semantic macro definitions used by PG | ||
\newcommand{\answerRule}[2][]{\raisebox{-3pt}{\parbox[t]{#2ex}{\hrulefill}}} | ||
|
Oops, something went wrong.