activities/memory/MemoryGame. MemoryGame

This class of Activity shows a panel with duplicate ActiveBox objects initially
hidden and shuffled. To complete the activity, all object pairs must be found. Only two objects
are revealed in every move, so the user must remember the content of each cell.

The cell pairs can have identical content, defined in the primary ActiveBagContent of
the activity, or two different contents. In this case, the secondary bag elements will have
content related to each primary element.

Constructor

new MemoryGame(project)

MemoryGame constructor

Parameters:
NameTypeDescription
projectmodule:project/JClicProject.JClicProject

The JClicProject to which this activity belongs

Extends

Members

abc :Array.<module:boxes/ActiveBagContent.ActiveBagContent>

Array of bags with the description of the content to be displayed on panels and cells.

absolutePosition :module:AWT.Point

The position of the activity panel on the player.

absolutePositioned :boolean

Whether to place the activity panel at the point specified by absolutePosition or leave
it centered on the main player's window.

Type:
  • boolean

acp :module:automation/AutoContentProvider.AutoContentProvider

Special object used to generate random content at the start of the activity

activityBgColor :string

The background color of the activity

Type:
  • string

activityBgGradient :module:AWT.Gradient

Gradient used to draw backgrounds inside the activity.

bActionsCounter :boolean

Whether to display or not the 'actions' counter

Type:
  • boolean

bScoreCounter :boolean

Whether to display or not the 'score' counter

Type:
  • boolean

bTimeCounter :boolean

Whether to display or not the 'time' counter

Type:
  • boolean

bgColor :string

The background color of the activity panel

Type:
  • string

bgGradient :module:AWT.Gradient

When set, gradient used to draw the activity window background

bgImageFile :string

Filename of the image used as a panel background.

Type:
  • string

border :boolean

Whether to draw a border around the activity panel

Type:
  • boolean

boxGridPos :string

Relative position of the text grid (uses the same position codes as box grids)

Type:
  • string

className :string

The class name of this Activity

Type:
  • string

code :string

Code used in reports to filter queries. Default is null.

Type:
  • string

countDownActions :boolean

Whether the actions counter should display a countdown when maxActions > 0

Type:
  • boolean

countDownTime :boolean

Whether the time counter should display a countdown when maxTime > 0

Type:
  • boolean

description :string

A short description of the activity

Type:
  • string

document :module:activities/text/TextActivityDocument.TextActivityDocument

The main document used in text activities

dragCells :boolean

Wheter the cells of the activity will be dragged across the screen.
When false, a line will be painted to link elements.

Type:
  • boolean

eventSounds :module:media/EventSounds.EventSounds

Specific set of EventSounds used in the activity. The default is null, meaning
to use the default event sounds.

helpMsg :string

Message to be shown in the help window when showSolution is false.

Type:
  • string

helpWindow :boolean

Whether to allow help about the activity or not.

Type:
  • boolean

includeInReports :boolean

Whether to generate usage reports

Type:
  • boolean

infoCmd :string

System command to be launched when the user clicks on the 'info' button. Default is null.
Important: this parameter is currently not being used

Type:
  • string

infoUrl :string

URL to be launched when the user clicks on the 'info' button. Default is null.

Type:
  • string

invAss :boolean

Flag to indicate "inverse resolution" in complex associations

Type:
  • boolean

margin :number

The space between the activity components measured in pixels.

Type:
  • number

maxActions :number

Maximum number of actions allowed to solve the activity. The default value is 0, meaning
unlimited actions.

Type:
  • number

maxTime :number

Maximum amount of time (seconds) to solve the activity. The default value is 0, meaning
unlimited time.

Type:
  • number

Array of menu elements, used in activities of type Menu

Type:
  • Array.<object>

messages :Array.<module:boxes/ActiveBoxContent.ActiveBoxContent>

The content of the initial, final, previous and error messages shown by the activity.

name :string

The Activity name

Type:
  • string

numericContent :boolean

This activity uses numeric expressions, so text literals should be
converted to numbers for comparisions, taking in account the
number format of the current locale (dot or comma as decimal separator)

Type:
  • boolean

project :module:project/JClicProject.JClicProject

The JClicProject to which this activity belongs

reportActions :boolean

Whether to send action events to the Reporter

Type:
  • boolean

showSolution :boolean

Whether to show the solution on the help window.

Type:
  • boolean

shuffleA :boolean

Box grid A must be shuffled.

Type:
  • boolean

shuffleB :boolean

Box grid B must be shuffled.

Type:
  • boolean

shuffles :number

Number of times to shuffle the cells at the beginning of the activity

Type:
  • number

skinFileName :string

File name of the Skin used by the activity. The default value is null, meaning that the
activity will use the skin specified for the project.

Type:
  • string

tgc :module:boxes/TextGridContent.TextGridContent

Content of the grid of letters used in crosswords and shuffled letters

tiledBgImg :boolean

Whether the bgImage (if any) has to be tiled across the panel background

Type:
  • boolean

transparentBg :boolean

Whether the activity window has transparent background.

Type:
  • boolean

type :string

Type of activity, used in text activities to distinguish between different variants of the
same activity. Possible values are: orderWords, orderParagraphs, identifyWords and
identifyChars.

Type:
  • string

useOrder :boolean

Wheter the activity must be solved in a specific order or not.

Type:
  • boolean

windowSize :module:AWT.Dimension

Preferred dimension of the activity window

(static) Panel :class

Panel class associated to this type of activity: MemoryGamePanel

Type:
  • class

Methods

canReinit() → {boolean}

Whether or not the activity can be reset

Returns:
Type: 
boolean

clear()

Called when the activity must reset its internal components

end()

Called when the activity must be disposed

getActivityPanel(ps) → {module:Activity.ActivityPanel}

Builds the ActivityPanel object.
Subclasses must update the Panel member of its prototypes to produce specific panels.

Parameters:
NameTypeDescription
psmodule:JClicPlayer.JClicPlayer

The JClicPlayer used to build media objects.

getAttributes() → {object}

Gets a object with the basic attributes needed to rebuild this instance excluding functions,
parent references, constants and also attributes retaining the default value.
The resulting object is commonly usued to serialize elements in JSON format.

Returns:
  • The resulting object, with minimal attrributes
Type: 
object

getMinNumActions() → {number}

Retrieves the minimum number of actions needed to solve this activity.

Returns:
Type: 
number

getWindowSize() → {module:AWT.Dimension}

Getter method for windowSize

Returns:
Type: 
module:AWT.Dimension

hasInfo() → {boolean}

Whether or not the activity has additional information to be shown.

Returns:
Type: 
boolean

hasRandom() → {boolean}

Whether or not the activity uses random to shuffle internal components

Returns:
Type: 
boolean

helpSolutionAllowed() → {boolean}

Whether the activity allows the user to request the solution.

Returns:
Type: 
boolean

helpWindowAllowed() → {boolean}

Whether the activity allows the user to request help.

Returns:
Type: 
boolean

initAutoContentProvider()

Initialises the AutoContentProvider, when defined.

mustPauseSequence() → {boolean}

When this method returns true, the automatic jump to the next activity must be paused at
this activity.

Returns:
Type: 
boolean

needsKeyboard() → {boolean}

When true, the activity makes use of the keyboard

Returns:
Type: 
boolean

prepareMedia(ps)

Preloads the media content of the activity.

Parameters:
NameTypeDescription
psmodule:JClicPlayer.JClicPlayer

The module:JClicPlayer.JClicPlayer used to realize the media objects.

readMessage($xml) → {module:boxes/ActiveBoxContent.ActiveBoxContent}

Read an activity message from an XML element

Parameters:
NameTypeDescription
$xmlexternal:jQuery

The XML element to be parsed

setAttributes(data)

Load the activity settings from a data object

Parameters:
NameTypeDescription
dataobject

The data object to parse

setProperties($xml)

Loads this object settings from an XML element

Parameters:
NameTypeDescription
$xmlexternal:jQuery

The jQuery XML element to parse

setWindowSize(windowSize)

Setter method for windowSize

Parameters:
NameTypeDescription
windowSizemodule:AWT.Dimension

shuffleAlways() → {boolean}

When true, the activity must always be shuffled

Returns:
Type: 
boolean