Giter Club home page Giter Club logo

adapt-contrib-matching's Introduction

adapt-contrib-matching

Matching in action Matching is a question component bundled with the Adapt framework.

Possible answers to the question are presented within one or more drop-downs. Upon submission, feedback is provided via the Tutor extension, if installed. Feedback can be provided for correct, incorrect and partially correct answers. The number of attempts allowed may be configured.

Visit the Matching wiki for more information about its functionality and for explanations of key properties.

Installation

As one of Adapt's core components, Matching is included with the installation of the Adapt framework and the installation of the Adapt authoring tool.

  • If Matching has been uninstalled from the Adapt framework, it may be reinstalled. With the Adapt CLI installed, run the following from the command line: adapt install adapt-contrib-matching

    Alternatively, this component can also be installed by adding the following line of code to the adapt.json file: "adapt-contrib-matching": "*" Then running the command: adapt install (This second method will reinstall all plug-ins listed in adapt.json.)

  • If Matching has been uninstalled from the Adapt authoring tool, it may be reinstalled using the Plug-in Manager.

Settings Overview

The attributes listed below are used in components.json to configure Matching, and are properly formatted as JSON in example.json. Visit the Matching wiki for more information about how they appear in the authoring tool.

Attributes

In addition to the attributes specifically listed below, question components can implement the following sets of attributes:

  • 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.
  • core buttons: Default values are found in course.json, but may be overridden by Matching's model in components.json.

_component (string): This value must be: matching.

_classes (string): CSS class name to be applied to Matching’s containing div. The class must be predefined in one of the Less files. Separate multiple classes with a space.

_layout (string): This defines the horizontal position of the component in the block. Acceptable values are full, left or right.

instruction (string): This optional text appears above the component. It is frequently used to guide the learner’s interaction with the component.

ariaQuestion (string): This will be read out by screen readers instead of reading the title, body & instruction fields when focusing on the group or radiogroup.

_attempts (number): This specifies the number of times a learner is allowed to submit an answer. The default is 1.

_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 attribute group. The default is false.

_shouldResetAllAnswers (boolean): Setting this value to false will stop correct answers from being reset when the question is reset - this can be better experience for the learner in instances when there are many items for them to answer. The default is true.

_isRandom (boolean): Setting this value to true will cause the possible answers associated with each item to appear in a random order each time the component is loaded. The default is false.

_isRandomQuestionOrder (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.

_questionWeight (number): A number which reflects the significance of the question in relation to the other questions in the course. This number is used in calculations of the final score reported to the LMS.

_canShowModelAnswer (boolean): Setting this to false prevents the _showCorrectAnswer button from being displayed. The default is true.

_canShowFeedback (boolean): Setting this to false disables feedback, so it is not shown to the user. The default is true.

_canShowMarking (boolean): Setting this to false prevents ticks and crosses being displayed on question completion. The default is true.

_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.

placeholder (string): This is the text that is initially displayed on each drop-down. It is usually set to something like 'Please select an option'.

_allowOnlyUniqueAnswers (boolean): When set to false, multiple items can be selected with the same option text. Defaults to false.

_hasItemScoring (boolean): When set to false, this question scores 0 for incorrect and 'Question Weight' for correct. When enabled, this question scores by summing the scores of the selected options. Defaults to false.

_items (array): Multiple items may be created. Each item represents one question and its possible answers. It contains values for text and multiple _options.

text (string): Text that functions as the question.

_options (array): Multiple options may be created. Each option functions as a possible answer to the question text. It contains values for text and isCorrect.

text (string): This is the value of the dropdown. It is the text of a possible answer.

_isCorrect (boolean): This value determines whether the dropdown must be selected for a correct answer. Set to true if this option is a correct answer. The default is false.

_feedback (object): If the Tutor extension is enabled, these various texts will be displayed depending on the submitted answer. _feedback contains 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.

title (string): Title text for the feedback that will be displayed when the question is submitted.

altTitle (string): This will be read out by screen readers as an alternative title if no visual title is included.

correct (string): Text that will be displayed when the submitted answer is correct.

_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.

final (string): Text that will be displayed when the submitted answer is incorrect and no more attempts are permitted.

notFinal (string): Text that will be displayed when the submitted answer is incorrect while more attempts are permitted. This is optional—if you do not supply it, the _incorrect.final feedback will be shown instead.

_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.

final (string): Text that will be displayed when the submitted answer is partly correct and no more attempts are permitted. This is optional—if you do not supply it, the _incorrect.final feedback will be shown instead.

notFinal (string): Text that will be displayed when the submitted answer is partly correct while more attempts are permitted. This is optional—if you do not supply it, the _incorrect.notFinal feedback will be shown instead.

Accessibility

Matching has been assigned a descriptive label using the aria-label attribute: ariaRegion.

When Matching 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) when the Correct Answer button is toggled by the learner. The following attributes are used to provide this functionality: ariaCorrectAnswer, ariaUserAnswer.

These 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._matching object in course.json (or Project settings > Globals in the Adapt Authoring Tool).

Limitations

No known limitations.


adapt learning logo Author / maintainer: Adapt Core Team with contributors
Accessibility support: WAI AA
RTL support: Yes
Cross-platform coverage: Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, Safari for macOS/iOS/iPadOS, Opera

adapt-contrib-matching's People

Contributors

andrewhosgood avatar brian-learningpool avatar cahirodoherty-learningpool avatar cajones avatar chris-steele avatar chucklorenz avatar dancgray avatar darylhedley avatar dependabot[bot] avatar eleanor-heath avatar guywillis avatar himanshu1618 avatar jamesrea83 avatar jasonbutler avatar joe-allen-89 avatar joe-replin avatar kirsty-hames avatar lc-thomasberger avatar lemmyadams avatar moloko avatar olaoluwam avatar oliverfoster avatar olivermartinfoster avatar sarveshwar-gavhane avatar semantic-release-bot avatar swashbuck avatar taylortom avatar thomasschuiki avatar tomgreenfield avatar zenduo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adapt-contrib-matching's Issues

Item text doesn't compile a11y_alt_text helper

Subject of the issue

The a11y_alt_text helper tag syntax is being displayed instead of compiling the on screen text and hidden screen reader text.

Expected behaviour

Using the helper should produce display text with an alternative hidden screen reader version.

Similar issues were raised and resolved previously for other components. See Hotgraphic for reference.

ie8/9 Disabled State default styling cannot be overriden

Having issues where the select text turns into a light grey when disabled on IE8/9. After some research it looks like it's not possible to change that grey. This is causing issues where the text is very hard to read depending on the background colour of the select. Only way around it atm is for it to be styled with a white background colour on the browsers affected.

matching-item__select-container style is missed

With the last version, it was missed the style in the check icons problably because someone changed class naming.
Previosly the class was named
matching__select-state{
position: absolute;
top: 50%;
right: 1rem;
transform: translateY(-50%);
}
It could be now:
.matching-item {

&__select-container {
position: relative;
}

&__select-state {
position: absolute;
top: 15%;
right: 1rem;
transform: translateY(50%);
}
...

User answer not being shown in IE9

The selectOption function doesn't properly select the correct option in IE9. The fix is not to use attr, should be using prop. This is from jquery docs:

"To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method."

Dropdown select fails on reset (when using tutor)

There appears to be a bug with matching when notifications are stacked up and then closed. This is currently not the behaviour of tutor, but for any extensions that expand on the Adapt.notify stack it may cause issues.

Replication of bug can be achieved by using the hack outlined below:

  1. Make a change to tutor that forces multiple popups (i.e. add another notify.create(this.notifyOptions); below the original on line https://github.com/adaptlearning/adapt-contrib-tutor/blob/master/js/TutorNotify.js#L26, to force the same popup twice)
  2. Create a course using matching and an assessment with this altered tutor
  3. The first dropdown selection and submission gives assessment feedback and tutor feedback (if configured)
  4. Reset the assessment
  5. Dropdown options appear on click, but options do not disappear (on click/blur/escape etc)

On console debugging, I can see that the blur event is not been fired on the list items at all. Not sure why the page loses this.

Use monitorEvents($('.js-dropdown-list')[0], "control") in the console to confirm difference in before and after reset behaviour.

NB: Functionality is intact when tutor is removed

_shouldResetAllAnswers no longer used

Redundant component setting

_shouldResetAllAnswers doesn't seem to do anything anymore?

Your environment

  • version (AT/Framework) v0.10.5/v5.28.11

Steps to reproduce

  • Create a Matching component using the Authoring Tool
  • Set the attempts to 2 (or more)
  • Uncheck the "Reset all answers?" option
  • Answer some options incorrectly
  • Reset question

Expected behaviour

The question should reset only the wrong answers.

Actual behaviour

All answers are reset

Screenshots (if you can)

image

Blur event not called

When leaving the dropdown list, the blur even isn't being called. I was able to work around it by adding an additional event call after clicking the list item. Added to the this.$list.on even located on line 43 of the dropdown.js document.

Best guess is the original click even isn't firing changing the close property right and is creating a constant loop of setting the state to false and then back to true.

If anything, my solution is more of a fallback to ensure that the option is selected and the dropdown goes away as to not prevent progression.

Randomise items

Is it possible to add the ability to randomise the order of the Matching items as well as the Randomising of the answers?

Thanks

Caleb

Submit button visibility

The submit button is visible after the number of attempts has been exceeded, and the answer is incorrect.

Class updates for completed

Incorrect icon status is always displayed when:

  • the component is completed
  • _isEnabledOnRevisit is false
  • you navigate away, then back

My answer is not the one I selected when randomised

When you answer the question the question incorrectly, click on the correct answer button and then click on my answer button, you will notice that the answers that displayed are not the ones you answered.

BEM Naming - inconsistent between plugins

Following similar inconsistent BEM naming in other plugins (Accordion / GMCQ), the Matching naming convention should be changed to follow suit.

e.g.

Current:
.matching_item
.matching__item-title

Proposed:
.matching-item
.matching-item__title

Develop branch properties.schema need updating

properties.schema needs updating with new schema attributes. ariaLabel fields need adding to properties.schema.

Needed for framework v2.0 and authoring tool compatibility.

disabledAriaLabel in example.json is now redundant and should be removed?

Notification when option/s not selected

Currently when user does not select an option/options and clicks Submit, nothing happens. Better solution would be to give some hint - e.g. red border of text box or change the dropdown option colour to red.

Essentially adding a class to the dropdown would allow any bespoke customisation.

Randomise functionality

The ability to randomise question stems similar to the MCQ component via an _isRandom setting may be required

Marking is displayed when in an an assessment and the assessments setting "Display Marking" is set to false

When the “Display Marking” toggle is switched off on the assessment, the correct/incorrect marking should not appear after the matching question has been answered.

The marking has not been applied correctly since this release Release v6.0.0 · adaptlearning/adapt-contrib-matching

I have taken a recording of the matching question working correctly in this release Release v5.0.0 · adaptlearning/adapt-contrib-matching

ADAPT-9875.mov

Invalid student response data

One of the LMS systems we are testing on is displaying an error for the matching question component

Your environment

Testing on Windows 10 Chromes PC

Steps to reproduce

Submit the answer to the matching question

Expected behaviour

I would not expect to get an error

Actual behaviour

An error appears saying "Incorrect Data Type"

Via dev tools the following:
16:40:50.462 ScormWrapper::setValue: _property=cmi.interactions.0.type _value=matching
16:40:50.557 ScormWrapper::setValue: _property=cmi.interactions.0.student_response _value=2.3,3.2,1.3
16:40:50.656 Unable to set cmi.interactions.0.student_response to: '2.3,3.2,1.3' Error: 405 - Incorrect Data Type LMS Error Info: For the 'cmi.interactions.0.student_response' data model element an incorrect value was submitted. Incorrect value: '2.3,3.2,1.3'.

Screenshots (if you can)

image

Convert block elements to inline

Block level elements fails the w3c validator when they are children of button or label elements.

Convert block level elements to inline to pass w3c validator checks.

Text attribute doesn't allow html tag usage

In the below .json... the text attribute doesn't render html tags in the build.

"items": [
{
"text": "

Title
",
"options": [
{
"text": "Title here",
"correct": true
},
{
"text": "Title here",
"correct": false
}
]
},
{

accessibility: Add correct +/ incorrect aria labels to ticks and crosses

Subject of the issue/enhancement/features

Tick and cross icons do not contain aria labels.

Relates to adaptlearning/adapt_framework#2241

Your environment

  • Framework 5.22.3

Steps to reproduce

  1. Complete a Matching component with a mix of correct and incorrect responses
  2. Toggle between Show Correct Answer and Show My Answer

Expected behaviour

The tick and cross icons should have aria labels indicating if they represent correct or incorrect.

Actual behaviour

No aria labels

Change _shouldShowMarking for _canShowMarking in matching.jsx

Subject of the issue/enhancement/features

Change _shouldShowMarking for _canShowMarking in matching.jsx template.
Now it looks like undefined and avoid to show the tick/cross next to the item.

Expected behaviour

True/false from config.

Actual behaviour

undefined

Normalize icons globally

Subject of the issue/enhancement/features

Not a bug, but more housecleaning. Looking to ensure all icons in every template are uniform and set up with the same structure with the appropriate aria hidden label.

<span className="component-item__icon" aria-hidden="true">
  <span className="icon"></span>
</span>

OR

<span className="component-item__icon" aria-label="ARIA Description.">
  <span className="icon" aria-hidden="true"></span>
</span>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.