Skip to content

Add flags for context related to partial credit of SigFig problems.#34

Open
pstaabp wants to merge 1 commit into
sigfig-exponential-formfrom
sig-fig-add-partial-credit
Open

Add flags for context related to partial credit of SigFig problems.#34
pstaabp wants to merge 1 commit into
sigfig-exponential-formfrom
sig-fig-add-partial-credit

Conversation

@pstaabp
Copy link
Copy Markdown
Owner

@pstaabp pstaabp commented May 22, 2026

This includes flags for determining if a problem is to check to see if an answer has the correct # of sig figs and/or is close and give partial credit.

This includes flags for determining if a problem is to check to see if an answer has the correct # of sig figs and/or is close and give partial credit.
@pstaabp pstaabp force-pushed the sig-fig-add-partial-credit branch from 5fdce91 to 12e0598 Compare May 22, 2026 18:40
@pstaabp
Copy link
Copy Markdown
Owner Author

pstaabp commented May 22, 2026

@dpvc Now that I have more time, getting back to this. The code that I have in the PR is to add a couple of flags that allow partial credit if either the student answer matches the correct answer (within tolerance) but the number of sig figs is wrong or the number of sig figs matches and the student answer is incorrect but within tolerance.

We had this working on a different branch before I merged your code about handling the exponential form. I've been testing with the units as:

DOCUMENT();
loadMacros("PGstandard.pl","PGML.pl",'contextSignificantFigures.pl', 'contextUnits.pl');

Context(context::Units::extending('SignificantFigures')->withUnitsFor('length'))->flags->set(tolerance => 1,partial_credit=>0.48);

$ans=Compute('123.0 cm');
BEGIN_PGML
Enter the value [$ans]

[_]{$ans}
END_PGML
ENDDOCUMENT();

Now, I'm getting the following error:

ERRORS from evaluating PG file: Can't locate object method "STRING" via package "context::Units::BOP::Space" 
at line 737 of [PG]/macros/contexts/contextSignificantFigures.pl from within 
 context::SignificantFigures::BOP::space::string called at line 1935 of 
[PG]/macros/contexts/contextUnits.pl from within context::Units::BOP::string
called at line 755 of [PG]/lib/Parser.pm from within Parser::string called at 
line 107 of [PG]/macros/core/Parser.pl from within main::Compute called at line 6 of undefined

This looks like it's calling the new STRING method that you put in, but isn't being handled right with units.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant