Skip to content

Graphtool graph math object #1218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

drgrice1
Copy link
Member

Switch to a better extension system for the GraphTool.

For JavaScript instead of piecing together the parts of the class definition, use a function that returns the class definition directly. This has the advantage of being able to use super directly to access methods of the parent class, and is just much easier to work with.

All of the graph objects and graph tools are now in separate files (except the SelectTool and SolidDashTool which are core functionality).

For Perl, all graph objects are packages that derive from the GraphTool::GraphObject package instead of the previous method of defining cmp and tikz subroutines in a hash. A mapping from the string identifier to the package is maintained and used to construct the correct perl object for a graph tool object. There is a compatibility layer for objects added the old way.

Furthermore this take the Perl package approach further and the GraphTool::GraphObject package derives from the Value::List package. This means they are MathObjects. This makes things much simpler when writing a custom checker. The elements of the correct and student answer lists in the list_checker are all objects that derive from a GraphTool::GraphObject (which derives from a Value::List). See the new POD on CUSTOM CHECKERS for details.

@drgrice1 drgrice1 force-pushed the graphtool-graph-math-object branch 2 times, most recently from 0b7593a to ae0aeef Compare April 1, 2025 20:10
@drgrice1 drgrice1 force-pushed the graphtool-graph-math-object branch from ae0aeef to aed57f2 Compare April 8, 2025 23:06
For JavaScript instead of piecing together the parts of the class
definition, use a function that returns the class definition directly.
This has the advantage of being able to use `super` directly to access
methods of the parent class, and is just much easier to work with.

All of the graph objects and graph tools are now in separate files
(except the SelectTool and SolidDashTool which are core functionality).

For Perl, all graph objects are packages that derive from the
GraphTool::GraphObject package instead of the previous method of
defining cmp and tikz subroutines in a hash. A mapping from the string
identifier to the package is maintained and used to construct the
correct perl object for a graph tool object. There is a compatibility
layer for objects added the old way.
This makes things much simpler when writing a custom checker.  The
elements of the correct and student answer lists in the list_checker are
all objects that derive from a GraphTool::GraphObject (which derives
from a Value::List). See the new POD on CUSTOM CHECKERS for details.
@drgrice1 drgrice1 force-pushed the graphtool-graph-math-object branch from aed57f2 to 1ea544f Compare April 16, 2025 02:14
Copy link
Member

@pstaabp pstaabp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested all of the graph tool problems in the Sample problem set.

Also, we should update the custom checker graph tool sample problem, since this simplifies the checking.

@drgrice1
Copy link
Member Author

Yeah, I will add that to this pull request.

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.

2 participants