Skip to content

Commit

Permalink
Merge pull request #108 from davetaz/master
Browse files Browse the repository at this point in the history
Adding attribution to GMCQ component
  • Loading branch information
oliverfoster authored Apr 21, 2017
2 parents 358092c + 3a05546 commit 6472876
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ guide the learner’s interaction with the component.
>>**small** (string): File name (including path) of the image used with small device width. Path should be relative to the *src* folder (e.g., *course/en/images/origami-menu-two.jpg*).
>>**alt** (string): This text becomes the image’s `alt` attribute.
>>**alt** (string): This text becomes the image’s `alt` attribute.
>>**attribution** (string): Optional text to be displayed as an [attribution](https://wiki.creativecommons.org/Best_practices_for_attribution). By default it is displayed below the image. Adjust positioning by modifying CSS. Text can contain HTML tags, e.g., `Copyright © 2015 by <b>Lukasz 'Severiaan' Grela</b>`.
**_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**
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.
Expand Down Expand Up @@ -108,7 +110,7 @@ label is not a visible element. It is utilized by assistive technology such as s
No known limitations.

----------------------------
**Version number:** 2.0.5 <a href="https://community.adaptlearning.org/" target="_blank"><img 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"></a>
**Version number:** 2.0.6 <a href="https://community.adaptlearning.org/" target="_blank"><img 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"></a>
**Framework versions:** 2.0
**Author / maintainer:** Adapt Core Team with [contributors](https://github.com/adaptlearning/adapt-contrib-gmcq/graphs/contributors)
**Accessibility support:** WAI AA
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapt-contrib-gmcq",
"version": "2.0.5",
"version": "2.0.6",
"framework": "^2.0.11",
"homepage": "https://github.com/adaptlearning/adapt-contrib-gmcq",
"issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-gmcq%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
Expand Down
2 changes: 2 additions & 0 deletions example.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"_shouldBeSelected":true,
"_graphic": {
"alt": "Alt text for option 1",
"attribution":"Copyright © 2015",
"large": "course/en/images/gqcq-1-large.gif",
"small": "course/en/images/gqcq-1-small.gif"
}
Expand All @@ -33,6 +34,7 @@
"_shouldBeSelected":false,
"_graphic": {
"alt": "Alt text for option 2",
"attribution":"Copyright © 2015",
"large": "course/en/images/gqcq-2-large.gif",
"small": "course/en/images/gqcq-2-small.gif"
}
Expand Down
4 changes: 4 additions & 0 deletions less/gmcq.less
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@
}
}
}
.graphic-attribution {
font-size:0.75em;
line-height: 1em;
}
}

.no-touch {
Expand Down
9 changes: 9 additions & 0 deletions properties.schema
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@
"validators": [],
"help": "Alternative text for this items image",
"translatable": true
},
"attribution": {
"type":"string",
"required":false,
"default": "",
"inputType": "Text",
"validators": [],
"help": "Text to be displayed as an attribution",
"translatable": true
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions templates/gmcq.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<label aria-hidden="true" id="{{../_id}}-{{@index}}-aria" for="{{../_id}}-{{@index}}" class="{{#unless ../_isEnabled}}disabled {{/unless}} component-item-color component-item-text-color component-item-border {{#if _isSelected}}selected{{/if}} a11y-ignore" tabindex="-1">

<img src="{{_graphic.src}}" data-large="{{_graphic.large}}" data-small="{{_graphic.small}}"/>
{{#if _graphic.attribution}}
<div class="graphic-attribution">{{{_graphic.attribution}}}</div>
{{/if}}

<div class="gmcq-item-checkbox">
<div class="gmcq-item-state">
Expand Down

0 comments on commit 6472876

Please sign in to comment.