PG.pl uses the round function without explicitly loading a package that contains it.

Aperta
#2,565 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
perl
Ambito
backend

Direzione di ricerca

Start with the minimal problem in the issue, which calls the round function from PG.pl line 1097 without loading PGauxiliaryFunctions.pl. Check where round is defined and how other macros expose helpers before choosing a fix, since the issue itself leaves open whether PG.pl should load that file. Done means the MWE shows feedback with no 'Undefined subroutine' warning, and maintainers have agreed on where the helper should live.

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

Descrizione

Here is a MWE:

DOCUMENT();

loadMacros(
    "PG.pl",
    "PGbasicmacros.pl",
    "PGML.pl",
);

$ans = List("1,2");

BEGIN_PGML
Enter [`1,2`]: [_]{$ans}
END_PGML
ENDDOCUMENT();

Enter "1" in the answer blank and you get the following warning message, and the feedback is not shown for the answer.

ERRORS from post processing PG text:
Undefined subroutine &main::round called at [PG]/macros/PG.pl line 1097

This is because the round function is defined in PGauxiliaryFunctions.pl, which is not loaded by this problem.

This could be solved by having PG.pl load PGauxiliaryFunctions.pl, but it seems wrong to have the core PG macro depend on other macro files.

Lingua principale
Perl
Stelle
164
Fork
167
Merge medio
6g 7h
PR unite (30g)
27

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

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/webwork2

Tutte le issue di openwebwork/webwork2

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.