Group Abstract Group Abstract

Message Boards Message Boards

Integrate a Dynamic Locator to check answers by navigating x-y coordinates?

I created the following test for young learners to check their understanding of x-y coordinates:enter image description here

aif[] := RandomInteger[{-6, 6}]
Graphics[{PointSize[Large], Blue, Point[Table[{aif[], aif[]}, 5]]},
 Axes -> True, AxesLabel -> {"X", "Y"}, AxesStyle -> Black, 
 GridLines -> {Range[-7, 7, 1], Range[-7, 7, 1]}, 
 GridLinesStyle -> Dotted, PlotRange -> {{-7, 7}, {-7, 7}}]

Firstly, I would like to add Dynamic Locator for learners to check their answers by navigating to each point and reading it's coordinates. Can anybody help, pls?

Secondly, How can I label these points using letters A,B,C,D,E?

The routine is the following: complete the task, submit the answers, check your answers, grade your work. Therefore, I do not want Locator to be available from the beginning but this I will fix myself.

I am quite excited about this type of tasks: students are always tempted to chenge the wrong answers to paint more positive picture about their performance and, therefore, the self assessment / self marking might not be reliable. I do not use peer marking and I try to miminmize time I spent on grading of students' work. The routine above kills more than two birds with one Mathematica code: the answers are submitted, and, therefore, students can be trusted to mark their work. They get the grade swiftly without any cost for me. By marking their work learners can get an idea about the mistakes they have made if any and set individual learning targets. I note in passing I am no longer setting the learning targets for my students or, in plain English, I do not tell my students what they are not good at. I have time to focus on supporting my students and check that they mark their work properly. Overall, marking their work, understanding their mistakes and setting learning targets provides sufficient evidence to evaluate their "behaviour for learning".

POSTED BY: Vladimir Portnyk
5 Replies
Posted 6 years ago
POSTED BY: Updating Name

You are brilliant! I was looking for these arrowheads but in vain. Thank you so much! Your response is a true treasure box for me!

I note in passing I have concurred Dynamic Locator, see below. Feel free to share your ideas about possible deployment options and everything really. I do not have any coding experience in Mathematica. Fortran 88, Basics, Pascal, C++, Java, JavaScript, VB, Paradox, Delphi, PowerBuilder, SQL, XML, DirectX and Haskell yes, as a Technical Architect of Symbian OS I thought I know something but It seems Erich Gamma's Design Patterns, The Book of Household Management in the field of software development, is in the hall of fame, but it used to be at my desk (I had a few copies :) )!

To be fair since I pronounced Haskell to be a better alternative for exotic derivatives based financial products representations and life cycling vs Excel tables, VisualBasic, C++ or Java and moving from IT to Hybrid Exotic trading stopping by at the Quant team to tune up my vision to "see it through" I spent a few years of having functional fun in the world of financial derivates and client side products where the future event dates are known today. Recently developing quantitative investment strategies and asking Quant-IT to develop a few helper functions to represent traditional delta 1 products such as basket of shares or ETF holdings where the future event dates are not known in advance and the events are observed, triggered and implemented, for example, the portfolio rebalancing to ensure no single component represents more than 10% of the portfolio. Most recently teaching Advanced Level Maths. Among these very different areas there is something of critical importance in common: automation.

aif[] := RandomInteger[{-6, 6}]
DynamicModule[{ 
  B = {0, 0}}, {Graphics[{Locator[Dynamic[B]], PointSize[Large], Blue,
     Point[Table[{aif[], aif[]}, 5]]},
   Axes -> True, AxesLabel -> {"X", "Y"}, AxesStyle -> Black, 
   GridLines -> {Range[-7, 7, 1], Range[-7, 7, 1]}, 
   GridLinesStyle -> Dotted, PlotRange -> {{-7, 7}, {-7, 7}} ], 
  Dynamic[B]}]
POSTED BY: Vladimir Portnyk
Posted 6 years ago

Vladimir,

Another option for visualizing the solution is to draw arrows from the axes to the point when the mouse is over a point. e.g

epilog = {Mouseover[
      {PointSize[Large], Red, Point[#]},
      {{Green, Thick, Arrowheads[{0.0, 0.03}], Arrow[{{0, #[[2]]}, #}]},
       {Green, Thick, Arrowheads[{0.0, 0.03}], Arrow[{{#[[1]], 0}, #}]},
       {Style[Text[#[[1]], {#[[1]]/2, #[[2]] + 0.2}], 12, Black]},
       {Style[Text[#[[2]], {#[[1]] - 0.2, #[[2]]/2}], 12, Black]}
       }] & /@ points};

And add Epilog -> epilog to the ListPlot. When the mouse hovers over the {2, -2} point:

enter image description here

POSTED BY: Rohit Namjoshi

I just posted a new question activity. what do you think?

POSTED BY: Vladimir Portnyk
Posted 6 years ago

Hi Vladimir,

Sounds like a fun project. How about something like this.

range = {-6, 6};
numPoints = 5;
points = RandomInteger[range, {numPoints, 2}];
labels = Alphabet[] // ToUpperCase // Take[#, numPoints] &;
tooltipPoints = Tooltip[#, StringTemplate["(``, ``)"][Sequence @@ ##]] & /@ points;

To plot points with labels and no tooltip

ListPlot[points -> labels,
 PlotRange -> Transpose[{range, Reverse@range}],
 AspectRatio -> 1,
 GridLines -> Full,
 GridLinesStyle -> Dotted,
 PlotStyle -> {PointSize[Large], Red},
 PlotRangePadding -> 1,
 AxesLabel -> {"X", "Y"},
 AxesStyle -> Arrowheads[{0.0, 0.04}],
 ImageSize -> 400]

enter image description here

To plot points with tooltips, replace points -> labels with tooltipPoints -> labels.

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard