Ask Your Question

With sage cell server implement an automatically generated and automatically checks the job in algebra or calculus.

asked 2013-11-05 07:50:47 -0500

updated 2015-01-14 07:33:52 -0500

FrédéricC gravatar image

Hello! I have a problem. How to organize a dialogue with the user? So that he could enter a reply, and the server gave the answer: right or wrong. On the example of computing the determinant of a matrix. The following quote program listing.

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">

    <title>Sage Cell Server</title>

    <script src=""></script>
    <script src=""></script>

    <script>$(function () {
    // Make the div with id 'mycell' a Sage cell
    sagecell.makeSagecell({inputLocation:  '#mycell1',
                           template:       sagecell.templates.minimal,
                           evalButtonText: 'Generate'});
    sagecell.makeSagecell({inputLocation: 'div.compute',
                           evalButtonText: 'Evaluate'});
    sagecell.makeSagecell({inputLocation:  '#mycell2',
                           template:       sagecell.templates.minimal,
                           evalButtonText: 'Generate'});



    <h1>Calculate the determinant</h1>

    <div id="mycell1"><script type="text/x-sage">
A=random_matrix(ZZ, 2, 2, x=-5, y=5)




    <div class="compute"><script type="text/x-sage"></script></div>

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-11-05 20:53:49 -0500

ppurka gravatar image

updated 2013-11-05 21:08:37 -0500

slelievre gravatar image

Look at this post and the exercise string decorator.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-11-05 07:50:47 -0500

Seen: 147 times

Last updated: Nov 05 '13