Fraction context and FormulaWithUnits

Đang mở
#1,137 3 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
perl
Lĩnh vực
backend

Hướng nghiên cứu

Start with the reproduction in the issue: a PGML problem loading parserFormulaWithUnits.pl and contextFraction.pl with Context("Fraction"), where a correct answer of 1/2 min is rejected. Look at how FormulaWithUnits evaluates the fraction under the Fraction context, and compare with the Numeric context path the reporter mentions where reduceConstants is set to 0. Done means the fraction-form answer is accepted and a test covers it. The issue has been open about two years with no assignee or linked pull request, and it mentions a related issue, #1107, that may supersede it.

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

Mô tả

MathObject issue

Suppose a problem has an answer like 1/2 min. If you use parserNumberWithUnits.pl, it won't keep the fraction form, and that is important in a certain pedagogical context I am working with.

So I tried something like this, combining parserFormulaWithUnits.pl and contextFraction.pl.

DOCUMENT();
loadMacros(qw(PGstandard.pl PGML.pl parserFormulaWithUnits.pl contextFraction.pl));

Context("Fraction");
$answer = FormulaWithUnits("1/2 min");

BEGIN_PGML
Enter [|1/2 min|]*.

[_]{$answer}{16}
END_PGML

ENDDOCUMENT();

And submitting the correct answer, it is not accepted as correct. I think #1107 might make this moot, in that it could offer a better way to have a fraction with units. Also, it looks like I can accomplish what I want with FormulaWithUnits and Numeric context where I set reduceConstants to 0. But this did seem like a possible bug to report.

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.