Maple Learn Content Tools - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Information : Updates : Maple 2021 : Maple Learn Content Tools

Maple Learn Content Tools 

Maple 2021 provides new 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 Practice Sheets 

Animated Step-by-Step Solutions 

Canvas Scripting 

Maple 2021 provides new tools for creating documents and interactive applications programmatically. The new concept of a canvas has two main uses.   

First, the canvas allows you to create Maple Learn content in Maple and then share it through Maple Learn.  This allows instructors to take advantage of Maple’s more advanced document and analysis tools to create sophisticated content that students can then use in Maple Learn.  

Second, the canvas provides a framework for Maple users to easily build applications where the number of required input fields is not known in advance. The user can create as many input fields as they need as they use the application, and Maple looks after the details of creating and extracting the information from those fields for you. All canvas applications be used in Maple or shared through Maple Learn. 

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.  
 

A canvas is both: 

  • a document template where math can be inserted and acted upon by button clicks within Maple, and
 

  • the document environment used by Maple Learn.
 

The NewCanvas and ShowCanvas commands can be used to construct and display math and text content organized in a grid layout.  When a ScriptButton is present, additional controls and blank entry boxes are available for user input.  Using Script actions the math and text can be modified and/or annotated.  


In scenario 1., the canvas is viewed and interacted with directly inside a Maple document.  

In scenario 2., the
ShareCanvas command is used to send the canvas to Maple Learn, where it can be viewed and interacted with inside a web browser. 

Simple Example 

In this example we use the NewCanvas command with lists of content in order to arrange the output into two columns.  

 

> with(DocumentTools:-Canvas); -1
 

> eq1 := Int(sqrt(`+`(sqrt(`^`(x, n)), `/`(1, `*`(`+`(alpha, `^`(beta, gamma)))))), x = `+`(`-`(infinity)) .. infinity); -1
 

> inerteq := `%+`(1, 1); -1
 

> cv := NewCanvas([
cv := NewCanvas([
cv := NewCanvas([
cv := NewCanvas([
cv := NewCanvas([
 


The
ShowCanvas command displays the created canvas. 

> ShowCanvas(cv);
 

Embedded component

Embedded component Embedded component
Embedded componentEmbedded component Embedded component
Embedded componentEmbedded component Embedded componentEmbedded component

The ShareCanvas command sends the canvas to Maple Learn and gives you a link to your document. 

> ShareCanvas(cv);
 

https://learn.maplesoft.com/#/?d=JSKFAPGRLOEMOILRAHFTGFBHFKCOHUHPKULNFPBTELLSOGHNDUMSOIPNBPLLMLKPHPHKCTKPEKLNNFPOPHOGOJPNPNLOAJPJPJAK 

Interactive Example 

In this example, we will define an application that allows user input and provides feedback.  The FindPrimes procedure will run when a button is pressed.  It will use the GetMath command to extract all of the math in the canvas area, then use Script commands, including Annotate to add annotations to the inputs.  

> FindPrimes := proc( canvas )
  uses DC=DocumentTools:-Canvas;
  local script := DC:-Script();
  for local m in DC:-GetMath(canvas) do  # get all the math in the canvas
      SetActive(script,m);    # set the location of the annotation
      if m:-math::integer and isprime(m:-math) then
          Annotate(script,"Good job, this is prime");   # annotate based on the given math
     else
          Annotate(script,"This is not prime");
     end if;
 end do;
 ToString(script);
end proc:
 

Generate the canvas 

> with(DocumentTools:-Canvas); -1
 

> cv := NewCanvas([
cv := NewCanvas([
 

To test this within Maple, run: 

> ShowCanvas(cv);
 

Embedded component

Image
Embedded componentEmbedded component
Embedded componentEmbedded component

ImageTo try this on the web using Maple Learn, execute: 

> ShareCanvas(cv);
 

https://learn.maplesoft.com/#/?d=PKHUBIIINLGTCNLKJPERNOMOFJDQDFETEKNQIFHQGOMMKIAGJQFHFSOODNCPPGNKEMAMPGJRHTGIESNLLKNGBRFPGKDQOFBPEHOT 

Help with Math Problems 

The new SolvePractice command generates a canvas with SolveFeedback as the command behind the button.   

> with(Grading); -1
 

> SolvePractice(`+`(`*`(2, `*`(x)), 3) = `+`(`*`(4, `*`(x)), `-`(5)), x);
 

Embedded component

Image
Embedded componentEmbedded component
Embedded componentEmbedded component
Embedded componentEmbedded component
Embedded componentEmbedded component
Embedded componentEmbedded component

ImageThis interactive example can also be shared via Maple Learn: 

cv := SolvePractice(`+`(`*`(2, `*`(x)), 3) = `+`(`*`(4, `*`(x)), `-`(5)), x, 'output' = 'link'); -1https://learn.maplesoft.com/#/?d=JPJUCLCQHQBSLFIKCRCRORKMFLALBFGLOLEGHROTKPFIJKAJMTLKKNJGIKNLGHCHLKMMOQIHKKPPOFMQDIMGLPENLHFLNRFHJMJR 

Canvas-based Practice Sheets 

The PracticeSheet command now has an option to return a canvas, which can be deployed to Maple Learn. 

> with(Student:-Basics); -1
 

> cv := Student:-Basics:-PracticeSheet(
cv := Student:-Basics:-PracticeSheet(
cv := Student:-Basics:-PracticeSheet(
cv := Student:-Basics:-PracticeSheet(
cv := Student:-Basics:-PracticeSheet(
 

> with(DocumentTools:-Canvas); -1
 

> ShowCanvas(cv); 1
 

Embedded component

Embedded component
Embedded componentEmbedded component Embedded componentEmbedded component
Embedded componentEmbedded component Embedded componentEmbedded component
Embedded componentEmbedded component Embedded componentEmbedded component
Embedded componentEmbedded component Embedded componentEmbedded component
Embedded componentEmbedded component Embedded componentEmbedded component
Embedded componentImage
Image

ImageShareCanvas(cv); 1  

https://learn.maplesoft.com/#/?d=HTCFHQEGJMNQLSMOHTGIMPBPBJNIFLEMIMLJNJMQGQMQBHHIFHFQJKHFMGCRHUIMLGKPOLPQGPLHBPDSFNAOPPPSEGLRJOETCILT 

Animated Step-by-Step Solutions 

The ShowSolution commands and many other commands that generate step-by-step solutions to problems can generate a canvas that is scripted in such a way that it will reveal solution steps in an animated fashion. 

> with(Student:-Calculus1); -1
 

> expr := Int(sin(`+`(`*`(2, `*`(x)))), x);
 

Typesetting:-mprintslash([expr := Int(sin(`+`(`*`(2, `*`(x)))), x)], [Int(sin(`+`(`*`(2, `*`(x)))), x)]) (4.1)
 

> ShowSolution(expr, 'displaystyle' = 'columns'); 1
 

Embedded component

Embedded componentEmbedded component
Embedded componentEmbedded component Embedded componentEmbedded component
Embedded componentEmbedded component Embedded component
Embedded componentEmbedded component Embedded componentEmbedded component
Embedded componentEmbedded component Embedded component
Embedded componentEmbedded component Embedded componentEmbedded component
Embedded componentEmbedded component Embedded component
Embedded componentEmbedded component Embedded componentEmbedded component
Embedded componentEmbedded component Embedded component
Embedded componentEmbedded component
Embedded componentEmbedded component
Embedded component
Embedded componentEmbedded component
Embedded component
Embedded componentEmbedded component
Embedded componentEmbedded component
Embedded component
Embedded componentEmbedded component
Embedded componentEmbedded component
Embedded component
Embedded componentEmbedded component

cv := ShowSolution(expr, 'displaystyle' = 'columns', 'output' = 'canvas'); -1  

> with(DocumentTools:-Canvas); -1
 

> ShareCanvas(cv); 1
 

https://learn.maplesoft.com/#/?d=KHLMGRHHJRJTETOSOHEJFFDJANMHHUMODJPGKPKFJUFTMRFMOFHFOMPJHHCGOMELLSLMNLPIEOKTDHMIAKLPKSPRESPLHRCJDMLF