Picture of Adam Laird
Custom drag to correct rank component required immediatly
by Adam Laird - Tuesday, 29 September 2015, 8:03 AM
 

Hi there I need a custom question component which is a question with 5 answers that need to be ordered in the correct position in order of priority.

Really need this ASAP otherwise will have to use flash again

All the scoring is already worked out the algorithm would work as follows

Max score per question = 20

positionValue array = (-2,-1,0,1,2)

correct answer position 1,2,3,4,5

_scoringValue = 2;

for each ( var value:String in question.correctAnswerPositions )
{if ( answer.position == value )
    {answer.scoringValue = _scoringValue;}
    _scoringValue --;
}

which would of course give you a corresponding scoring value of 2,1,0,-1,-2

you then:

answerScore = answer.scoringValue + positionValue[i];

if (answerScore<0) answerScore = answerScore*-1;

questionScore = questionScore - answerScore;

Please message me as soon as possible if you can assist