Set "data-stdin" for "ace-interactive-code" via text field

Re: Set "data-stdin" for "ace-interactive-code" via text field

by Richard Lobb -
Number of replies: 3
Hi Andreas.

Good to know it has proved useful. I had fun solving the problem but it was way harder than it should have been. And I've definitely warmed to the idea of having a textarea to define stdin - it could be very useful for non-interactive applications, e.g. in an algorithms course. I intend to make this sort of thing much easier. Sorry about the silly joke about your "poor students" (see edited version).

As highlighted by your question, the current data-stdin and data-files attributes aren't very useful. So my current plan for when I have a bit more time is to deprecate them both and add instead data-stdin-id and data-file-ids, which will specify the IDs of textarea elements to act as the sources of the text (dynamically of course).

“All problems in computer science can be solved by another level of indirection." - David Wheeler.

Thanks for leading me to what I hope is a significant improvement.

Richard
In reply to Richard Lobb

Re: Set "data-stdin" for "ace-interactive-code" via text field

by Andreas Haja -

Hello Richard. 

I see it exactly as you do: this extension would be a very interesting tool for an algorithm course or even for a beginners course, where the reaction of a program to different inputs could be checked very easily. 

One of the main advantages from my point of view is that students can run the code 1:1 on their own machines without having to make any changes in terms of terminal input/output. 

I'm looking forward to the extension you mentioned. 

Many greetings, Andreas

In reply to Andreas Haja

Re: Set "data-stdin" for "ace-interactive-code" via text field

by Richard Lobb -
Hi again Andreas

The extension is now available. Plus some hooks for uploading files (either actual files or pseudo-files/named strings). And min-lines/max-lines to limit size of Ace editor window. All these features are documented in the demo page.

Hope it all works. Please let me know if not.

Richard
In reply to Richard Lobb

Re: Set "data-stdin" for "ace-interactive-code" via text field

by Andreas Haja -
Hi Richard, 

sorry for the late reply and thanks for implementing this awesome feature. I am using it in several of my courses now and it works like a charm. 

All the best and Happy Halloween, 
Andreas