Advanced Strategy: Scaffolding

Scaffolding is an effective technique to guide students towards difficult problems and deeper understanding. WeBWorK has recently introduced a new framework for coding problems, allowing you to implement scaffolding techniques in your WeBWorK problems. So, how do we take advantage of this framework?

First, we must include the necessary macros:




Without including “” in the loadMacros() call, WeBWorK will complain if we try to use the these snippets.

Essentially, the idea behind implementing “” is that we are writing multiple sub-problems within the same problem. This means that we will use the BEGIN_TEXT / END_TEXT repeatedly. Each level of the scaffolding will essentially be it’s own problem, complete with answer checking.


Section::Begin(“Part 1: The first part”);






ANS( $youranswer->cmp() );  #As many as required by the number of \{ ans_rule() \} calls in this section.


<<< REPEAT “Section::Begin()” / “Section::End()” FOR AS MANY SECTIONS AS YOU LIKE >>>


You should recognize what exists between the “Section::Begin” and the “Section::End” as the code for what is usually an entire problem. However, we can now begin a “new problem” within the same problem by going back to “Section::Begin” and repeating the process.

There are several settings that may be adjusted in the initial “Scaffold::Begin(…);” call. use the information at the bottom of the page, do NOT use the sample code.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.