Skip to content

An example interactive game component for Adapt. This example is a number guessing game.

License

Notifications You must be signed in to change notification settings

davetaz/adapt-mygame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Game Component

My Game Component is a question component for the Adapt framework.

My Game Component allows the user to input a free-form answer in response to an initial question. They are trying to guess the number the computer is thinking of.

My Game Component is a simple derivative of the Text Input component See here for more information about its functionality and for explanations of key properties.

Installation

Drop the component in the components directory of your courses src directory.

You can also install the component via the authoring tool.

Settings Overview

The attributes listed below are used in components.json to configure My Game, and are properly formatted as JSON in example.json.

Attributes

_minNumber (number): The minimum number people are guessing

_maxNumber (number): The maximum number people are guessing

In addition, 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 Text Input's model in components.json.

_component (string): This value must be: textinput. (One word, all lowercase.)

_classes (string): CSS class name to be applied to [core plug-in]’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.

_attempts (integer): 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.

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

_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 answer(s) will be recorded on the LMS via cmi.interactions. Default is true. For further information, see the entry for _shouldRecordInteractions in the README for adapt-contrib-spoor.

_allowsAnyCase (boolean): This setting determines whether or not the learner's input must match the uppercase and lowercase letters of the supplied answer/s. Set to false if case-sensitivity is required for a correct answer. The default is true.

_allowsPunctuation (boolean): This setting determines whether the learner's input may include punctuation characters listed below. The default is true.
) ( ~ _ - = } { : ; * & ^ % £ $ ! # - / , . `

_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): If not set, the component's displayTitle is used as the feedback title. If displayTitle is not set , title will be used instead.

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.

Limitations

No known limitations.


Version number: 1.0.0 adapt learning logo
Framework versions: 5.7+
Author / maintainer: Adapt Core Team with contributors
Accessibility support: None RTL support: Yes Cross-platform coverage: Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, IE11, Safari 12+13 for macOS/iOS/iPadOS, Opera

About

An example interactive game component for Adapt. This example is a number guessing game.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published