Skip to main content
Logo image

PreTeXt Sample Book Abstract Algebra (SAMPLE ONLY)

Section 3.28 SPLICE Integration

View Source for section
  <section xml:id="splice-integration">
    <title>SPLICE Integration</title>
    <p>
      <url href="https://cssplice.org/" visual="cssplice.org">SPLICE</url>
      is a project to supply documentation and infrastructure to help with adopting shared standards,
      protocols,
      and tools for web-based learning tools.
      The project has designed a
      <url href="https://cssplice.org/slcp/index.html" visual="cssplice.org/slcp">protocol</url>
      for an embedded iframe to communicate with its host page.
    </p>
    <p>
      One aspect is the ability of an iframe to ask for a new size.
      Below is a test of that capability.
    </p>
    <p>
      These are examples that use the
      <url href="https://cssplice.org/slcp/index.html" visual="cssplice.org/slcp">SPLICE</url>
      protocol for communicating with a server, such as Runestone.
      They are all integrated into this <pretext/> book as an <tag>interactive</tag> that uses an <attr>iframe</attr> attribute to embed an iframe from some other server.
    </p>
    <p>
      This first sample tests the ability of an iframe to ask for a new size.
    </p>
    <interactive xml:id="splice-resize-example" platform="javascript" width="60%" aspect="2:1" source="splice/splice-resize.js"/>
    <p>
      The next uses
      <url href="https://codecheck.io" visual="codecheck.io">CodeCheck</url>.
    </p>
    <figure xml:id="horstmann-codecheck">
      <caption>CodeCheck <c>iframe</c></caption>
      <interactive label="interactive-horstmann-codecheck" iframe="https://codecheck.io/files/wiley/ch-bj4cc-c06_exp_6_105" width="95%" aspect="1:1"/>
    </figure>
    <p>
      And the remaing four are from the
      <url href="https://opendsax.cs.vt.edu/" visual="opendsax.cs.vt.edu">OpenDSA</url>
      project.
    </p>
    <figure xml:id="opendsa-slideshow">
      <caption>Stack pop slideshow</caption>
      <interactive label="opendsa-slideshow-pop" iframe="https://opendsax.cs.vt.edu/embed/astackPopCON" width="95%"/>
    </figure>
    <figure xml:id="splice-integration-insert">
      <caption>A List Insertion Exercise</caption>
      <interactive label="OpenDSA-list-insertion" iframe="https://opendsax.cs.vt.edu/OpenDSA/Exercises/List/AlistInsertPRO.html" width="100%"/>
    </figure>
    <figure xml:id="splice-integration-bs">
      <caption>A Binary Search Exercise</caption>
      <interactive label="OpenDSA-integration-bs" iframe="https://opendsax.cs.vt.edu/OpenDSA/AV/Searching/binarySearchPRO.html" width="175%" aspect="3:1"/>
    </figure>
    <figure xml:id="splice-integration-dijkstra">
      <caption>Dijkstra's Algorithm Exercise</caption>
      <interactive label="OpenDSA-integration-dijkstra" iframe="https://opendsax.cs.vt.edu/OpenDSA/AV/Graph/DijkstraPE.html" width="175%" aspect="1:1"/>
    </figure>
<!-- Following exercises should go into their own section, but that -->
<!-- messes up numbering and it is hard to see changes.  Wait until -->
<!-- this settles down some, and then split these off.              -->
    <p>
      (2025-11-05) The following two exercises are
      <alert>strictly EXPERIMENTAL</alert>.
      Do not incorporate them into your projects as they are likely to change dramatically.
    </p>
<!-- 2025-11-05: Donated by Matt Boelkins from Active Calculus  -->
<!-- where it has @xml:id "doenet-interactive-exercise-1-1-1" -->
    <exercise>
      <title>Finding the average velocity of a moving object from data (dual, Doenet)</title>
      <dynamic>
      <statement>
        <interactive label="doenet-velocity" platform="doenetml">
<slate surface="doenetml">

&lt;setup&gt;
&lt;math name="a"&gt;&lt;selectFromSequence from="0.3" to="0.5" step="0.1"/&gt;&lt;/math&gt;
&lt;math name="b"&gt;&lt;selectFromSequence from="1.3" to="1.8" step="0.1"/&gt;&lt;/math&gt;
&lt;math name="c"&gt;&lt;selectFromSequence from="1" to="3" step="1"/&gt;&lt;/math&gt;
&lt;function name="s" symbolic="false"&gt;
$b*x^2
&lt;/function&gt;
&lt;/setup&gt;
&lt;!--
&lt;p&gt;&lt;m&gt;a=$a&lt;/m&gt;, &lt;m&gt;b=$b&lt;/m&gt;, &lt;m&gt;c=$c&lt;/m&gt;&lt;/p&gt;
--&gt;
&lt;p&gt; Consider a car whose position &lt;m&gt;s&lt;/m&gt; (in feet) at time &lt;m&gt;t&lt;/m&gt; (in seconds) is given by the table: &lt;/p&gt;
&lt;table suppressTableNameInTitle="true"&gt;
&lt;tabular top="minor" bottom="minor" left="minor" right="minor"&gt;
&lt;row&gt;
&lt;cell&gt;&lt;m&gt;t&lt;/m&gt; (sec)&lt;/cell&gt;
&lt;cell&gt;&lt;m&gt;0&lt;/m&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify&gt;$a&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify&gt;2$a&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify&gt;3$a&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify&gt;4$a&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify&gt;5$a&lt;/math&gt;&lt;/cell&gt;
&lt;/row&gt;
&lt;row&gt;
&lt;cell&gt;&lt;m&gt;s&lt;/m&gt; (feet)&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s(0)&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s($a)&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s(2$a)&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s(3$a)&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s(4$a)&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s(5$a)&lt;/math&gt;&lt;/cell&gt;
&lt;/row&gt;
&lt;/tabular&gt;
&lt;/table&gt;
&lt;p&gt; &lt;ol marker="a"&gt; &lt;li&gt; &lt;p&gt; What are the units on the average velocity of the car? &lt;/p&gt; &lt;answer&gt; &lt;choiceInput name="choice1" inline&gt; &lt;choice&gt;miles per hour&lt;/choice&gt; &lt;choice&gt;feet&lt;/choice&gt; &lt;choice credit="1"&gt;feet per second&lt;/choice&gt; &lt;choice&gt;seconds&lt;/choice&gt; &lt;/choiceInput&gt; &lt;/answer&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt;Find the average velocity of the car on the interval &lt;m&gt;0 \le t \le &lt;math simplify&gt;3*$a&lt;/math&gt;&lt;/m&gt;. &lt;/p&gt; &lt;/li&gt; &lt;answer allowedErrorInNumbers="0.05" allowedErrorIsAbsolute="true"&gt; ($$s(3*$a)-$$s(0*$a))/(3$a) &lt;/answer&gt; &lt;!-- &lt;math simplify displayDigits="8"&gt; ($$s(3*$a)-$$s(0*$a))/(3$a) &lt;/math&gt;, &lt;math displayDigits="8"&gt; ($$s(3*$a)-$$s(0*$a))/(3$a) &lt;/math&gt; --&gt; &lt;li&gt; &lt;p&gt; Find the average velocity of the car on the interval &lt;m&gt;[&lt;math simplify&gt;$c*$a&lt;/math&gt;, &lt;math simplify&gt;($c+2)*$a&lt;/math&gt;]&lt;/m&gt;. &lt;/p&gt; &lt;/li&gt; &lt;answer allowedErrorInNumbers="0.05" allowedErrorIsAbsolute="true"&gt; ($$s(($c+2)*$a)-$$s($c*$a))/(2$a) &lt;/answer&gt; &lt;/ol&gt; &lt;/p&gt;

</slate>
        </interactive>
      </statement>
      </dynamic>
      <static>
        <introduction>
          <p>
            Consider a car whose position <m>s</m>
            (in feet)
            at time <m>t</m>
            (in seconds)
            is given by the table:
          </p>
<!-- $a = 0.3, $$s(x) = 1.3*x^2 -->
          <tabular top="minor" bottom="minor" left="minor" right="minor">
            <row>
              <cell><m>t</m> (sec)</cell>
              <cell><m>0</m></cell>
              <cell><m>0.3</m></cell>
              <cell><m>0.6</m></cell>
              <cell><m>0.9</m></cell>
              <cell><m>1.2</m></cell>
              <cell><m>1.5</m></cell>
            </row>
            <row>
              <cell><m>s</m> (feet)</cell>
              <cell><m>0</m></cell>
              <cell><m>0.117</m></cell>
              <cell><m>0.468</m></cell>
              <cell><m>1.053</m></cell>
              <cell><m>1.872</m></cell>
              <cell><m>2.925</m></cell>
            </row>
          </tabular>
        </introduction>
        <task>
          <statement>
            <p>
              What are the units on the average velocity of the car?
            </p>
          </statement>
          <hint>
            <p>
              Consider possibilities such as
              <q>feet</q>,
              <q>seconds</q>,
              <q>feet per second</q>, or
              <q>seconds per foot</q>.
            </p>
          </hint>
          <answer>
            <p>
              feet per second
            </p>
          </answer>
        </task>
        <task>
          <statement>
            <p>
              Find the average velocity of the car on the interval <m>0 \le t \le 0.9</m>.
            </p>
          </statement>
          <hint>
            <p>
              Recall that average velocity is
              <q>change in position divided by change in time</q>.
            </p>
          </hint>
          <answer>
            <p>
              The average velocity of the car on the interval
              <m>0 \le t \le 0.9</m> is <m>1.17</m> feet per second.
            </p>
          </answer>
        </task>
        <task>
          <statement>
            <p>
 <!-- $c = 3 --> Find the average velocity of the car on the interval <m>[0.9, 1.5]</m>.
            </p>
          </statement>
          <answer>
            <p>
              The average velocity of the car on the interval
              <m>[0.9,1.5]</m> is <m>3.12</m> feet per second.
            </p>
          </answer>
        </task>
      </static>
    </exercise>
    <exercise>
      <title>OpenDSA List Insertion (Dual)</title>
      <dynamic>
      <statement>
        <p>
          Work this following problem.
          Note that this is really just a test to see if additional text
          (beyond an <tag>interactive</tag>)
          will show up.
        </p>
        <interactive label="OpenDSA-list-insertion-exercise" iframe="https://opendsax.cs.vt.edu/OpenDSA/Exercises/List/AlistInsertPRO.html" width="100%"/>
      </statement>
      </dynamic>
      <static>
        <statement>
          <p>
            An exercise about array-based list insertion goes here.
          </p>
        </statement>
      </static>
    </exercise>
  </section>
SPLICE is a project to supply documentation and infrastructure to help with adopting shared standards, protocols, and tools for web-based learning tools. The project has designed a protocol for an embedded iframe to communicate with its host page.
One aspect is the ability of an iframe to ask for a new size. Below is a test of that capability.
These are examples that use the SPLICE protocol for communicating with a server, such as Runestone. They are all integrated into this PreTeXt book as an <interactive> that uses an @iframe attribute to embed an iframe from some other server.
This first sample tests the ability of an iframe to ask for a new size.
The next uses CodeCheck.
View Source for figure
<figure xml:id="horstmann-codecheck">
  <caption>CodeCheck <c>iframe</c></caption>
  <interactive label="interactive-horstmann-codecheck" iframe="https://codecheck.io/files/wiley/ch-bj4cc-c06_exp_6_105" width="95%" aspect="1:1"/>
</figure>
Figure 3.28.1. CodeCheck iframe
And the remaing four are from the OpenDSA project.
View Source for figure
<figure xml:id="opendsa-slideshow">
  <caption>Stack pop slideshow</caption>
  <interactive label="opendsa-slideshow-pop" iframe="https://opendsax.cs.vt.edu/embed/astackPopCON" width="95%"/>
</figure>
Figure 3.28.2. Stack pop slideshow
View Source for figure
<figure xml:id="splice-integration-insert">
  <caption>A List Insertion Exercise</caption>
  <interactive label="OpenDSA-list-insertion" iframe="https://opendsax.cs.vt.edu/OpenDSA/Exercises/List/AlistInsertPRO.html" width="100%"/>
</figure>
Figure 3.28.3. A List Insertion Exercise
View Source for figure
<figure xml:id="splice-integration-bs">
  <caption>A Binary Search Exercise</caption>
  <interactive label="OpenDSA-integration-bs" iframe="https://opendsax.cs.vt.edu/OpenDSA/AV/Searching/binarySearchPRO.html" width="175%" aspect="3:1"/>
</figure>
Figure 3.28.4. A Binary Search Exercise
View Source for figure
<figure xml:id="splice-integration-dijkstra">
  <caption>Dijkstra's Algorithm Exercise</caption>
  <interactive label="OpenDSA-integration-dijkstra" iframe="https://opendsax.cs.vt.edu/OpenDSA/AV/Graph/DijkstraPE.html" width="175%" aspect="1:1"/>
</figure>
Figure 3.28.5. Dijkstra’s Algorithm Exercise
(2025-11-05) The following two exercises are strictly EXPERIMENTAL. Do not incorporate them into your projects as they are likely to change dramatically.

Checkpoint 3.28.6. Finding the average velocity of a moving object from data (dual, Doenet).

View Source for exercise
    <exercise>
      <title>Finding the average velocity of a moving object from data (dual, Doenet)</title>
      <dynamic>
      <statement>
        <interactive label="doenet-velocity" platform="doenetml">
<slate surface="doenetml">

&lt;setup&gt;
&lt;math name="a"&gt;&lt;selectFromSequence from="0.3" to="0.5" step="0.1"/&gt;&lt;/math&gt;
&lt;math name="b"&gt;&lt;selectFromSequence from="1.3" to="1.8" step="0.1"/&gt;&lt;/math&gt;
&lt;math name="c"&gt;&lt;selectFromSequence from="1" to="3" step="1"/&gt;&lt;/math&gt;
&lt;function name="s" symbolic="false"&gt;
$b*x^2
&lt;/function&gt;
&lt;/setup&gt;
&lt;!--
&lt;p&gt;&lt;m&gt;a=$a&lt;/m&gt;, &lt;m&gt;b=$b&lt;/m&gt;, &lt;m&gt;c=$c&lt;/m&gt;&lt;/p&gt;
--&gt;
&lt;p&gt; Consider a car whose position &lt;m&gt;s&lt;/m&gt; (in feet) at time &lt;m&gt;t&lt;/m&gt; (in seconds) is given by the table: &lt;/p&gt;
&lt;table suppressTableNameInTitle="true"&gt;
&lt;tabular top="minor" bottom="minor" left="minor" right="minor"&gt;
&lt;row&gt;
&lt;cell&gt;&lt;m&gt;t&lt;/m&gt; (sec)&lt;/cell&gt;
&lt;cell&gt;&lt;m&gt;0&lt;/m&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify&gt;$a&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify&gt;2$a&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify&gt;3$a&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify&gt;4$a&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify&gt;5$a&lt;/math&gt;&lt;/cell&gt;
&lt;/row&gt;
&lt;row&gt;
&lt;cell&gt;&lt;m&gt;s&lt;/m&gt; (feet)&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s(0)&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s($a)&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s(2$a)&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s(3$a)&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s(4$a)&lt;/math&gt;&lt;/cell&gt;
&lt;cell&gt;&lt;math simplify displayDigits="4"&gt;$$s(5$a)&lt;/math&gt;&lt;/cell&gt;
&lt;/row&gt;
&lt;/tabular&gt;
&lt;/table&gt;
&lt;p&gt; &lt;ol marker="a"&gt; &lt;li&gt; &lt;p&gt; What are the units on the average velocity of the car? &lt;/p&gt; &lt;answer&gt; &lt;choiceInput name="choice1" inline&gt; &lt;choice&gt;miles per hour&lt;/choice&gt; &lt;choice&gt;feet&lt;/choice&gt; &lt;choice credit="1"&gt;feet per second&lt;/choice&gt; &lt;choice&gt;seconds&lt;/choice&gt; &lt;/choiceInput&gt; &lt;/answer&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt;Find the average velocity of the car on the interval &lt;m&gt;0 \le t \le &lt;math simplify&gt;3*$a&lt;/math&gt;&lt;/m&gt;. &lt;/p&gt; &lt;/li&gt; &lt;answer allowedErrorInNumbers="0.05" allowedErrorIsAbsolute="true"&gt; ($$s(3*$a)-$$s(0*$a))/(3$a) &lt;/answer&gt; &lt;!-- &lt;math simplify displayDigits="8"&gt; ($$s(3*$a)-$$s(0*$a))/(3$a) &lt;/math&gt;, &lt;math displayDigits="8"&gt; ($$s(3*$a)-$$s(0*$a))/(3$a) &lt;/math&gt; --&gt; &lt;li&gt; &lt;p&gt; Find the average velocity of the car on the interval &lt;m&gt;[&lt;math simplify&gt;$c*$a&lt;/math&gt;, &lt;math simplify&gt;($c+2)*$a&lt;/math&gt;]&lt;/m&gt;. &lt;/p&gt; &lt;/li&gt; &lt;answer allowedErrorInNumbers="0.05" allowedErrorIsAbsolute="true"&gt; ($$s(($c+2)*$a)-$$s($c*$a))/(2$a) &lt;/answer&gt; &lt;/ol&gt; &lt;/p&gt;

</slate>
        </interactive>
      </statement>
      </dynamic>
      <static>
        <introduction>
          <p>
            Consider a car whose position <m>s</m>
            (in feet)
            at time <m>t</m>
            (in seconds)
            is given by the table:
          </p>
<!-- $a = 0.3, $$s(x) = 1.3*x^2 -->
          <tabular top="minor" bottom="minor" left="minor" right="minor">
            <row>
              <cell><m>t</m> (sec)</cell>
              <cell><m>0</m></cell>
              <cell><m>0.3</m></cell>
              <cell><m>0.6</m></cell>
              <cell><m>0.9</m></cell>
              <cell><m>1.2</m></cell>
              <cell><m>1.5</m></cell>
            </row>
            <row>
              <cell><m>s</m> (feet)</cell>
              <cell><m>0</m></cell>
              <cell><m>0.117</m></cell>
              <cell><m>0.468</m></cell>
              <cell><m>1.053</m></cell>
              <cell><m>1.872</m></cell>
              <cell><m>2.925</m></cell>
            </row>
          </tabular>
        </introduction>
        <task>
          <statement>
            <p>
              What are the units on the average velocity of the car?
            </p>
          </statement>
          <hint>
            <p>
              Consider possibilities such as
              <q>feet</q>,
              <q>seconds</q>,
              <q>feet per second</q>, or
              <q>seconds per foot</q>.
            </p>
          </hint>
          <answer>
            <p>
              feet per second
            </p>
          </answer>
        </task>
        <task>
          <statement>
            <p>
              Find the average velocity of the car on the interval <m>0 \le t \le 0.9</m>.
            </p>
          </statement>
          <hint>
            <p>
              Recall that average velocity is
              <q>change in position divided by change in time</q>.
            </p>
          </hint>
          <answer>
            <p>
              The average velocity of the car on the interval
              <m>0 \le t \le 0.9</m> is <m>1.17</m> feet per second.
            </p>
          </answer>
        </task>
        <task>
          <statement>
            <p>
 <!-- $c = 3 --> Find the average velocity of the car on the interval <m>[0.9, 1.5]</m>.
            </p>
          </statement>
          <answer>
            <p>
              The average velocity of the car on the interval
              <m>[0.9,1.5]</m> is <m>3.12</m> feet per second.
            </p>
          </answer>
        </task>
      </static>
    </exercise>

Checkpoint 3.28.7. OpenDSA List Insertion (Dual).

View Source for exercise
<exercise>
  <title>OpenDSA List Insertion (Dual)</title>
  <dynamic>
  <statement>
    <p>
      Work this following problem.
      Note that this is really just a test to see if additional text
      (beyond an <tag>interactive</tag>)
      will show up.
    </p>
    <interactive label="OpenDSA-list-insertion-exercise" iframe="https://opendsax.cs.vt.edu/OpenDSA/Exercises/List/AlistInsertPRO.html" width="100%"/>
  </statement>
  </dynamic>
  <static>
    <statement>
      <p>
        An exercise about array-based list insertion goes here.
      </p>
    </statement>
  </static>
</exercise>
Work this following problem. Note that this is really just a test to see if additional text (beyond an <interactive>) will show up.