{"id":21065629,"url":"https://github.com/adaptlearning/adapt-contrib-mcq","last_synced_at":"2025-05-16T02:33:27.597Z","repository":{"id":12637378,"uuid":"15308846","full_name":"adaptlearning/adapt-contrib-mcq","owner":"adaptlearning","description":"A multiple choice question","archived":false,"fork":false,"pushed_at":"2025-04-01T08:43:33.000Z","size":522,"stargazers_count":9,"open_issues_count":1,"forks_count":41,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-03T19:12:46.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adaptlearning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2013-12-19T10:25:54.000Z","updated_at":"2025-04-01T08:43:36.000Z","dependencies_parsed_at":"2024-09-17T16:57:19.476Z","dependency_job_id":"6444f13a-a451-415d-9f21-86c3f7023c20","html_url":"https://github.com/adaptlearning/adapt-contrib-mcq","commit_stats":null,"previous_names":[],"tags_count":66,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptlearning%2Fadapt-contrib-mcq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptlearning%2Fadapt-contrib-mcq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptlearning%2Fadapt-contrib-mcq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptlearning%2Fadapt-contrib-mcq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adaptlearning","download_url":"https://codeload.github.com/adaptlearning/adapt-contrib-mcq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254456371,"owners_count":22074161,"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":[],"created_at":"2024-11-19T17:55:50.670Z","updated_at":"2025-05-16T02:33:27.204Z","avatar_url":"https://github.com/adaptlearning.png","language":"JavaScript","readme":"# adapt-contrib-mcq\n\n\u003cimg src=\"https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/mcq01.gif\" alt=\"multiple choice question in action\" align=\"right\"\u003e **Multiple Choice Question (MCQ)** is a *question component* bundled with the [Adapt framework](https://github.com/adaptlearning/adapt_framework).\n\nPossible answers are presented to the learner accompanied by a radio button or checkbox, depending on whether a single answer or multiple answers are required. Upon submission, feedback is provided via the [**Tutor** extension](https://github.com/adaptlearning/adapt-contrib-tutor), if installed. Feedback can be provided for correct, incorrect and partially correct answers. The number of attempts allowed may be configured. [**GMCQ**](https://github.com/adaptlearning/adapt-contrib-gmcq/wiki) is a variation that includes a graphic.\n\n[Visit the **MCQ** wiki](https://github.com/adaptlearning/adapt-contrib-mcq/wiki) for more information about its functionality and for explanations of key properties.\n\n## Installation\n\nAs one of Adapt's *[core components](https://github.com/adaptlearning/adapt_framework/wiki/Core-Plug-ins-in-the-Adapt-Learning-Framework#components),* **MCQ** is included with the [installation of the Adapt framework](https://github.com/adaptlearning/adapt_framework/wiki/Manual-installation-of-the-Adapt-framework#installation) and the [installation of the Adapt authoring tool](https://github.com/adaptlearning/adapt_authoring/wiki/Installing-Adapt-Origin).\n\n* If **MCQ** has been uninstalled from the Adapt framework, it may be reinstalled.\nWith the [Adapt CLI](https://github.com/adaptlearning/adapt-cli) installed, run the following from the command line:\n`adapt install adapt-contrib-mcq`\n\n    Alternatively, this component can also be installed by adding the following line of code to the *adapt.json* file:\n    `\"adapt-contrib-mcq\": \"*\"`\n    Then running the command:\n    `adapt install`\n    (This second method will reinstall all plug-ins listed in *adapt.json*.)\n\n* If **MCQ** has been uninstalled from the Adapt authoring tool, it may be reinstalled using the [Plug-in Manager](https://github.com/adaptlearning/adapt_authoring/wiki/Plugin-Manager).\n\n\u003cdiv float align=right\u003e\u003ca href=\"#top\"\u003eBack to Top\u003c/a\u003e\u003c/div\u003e\n\n## Settings Overview\n\nThe attributes listed below are used in *components.json* to configure **MCQ**, and are properly formatted as JSON in [example.json](https://github.com/adaptlearning/adapt-contrib-mcq/blob/master/example.json). Visit the [**MCQ** wiki](https://github.com/adaptlearning/adapt-contrib-mcq/wiki) for more information about how they appear in the [authoring tool](https://github.com/adaptlearning/adapt_authoring/wiki).\n\n### Attributes\n\nIn addition to the attributes specifically listed below, [*question components*](https://github.com/adaptlearning/adapt_framework/wiki/Core-Plug-ins-in-the-Adapt-Learning-Framework#question-components) can implement the following sets of attributes:\n+ [**core model attributes**](https://github.com/adaptlearning/adapt_framework/wiki/Core-model-attributes): These are inherited by every Adapt component. They have no default values. Like the attributes below, their values are assigned in *components.json*.\n+ [**core buttons**](https://github.com/adaptlearning/adapt_framework/wiki/Core-Buttons): Default values are found in *course.json*, but may be overridden by **MCQ's** model in *components.json*.\n\n**\\_component** (string): This value must be: `mcq`.\n\n**\\_classes** (string): CSS class name to be applied to **MCQ**’s containing `div`. The class must be predefined in one of the Less files. Separate multiple classes with a space.\n\n**\\_layout** (string): This defines the horizontal position of the component in the block. Acceptable values are `full`, `left` or `right`.\n\n**instruction** (string): This optional text appears above the component. It is frequently used to\nguide the learner’s interaction with the component.\n\n**ariaQuestion** (string): This will be read out by screen readers instead of reading the title, body \u0026 instruction fields when focusing on the group or radiogroup.\n\n**\\_attempts** (integer): This specifies the number of times a learner is allowed to submit an answer. The default is `1`.\n\n**\\_shouldDisplayAttempts** (boolean): Determines whether or not the text set in **remainingAttemptText** and **remainingAttemptsText** will be displayed. These two attributes are part of the [core buttons](https://github.com/adaptlearning/adapt_framework/wiki/Core-Buttons) attribute group. The default is `false`.\n\n**\\_isRandom** (boolean): Setting this value to `true` will cause the `_items` to appear in a random order each time the component is loaded. The default is `false`.\n\n**\\_hasItemScoring** (boolean): When `false`, this question scores 0 for incorrect and `_questionWeight` for correct. When `true`, this question scores by summing the `_score` of the selected items.\n\n**\\_questionWeight** (number): When `_hasItemScoring` is `false`, this is the question score for a correct response. This number is used in calculations of the final score reported to the LMS.\n\n**\\_selectable** (integer): Defines the number of **\\_items**, or answers, that can be selected. If the value of **\\_selectable** is `1`, **\\_items** will be presented with HTML radio buttons. If the value is greater than `1`, they will be presented with HTML checkboxes. This number can be smaller, match or exceed the number of **\\_items** whose **\\_shouldBeSelected** is set to `true`. The default is `1`.\n\n**\\_canShowModelAnswer** (boolean): Setting this to `false` prevents the [**_showCorrectAnswer** button](https://github.com/adaptlearning/adapt_framework/wiki/Core-Buttons) from being displayed. The default is `true`.\n\n**\\_canShowCorrectness** (boolean): Setting this to `true` replaces the associated `_canShowModelAnswer` toggle button and displays correctness directly on the component items. The default is `false`.\n\n**\\_canShowFeedback** (boolean): Setting this to `false` disables feedback, so it is not shown to the user. The default is `true`.\n\n**\\_canShowMarking** (boolean): Setting this to `false` prevents ticks and crosses being displayed on question completion. The default is `true`.\n\n**\\_recordInteraction** (boolean) Determines whether or not the learner's answers will be recorded to the LMS via cmi.interactions. Default is `true`. For further information, see the entry for `_shouldRecordInteractions` in the README for [adapt-contrib-spoor](https://github.com/adaptlearning/adapt-contrib-spoor).\n\n**\\_items** (array): Each *item* represents one choice for the multiple choice question and contains values for **text**, **\\_shouldBeSelected**, and **feedback**.\n\n\u003e**text** (string): Text that comprises the multiple choice option.\n\n\u003e**altText** (string): This will be read out by screen readers instead of reading `text`.\nOptional for providing alternative text, for example, to specify how a word should be pronounced.\n\n\u003e**\\_shouldBeSelected** (boolean): Determines whether the *item* must be selected for the answer to be correct. Value can be `true` or `false`. The value of **\\_selectable** can be smaller, match or exceed the total number of **\\_items** where **\\_shouldBeSelected** is set to `true`.\n\n\u003e**\\_isPartlyCorrect** (boolean): Determines whether the *item* when selected marks the question as partly correct. Value can be `true` or `false`. Default is `false`.\n\n\u003e**feedback** (string): This attribute is used only when the value for **\\_selectable** is set to `1` (i.e., radio button style questions). This text will be shown if the learner selects this item, and it is an incorrect answer.\n\n\u003e**\\_score** (number): If `_hasItemScoring` is `true`, when selected, item scores are summed to give the question score.\n\n**\\_feedback** (object): If the [**Tutor** extension](https://github.com/adaptlearning/adapt-contrib-tutor) is enabled, these various texts will be displayed depending on the submitted answer. **\\_feedback**\ncontains values for three types of answers: **correct**, **\\_incorrect**, and **\\_partlyCorrect**. Some attributes are optional. If they are not supplied, the default that is noted below will be used.\n\n\u003e**title** (string): Title text for the feedback that will be displayed when the question is submitted.\n\n\u003e**altTitle** (string): This will be read out by screen readers as an alternative title if no visual title is included.\n\n\u003e**correct** (string): Text that will be displayed when the submitted answer is correct.\n\n\u003e**\\_incorrect** (object): Texts that will be displayed when the submitted answer is incorrect. It contains values that are displayed under differing conditions: **final** and **notFinal**.\n\n\u003e\u003e**final** (string): Text that will be displayed when the submitted answer is incorrect and no more attempts are permitted.\n\n\u003e\u003e**notFinal** (string): Text that will be displayed when the submitted answer is incorrect while more attempts are permitted. This is optional\u0026mdash;if you do not supply it, the **\\_incorrect.final** feedback will be shown instead.\n\n\u003e**\\_partlyCorrect** (object): Texts that will be displayed when the submitted answer is partially correct. It contains values that are displayed under differing conditions: **final** and **notFinal**.\n\n\u003e\u003e**final** (string): Text that will be displayed when the submitted answer is partly correct and no more attempts are permitted. This is optional\u0026mdash;if you do not supply it, the **\\_incorrect.final** feedback will be shown instead.\n\n\u003e\u003e**notFinal** (string): Text that will be displayed when the submitted answer is partly correct while more attempts are permitted. This is optional\u0026mdash;if you do not supply it, the **\\_incorrect.notFinal** feedback will be shown instead.\n\n### Accessibility\n**Multiple Choice Question** has been assigned a descriptive label using the [aria-label](https://github.com/adaptlearning/adapt_framework/wiki/Aria-Labels) attribute: **ariaRegion**.\n\nWhen **Multiple Choice Question** is used with Adapt Framework v5.12.0 (or better), it supports announcing the correct/learner answer to screen readers (via an an [ARIA Live Region](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions)) when the Correct Answer button is toggled by the learner. The following attributes are used to provide this functionality: **ariaCorrectAnswer**, **ariaCorrectAnswers**, **ariaUserAnswer**, **ariaUserAnswers**.\n\nThese ARIA labels are not visible elements; they are used by assistive technology (such as screen readers). Should any of these labels need to be customised or translated, they can be found within the `_globals._components._mcq` object in **course.json** (or Project settings \u003e Globals in the Adapt Authoring Tool).\n\n\u003cdiv float align=right\u003e\u003ca href=\"#top\"\u003eBack to Top\u003c/a\u003e\u003c/div\u003e\n\n## Limitations\n\nNo known limitations.\n\n----------------------------\n\u003ca href=\"https://community.adaptlearning.org/\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg\" alt=\"adapt learning logo\" align=\"right\"\u003e\u003c/a\u003e\n**Author / maintainer:** Adapt Core Team with [contributors](https://github.com/adaptlearning/adapt-contrib-mcq/graphs/contributors)\n**Accessibility support:** WAI AA\n**RTL support:** Yes\n**Cross-platform coverage:** Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, IE11, Safari 14 for macOS/iOS/iPadOS, Opera\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptlearning%2Fadapt-contrib-mcq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadaptlearning%2Fadapt-contrib-mcq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptlearning%2Fadapt-contrib-mcq/lists"}