npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

programming-exercise-juezlti

v1.1.8

Published

A class that abstract a YAPEXIL schema also allows to serialize and deserialize exercise as well load remotely

Downloads

29

Readme

Programming-exercise-juezlti

A simple and efficient way to represent YAPEXIL format as JS objects

N|Solid

YAPEXIL is a JSON format in which the goal is to represent in an orthodoxy manner Programming exercises. This type of representation although efficient could sometimes lead to a complexity that can not be handled by a non-expert in this schema. Therefore this npm package focusing in:

  • Facilitate serialization and deserialization
  • Translation of YAPEXIL formatted exercises to JS object
  • ✨ And more Magics ✨

Examples

Fetching remotely exercise

For loading an exercise placed remotely on the internet do the following:

loadSchemaYAPEXIL().then(() => {
    ProgrammingExercise.loadRemoteExercise(learningObject, {
       'BASE_URL': process.env.BASE_URL,
       'EMAIL': process.env.EMAIL,
       'PASSWORD': process.env.PASSWORD,
        }).then((programmingExercise) => {
            //...stuff
        })
})

First, it is necessary to load the schema to evaluate the JSON that will be fetched. The 'loadSchemaYAPEXIL' method does not generate overhead when called multiple times as this method implements a cache. When the script knows the form of the YAPEXIL Schama it is possible to fetch an exercise in this format by doing 'ProgrammingExercise.loadRemoteExercise'. This method will then load an exercise remotely and expose the exercise as an instance of the ProgrammingExercise class.

Fetching local exercise

The ProgrammingExercise class besides making possible the fetch of remotely exercise also makes it possible to load exercise from your file system. To achieve this just do the following

loadSchemaYAPEXIL().then(() => {
    ProgrammingExercise.deserialize(path_to_zip_folder_exercise), `${learningObject}.zip`)
    .then((programmingExercise) => {
            //...stuff
    }).catch((error) => {
            //...stuff
    })
})

Persisting a remotely exercise

When bandwidth savings or other reasons are needed to persist the exercise, this can be achieved by calling the serialization method on an instance of the Programming Exercise class

programmingExercise.serialize(path_to_folder).then(() => {
    //...stuff
    }).catch((err) => {
    //...stuff
    });
})

Creating an exercise programmatically

In order to create an exercise programmatically, the user needs to have in his possession the correct values that fit the YAPEXIL schema. More information about the schema could be found at YAPEXIL Github

Installation

To install this package you just need to do

npm i programming-exercise-juezlti

License

MIT

Free Software, Hell Yeah!