Index: js/human_3d_alignment/src/index.jsx
===================================================================
--- js/human_3d_alignment/src/index.jsx	(revision 942)
+++ js/human_3d_alignment/src/index.jsx	(revision 964)
@@ -4,4 +4,5 @@
 import React from 'react';
 import Genotypes from './utils/genotypes';
+import GenotypeParser from './utils/genotypeparser';
 import TitlePanel from './viewskeleton/titlepanel';
 import WidgetsContainer from './viewskeleton/widgetscontainer';
@@ -13,5 +14,5 @@
 import EndViewer from './widgets/endviewer';
 
-const ROUNDS = 15;
+const ROUNDS = 6;
 
 const styles = {
@@ -93,5 +94,7 @@
             selectedSportYears: {value: "empty", label: " "},
             selectedSportHours: {value: "empty", label: " "},
-            selectedSportType: {value: "empty", label: " "},
+            selectedSportStrength: {value: "empty", label: " "},
+            selectedSportCardio: {value: "empty", label: " "},
+            selectedSportIntellect: {value: "empty", label: " "},
             selectedCons: {value: "empty", label: " "},
             selectedCalculations: {value: "empty", label: " "},
@@ -105,5 +108,11 @@
             controlMode: 'translate',
             blockView: true,
-            result: ''
+            result: '',
+            random: false,
+            sequence1: [0, 2, 1, 2, 11, 2],
+            sequence2: [12, 11, 7, 3, 10, 10],
+            sequence_len: 6,
+            sequence_pos: 0,
+            textValue: ''
         };
 
@@ -135,9 +144,12 @@
         this.handleChangeSportYears = this.handleChangeSportYears.bind(this);
         this.handleChangeSportHours = this.handleChangeSportHours.bind(this);
-        this.handleChangeSportType = this.handleChangeSportType.bind(this);
+        this.handleChangeStrengthPercent = this.handleChangeStrengthPercent.bind(this);
+        this.handleChangeCardioPercent = this.handleChangeCardioPercent.bind(this);
+        this.handleChangeIntellectPercent = this.handleChangeIntellectPercent.bind(this);
         this.handleChangeCons = this.handleChangeCons.bind(this);
         this.handleChangeCalculations = this.handleChangeCalculations.bind(this);
         this.handleChangeNavigation = this.handleChangeNavigation.bind(this);
         this.handleChangePercent = this.handleChangePercent.bind(this);
+        this.handleChangeText = this.handleChangeText.bind(this);
         this.handleChangeStartTime = this.handleChangeStartTime.bind(this);
         this.handleChangeFitHeight = this.handleChangeFitHeight.bind(this);
@@ -173,5 +185,5 @@
         this.genotypes = new Genotypes(this, "https://raw.githubusercontent.com/arturolejnik95/human_3d_alignment/master/walking.gen");   //load text from file to this.genotypes
         //or another URL...
-        let head = "'User ID'|'User IP'|'Gender'|'Year of birth'|'Handeness'|'Sleep hours'|'Sleep hours today'|'YearsGamePlaying'|'HoursGamePlaying'|'Musical experience'|'MusicalDuration'|'Languages'|'SportYears'|'SportHours'|'SportType'|'Cons'|'Calculations'|'Navigation'|'Start time'|'Stop time'|'Position of 1st'|'Position of 2nd'|'Rotation of 1st'|'Rotation of 2nd'|'ID 1st'|'ID 2nd'|'Fit'|'Result'\n"
+        let head = "'User ID'|'User IP'|'Gender'|'Year of birth'|'Handeness'|'Sleep hours'|'Sleep hours today'|'YearsGamePlaying'|'HoursGamePlaying'|'Musical experience'|'MusicalDuration'|'Languages'|'SportYears'|'SportHours'|'StrengthPercent'|'CardioPercent'|'IntellectPercent'|'Cons'|'Calculations'|'Navigation'|'Start time'|'Stop time'|'Position of 1st'|'Position of 2nd'|'Rotation of 1st'|'Rotation of 2nd'|'ID 1st'|'ID 2nd'|'Fit'|'Result'|'Reason|\n"
         this.handleChangeResult(head);
     }
@@ -246,5 +258,7 @@
                     this.state.selectedSportYears.value + '|' +
                     this.state.selectedSportHours.value + '|' +
-                    this.state.selectedSportType.value + '|' +
+                    this.state.selectedSportStrength.value + '|' +
+                    this.state.selectedSportCardio.value + '|' +
+                    this.state.selectedSportIntellect.value + '|' +
                     this.state.selectedCons.value + '|' +
                     this.state.selectedCalculations.value + '|' +
@@ -267,5 +281,5 @@
             }
         }
-        fit = fit + '|' + this.state.percent + '\n';
+        fit = fit + '|' + this.state.percent + '|' + this.state.textValue.split("|").join(","); + '\n';
 
         this.sendToServer(fit);
@@ -310,65 +324,83 @@
      */
     loadNewGenotypes() {
-        //Firstly it chooses pair of genotypes that user doesnt used before
-        let rand1, rand2, amount1, amount2, gen1, gen2;
-
-        do {
-            rand1 = 0, rand2 = 0;
-            do  {
-                while (rand1 == rand2) {
-                    rand1 = Math.floor(Math.random() * this.state.genotypes);
-                    rand2 = Math.floor(Math.random() * this.state.genotypes);
-                }
-            } while (this.state.pairs.includes([rand1, rand2]) || this.state.pairs.includes([rand2, rand1]));
-
-            //This part load genotypes to the state
-            gen1 = this.genotypes.genotype[rand1];
-            gen2 = this.genotypes.genotype[rand2];
-            amount1 = gen1.split('').filter(function(sign){return sign === 'X'}).length;
-            amount2 = gen2.split('').filter(function(sign){return sign === 'X'}).length;
-            if (amount1 > 0) {
-                amount1++;
-            }
-            if (amount2 > 0) {
-                amount2++
-            }
-        } while (amount1 > 52 || amount2 > 52);
-
-        let newpairs = this.state.pairs;
-        if (amount1 <= amount2) {
-            newpairs.push([rand1, rand2]);
-            this.setState({ genotype1: gen1, genotype2: gen2 }, function() {
-                console.log(`Genotypes: `, this.state.genotype1, this.state.genotype2);
-            });
-            this.setState({parts1: amount1, parts2: amount2}, function() {
-                console.log(this.state.parts1 + ' ' + this.state.parts2);
-            });
-        } else {
-            newpairs.push([rand2, rand1]);
-            this.setState({ genotype1: gen2, genotype2: gen1 }, function() {
-                console.log(`Genotypes: `, this.state.genotype1, this.state.genotype2);
-            });
-            this.setState({parts1: amount2, parts2: amount1}, function() {
-                console.log(this.state.parts1 + ' ' + this.state.parts2);
-            });
-        }
-        this.setState({ pairs: newpairs }, function() {
-            console.log(`Pairs: `, this.state.pairs);
-        });
-
-        //Load tables of selected parts in fitviewer
-        let min = Math.min(amount1, amount2);
-        let s1 = [];
-        let s2 = [];
-        for (let i = 0; i < min; i++) {
-            s1.push((i+1).toString());
-            s2.push(' ');
-        }
-
-        //Start new round and load to state tables of selected and round
-        let r = this.state.round + 1;
-        this.setState({ round: r, selected1: s1, selected2: s2}, function() {
-            console.log(`Round and state `, this.state.round + '. ' + this.state.selected1 + ' ' + this.state.selected2);
-        });
+          
+               //Firstly it chooses pair of genotypes that user doesnt used before
+               let rand1, rand2, amount1, amount2, gen1, gen2;
+
+               do {
+                    if (this.state.random)
+                    {
+                         rand1 = 0, rand2 = 0;
+                         do  {
+                              while (rand1 == rand2) {
+                                   rand1 = Math.floor(Math.random() * this.state.genotypes);
+                                   rand2 = Math.floor(Math.random() * this.state.genotypes);
+                              }
+                         } while (this.state.pairs.includes([rand1, rand2]) || this.state.pairs.includes([rand2, rand1]));
+                    }
+                    else
+                    {
+                         if (this.state.sequence_pos==this.state.sequence_len)
+                         {
+                              this.onClickFinish();
+                         }
+                         else
+                         {
+                              rand1 = this.state.sequence1[this.state.sequence_pos];
+                              rand2 = this.state.sequence2[this.state.sequence_pos];
+							  this.setState({ sequence_pos: this.state.sequence_pos + 1 }, function() {
+                              });
+							  console.log("state", this.state.sequence_pos);
+                         }
+                    }
+
+                    //This part load genotypes to the state
+                    gen1 = this.genotypes.genotype[rand1];
+                    gen2 = this.genotypes.genotype[rand2];
+                    
+                    let model1 = GenotypeParser.getModelFromGenotype(gen1);
+                    let model2 = GenotypeParser.getModelFromGenotype(gen2);
+                    
+                    amount1 = model1.getPartCount();
+                    amount2 = model2.getPartCount();
+     
+               } while (amount1 > 52 || amount2 > 52);
+
+               let newpairs = this.state.pairs;
+               if (amount1 <= amount2) {
+                    newpairs.push([rand1, rand2]);
+                    this.setState({ genotype1: gen1, genotype2: gen2 }, function() {
+                         console.log(`Genotypes: `, this.state.genotype1, this.state.genotype2);
+                    });
+                    this.setState({parts1: amount1, parts2: amount2}, function() {
+                         console.log(this.state.parts1 + ' ' + this.state.parts2);
+                    });
+               } else {
+                    newpairs.push([rand2, rand1]);
+                    this.setState({ genotype1: gen2, genotype2: gen1 }, function() {
+                         console.log(`Genotypes: `, this.state.genotype1, this.state.genotype2);
+                    });
+                    this.setState({parts1: amount2, parts2: amount1}, function() {
+                         console.log(this.state.parts1 + ' ' + this.state.parts2);
+                    });
+               }
+               this.setState({ pairs: newpairs }, function() {
+                    console.log(`Pairs: `, this.state.pairs);
+               });
+
+               //Load tables of selected parts in fitviewer
+               let min = Math.min(amount1, amount2);
+               let s1 = [];
+               let s2 = [];
+               for (let i = 0; i < min; i++) {
+                    s1.push((i+1).toString());
+                    s2.push(' ');
+               }
+
+               //Start new round and load to state tables of selected and round
+               let r = this.state.round + 1;
+               this.setState({ round: r, selected1: s1, selected2: s2}, function() {
+                    console.log(`Round and state `, this.state.round + '. ' + this.state.selected1 + ' ' + this.state.selected2);
+               });
     }
 
@@ -377,5 +409,5 @@
      */
     isReady() {
-        if (this.state.selectedSportType.value != 'empty' && this.state.selectedYearsGamePlaying.value != 'empty' && this.state.selectedHoursGamePlaying.value != 'empty' && this.state.selectedMusicalDuration.value != 'empty' && this.state.selectedLanguages.value != 'empty' && this.state.selectedSportYears.value != 'empty' && this.state.selectedSportHours.value != 'empty' && this.state.selectedCons.value != 'empty' && this.state.selectedCalculations.value != 'empty' && this.state.selectedNavigation.value != 'empty' && this.state.selectedMusicalExperience.value != 'empty' && this.state.selectedGender.value != 'empty' && this.state.selectedSleepHoursToday.value != 'empty' && this.state.selectedSleepHours.value != 'empty' && this.state.selectedHand.value != 'empty' && this.state.selectedYear.value != 'empty' && this.state.sliderUpdated) {
+        if (this.state.textValue && this.state.selectedSportIntellect.value != 'empty' && this.state.selectedSportCardio.value != 'empty' && this.state.selectedSportStrength.value != 'empty' && this.state.selectedYearsGamePlaying.value != 'empty' && this.state.selectedHoursGamePlaying.value != 'empty' && this.state.selectedMusicalDuration.value != 'empty' && this.state.selectedLanguages.value != 'empty' && this.state.selectedSportYears.value != 'empty' && this.state.selectedSportHours.value != 'empty' && this.state.selectedCons.value != 'empty' && this.state.selectedCalculations.value != 'empty' && this.state.selectedNavigation.value != 'empty' && this.state.selectedMusicalExperience.value != 'empty' && this.state.selectedGender.value != 'empty' && this.state.selectedSleepHoursToday.value != 'empty' && this.state.selectedSleepHours.value != 'empty' && this.state.selectedHand.value != 'empty' && this.state.selectedYear.value != 'empty' && this.state.sliderUpdated) {
             this.setState({isDisable: false}, function() {
                 console.log(this.state.isDisable);
@@ -442,14 +474,36 @@
      /**
      * Allow to change sport type in state
-     * @param {string} sport type choosed sport type by user in listbox 
-     */
-    handleChangeSportType(sporttype) {
-        this.setState({ selectedSportType: sporttype }, function() {
-            console.log(`Sport type selected:`, this.state.selectedSportType);
-            this.isReady();
-        });
-    };
-    
-	 /**
+     * @param {Integer} sporttype choosed strenght component
+     */
+    handleChangeStrengthPercent(sporttype) {
+        this.setState({ selectedSportStrength: sporttype }, function() {
+            console.log(`Sport type selected:`, this.state.selectedSportStrength);
+            this.isReady();
+        });
+    };
+     
+     /**
+     * Allow to change sport type in state
+     * @param {Integer} sporttype choosed cardio component 
+     */
+    handleChangeCardioPercent(sporttype) {
+        this.setState({ selectedSportCardio: sporttype }, function() {
+            console.log(`Sport type selected:`, this.state.selectedSportCardio);
+            this.isReady();
+        });
+    };
+     
+     /**
+     * Allow to change sport type in state
+     * @param {Integer} sporttype choosed intellect component
+     */
+    handleChangeIntellectPercent(sporttype) {
+        this.setState({ selectedSportIntellect: sporttype }, function() {
+            console.log(`Sport type selected:`, this.state.selectedSportIntellect);
+            this.isReady();
+        });
+    };
+    
+     /**
      * Allow to years game playing type in state
      * @param {string} gameyp type choosed years game playing by user in listbox 
@@ -462,5 +516,5 @@
     };
 
-	 /**
+     /**
      * Allow to hours game playing type in state
      * @param {string} gamehp type choosed hours game playing by user in listbox 
@@ -643,4 +697,15 @@
         this.setState({ percent: per, sliderUpdated: true }, function() {
             console.log('Percent selected: ' + this.state.percent + ' ' + this.state.sliderUpdated);
+            this.isReady();
+        });
+    }
+     
+     /**
+     * Allow to change text area in state
+     * @param {string} per text input
+     */
+    handleChangeText(per) {
+        this.setState({ textValue: per }, function() {
+            console.log('Text value: ' + this.state.textValue);
             this.isReady();
         });
@@ -867,5 +932,7 @@
                             handleChangeSleepHoursToday = {(hours) => {this.handleChangeSleepHoursToday(hours)}}                            
                             handleChangeGender = {(gen) => {this.handleChangeGender(gen)}}
-                            handleChangeSportType = {(gen) => {this.handleChangeSportType(gen)}}
+                            handleChangeStrengthPercent = {(gen) => {this.handleChangeStrengthPercent(gen)}}
+                            handleChangeCardioPercent = {(gen) => {this.handleChangeCardioPercent(gen)}}
+                            handleChangeIntellectPercent = {(gen) => {this.handleChangeIntellectPercent(gen)}}
                             handleChangeMusicalExperience = {(gen) => {this.handleChangeMusicalExperience(gen)}}
                             handleChangeHand = {(hand) => {this.handleChangeHand(hand)}}
@@ -904,4 +971,5 @@
                             onClickNext = {() => {this.onClickNext()}}
                             onClickFinish = {() => {this.onClickFinish()}}
+                            handleChangeText = {(per) => {this.handleChangeText(per)}}
                             handleChangePercent = {(per) => {this.handleChangePercent(per)}}/>,
                         i: "" + i + 'sliderviewer',
