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

smart-answer-eval-

v1.0.1

Published

Evaluate Subjective Answers

Downloads

10

Readme

What is this ?

This is a module that helps in evaluating the subjective answers in the following way:

Correct: This is when the submitted answer is judged to be fully correct.

Close match: This is when the answer is judged to be close to the right answer, but not close enough to be marked correct. In this case, we send a hint to the user. e.g.

If the answer is “Mahatma Gandhi” but they submit “Mahatma Gaandhi”, it returns a hint like: “You’ve almost got the right answer, it’s just a few characters off. Check for typos or similar variations.”

If the answer is United States of America and they write “USA” or “U.S.A.” or “U. S. A.”, then it returns “Please enter the expanded form of your answer”

Wrong: This is returned when the answer is too dissimilar from the correct answer.

What happens behind the scene ?

Fuzzy match:

When the characters in the answer are very similar to the submitted response, e.g. in case of typos of minor differences, e.g. “beleive” instead of “believe”. If the difference is too large, then it should be considered wrong. You can take a judgement about the right threshold that should be considered “close”.

Short forms:

When short forms like “USA,” “U S A”, “U.S.A.” or “U. S. A.” are used instead of “United States of America”. In such cases, it returns a hint saying that the full form should be used.

Missing/wrong unit:

E.g. “50” or “50 kilo grams“ or “50 keys” instead of “50 kgs”. (If the answer looks like a number+unit but only the number matches, then it always returns a hint saying that they;ve got the right number, but the unit is not matching.

Installation

npm i smart-answer-eval --save

then..

import {evaluateAnswer} from 'smart-answer-eval'

evaluateAnswer(userAnswer, correctAnswer)