Using Scastie in classroom setting

I am planning to teach a 2 week programming class to a group of high school students.
The IT department refuses to install the IDE and development tools I want, so I’m forced to
use online resources.

I think the Scastie tool will suffice for the extent of the programs we wish to write.
Our programs will probably be limited to 10, 20, maximally 30 lines at a time.
However, there doesn’t seem to be any sort of file management feature in Scastie.
Students would have to copy paste from other editors into Scastie, and remember to copy-paste
back into their filesystem. yes the Scastie sessions are saved by sha1 sum, which the students could manage in some sort of notebook, but there’d be no way to find one if it were lost.

Is there any thought to adding some sort of file management to Scastie, upload-file, needs-save, save-as feature?

What other online tool could someone suggest?

I’ve found a couple with a google search which I know nothing about the robustness or hidden costs of. E.g., Online Scala Compiler - Online Scala Editor - Run Scala Online - Online Scala Runner
which appears to have some sort of file upload and save feature.

1 Like

I also found https://replit.com/teams?checkout=teams_education
which claims to be an online Scala IDE.

It has a teacher/educator plan costing $35 per month for unlimited number of students.
Not sure if that’s really any better than the free plan for the purpose I’d use it for.

You should also be able to use Gitpod which allows you to use 50h per month for free and should work well with Metals Scala Language Server.

I am not sure if anyone yet tried using it for educational purposes, but for sure local Metals with Visual Studio Code was used successful in that setting.

I think there was a talk of having Intellij Idea online, but I can’t find any references to it (I might be making that up).

looking into this. Thanks for the pointer. wow it seems awfully complicated. For example, the first problem I ran into was that the sbt build fails from within this online editor, and it tells me to look at the log files. But apparently the log files are hidden somewhere in a docker image which I have not access to. :frowning:

For most of the needs unlike deployment and such, you should try scala-cli. It is pretty awesome. Give it a try.

The logs should be visible in the Output (Metals) window, we have a project setup here that should be quicker to use:

I was able to import the project without issues, though on second try (first try Gitpod indeed had some issues, which I haven’t encountered before)

Scalacli is indeed super useful, but it needs to be downloaded locally and from what I understand that’s an issue?

There is some more info here:

With some modifications we could also create a gitpod ready workspace based on scalacli.

Scala-cli does not require installation. So anyone can just run in user-mode and the dependencies will be download for the first time. I think it should work, assuming that those computers have internet access.

Do I understand correctly that scala-cli does not solve the IDE problem, just the compiler problem?

While Scastie doesn’t have files, you can save your code if you log in (with Github iirc).

scala-cli is not a replacement for IDE but can certainly do a wide variety of things - repl, compile, watch, run, build native and js etc.

You could run a Jupyter Notebook with a Scala kernel https://almond.sh/
It’s easy to run it via docker then you can use ngrok to create an URL your students can access.

docker run -it --rm -p 8888:8888 almondsh/almond:latest
ngrok http 8888

Then you can login with the token provided:
https://737c-2001-18c0-2df-7300-3c5a-cc85-7176-407f.ngrok.io/?token=fd1c48562dc5a03002d902e32fda0e6bb2e1223a4cb1a576

3 Likes

I’m not 100% sure I understand. Sure I can save the files. But can I later get a list of files I’ve saved, and can I name them in a meaningful way. I think they all save using just a sha1 code. Right? So if I loose the sha1 code, I can never find my code again.

Am I right, or is there some feature I’m unaware of?

does this mean docker has to be installed ? My IT department does not want to install tools.
Sorry if I misunderstood. If I could Install things, I’d install intelliJ and share the project via github.

The gitpod webpage says they can run any jetbrains web browser.


Perhaps this is what you were thinking of?

Can you help me understand the model of using such a template? I opened gitpod on that template by prefixing the magix word to the repo url. Now, if I want to create a progect for myself and students, what should I do? I suppose the project should contain an initial state like this template, but not the history of the template. Right?

Do I need to check out this commit locally, remove the .git directory, and then create a new github project seeded with that content?

Oh right, you can’t name them, but you do see a preview of the first line. Gitpod’s probably better though.

1 Like

its a shame because scastie is pretty close to what I need, but unusable because of missing file management.

Is “copy the URL” necessarily that much of a killer? I mean, I expect current high-school students to be fairly sophisticated online; I wouldn’t expect it to be strange to them. You know your students, but I’m a little surprised that telling folks to copy and paste the URL of their work is an insuperable barrier to using the tool.

Is it plausible to ask them to set up a GitHub account? It’s not hard to do so, and if you are logged in with GH, then Scastie does keep track of all of your work, automatically…

Yes, that is a tempting solution. Because if you can manage your URLs it becomes simple.
Do you think it is really manageable?
This is a very simple infrastructure.
What’s the downside?

Each student would have to keep some sheet of description like the following?
And if he/she fails to save something, and copy the URL, the data is lost.

day 1 problem 1 https://scastie.scala-lang.org/jimka2001/GnhwklmcRAuZKCtPu1DNGw/4
day 1 problem 2 https://scastie.scala-lang.org/jimka2001/GnhwklmcRAuZKCtPu1DNGw/5
day 1 problem 3 https://scastie.scala-lang.org/jimka2001/GnhwklmcRAuZKCtPu1DNGw/6
day 2 problem 1 https://scastie.scala-lang.org/jimka2001/GnhwklmcRAuZKCtPu1DNGw/7
day 2 problem 2 https://scastie.scala-lang.org/jimka2001/GnhwklmcRAuZKCtPu1DNGw/8
...
day 10 problem 4 https://scastie.scala-lang.org/jimka2001/GnhwklmcRAuZKCtPu1DNGw/32
day 10 problem 5 https://scastie.scala-lang.org/jimka2001/GnhwklmcRAuZKCtPu1DNGw/33

too bad scastie does not keep some sort of audit trail of URLs per user who is logged in.