Calling into question PGML answer LaTeX parsing

Đang mở
#1,542 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 4 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
12/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
latex, perl
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Perl
Star
48
Fork
78
Merge trung bình
5 ngày 13 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của openwebwork/pg

Tất cả issue của openwebwork/pg

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.