Build and Share Interactive Content
Maple 2022 provides additional tools for creating documents and interactive applications programmatically. These tools can be used to develop Maple Learn content or to create applications to be used in Maple. Maple Learn is a new online environment designed specifically for teaching and learning mathematics.
Canvas Scripting
Help with Math Problems
Canvas-based Quizzes
Maple 2022 greatly extends the tools for creating Canvas-based documents and interactive applications programmatically.
The Canvas package provides a framework for Maple users to easily build applications that can be used both in Maple and also shared on the web through Maple Learn. These applications can gather user input and compute using standard Maple commands in either environment.
Canvas Package
The DocumentTools[Canvas] package builds on DocumentTools component primitives to provide a simple way to generate a grid layout of text and math. It provides an easy mechanism to programmatically generate a page of math text and other elements. New in Maple 2022 is the ability to add Sliders, 3-D Plots, Images, Hyperlinks, Line-Drawings, and many new options for controlling the display of math and text.
3-D Plot Example
Image Example
In this example we embed an image in the canvas. Note: To execute this code you must be logged into the MapleCloud; see the Image command's help page for details.
The ShareCanvas command sends the canvas to Maple Learn and gives you a link to your document.
https://learn.maplesoft.com/#/?d=OTCKBNLTJUKMAKLMCLFIDMBFMJLKJPDQCGJIOMPJCPIOAOFQHNNHERHGFUIRNOBNEKOMGSMTIGCNKHETLJOLPIITMGKFMUMTONNN
Interactive Example
In this example, we will define an application that allows user input and provides feedback. The UpdateStats procedure will run when a button is pressed. It will use the new GetElements command to extract specific pieces of the canvas, including an array of points as input to analyze, and named elements so they can be replaced with updated values.
https://learn.maplesoft.com/#/?d=BNMSGTBOPRITAPETOFHTHSLKMKFQANDSKGBRBUOTCPNKDQJKAMOSNPHUHNIKEGHQDJCPEPCLFOMOPUIUNKPGCPMRDQHKNHMLCOBU
On-Click Events
The Plot element has a new "onclick" option, and the Button element has a new "onmoved" option. These can be used to react to events such as clicking on a plot or moving an image on a canvas. There is also a new hidden State element, which can be used to record behind the scenes values that don't need to be visible in the canvas.
In this example the user is asked to click on a plot to add points. When 2 or more points are set, the application will find a polynomial curve fit approximation and draw that on the plot too.
https://learn.maplesoft.com/#/?d=JOESANAGLRBIJUFMNQPRKGBMGKPIEODNBGGSCSEGOINMOIMFOOMODLILPIASNREKAKERCTHSEPIOIRGUAQCTIKLSCMCTOIAUFOJP
The new IntPractice and DiffPractice commands extend the algorithm behind SolveFeedback to handle integrals and derivatives.
https://learn.maplesoft.com/#/?d=ITFOMGBOPTOMCGMGLPBNLLKPHFEJERLHLOAJBOGMGKNGHLBQPLDLNIKQPSELBIJNKPLHLQKGFSLFKTGJIPKQIPMRDGOLHPKTDKFG
The Quiz command now has an option to supply a solution. The quiz question, verifier, new-problem generator and solution can return a canvas, which can be deployed to Maple Learn.
https://learn.maplesoft.com/#/?d=LOJKCGMHBIMFJHPGPFANCRFGLRDGLHGODFDMIHGNAPBHLNLRGJGUFUMMPRJQJNAFNJGRBPMKEGKUAUOKAOKRINEPNNPNCIFULMIF
Download Help Document