Can we display editable Elixir cells to the user of a deployed LiveBook app?

Hey guys!

Background info: I am trying to use LiveBook to create some Elixir practice problems. I’d like the user to be able to enter their answer into an elixir cell, then I check their answer by running a test on their code (hidden so they can’t see it).

See this pic for what a practice problem might look like: Practice Problem

Question: I just tried using “Deploy as App” in LiveBook and it solves the problem of needing to hide code from the end-user. However, “deploy as app” actually hides too much.

I want the user to be able to write into an elixir cell. But I can’t find any way to get an elixir cell to display in a deployed LiveBook app. I looked into both Kino.Frame and Kino.Input. Did I miss something?

If this capability does not exist yet, is it possible to add a feature to LiveBook where we could set a flag to tell LiveBook which particular elixir cells on a page we want hidden upon ‘deploy to app’ instead of it automatically hiding all of them?

Hey @lmletham! Apps serve a different purpose, their source code (cells) never changes. Learning materials are better as plain notebooks, so the user can edit and evaluate the code, having access to all the intellisense features.

You can use modules with doctests and tell the user to implement a function, Livebook automatically runs doctests. You can also define whole test suites using ExUnit. You can use the <details> tag in Markdown cells to offer example solutions or tips. You can see curriculum/exercises at main · DockYard-Academy/curriculum · GitHub for examples.