Skip to content

Commit

Permalink
Merge pull request #814 from openwebwork/PG-2.18
Browse files Browse the repository at this point in the history
PG 2.18
  • Loading branch information
drgrice1 authored Jul 20, 2023
2 parents a29b85f + e85f611 commit e258ae2
Show file tree
Hide file tree
Showing 739 changed files with 108,482 additions and 121,874 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/coverage.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/linter.yml
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
47 changes: 47 additions & 0 deletions .github/workflows/unit-tests.yml
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
4 changes: 2 additions & 2 deletions .gitignore
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
43 changes: 22 additions & 21 deletions .perltidyrc
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
16 changes: 8 additions & 8 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
WeBWorK
Online Homework Delivery System
Version 2.*
WeBWorK
Online Homework Delivery System
Version 2.*

Copyright 2000-2022, The WeBWorK Project
All rights reserved.
Copyright 2000-2023, The WeBWorK Project
All rights reserved.

This program is free software; you can redistribute it and/or modify
it under the terms of either:

a) the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option)
any later version, or
Expand All @@ -24,7 +24,7 @@
one.

You should also have received a copy of the GNU General Public License
along with this program in the file named "Copying". If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
along with this program in the file named "Copying". If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA or visit their web page on the internet at
http://www.gnu.org/copyleft/gpl.html.
20 changes: 10 additions & 10 deletions README
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.
4 changes: 2 additions & 2 deletions VERSION
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;
15 changes: 15 additions & 0 deletions assets/tex/CAPA.tex
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}}
71 changes: 71 additions & 0 deletions assets/tex/PGML.tex
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}%
37 changes: 37 additions & 0 deletions assets/tex/pg.sty
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}}}

Loading

0 comments on commit e258ae2

Please sign in to comment.