Sagelets in WebWork

66 views
Skip to first unread message

John Travis

unread,
Jan 13, 2012, 12:10:21 PM1/13/12
to sage-notebook
I've been trying to wear out the single cell server with sagelets from
within WebWork problems. If interested, you can view what I have thus
far by browsing http://math.mc.edu/webwork2/sage_demos/ and logging
into the system as guest. I need to fix at least one answer checker
but you can get the idea.

A minor issue that I have found with the single-cell is that it will
no longer allow one to use "input_grid" as part of an interact input.
This is not mission critical but just passing the word along.

John T

alex_kramer

unread,
Jan 13, 2012, 12:34:22 PM1/13/12
to sage-notebook
On Jan 13, 12:10 pm, John Travis <tra...@mc.edu> wrote:
> A minor issue that I have found with the single-cell is that it will
> no longer allow one to use "input_grid" as part of an interact input.
> This is not mission critical but just passing the word along.

What's the issue you're having with the InputGrid (or
input_grid for compatibility with the sagenb syntax)
interact control? I just tried a basic example on
sagemath.org:5467, and it worked as expected.

John Travis

unread,
Jan 13, 2012, 3:04:07 PM1/13/12
to sage-notebook
Below doesn't work for me. Replacing input_grid with two
"input_box"es works fine in the single-cell.

JT

var('x,y,t,z')
f(x,y)=sin(x)*cos(y)

@interact
def
myfun(location=input_grid(1,2,default=[0,0],width=2),angle=slider(0,1,label
= "Angle"),show_surface=("Show surface", True)):
print 'hi'

alex_kramer

unread,
Jan 13, 2012, 4:16:26 PM1/13/12
to sage-notebook
This appears to be a bug in our code for achieving compatibility with
the
notebook's interact syntax (interacts were rewritten for the
singlecell). I've
opened an issue here:
https://github.com/jasongrout/simple-python-db-compute/issues/224

On Jan 13, 3:04 pm, John Travis <tra...@mc.edu> wrote:

> @interact
> def
> myfun(location=input_grid(1,2,default=[0,0],width=2),angle=slider(0,1,label
> = "Angle"),show_surface=("Show surface", True)):
>     print 'hi'

For right now, if you use nested lists for the default value it works
fine:

default = [[0,0,]]

Jason Grout

unread,
Jan 14, 2012, 3:35:00 PM1/14/12
to sage-n...@googlegroups.com
On 1/13/12 2:04 PM, John Travis wrote:
> Below doesn't work for me. Replacing input_grid with two
> "input_box"es works fine in the single-cell.
>
> JT

By the way, Alex fixed this and I pushed his fix to sagemath.org:5467,
so your example should work now.

Thanks,

Jason

John Travis

unread,
Jan 15, 2012, 8:40:23 PM1/15/12
to sage-notebook
On Jan 14, 2:35 pm, Jason Grout <jason-s...@creativetrax.com> wrote:

> By the way, Alex fixed this and I pushed his fix to sagemath.org:5467,
> so your example should work now.
>
> Thanks,
>
> Jason

Thanks to all for your work on the single-cell.

JT

John Travis

unread,
Feb 8, 2012, 3:22:50 PM2/8/12
to sage-notebook
Has anything been changed with respect to aleph.sagemath.org ? This
morning everything was working fine but this afternoon my WebWork
sagelet problems only produce a session number and an empty box. No
go via the WebWork problem in Safari, Chrome OS or Firefox in Win7.
Also, a HTML file that calls the single cell using javascript (as in
the WebWork problems) fails in a similar manner. On the other hand,
browsing directly to the web site works fine still.

JT

John Travis

unread,
Feb 8, 2012, 3:44:57 PM2/8/12
to sage-notebook
Also, just noticed the Android app is not working either.

Jason Grout

unread,
Feb 8, 2012, 4:40:50 PM2/8/12
to sage-n...@googlegroups.com
On 2/8/12 2:22 PM, John Travis wrote:
> Has anything been changed with respect to aleph.sagemath.org ? This
> morning everything was working fine but this afternoon my WebWork
> sagelet problems only produce a session number and an empty box. No
> go via the WebWork problem in Safari, Chrome OS or Firefox in Win7.
> Also, a HTML file that calls the single cell using javascript (as in
> the WebWork problems) fails in a similar manner. On the other hand,
> browsing directly to the web site works fine still.


No, nothing changed. I used it about an hour ago and it was working
fine. However, I see that it isn't responding now.


I see some errors on the server. I'll restart it for now and take a
look at the errors when I have time. I've also opened an issue with the
tracebacks.

It should work now.

Thanks,

Jason


John Travis

unread,
Feb 8, 2012, 5:36:18 PM2/8/12
to sage-notebook
On Feb 8, 3:40 pm, Jason Grout <jason-s...@creativetrax.com> wrote:
> I see some errors on the server.  I'll restart it for now and take a
> look at the errors when I have time.  I've also opened an issue with the
> tracebacks.
>
> It should work now.
>
> Thanks,
>
> Jason

Works. Thanks!

JT
Reply all
Reply to author
Forward
0 new messages