Calling into question PGML answer LaTeX parsing

Abierto
#1,542 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
12/100
Tipo de issue
Refactorización
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
latex, perl
Área
backend

Línea de trabajo

The question concerns the LaTeX math-processing call in macros/core/PGML.pl that the issue links, which runs on all answer rules. Read the git history of that line and the array-answer path it was added for, then check how image answers from plots.pl are rendered. The issue asks for a maintainer decision on whether to remove or narrow the call, not for a patch, so an outcome is a clear design answer on the issue.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I want to know why the following line of code exists:

https://github.com/openwebwork/pg/blob/ac2907f20864dc3261ea1d8c0003ffc6228c2266/macros/core/PGML.pl#L1408

It seems to me that any answer rule method should already create properly formatted output for the current display mode, and should not need further processing of math for TeX.

Looking back through git blame it seems that this was added in 2015, but at that time this was only done for array answers (answers inserted with [_]*{...}). In 2018 this processing was extended to all answers.

In my testing, I haven't seen any answers (array or otherwise) where this is actually needed.

So what type of answer is this really needed for? Could the code for those answer types be updated to properly deal with this in a less intrusive way?

The reason that I ask is because I have increasingly seen this causing problems with certain types of answers, and not helping anywhere. There are many types of answers these days that are rather intensive with what the answer rule includes. Those answers could include many things that are improperly processed by the PGML::LaTeX call. The primary issue with with an image object from the plots.pl macro. For example, if the new parserMatchList.pl macro in #1541 has answers that are images created with the plots.pl macro.

The same thing could happen with answers for parserRadioButtons.pl or parserCheckboxList.pl that have images created with the plots.pl macro in them. Note that there are HTML validity issues if this is done at this point. However, I have a branch that I have been waiting to create a pull request of specifically because of this issue in which a new answer formatting option for those macros is added that places the text for a check box or radio button answer outside of the label, thus making it possible for these types of answers to be valid for these macros.

Lenguaje dominante
Perl
Estrellas
48
Forks
78
Merge medio
5 d 13 h
PR fusionados (30 d)
9

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openwebwork/pg

Todos los issues de openwebwork/pg

Issues similares

Más issues de Perl

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.