Skip to content

ETS-PFE004-Plateforme-sondage-minitest/ETS-PFE004-EvalueTonSavoir-Frontend

Repository files navigation

To run this project

First install with: npm install

To run the project: npm run dev

To run tests: npm run test

Environment variables

Create a .env file at the root of the project with the following variables:

VITE_BACKEND_URL="https://ets-glitch-backend.glitch.me/"
VITE_AZURE_BACKEND_URL="https://evaluetonsavoirbackend.azurewebsites.net/"

Original code

The original code has been developed to create a VS extension to support GIFT text format.

The code can be found here: https://codesandbox.io/s/gift-templates-iny09

We decided to reuse this code because it provides a preview close to how looks like quizzes in Moodle. Which is a well-known platform at École de technologie supérieure (ÉTS).

Related NPM packages:

In order to reuse the code, we had to install the following NPM packages:

  • katex : A fast, easy-to-use JavaScript library for TeX math rendering on the web.
  • marked : A markdown parser and compiler. Built for speed.
  • nanoid : A tiny (108 bytes), secure, URL-friendly, unique string ID generator for JavaScript.
  • gift-pegjs : A GIFT parser for JavaScript using PEG.js.
  • @types/katex : TypeScript definitions for katex.
  • @types/marked : TypeScript definitions for marked.
  • @types/nanoid : TypeScript definitions for nanoid.

Modifications

  • Error.ts: changed 2 let document and newText into const. (es-lint)

  • GlobalFeedback.ts: removed unused import of TextFormat. (es-lint)

  • Matching.ts: removed unused import of Match. (es-lint)

  • TextType.ts: replaced the marked call by marked.parse and fixed SyntaxError: ambiguous indirect export: default for { marked }.

  • Put Template and ErrorTemplate functions apart from index.ts to dedicated .ts files.