home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 145
/
MOBICLIC145.ISO
/
pc
/
DATA
/
DSS145
/
DSS145_12
/
DSS145_12.swf
/
scripts
/
dss145_12
/
Question.as
< prev
next >
Wrap
Text File
|
2012-07-19
|
1KB
|
47 lines
package dss145_12
{
public class Question
{
public var no:int;
public var idLM:String;
public var text:String;
public var reponses:Vector.<Reponse>;
public function Question()
{
this.reponses = new Vector.<Reponse>();
super();
}
public function melangerReponses() : void
{
var tri:Function = null;
tri = function(param1:Number, param2:Number):Number
{
return Number(Math.round(Math.random() * 2) - 1);
};
var _tab_alea:Array = [];
var i:int = 0;
while(i < this.reponses.length)
{
_tab_alea.push(i);
i++;
}
_tab_alea.sort(tri);
var _reponsesResult:Vector.<Reponse> = new Vector.<Reponse>();
var j:int = 0;
while(j < _tab_alea.length)
{
_reponsesResult.push(this.reponses[_tab_alea[j]]);
j++;
}
this.reponses = _reponsesResult;
}
}
}