A browser session is normallu pasive. That is it doesn't see (or
display) new information unless asked to do so (by a user request).

I haven't paid attention to your overall architecture, but suspect you
need something like the new timer event in order to update other user
states. There is a new demo that has shows how to use the timer.


On Mon, Sep 29, 2014 at 7:57 AM, Brian Schott <[email protected]> wrote:
> Joe and others,
>
> [Please accept my apologies for the length of this post.]
>
> My grandson visited over the weekend and I had an opportunity to exercise
> the turtle graphics system with him and with my wife for an extended period
> of time. It was a very informative and mostly excellent experience. However
> a result of that experimentation is that I now realize I do not understand
> a key feature of how JHS works in the several distinct sessions on my local
> area network.
>
> Whereas everyone (all the various users) does see how the turtles have
> moved and all of the turtles' current state no matter which session/screen
> they are observing, the other features of the graphics system only change
> on their own screen. Even the status of the various turtles is only updated
> on the local screen when the local user makes a change of the turtle by
> moving or turning the turtle on his session. The individual user can
> request a do-nothing action like moving the turtle forward 0 steps or
> turning the turtle 0° just so he or she can see the current status of all
> of the turtles.
>
> Almost all of that in the previous paragraph is as I would expect the
> system to behave and largely how I **want** the system to behave. However a
> key feature that is missing in the system is that the turtles can draw a
> line where they have moved, and  but that line only shows on the screen of
> the person who whose turtle created that line and not on any other screen. By
> the way, those lines are referred to as "pens" in turtle circles.
>
> Also other features which are not important and which I don't wish to
> change, do not change. For example if the user at one screen changes the
> viewing position perspective or changes the background color, then it is
> desirable in most circumstances that other people not necessarily see
> changes.
>
> So my major question is, how can I make the pens appear on other screens? I
> am going to show below (a) the code that creates the changing colors of the
> background screens and (b) the code that changes the pens and the positions
> of the turtles in the hopes that that is enough but I am fully aware it may
> not be. Notice that in both cases the main work is done my the function
> `draw()` which is not really shown, but may be important.
>
> In the "command_enter" functions below, the pen colors and pen positions
> are stored in the nouns `linecolors` and `moves`, which are distinct from
> the other values passed around in the graphics system because they are
> accumulated using the js ".concat" feature. The other features in the
> "command_enter" functions below paint the various turtles, not the pens,
> and are updated on all screens.
>
> *******(a)*******
> function ev_bgcolor_click(){jdoajax([],"");}
> function ev_bgcolor_click_ajax(tx){bgcolor=eval(tx[0]);draw();}
>
> *******(b)*******
> function ev_command_enter(){jdoajax(["command"],"");}
> function ev_command_enter_ajax(elements)
> {
>     var number = elements[0];
>     viewXYZ = elements[1];
>     viewUP  = elements[2];
>
>     var r = 0;
>     var drawFrame = function() {
> var ts = [];
> for(var i = 0; i < 13; i++) {
>     element = r*13+i+3;
>     ts.push(elements[element]);
> }
> linecolor=eval(ts[0]);
> linecolors = linecolors.concat(linecolor);
> move=eval(ts[1]);
> moves = moves.concat(move);
> leftColors=eval(ts[2]);
> rightColors=eval(ts[3]);
> backColors=eval(ts[4]);
> bottoms=eval(ts[5]);
> lefts=eval(ts[6]);
> rights=eval(ts[7]);
> backs=eval(ts[8]);
> bottomNs=eval(ts[9]);
> leftNs=eval(ts[10]);
> rightNs=eval(ts[11]);
> backNs=eval(ts[12]);
> draw();
> r++;
> if (r < number) {
>     requestAnimationFrame(drawFrame);
> }
>     }
>     requestAnimationFrame(drawFrame);
> }
>
> On Fri, Sep 26, 2014 at 7:39 AM, Joe Bogner <[email protected]> wrote:
>
>> Hi Brian, I don't know of a way to do that without patching the JHS
>> jijx code. However, since the session is shared by everyone, it should
>> only need to be entered once.
>>
>> I'm imagining the scenario where an instructor has this loaded and
>> students are connecting to it. The instructor would first enter that
>> and all the students would already have it in their shared session
>>
>>
>>
>> --
> (B=)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to