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

pedago-angular-quiz

v0.0.3-beta

Published

A pedago quiz component for Angular projects

Downloads

11

Readme

This library was generated with Angular CLI version 16.2.0.

Installing

npm install pedago-angular-quiz --save

Usage

Import NgxQuizModule

import { PedagoAngularQuizModule } from 'pedago-angular-quiz';

@NgModule({
  imports: [
    // Other module imports
    PedagoAngularQuizModule
  ],
  // Other module properties
})
export class YourModule { }

Usage

Use it in your template and then pass a data object to the component as follows as an example

<pedago-angular-quiz [data]="data" (onSubmit)="onSubmit($event)"></pedago-angular-quiz>

Configuration

Properties

| Property | Type | Description | |---------------|-----------|----------------------------------| | data! | IData | The quiz data | | metadata? | IMetadata | The quiz configuration | | client? | string | The client name | | userId? | string | The connected user id |

Emitters

| Name | Parameters | Description | |-------------------|----------------|---------------------------------------| | onSubmit | event: IResult | Callback to invoke on quiz submission |

Interfaces

IData

Interface representing the data structure of the quiz:

interface IData {
questions: IQuestion[];
}

IQuestion

Interface representing a quiz question:

interface IQuestion {
  question: string;
  options: IOption[];
  explanation: string;
  skill: string;
}

IOption

Interface representing a question option:

interface IOption {
  option: string;
  is_correct: boolean;
}

IResult

Interface representing the result of the quiz:

interface IResult {
  client?: string;
  userId?: string;
  response: IResponse[];
}

IResponse

Interface representing the response to a quiz question:

interface IResponse {
  questionID: string;
  answer: string | string[];
  correctedAnswer: string | string[];
  is_correct: boolean;
  is_partially_correct?: boolean;
}

ITheme

Interface representing the theme of the quiz:

interface ITheme {
  primaryColor?: string;
  secondaryColor?: string;
  hasheader?: boolean;
  headerBackColor?: string;
  headerImage?: string;
}

Examples

const data = {
  "questions":
  [
    {
      "question": "Quelle est la règle de probabilité qui dit que la probabilité d'un événement complémentaire est égale à 1 moins la probabilité de cet événement ?",
      "options": [
        {
          "option": "La règle de l'addition",
          "is_correct": false
        },
        {
          "option": "La règle de la multiplication",
          "is_correct": false
        },
        {
          "option": "La règle du complément",
          "is_correct": true
        },
        {
          "option": "La règle de Bayes",
          "is_correct": false
        }
      ],
      "explanation": "La réponse correcte est la règle du complément. Cette règle indique que la probabilité de l'événement complémentaire est égale à 1 moins la probabilité de l'événement lui-même.",
      "skill": "Applying Probability Rules"
    },
    {
      "question": "Quelles sont les distributions de probabilité discrètes les plus couramment utilisées pour modéliser des phénomènes aléatoires dans le domaine des sciences et de l'ingénierie?",
      "options": [
        {
          "option": "Loi normale",
          "is_correct": false
        },
        {
          "option": "Loi uniforme",
          "is_correct": false
        },
        {
          "option": "Loi binomiale",
          "is_correct": true
        },
        {
          "option": "Loi exponentielle",
          "is_correct": true
        }
      ],
      "explanation": "Les lois binomiale et exponentielle sont des distributions de probabilité discrètes couramment utilisées pour modéliser des phénomènes aléatoires. La loi binomiale est utilisée pour des expériences aléatoires avec un nombre fixe d'essais indépendants, tandis que la loi exponentielle est utilisée pour modéliser le temps entre occurrences d'événements selon un processus de Poisson.",
      "skill": "Random Variables and Their Distributions"
    },
    {
      "question": "Quelle est la règle utilisée pour calculer la probabilité de l'intersection de deux événements indépendants?",
      "options": [
        {
          "option": "La règle de l'addition",
          "is_correct": false
        },
        {
          "option": "La règle de Bayes",
          "is_correct": false
        },
        {
          "option": "La règle de la multiplication",
          "is_correct": true
        },
        {
          "option": "La règle du complément",
          "is_correct": false
        }
      ],
      "explanation": "La réponse correcte est la règle de la multiplication. Cette règle stipule que la probabilité de l'intersection de deux événements indépendants est égale au produit de leurs probabilités individuelles.",
      "skill": "Applying Probability Rules"
    }
  ]
}


License

This project is licensed under the MIT License - see the LICENSE file for details.