Adding the ability to use units with significant figures. #36
Conversation
when using the extension with Units context and added a test for units with significant figures.
|
@dpvc Somehow I inadvertently merged the previous one. I just updated the code with your suggestions from #34 and that fixed the error about the missing STRING function, but a couple of other issues popped up:
This doesn't occur within WeBWorK. I see that that WWSafe has a DESTROY sub that may handle it there. I'm guessing it's trying to call the DESTROY method that doesn't exist in either the base or extending class. |
Also fixed an issue with the testing for "closeness" between student and correct sigfig answers.
Well, I suppose it could be added to the list of allowed functions. Alternatively, you can remove it and just use die "Can't locate object method \"$method\" via package \"" . ref($self) . "\"\n";instead. This will mean the location of the call won't be made, but I suppose that's OK. It might be possible to use the output of As for die "Can't locate object method \"$method\" via package \"" . ref($self) . "\"\n"
unless $method eq 'DESTROY'; |
|
If you continue to get you may need to add return unless $self;before the line defining |
c7b437d to
b8bcff5
Compare
|
@dpvc Just updated code again. I still was seeing some warning, but got some AI help to add some lines to return early from methods if there was undefined fields. Both the sample pg problems in WeBWorK and the tests for using Units context seem to be working now, but want to make sure I added too much. Also, I'm not sure where to add the 'caller' function to the safe. I tried a couple of places in the wwsafe.pm file that seemed logical, but still getting a number of errors when running all of the tests. |
when using the extension with Units context and added a test for units with significant figures.