Coder Social home page Coder Social logo

liatemplates / pyodide Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 62.14 MB

A template for using Pyodide in LiaScript

Home Page: https://liascript.github.io/course/?https://raw.githubusercontent.com/liaTemplates/Pyodide/master/README.md

liascript python programming template python-tutorial pyodide liascript-template

pyodide's People

Contributors

andre-dietrich avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sebastianzug

pyodide's Issues

Add way to conditionally show help text after errors?

Hello! Thank you so much for your work on this template. It's fantastic! We're building several LiaScript courses using Pyodide now, and we've run into an issue that may be of interest to others as well.

For some executable code blocks, we'd like to provide additional pedagogical text when learners encounter errors --- in other words, we'd like a way to add a custom message below a code block if a user runs the code and receives an error, ideally in addition to the error handling already happening in the Pyodide.eval_ macro.

For example, we have courses where learners load the example data on one slide of the course and then use it throughout the following slides. If someone enters the course at a later slide (maybe if a friend sends them a link to that particular slide), or if they refresh the browser part way through a course, the data loaded on an earlier slide will no longer be available. Then when they try to execute a code block, it won't work (they'll get something like "NameError: name 'data' is not defined", which is suggestive but we could be much more helpful). So when we include executable code blocks that we know rely on code having been run previously in the course, it would be fantastic to be able to show a helpful message to that effect if they code returns an error.

It would be ideal to have the helpful message be regular liascript, rather than showing up in the console log for the code block (so we could include a hyperlink back to the slide with the code they need to run, for example).
I tried modifying the Pyodide.eval_ macro to return an output that would be a boolean indicating if the code ran successfully or not, but I wasn't able to get it to work. I was hoping to add a new smaller macro to that would that that as input and print a help message if true or just print nothing if false.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.