Fraction context and FormulaWithUnits

Aperta
#1,137 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
perl
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Perl
Stelle
48
Fork
78
Merge medio
5g 13h
PR unite (30g)
9

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openwebwork/pg

Tutte le issue di openwebwork/pg

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.