Preparing homework for WQS: the current algorithm

In this worksheet, I will tell how to make up a homework set using Maple and post it to WQS as of March 1999. In the future, I am sure the algorithm will change; currently, it is an 8 step process.

Suppose your name is carl and you want to make a homework set on parametric equations.

Step 1. Make a directory in your public_html called param. This is where you will store the files for your homework set. Note: the directory that this occurs in is an example.

Step 2. Copy the package WQStools.m and the perl script mkquiz39.pl into the directory param. WQStools is a package of Maple words which automate the insertion of WQS directives into the homework worksheet. mkquiz39.pl is used to automate the creation of html files needed to post the homework to WQS.

Step 3. Now open a Maple worksheet and load the WQStools package.

> with(WQStools);

[Maple Math]

>

The first 6 words in the package are words to help with the drawing of pictures. The last 4 words are the ones we want to illustrate here.

First, we will insert a WQS header, using the word makehead . you will need to select the blue text from BEGINWQSLINE to ENDWQSLINE and then change the paragraph style from Text Output to Normal in the style box at the top of the worksheet.

You will need to modify the word makehead to insert the correct path for you.

>

> makehead(param);

BEGINWQSHEADER

E1:

F1:/u/disk13/ma/carl/public_html/dolts/param

U1:http://www.ms.uky.edu/~carl/dolts/param

ENDWQSHEADER

Next, we can insert a Title using maketext . Below I have used it twice, to illustrate 'before' and 'after'. In order to put in the title after the T1_ line, you will need to select the blue text from T1_ to ENDWQSLINE and then change the paragraph style from Text Output to Normal in the style box at the top of the worksheet. Then you can insert whatever text you want and it will be included in the homework just before question 1.

> maketext(1);

T1_

BEGINWQSLINE

T1: {include:T1_.html}

ENDWQSLINE

Here is the title we have chosen.

> maketext(1);

T1_

Some problems with parametric equations

BEGINWQSLINE

T1: {include:T1_.html}

ENDWQSLINE

Now we want to insert a blank question using the word makequest. It will be question 1, and we want 5 alternatives to be listed. Currently, makequest(1,5) will randomly choose one of the alternatives and ask you to put the correct answer there.

> makequest(1,5);

Q1_

A1_

A2_
Put correct answer here

A3_

A4_

A5_

BEGINWQSLINE

Q1: {include:Q1_.html}

R1: A2

A1: {include:Q1_A1_.html}

A2: {include:Q1_A2_.html}

A3: {include:Q1_A3_.html}

A4: {include:Q1_A4_.html}

A5: {include:Q1_A5_.html}

ENDWQSLINE

As with maketext, in order to fill in the blanks we need to change the paragraph style to Normal. Below, we have done some computations and made up question 1.

> readlib(piecewise);

[Maple Math]

> array(1..3,1..2,[[x = 2 + 3*t, ` `],[` `, ` ,0 <= t <= 3`],
[y = 11 - 2*t,` `]]);

[Maple Math]

>

> makequest(1,5);

Q1_

Find parametric equations for the moving point P = [x,y] if P travels at constant velocity from (2,3) to (11,-3) between t=0 and t=3.

A1_

[Maple Math]

A2_
[Maple Math]

A3_

[Maple Math]

A4_

[Maple Math]

A5_

none of the above

BEGINWQSLINE

Q1: {include:Q1_.html}

R1: A2

A1: {include:Q1_A1_.html}

A2: {include:Q1_A2_.html}

A3: {include:Q1_A3_.html}

A4: {include:Q1_A4_.html}

A5: {include:Q1_A5_.html}

ENDWQSLINE

>

Now, for the next question we wanted to insert a solution, if someone wants to see it. So we use the word makesol (param,2), where param is the name of the problem set and 2 is the question number we want to solve. After that we insert the problem using makequest(2,5)

> makesol(param,2);

>

T2_

To see the solution to Question 2 <a href="http://www.ms.uky.edu/~carl/dolts/param/S2_.html" target="_top"> click here</a>.

BEGINWQSLINE

T2: {include:T2_.html}

ENDWQSLINE

S2_

Note the distance from [1,2] to [13,7] is [Maple Math] , so at t = 2 seconds, P = [13,7]. So the speed in the x-direction is 12/2 = 6 ft/sec and the speed in the y-direction is 5/2 ft/sec. So the equations are [Maple Math] .

SKIP

>

> array(1..2,1..1,[[x = 1 + 13/2*12/13*t],[y = 2 + 13/2*(-5)/13*t]]);

[Maple Math]

> y = 2 + 13/2*(-5)/13*t;

[Maple Math]

> makequest(2,5);

Q2_

Find parametric equations for the moving point P = [x,y] if P travels at constant speed 6.5 ft/sec from (1,2) in the direction of (13,7)

A1_
[Maple Math]

A2_

[Maple Math]

A3_

[Maple Math]

A4_

[Maple Math]

A5_

none of the above

BEGINWQSLINE

Q2: {include:Q2_.html}

R2: A1

A1: {include:Q2_A1_.html}

A2: {include:Q2_A2_.html}

A3: {include:Q2_A3_.html}

A4: {include:Q2_A4_.html}

A5: {include:Q2_A5_.html}

ENDWQSLINE

Now here is an example of using maketext to introduce a problem setting, and then using makequestion several times after that to pose questions in that setting.

> maketext(3);

T3_
A girl is playing on a flatcar which is moving in the positive x-direction at 10 m/sec. At time t0 she throws the ball straight upward (as viewed from the moving train) with an initial velocity 24.5 m/sec from a height 1 meter above the flatcar. From her point of view, the ball goes straight up and down, and lands on the flatcar directly below the point from which she threw it. However, an observer on the ground sees the ball travel in an arc.


Set up a coordinate system which is fixed to the earth (i.e. one which is not moving along with the train), with the y-axis pointing up and the x-axis pointing in the direction of motion of the train. Choose the origin to be the point in space which is 1 meter below the point from which the ball was released. Neglect air resistance, and take g = 9.8 m/sec^2.

[Maple Plot]

BEGINWQSLINE

T3: {include:T3_.html}

ENDWQSLINE

> f := t->10*t: g := t-> 1+24.5*t-9.8/2*t^2;

[Maple Math]

> sol:=solve(g(t)=1,t);

[Maple Math]

> frame := t-> plots[display]([PP([f(t),g(t)+1/2],1/2,blue),
PP([-3+f(t),1/2],1/2,green),
PP([1+f(t),1/2],1/2,green),
plots[polygonplot]([[-4+f(t),1/2],[2+f(t),1/2],[2+f(t),1],[-4+f(t),1]],color=red)]);

[Maple Math]
[Maple Math]
[Maple Math]

> plots[display]([seq(frame(i/30*sol[2]),i=0..30)],
insequence=true,scaling=constrained);

>

> [f(t),g(t)];

[Maple Math]

> [10*t, 1+24.5*t-4.9*t^2];

> array(1..2,1..2,[[x= ``,f(t)],[y=``,g(t)]]);

[Maple Math]

>

> makequest(17,5);

Q3_
(a) Find parametric equations for the motion of the ball in this fixed coordinate system.

A1_
[Maple Math]

A2_
[Maple Math]

A3_
[Maple Math]

A4_
[Maple Math]

A5_

BEGINWQSLINE

Q3: {include:Q3_.html}

R3: A2

A1: {include:Q3_A1_.html}

A2: {include:Q3_A2_.html}

A3: {include:Q3_A3_.html}

A4: {include:Q3_A4_.html}

A5: {include:Q3_A5_.html}

ENDWQSLINE

> solve(diff(g(t),t),t);

[Maple Math]

>

> makequest(4,5);

Q4_
(b) Find the instant when the ball reaches the peak of its trajectory.

A1_
1.5

A2_
2

A3_
2.5

A4_
3

A5_
3.5

BEGINWQSLINE

Q4: {include:Q4_.html}

R4: A3

A1: {include:Q4_A1_.html}

A2: {include:Q4_A2_.html}

A3: {include:Q4_A3_.html}

A4: {include:Q4_A4_.html}

A5: {include:Q4_A5_.html}

ENDWQSLINE

>

> solve(g(t)=1,t);

[Maple Math]

>

> makequest(5,5);

Q5_
(c) Find the instant when the ball hits the flatcar

A1_
At t = 8 seconds

A2_
At t = 7 seconds

A3_
At t = 6 seconds

A4_
At t = 5 seconds

A5_
At t = 4 seconds

BEGINWQSLINE

Q5: {include:Q5_.html}

R5: A4

A1: {include:Q5_A1_.html}

A2: {include:Q5_A2_.html}

A3: {include:Q5_A3_.html}

A4: {include:Q5_A4_.html}

A5: {include:Q5_A5_.html}

ENDWQSLINE

Now, after you have made up all of your questions and saved the worksheet in the directory param, comes

Step 4: Export your worksheet to HTML in the directory param.

Step 5: Open a dos window in the directory and execute the line

perl mkquiz39.pl param1.html

This will create a pile of html files that WQS needs to make up the homework set. One of them, data, must be opened with vi and the control M's removed with the command

1,$s/^V^M//

Step 6: From a telnet window in unix, go to the directory param and execute the line

chmod -R go+r *

Step 7: cd to the directory your file wqs-dirs is located in and insert the path to param.

Step 8: Login to WQS and inspect your work for errors.