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

mark-statistic

v1.0.5

Published

Mini package counting your exams results.

Downloads

6

Readme

Description

mark-statistic is a package made for students to count their results on some exams. You can count your results for Russian Main State Exam, Russian United State Exam and other else exams.

Installition

$ npm i mark-statistic

Manual

Representing results:

Main class representing your result for some exam is Subject. It takes 5 parameters: 4 requered and 1 optional:

constructor(
    name: string, 
    result: number, 
    max: number, 
    grades: number[], 
    countable: boolean = false
)
  • name: string - The name of subject were passing.
  • result: number - The number of points you earned on this exam.
  • max: number - Max number of points can be earned on this exam.
  • grades: number[] - Array of points that equal some value in marks. Marks goes in order: [x, y, z]:
[
    /* Points lower than 3 */ 
    3, 
    /* Points between 3 and 4 */ 
    4, 
    /* Points between 4 and 5 */ 
    5 
    /* Points higher than 5 */ 
]

For example in Math Russian Main State Exam grades param will be [8, 15, 22]. You can add only 3 grade.

  • countable: boolean = false - This mark means that this exam will be counted with other exam with similar mark in hundred point system.

Creating table:

To create table you need to call function createTable(subjects: Subject[]).

It takes 1 param: subjects: Subject[], an array with initialized classes Subject.

const { Subject, createTable } = require('mark-statistic');

// Create result for Russian Main State Exam:
const maths = new Subject('Maths', 26, 32, [8, 15, 22], true);
const russianLanguage = new Subject('Russian language', 30, 32, [15, 23, 29], true);

const myResults = [maths, russianLanguage];
console.log(createTable(myResults));

Output will be:

+-------------------------------------------------+
|            Your final exam statistic            |
+------------------+---------+---------+----------+
|      Subject     | Integer | D. mark | Percents |
+------------------+---------+---------+----------+
| Russian language | 30 / 32 |  5 / 5  |   94 %   |
+------------------+---------+---------+----------+
|       Maths      | 26 / 32 |  5 / 5  |   81 %   |
+------------------+---------+---------+----------+
|                Total result: 175B               |
+-------------------------------------------------+

If you will enter negative numbers to constructor in class Subject error will thown, similar if you will pass empty array to function createTable.

Example

Russian Main State Exam

const { Subject, createTable } = require('mark-statistic');

const mySubjects = [
    new Subject('Maths', 24, 32, [8, 15, 22], true),
    new Subject('Physics', 29, 43, [12, 23, 35]),
    new Subject('Russian language', 30, 32, [15, 23, 29], true),
    new Subject('Informatic', 18, 19, [5, 10, 16], true)
];

console.log(createTable(mySubjects));
+-------------------------------------------------+
|            Your final exam statistic            |
+------------------+---------+---------+----------+
|      Subject     | Integer | D. mark | Percents |
+------------------+---------+---------+----------+
| Russian language | 30 / 32 |  5 / 5  |   94 %   |
+------------------+---------+---------+----------+
|    Informatic    | 18 / 19 |  5 / 5  |   95 %   |
+------------------+---------+---------+----------+
|      Physics     | 29 / 43 |  4 / 5  |   67 %   |
+------------------+---------+---------+----------+
|       Maths      | 24 / 32 |  5 / 5  |   75 %   |
+------------------+---------+---------+----------+
|                Total result: 264B               |
+-------------------------------------------------+

Feedback

Open issues and pull requests if it's mandatory. Thanks for reading and downloading.