"ClickLocations" (Question Interface Type)

"ClickLocations"

provides an interface for selecting locations on a background.

Properties

  • In QuestionInterface["ClickLocations",props], props is an Association that supports the following keys:
  • "Prompt"Nonetext asking the user a question
    Backgroundrequiredimage to place the items on
    "Count"Automaticnumber of items
    "Labels"Nonelist with corresponding labels for each item

Corresponding AssessmentFunction

  • "ClickLocations" is not an automatically assigned interface type for an AssessmentFunction. It must be specified in QuestionInterface.
  • When the Background is an image, values in the AssessmentFunction correspond to pixel locations.
  • By default, the "Count" matches the length of the correct answer in the AssessmentFunction.
  • Clicking exact locations is not practical, therefore, a nonzero tolerance and a "ComparisonMethod" such as "Point" should be set in the AssessmentFunction.
  • Locations in the answer key should be given as lists of coordinate pairs: AssessmentFunction[{{{chx1, chy1}, {chx2, chy2},} 1},]]
  • When no "Labels" are provided, "ListAssessment" must be set to "AllElementsOrderless": AssessmentFunction[, <|"ComparisonMethod"->"Vector","ListAssessment" "AllElementsOrderless"|>, Tolerance tol]]
  • If "Labels" are provided, "ListAssessment" must be set to "AllElementsOrdered" and the "Labels" should match the order of locations in the AssessmentFunction: AssessmentFunction[, <|"ComparisonMethod"->"Vector","ListAssessment" "AllElementsOrdered"|>, Tolerance tol]]

Examples

open allclose all

Basic Examples  (3)

Create a click-locations question without assessment:

Create a click-locations question with assessment:

Create a click-locations question with labels. Use the coordinate tool to locate the missing labels in the image:

Scope  (2)

Use the Coordinates Tool to extract some pixel positions from an image:

Create a question object with assessment using the image and chosen locations:

Create an image for a geometry problem:

Use the Coordinates Tool to find positions, then create a question with labels, awarding 20 points for a correct answer:

Applications  (1)

Create an image containing many flags:

Find specific flags using the Coordinates Tool and create a question:

Possible Issues  (1)

The "Background" must be an Image:

Use Image or Rasterize to convert Graphics into an Image:

Interactive Examples  (1)

Find locations of several types of objects in an image:

Create a question generator with a click-locations question object using the location data: