Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Showing score on graph

Contributor ,
Sep 23, 2012 Sep 23, 2012

Hi,

Still working on the eLearning project, trying to create a better way to display scores that the user receives after completing an exercise.

Scores for a larger group of exercise takers conforms to a normal distribution or bell curve. So a specific score could be shown on a normal distribution chart (550 X 268) like the following:

nDist1.png

If the user's score is 2.55, could add a blue dot at the chart bottom to show that score:

nDist1dot.png

But the challenge is how to  script this so that the score's blue dot is dynamically added in runtime? I've measured the X pixel distance between -0.65 (a useful end point) and 4.15 (another good choice for end point) and it is 285 px. 1.75 is at the midpoint = 285/2 or 142.50 px (+- from -0.65 or 4.15).

So, based on placement of the image on stage, choosing the correct registration point, accounting for (measuring and subtracting) the x distance from registration point to -0.65 in this example, a blue dot could be placed below -0.65 if the score were -0.65, and so forth, by setting the bluedot.x and visibility = true. Something like that?

These numbers would vary for different graphs with different samples (different means and standard deviations), but the pixel width between +- 3 (standard deviations) can always be measured and hard-coded in as variables.

But the script formula? Whew! So far, haven't been able to get my brain around this. (Maybe can leverage some of this discussion? : http://forums.adobe.com/message/4717869#4717869)

Any help appreciated.

TOPICS
ActionScript
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 23, 2012 Sep 23, 2012

use paramF that i've shown you previously.  it defines parameters that are used to linearly interpolate between two values.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 23, 2012 Sep 23, 2012

Hi kglad,

Thanks for your reply.

In the final analysis, I was not able to get the range settings correct with the moving bar and param F.

As an example, if 1.75 is the "zero" point (mean) in a specific range of scores, and the standard deviation (SD) is .80 (like the bar graph above), then I am not sure what to use to set the min/max. If I set it as +-3 SD's (in this example, (min = -0.65 and max = +4.15), then small positive scores like .75 which are below the zero point (1.75)  make the bar go  down, but not as far as it should. I think this is because the "zero" point is 0 and not 1.75 as it should be.

A .75 score in this example is in the -2 SD range, which makes it a  highly negative score. Maybe, my design is defective and can't be used to contextualize and display a normal distribution score. If I had designed it correctly, a .75 should display a bar going far down, not even a little bit down.

So, I redesigned this to use an image of the normal distribution bar graph for a specific data set, and then to try to dynamically show the specific score on the bottom using placement of a blue dot (like the example, above). But how to set this up in script, using paramF, etc. is the same challenge as the bar design that has failed. (And, in placing the blue dot, no movement is needed: just having it show in the correct location along the bottom of the graph, so the score corresponds with the X location on the graph.)

Here is my last paramF script, with the new values added. It does drive the bar down, but only a small amount. Maybe there is some way to reset some value so that it would show a bigger down movement? However, please note that if paramF could be fixed and adapted to the blue dot placement and graph, it would be ScaleX, not ScaleY, since blue dot placement would change on the X axis, not Y.

paramF(-0.65,-1,4.15,1);

var tween1:Tween = new Tween(bar1_mc, "scaleY", Strong.easeOut, 0, m*Dprime1+b, 2, true);  // where bar1_mc is your bar display for DPrime1

function paramF(x1:Number,y1:Number,x2:Number,y2:Number){

    m = (y1-y2)/(x1-x2);

    b = y1-m*x1;

}

My best guess, as mentioned, is that my bar/column design to display this score as part of a normal distribution, is faulty, and a different  approach, like the normal distribution graph and placement of a blue  dot to display the score, if scripted successfully, may be a design that  succeeds.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 23, 2012 Sep 23, 2012

you want to use the values (1.75,142.5,4.15,285):

paramF(1.75,142,4.15,285);

you can determine the x-position of a user's score using:

bluedot.x = m*userscore+b;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 23, 2012 Sep 23, 2012

Hi kglad,

Thank you for this. I tried it out first without setting up the chart image, but it did move bluedot. So, I'll need to "play" with it, try to set up the image, choose a registration point, re-do measurements, then I can change, as needed, the  paramF parameters to better fit.

Much thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 23, 2012 Sep 23, 2012
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines