
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
exerslide-plugin-javascriptexercise-layout
Advanced tools
A JavaScript exercise layout for exerslide.
This layout is intended for interactive JavaScript exercises. It shows a text editor to let the visitor input JavaScript and allows to specify validation logic to verify the solution.
+-----------------------+
| |
| Description |
| +---------------+ |
| | | |
| |Editor | |
| | | |
| +---------------+ |
| +------+ +-----+ |
| |Submit| |Reset| |
| +------+ +-----+ |
+-----------------------+
Code that is inputted in the text editor can be executed and verified. The
layout makes a special function available to the code in the editor: log
.
log
is a wrapper around console.log
which also records the values that have
been passed to it. These values can later be used to validate solutions.
description
: Free form text that will be shown above the text editor. Can
be used to introduce the question / problem.
assertion
: JavaScript code to validate the solution. The code has access to
three variables:
assert
, which is the assertion function. It takes a condition as first
argument and a message as second argument.source
: The text editor input.output
: An array of values which have been passed to the log
function.With this you can perform simple checks against the input source and logged output.
Note: If assertion
is not present, no "Submit" button is rendered. In
that case the layout can used as interactive demo.
The content of the slide is expected to be JavaScript and is used as the initial input of the text editor.
---
title: Exercise
layout_data:
description: |
Create a local variable with name `foo` and value `42`.
Use `log(foo)` to log the value of `foo`.
assertion: |
assert(
/var foo\s*=.+;?$/m.test(source),
"It doesn't look like you have declared a variable (hint: var)."
);
assert(output[0] === 42, "Don't forget to log the value");
---
// Create variable
//
log(foo);
exerslide-cli v1.1.0 (2016-09-09)
npm install exerslide
. To see the full
output, pass --verbose
(2b33dc3).exerslide init
command correctly forwards arguments to local
exerslide init
(2b33dc3)FAQs
A JavaScript exercise layout for exerslide.
The npm package exerslide-plugin-javascriptexercise-layout receives a total of 4 weekly downloads. As such, exerslide-plugin-javascriptexercise-layout popularity was classified as not popular.
We found that exerslide-plugin-javascriptexercise-layout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.