← All packages

@lacspace/quizpoll

v1.2.0Automation Kit1 @lacspace dep

Quiz and poll items from a news article without an LLM — English or Nepali: fill-in-the-blank on figures (distractors by scaling the number exactly as written, keeping Devanagari digits, लाख/करोड scale words, decimals), fill-in-the-blank on names (distractors from the article itself), true/false (incl. a statement with a perturbed figure), opinion polls from safe templates, did-you-know cards; deterministic seeded shuffle with answer index; per-platform fit (Instagram poll 2 / quiz 4, YouTube 5, X 4, Facebook). Deterministic, no AI tokens.

npm i @lacspace/quizpoll

Usage

quizpoll.ts
import { quizpoll } from "@lacspace/quizpoll";

const q = quizpoll(articleText, { maxQuiz: 4, maxPolls: 2, seed: 42 });
q.quiz[0]
// { kind: "number", question: "खाली ठाउँ भर्नुहोस्: बैंकहरूले कर्जामा लिने ब्याजदर ____ माथि लैजान पाउने छैनन्",
//   options: [{ text: "१३ प्रतिशत" }, { text: "१२ प्रतिशत", correct: true }, { text: "११ प्रतिशत" }, { text: "१४ प्रतिशत" }],
//   answerIndex: 1, explanation: "उत्तर: १२ प्रतिशत", source: "…",
//   fits: { "instagram-poll": false, "instagram-quiz": true, youtube: true, x: true, facebook: true, telegram: true } }
q.polls        // opinion polls from safe templates (no claims): "यसबारे तपाईंको धारणा के छ?" राम्रो निर्णय / गलत निर्णय / थाहा छैन
q.didYouKnow   // "थाहा छ? …" cards from the figure sentences

Exports 4

describenumberDistractorsquizpolltypedEntities

Keywords

quizpollengagementinstagramyoutubenepalinewsroom

More in Automation Kit

@lacspace/conductor

Drive every describe()-capable @lacspace package through one interface — merge descriptors into a single command catalogue, render it token-light for an LLM prompt, validate an AI-written plan against the command schemas (unknown commands, required inputs, types/enums, forward references, duplicate ids), and execute it step by step with $steps.<id>.output references, parallel groups, per-step timeouts, a whole-plan budget, optional steps, when-conditions and a dry run. The AI decides; the packages do the work. Zero deps.

@lacspace/extractive

Turn a full article into a compact brief for an AI writer — extractive TextRank summary, key-facts (numbers, money, percentages, dates, named entities), headline candidates and key phrases/hashtags, for English and Nepali (sentence splitting on the danda '।', decimal-safe). Deterministic, no LLM; reuses @lacspace/keyphrase and @lacspace/factcheck-lite. Exposes a describe() command schema so an AI 'conductor' can drive it.

@lacspace/hookwriter

Deterministic platform copy from facts — hooks, titles, captions, CTAs and descriptions in many styles (question, number-led, what-it-means, contrast, breaking, how-to, quote…), English and Nepali, trimmed to each platform's character limit (YouTube/IG/TikTok/FB/X/Threads/LinkedIn/Telegram). Fills ONLY the facts you pass (never invents claims) and drops sensational phrasing; AI optional, only to fill slots. Exposes a describe() command schema for an AI 'conductor'. Zero dependencies.

@lacspace/postbandit

A tiny Thompson-sampling multi-armed bandit to learn the best option per platform — posting time, format, thumbnail or title variant — from engagement rewards. Beta posteriors per arm, deterministic when seeded, JSON-persistable; plugs into postplan. Zero deps.

@lacspace/commentguard

Comment moderation for English, romanized Nepali and Devanagari — scores spam, abuse, hate, doxxing and link-spam and returns an allow / review / flag / hide action, with PII detection (Nepali phone, email, URLs/shorteners) and FAQ auto-reply suggestions. Deterministic rules + small, extendable lexicons; a borderline flag marks gray-zone comments for an optional AI second opinion. Exposes a describe() command schema. Zero dependencies.

@lacspace/sourcewatch

Re-verify that official source pages still back the facts you published: fetch a URL (HTML, plain text or PDF), extract its visible text, normalise it (NFC, Devanagari digits to ASCII, zero-width and soft-hyphen removal, unified spaces and dashes) and check expected strings, whole numbers ("1145" never matches inside "11450") or RegExps. Pure-JS PDF text extraction (object streams, FlateDecode/LZW/ASCII85/ASCIIHex with PNG predictors, ToUnicode CMaps, Differences encodings, TJ kerning, page-tree order). Detects placeholder pages ("this is test", default server pages, coming soon, suspended accounts), classifies failures (timeout, tls with chain/expired/self_signed/hostname kind, dns, network, http_4xx, http_5xx, not_found_text, placeholder_page, too_large, unparseable), streams bodies with a byte cap, retries transient errors, hashes the normalised text for change detection, and runs batches with a concurrency limit and one-request-per-host politeness. check(), checkAll(), summarize(), pdfText(), extractText(), normalise(), isPlaceholder(). Injectable fetch, zero dependencies, isomorphic (Node 18+, browsers, edge).