import React, { Component } from 'react'
import { connect } from 'react-redux'

import {RadioButton, RadioButtonGroup} from 'material-ui/RadioButton'
import RaisedButton from 'material-ui/RaisedButton'
import SwipeableViews from 'react-swipeable-views'
import { Card, CardText } from 'material-ui/Card'

import { nextQuestion } from './actions'
import Subjects from 'components/Subjects'
import EvaluationAxis from 'components/EvaluationAxis'

const mapStateToProps = ({ sequence, qswap }) => ({
  sequence, qswap 
})

class Experiment extends Component {
  constructor(props) {
    super(props)
    this.state = {
      slideIndex: 0
    }
  }

  next(value) {
    const{ dispatch } = this.props
    dispatch(nextQuestion(value))
    this.setState({
      slideIndex: 1
    })
  }
  
  render() {
    const { sequence, qswap } = this.props
    return (sequence == "question1")?
      <Card><CardText>
          <p>{JSON.stringify(Subjects)}</p>
          <p>{JSON.stringify(EvaluationAxis)}</p>
          <p>{sequence}</p>
      </CardText></Card>
      : <Card><CardText><p>実験終了（ほかの人が終わるまでお待ちください）</p></CardText></Card>
  }
}

export default connect(mapStateToProps)(Experiment)

@@ -775,18 +775,16 @@
  %7D)%0A  %7D%0A
-  
 %0A  rende
@@ -843,16 +843,17 @@
  return 
+(
 (sequenc
@@ -879,24 +879,33 @@
       %3CCard%3E
+%0A        
 %3CCardText%3E%0A 
@@ -1031,16 +1031,18 @@
 %3E%0A      
+  
 %3C/CardTe
@@ -1048,96 +1048,596 @@
 ext%3E
-%3C/Card%3E%0A      : %3CCard%3E%3CCardText%3E%3Cp%3E%E5%AE%9F%E9%A8%93%E7%B5%82%E4%BA%86%EF%BC%88%E3%81%BB%E3%81%8B%E3%81%AE%E4%BA%BA%E3%81%8C%E7%B5%82%E3%82%8F%E3%82%8B%E3%81%BE%E3%81%A7%E3%81%8A%E5%BE%85%E3%81%A1%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%EF%BC%89%3C/p%3E%3C/CardText%3E%3C/Card%3E%0A  %7D%0A%7D%0A%0A
+%0A        %3CRaisedButton label=%22next%22 onClick=%7Bthis.next.bind(this, 1)%7D/%3E%0A        %3C/Card%3E%0A        :(sequence == %22question2%22)?%0A        %3CCard%3E%0A          %3CCardText%3E%0A            %3Cp%3E%7BJSON.stringify(Subjects)%7D%3C/p%3E%0A            %3Cp%3E%7BJSON.stringify(EvaluationAxis)%7D%3C/p%3E%0A            %3Cp%3E%7Bsequence%7D%3C/p%3E%0A          %3C/CardText%3E%0A        %3CRaisedButton label=%22next%22 onClick=%7Bthis.next.bind(this, 1)%7D/%3E%0A          %3C/Card%3E%0A          :%0A          %3CCard%3E%0A            %3CCardText%3E%0A              %3Cp%3Eparticipants/Experiment.js%3C/p%3E%0A            %3C/CardText%3E%0A          %3C/Card%3E%0A          )%0A          %7D%0A          %7D%0A%0A          
 expo

divide-experiment is successful