Button to copy SageMath cell to clipboard
I will be using a link to a simple SageMathCell html page during Canvas quizzes in an online Discrete Math course. I would like to provide an additional "copy" button on the SageCell page that would allow the student to copy both their code and evaluated output into a textbox in a different browser window.
I realize it is now possible to separately cut and past the code and the output into a different textbox, but I would like to keep it as simple as possible. Any suggestions for the additional html that would add the button are appreciated.
To be more specific, I realize I could create an html button using:
<button onclick="myCopySageInOut()">Copy Sage Cell</button>
and I would need JavaScript code for the myCopySageInOut() function that would copy the input box text, append the output text and place in the clipboard. This is when I could use an example of the JavaScript code.
Do you mean a HTML page with an embedded SageMathCell?
Yes. A simple html page.
I just tried to make this, but it's complicated. The output can contain LaTeX, images, etc. I can post a script that works only with text output (and ignores all other output), if you're interested.
Yes, please post. Any starting point would be help and I am only interested in the text. The assignments will be simple code with simple text output.