{"id":16439116,"url":"https://github.com/milospaunovic/questionnaire","last_synced_at":"2025-03-23T08:31:52.097Z","repository":{"id":60303972,"uuid":"542283208","full_name":"MilosPaunovic/questionnaire","owner":"MilosPaunovic","description":"Serving random questions in multiple languages has never been this easy.","archived":false,"fork":false,"pushed_at":"2023-07-31T07:39:26.000Z","size":3976,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T16:40:57.041Z","etag":null,"topics":["questionnaire","questions"],"latest_commit_sha":null,"homepage":"https://bit.ly/3UDnETD","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MilosPaunovic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-27T20:47:54.000Z","updated_at":"2023-10-16T13:09:13.000Z","dependencies_parsed_at":"2024-10-28T15:30:44.650Z","dependency_job_id":"b33123fc-7f5a-467d-85b2-5a824ee4df98","html_url":"https://github.com/MilosPaunovic/questionnaire","commit_stats":{"total_commits":24,"total_committers":2,"mean_commits":12.0,"dds":"0.41666666666666663","last_synced_commit":"4492418ad8240e4497aa674d83145662ee4430db"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MilosPaunovic%2Fquestionnaire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MilosPaunovic%2Fquestionnaire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MilosPaunovic%2Fquestionnaire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MilosPaunovic%2Fquestionnaire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MilosPaunovic","download_url":"https://codeload.github.com/MilosPaunovic/questionnaire/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245078067,"owners_count":20557274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["questionnaire","questions"],"created_at":"2024-10-11T09:08:00.305Z","updated_at":"2025-03-23T08:31:51.182Z","avatar_url":"https://github.com/MilosPaunovic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Questionnaire\n\nPackage for generating random question(s) in multiple languages.\n\n[![Testing](https://github.com/MilosPaunovic/questionnaire/actions/workflows/testing.yml/badge.svg)](https://github.com/MilosPaunovic/questionnaire/actions/workflows/testing.yml)\n\n## Try it Online\n\n[Link to Codepen playground](https://codepen.io/milospaunovic/pen/MWGrdEZ?editors=1011)\n\n## Motivation\n\nMain idea and motivation behind this was work from [Nenad Ilić](https://github.com/ilic5000) and his post I saw on [Reddit](https://www.reddit.com/r/programiranje/comments/xofp1t/anansi_computer_vision_mini_projekat_izvukao_sam/). You could (and should) read more about it [here](https://github.com/ilic5000/pabkvizgenerator/blob/main/README.md).\n\n## Installation\n\n```bash\nnpm i @paunovic/questionnaire\n```\n\n## Configuring\n\n```js\nimport { initialize } from '@paunovic/questionnaire';\n\n// Initialization with default language pack\nconst QUESTIONNAIRE = initialize();\n\n// Initialization with different language pack, including variation\nconst QUESTIONNAIRE = initialize({ countryCode: 'rs', variation: 'cyrillic' });\n```\n\nCurrently available country codes and variations:\n\n| Country       | Country code | Variation  |  Questions  |\n| :------------ | :----------: | :--------: | :---------: |\n| Serbia `*`    | `rs`         | `cyrillic` | 10253       |\n\n`*` Default language; if no `countryCode` parameter is passed to `initialize` method, Serbian Latin will be loaded as a default language.\n\n## Methods\n\n#### Question\n\nReturns random question from the list in the object form, containing question and answer properties.\n\n```js\nQUESTIONNAIRE.question(); // =\u003e { question: 'QUESTION', answer: 'ANSWER' }\n```\n\nReturns random question from the list in the object form, containing question, answer and wrong (containg number of wrong answers you've specified, in range from 1 to 30) properties.\n\n```js\nQUESTIONNAIRE.question({ wrong: 3}); // =\u003e { question: 'QUESTION', answer: 'ANSWER', wrong: ['WRONG', 'WRONG', 'WRONG'] }\n```\n\n\n#### Questions\n\nReturns an array of 10 question objects from the list.\n\n```js\nQUESTIONNAIRE.questions() // =\u003e [{ question: 'QUESTION', answer: 'ANSWER' }, { question: 'QUESTION', answer: 'ANSWER' }...]\n```\n\nReturns an array of question objects with wrong answers (containg number of wrong answers you've specified, in range from 1 to 30) from the list (number of items defaults to 10, accepted range from 1 to 10000).\n\n```js\nQUESTIONNAIRE.questions({ howMany: 7, wrong: 1 }) // =\u003e [{ question: 'QUESTION', answer: 'ANSWER', wrong: ['WRONG'] }, { question: 'QUESTION', answer: 'ANSWER', wrong: ['WRONG'] }...]\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please try to follow [semantic commit messages](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716) principle to simplify navigation through git history.\n\n## License\n\n[MIT](https://raw.githubusercontent.com/MilosPaunovic/questionnaire/develop/LICENSE) © [Milos Paunovic](https://github.com/MilosPaunovic)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilospaunovic%2Fquestionnaire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilospaunovic%2Fquestionnaire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilospaunovic%2Fquestionnaire/lists"}