/* -----------------------------------------------------------------------------

SpeakingSlideController

----------------------------------------------------------------------------- */
SpeakingSlideController = Class.extend(
  SlideController,
  {

    //プロパティ----------------------------------------------------------------
    className   : "SpeakingSlideController",
    context     : {},           //initialize時必須
    type        : "",           //initialize時必須
    slidenumber : "",           //initialize時必須
    slideid     : "",           //initialize時必須
    template    : "",           //initialize時必須

    mode        : "challenge",  // challenge|review
    nextflash : "",

    user_id         : undefined,
    answersheet_id  : undefined,

    examNo          : 0,
    part            : 0,
    major           : 0,

    recorderObject  : undefined,
    recFileName     : undefined,

    recTime         : 0,        //録音時間
    ttime           : 0,        //ThinkingTime(PreparationTime)
    rtime           : 0,        //ResponseTime(実際の録音時間はrecTime)


    //※以下はタイプがquestion以外のSlideでは無効なプロパティ
    q_no        : "",         //initialize時必須
    data        : {},

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {
      this.parent( slideId );
      this.slideContent = $("div", $("#" + slideId));
    },

    //全スライド共通初期化処理
    commonInitialize: function(slideId,param) {

      this.parent( slideId );
      this.template = param.template;

      if( param.type != "" ){
        this.type     = param.type;
      }

      this.slidenumber    = param.slide_number;
      this.slideid        = slideId;
      this.data           = param.data;

      this.user_id        = param.user_id;
      this.answersheet_id = param.answersheet_id;
      this.examNo         = param.data.num;
      this.part           = param.data.part;
      this.major          = param.data.major;
      this.minor          = param.data.minor;

    },

    //指定桁数でゼロパディングするメソッド
    zeroPadding: function( targetNumber, digitNum ) {

      var tempNum = Math.pow( 10, digitNum ) + Number( targetNumber );

      tempNum = String(tempNum).slice(1);

      return tempNum;

    },

    //全スライド共通Play
    commonPlay: function() {

      if( this.recorderObject == undefined ){

       this.recorderObject = new FCSRecorder();

      }

    },

    setContext: function( context ){
      //Slideを統べる親クラス（Context）をセット
      //  ※SlideからContextにはcontext.notifyメソッド経由で通知すること

      this.context = context;

    },

    play: function(){
      //このSlideを表示するときにContextから呼ばれるメソッドです

      alert("この機能は未実装です：play");

    },

    stop: function(){
      //このSlideを抜けるときにContextから呼ばれるメソッドです

      alert("この機能は未実装です：stop");

    },

    dispQuestion: function(){

      alert("この機能は未実装です：dispQuestion");

      this.context.notify('thinking');

    },

    //進捗・成績の操作---------------------------------------------------------
    setFinish: function(){

      r.done();

    },

    setResult: function(){
      //※注　このメソッドはページが移動するときにContextのgoNextUrlからも呼び出されます

      if( this.recFileName ){

        r.user_answer( this.recFileName );

      }
      return r.push();

    },

    setCurrentResult: function(){
      //非同期通信でカレントスライドの成績・進捗を更新する。スライドのstopなど、ページ遷移を伴わない場合のみ使用可能
      if( this.recFileName ){
        
        r.user_answer( this.recFileName );

      }
      r.push_current();
    },

    //Timerの操作-----------------------------------------------------------
    showTimer: function(){
      this.context.components["timer"].show();
    },
    hideTimer: function(){
      this.context.components["timer"].hide();
    },
    showTimerCounter: function(){
      //TimerCounterのshow
      $("#timer_diplay").show();
    },
    hideTimerCounter: function(){
      //TimerCounterのhide
      $("#timer_diplay").hide();
    },

    //Flashの操作-----------------------------------------------------------
    playFlashMovie: function(){
      //該当typeのクラスメソッドを参照してください

      alert("この機能は未実装です：playFlashMovie");

    },

    stopFlashMovie: function(){

      var player_area_id = this.slideid+"_FlvPlayer";
      $("#"+player_area_id).html("");

    },

    createPlaySoundFileName: function(){

      var l_ExamNo      = this.zeroPadding(this.examNo, 2);
      var l_Part        = this.zeroPadding(this.part,   2);
      var l_Major       = this.zeroPadding(this.major,  2);
      var l_Minor       = this.zeroPadding(this.minor,   3);

      //this.playSoundBaseFileName  = "00-S-00-00-000"
      this.playSoundBaseFileName    = l_ExamNo + "-S-" + l_Part + "-" + l_Major + "-" + l_Minor;

    },

    playSound: function(){
      //該当typeのクラスメソッドを参照してください

      alert("この機能は未実装です：playSound");

    },

    playQuestionSound: function(){

      //出題テキストを表示
      $("#"+this.slideid+" .question").show();

      this.nextflash = "question";

      var playlist = [
        {
          "name" : "list",
          "value": [
            {
               path:static_path+"mp3/exam/" + this.playSoundBaseFileName +".mp3"
            }
          ]
        },
        {
            "name" : "autoplay",
            "value": true
        }
      ]

      createMP3Player( this, playlist );
    },


    stopSound: function(){

      //音声を削除
      $("#MP3PlayerArea").html("");

    },


    stopRehearsalSound: function(){
      //rehearsalのスライドで冒頭の説明音声が終わった後の処理をする

      //rehearsal音声を削除
      $("#MP3PlayerArea").html("");

      //通常はFCS_rec.swf、PlaybackResponseのときはFCS_playback.swfを生成する
      if( c.notify('isRecording') ){
        this.dispRecorder();
      }
      else{
        this.dispPlayback();
      }

    },

    stopQuestionSound: function(){
      //questionのスライドで冒頭のquestion音声が終わった後の処理をする

      //question音声を削除
      $("#MP3PlayerArea").html("");

      //通常はFCS_rec.swf、PlaybackResponseのときはFCS_playback.swfを生成する
      if( c.notify('isRecording') ){
        this.dispRecorder();
      }
      else{
        this.dispPlayback();
      }

    },
  
  
    //-------------------------------------------------------------------------
    //FlashProxyから再生終了通知を受け取るメソッド
    //  ※現在再生中のSWF・MP3が終了したときに呼ばれるメソッドです
    flashComplete: function(){

      switch( this.nextflash ){

        case "loopsound":
          //ループ音声を再生 ※VolumeCheckのみ
          this.stopFlashMovie();
          this.playLoopSound();
          break;

        case "q_sound":
          //Flv終了後、問題音声を再生
          this.stopFlashMovie();
          this.playQuestionSound();
          break;

        case "rehearsal":
          //音声終了後録音テストを表示
          this.stopRehearsalSound();
          break;

        case "question":
          //音声終了後問題を表示　※questionのみ
          this.stopQuestionSound();
          break;

        case "nextslide":
          //音声終了後自動で次のスライドへ
          this.stopFlashMovie();
          this.stopSound();
          this.context.notify('next');
          break;

        case "nextslide_for_sectiondirection":
          //音声終了後次のスライドへ移動せず待機、continueボタンON
          this.stopSound();
          this.context.notify('sectionDirectionEnd');
          break;

        case "startTimer":
          //音声終了後タイマー起動
          this.context.notify('startTimer');
          break;

        case "startPassageTimer":
          //音声終了後タイマー起動
          this.context.components["timer"].show();
          this.context.components["timer"].reset( '45000' );
          this.context.components["timer"].start( this.context.currentSlide );
          break;

        default:
          //なにもしない
          break;

      }

    },


    //-------------------------------------------------------------------------
    //FCS Recording and Playback関連
    //-------------------------------------------------------------------------
    createRecFileName: function(){

      var l_UserId      = this.user_id;
      
      var l_AnswerSheet = "0";
      if( this.answersheet_id ){
        l_AnswerSheet = this.answersheet_id;
      }
      var l_ExamNo      = this.zeroPadding(this.examNo,2);
      var l_Part        = this.zeroPadding(this.part,2);
      var l_Major       = this.zeroPadding(this.major,2);
      var l_Minor       = this.zeroPadding(this.minor,3);

//    this.recFileName = "debug/0-00-S-00-00-000";
      this.recFileName = l_UserId + "/" + l_AnswerSheet + "-" + l_ExamNo + "-S-" + l_Part + "-" + l_Major + "-" + l_Minor;

    },
    
    dispRecorder: function(){

      $("#"+this.slideid+" .recordingtime").show();

      var recorderParam = {
        client            : this,
        lcId              : "FCSRecorder",

        call_back         : 'eval(finishRec())',
        src               : 'local',
        svr               : FCS_SERVER_NAME,
        user              : this.recFileName,
        ttime             : 5,
        rtime             : 15,
        token             : FCS_TOKEN,
        recorder_area_id  : undefined
      }

      if( this.minor ){
        recorderParam.recorder_area_id = "FCSRecorder_"+this.minor;

        switch(this.template){
          case "type_tq":
            recorderParam.ttime=15;
            recorderParam.rtime=45;
            break;
          case "type_tsq":
            recorderParam.ttime=30;
            recorderParam.rtime=60;
            break;
          case "type_sq":
            recorderParam.ttime=20;
            recorderParam.rtime=60;
            break;
          default:
            recorderParam.ttime=0;
            recorderParam.rtime=15;
            break;
        }
      }
      else{
        recorderParam.recorder_area_id = "FCSRecorder_0";
        recorderParam.ttime=0;
        recorderParam.rtime=15;
      }

      this.ttime = recorderParam.ttime;
      this.rtime = recorderParam.rtime;

      this.startRec(recorderParam);

    },

    dispPlayback: function(){

      this.startPlayback();

    },

    startRec: function(recorderParam){

      this.recorderObject.createRecorder(recorderParam);

    },

    finishRec: function( recTime ){
      //speaking.htmlのfinishRecordingからも呼ばれます　AS→JS

      $("#"+this.slideid+" .recordingtime").hide();
      this.recorderObject.deleteRecorder();

      //録音した時間を成績に記録
      recTime = Math.round( Number(recTime) );
      //BEEPの時間も録音時間に含まれてしまうため制限時間いっぱいまで録音したときは表示上は制限時間オーバーとなります。そのため制限時間オーバー分の録音は制限時間いっぱいとして記録します。
      if( recTime > this.rtime ){
        r.elapsed_time( this.rtime );
      }
      else{
        r.elapsed_time( recTime );
      }

      c.notify("next");

    },


    startPlayback: function(){

      var playbackParam = {
        client            : this,
        lcId              : "FCSRecorder", //LocalConnection接続制限？のためlcIdは"FCSRecorder"で代用

        call_back         : 'eval(finishPlayback())',
        src               : 'local',
        svr               : FCS_SERVER_NAME,
        user              : this.recFileName,
        ttime             : undefined,
        rtime             : undefined,
        token             : FCS_TOKEN,
        recorder_area_id  : undefined,
        playback_area_id  : undefined,
        playbackmode      : "normal"
      }

      if( this.minor ){
        playbackParam.playback_area_id = "FCSPlayback_"+this.minor;
      }
      else{
        playbackParam.playback_area_id = "FCSPlayback_0";
      }

      this.recorderObject.createPlayback(playbackParam);

    },

    finishPlayback: function(){

      this.recorderObject.deletePlayback();
      //alert("SpeakingSlideController.finishPlayback");

      c.notify("next");

    }

  }
);


/* -----------------------------------------------------------------------------

SpeakingSlideController_Intro

----------------------------------------------------------------------------- */
SpeakingSlideController_Intro = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_Intro",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      //全スライド共通初期化処理
      this.commonInitialize(slideId,param);
      
    },

    play: function(){

      this.commonPlay();

      //タイマー停止
      //this.context.components["timer"].pauseTimer();

      //Timerエリアの非表示
      this.hideTimer();

    },

    stop: function(){

    }

  }
);

/* -----------------------------------------------------------------------------

SpeakingSlideController_recordingSetting

----------------------------------------------------------------------------- */
SpeakingSlideController_recordingSetting = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_recordingSetting",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      //全スライド共通初期化処理
      this.commonInitialize(slideId,param);

    },

    play: function(){

      this.commonPlay();

      var playbackParam = {
        client            : this,
        setting_area      : "FCSSetting"
      }
      this.recorderObject.createRecorderSetting(playbackParam);
      
    },

    stop: function(){

    }
    
  }
);


/* -----------------------------------------------------------------------------

SpeakingSlideController_rehearsal

----------------------------------------------------------------------------- */
SpeakingSlideController_rehearsal = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_rehearsal",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      //全スライド共通初期化処理
      this.commonInitialize(slideId,param);

    },

    play: function(){

      this.commonPlay();
      this.recFileName = this.user_id + "/0-00-S-00-00-000";

      if( !c.notify('isRecording') || c.notify('isRecordAgain') ){
        //isRecordingではなく、もしくはisRecordAgainのときは質問音声は流さない
        this.stopQuestionSound();
      }
      else{
        this.playSound();
      }

    },

    stop: function(){

      this.stopSound();

      if( this.recorderObject != undefined ){

        this.recorderObject.deleteRecorder();

      }

    },


    playSound: function(){

      this.nextflash = "question";

      var playlist = [
        {
          "name" : "list",
          "value": [
            {
               path:static_path+"mp3/exam/Dir3-4.mp3"
            },
            {
               path:static_path+"mp3/exam/Dir3-5.mp3"
            }
          ]
        },
        {
            "name" : "autoplay",
            "value": true
        }
      ]

      createMP3Player( this, playlist );

    },

    finishRec: function(){

      c.notify("next");

    }

  }
);


/* -----------------------------------------------------------------------------

SpeakingSlideController_rehearsalEnd

----------------------------------------------------------------------------- */
SpeakingSlideController_rehearsalEnd = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_rehearsalEnd",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      //全スライド共通初期化処理
      this.commonInitialize(slideId,param);

    },

    play: function(){

      this.commonPlay();

    },

    stop: function(){

    }

  }
);



/* -----------------------------------------------------------------------------

SpeakingSlideController_sectionDirection

----------------------------------------------------------------------------- */
SpeakingSlideController_sectionDirection = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_sectionDirection",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      this.commonInitialize(slideId,param);

      this.examNo = param.exam;
      this.part   = param.part;
      this.major  = param.major;
      this.minor  = param.minor;

    },

    play: function(){

      this.commonPlay();
      this.playSound();

    },

    stop: function(){

      this.stopSound();

    },

    playSound: function(){
      this.nextflash = "nextslide_for_sectiondirection";

      var playlist = [
        {
          "name" : "list",
          "value": [
            {
               path:static_path+"mp3/exam/Dir3-2.mp3"
            }
          ]
        },
        {
            "name" : "autoplay",
            "value": true
        }
      ]

      createMP3Player( this, playlist );
    }

  }

);



/* -----------------------------------------------------------------------------

SpeakingSlideController_Direction

----------------------------------------------------------------------------- */
SpeakingSlideController_Direction = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_Direction",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      this.commonInitialize(slideId,param);
      this.examNo = param.exam;
      this.part   = param.part;
      this.major  = param.major;
      this.minor  = param.minor;

    },

    play: function(){

      this.commonPlay();
      this.createPlaySoundFileName();
      r.seek(this.minor-1);
      this.playSound();

    },

    stop: function(){

      this.stopSound();

    },

    playSound: function(){
      this.nextflash = "nextslide";

      var playlist = [
        {
          "name" : "list",
          "value": [
            {
               path:static_path+"mp3/exam/" + this.playSoundBaseFileName +"-direction1.mp3"
            }
          ]
        },
        {
            "name" : "autoplay",
            "value": true
        }
      ]

      createMP3Player( this, playlist );
    }

  }

);


/* -----------------------------------------------------------------------------

SpeakingSlideController_Passage

----------------------------------------------------------------------------- */
SpeakingSlideController_Passage = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_Passage",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      this.commonInitialize(slideId,param);
      this.examNo = param.exam;
      this.part   = param.part;
      this.major  = param.major;
      this.minor  = param.minor;

    },

    play: function(){

      this.commonPlay();
      this.createPlaySoundFileName();
      this.nextflash = "startPassageTimer";

      var playlist = [
        {
          "name" : "list",
          "value": [
            {
              path:static_path+"mp3/exam/" + this.playSoundBaseFileName + "-before_issue_r.mp3"
            }
          ]
        },
        {
            "name" : "autoplay",
            "value": true
        }
      ]

      createMP3Player( this, playlist );
      
    },

    finishCountdown : function(){

      this.nextflash = "nextslide";

      var playlist = [
        {
          "name" : "list",
          "value": [
            {
              path:static_path+"mp3/exam/" + this.playSoundBaseFileName + "-direction2.mp3"
            }
          ]
        },
        {
            "name" : "autoplay",
            "value": true
        }
      ]

      createMP3Player( this, playlist );

    },

    stop: function(){

      //タイマーが残っていた場合のためリセット
      this.context.components["timer"].hide();
      this.context.components["timer"].reset( '0' );

      this.stopSound();

    },
    
    startTimer: function(){

      //alert("SpeakingSlideController_Passage StartTimer");

    },
    
    timeout: function(){
      //CountdownComponentの終了で呼ばれるメソッド

      this.finishCountdown();

    }

  }
);


/* -----------------------------------------------------------------------------

SpeakingSlideController_Listening

----------------------------------------------------------------------------- */
SpeakingSlideController_Listening = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      //全スライド共通初期化処理
      this.commonInitialize(slideId,param);
      this.examNo = param.exam;
      this.part   = param.part;
      this.major  = param.major;
      this.minor  = param.minor;

    },

    play: function(){

      this.playFlashMovie();

    },

    stop: function(){

      this.stopFlashMovie();

    },

    playFlashMovie: function(){

      this.nextflash = "nextslide";
      var player_area_id = this.slideid+"_FlvPlayer";

      var tempExamNo = String("0"+this.examNo).slice(-2);
      var tempPart   = String("0"+this.part).slice(-2);
      var tempMajor  = String("0"+this.major).slice(-2);
      var tempMinor  = String("00"+this.minor).slice(-3);

      var filename = tempExamNo + '-S-' + tempPart + '-' + tempMajor + '-' + tempMinor + '-issue_l.swf';

      createFlvPlayer(this,player_area_id,filename);

    }
    
  }
);



/* -----------------------------------------------------------------------------

SpeakingSlideController_Preparation

----------------------------------------------------------------------------- */
SpeakingSlideController_Preparation = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_Preparation",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      //全スライド共通初期化処理
      this.commonInitialize(slideId,param);
      this.examNo = param.exam;
      this.part   = param.part;
      this.major  = param.major;
      this.minor  = param.minor;
      this.timerId;

    },

    play: function(){
 
      this.commonPlay();

      var tempController = this;
      //3秒後にnext
      this.timerId = setTimeout(
        function(){ tempController.slideTimeout(tempController) },
        3000
      );

    },

    stop: function(){
 
      clearTimeout(this.timerId);
 
    },

    slideTimeout: function(){

      this.context.notify('next');
 
    }

  }
);


/* -----------------------------------------------------------------------------

SpeakingSlideController_partEnd

----------------------------------------------------------------------------- */
SpeakingSlideController_partEnd = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_partEnd",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      this.commonInitialize(slideId,param);

    },
    play: function(){

      this.commonPlay();

    },

    stop: function(){

    }

  }
);

/* -----------------------------------------------------------------------------

SpeakingSlideController_examOutro

----------------------------------------------------------------------------- */
SpeakingSlideController_examOutro = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_examOutro",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      this.commonInitialize(slideId,param);

    },
    play: function(){

      this.commonPlay();
      this.setFinish();

    },

    stop: function(){

    }

  }
);


/* -----------------------------------------------------------------------------

SpeakingSlideController_Qtype_tq

----------------------------------------------------------------------------- */
SpeakingSlideController_Qtype_tq = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_Qtype_tq",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {
      //全スライド共通初期化処理

      this.commonInitialize(slideId,param);

    },

    play: function(){

      this.commonPlay();
      this.createPlaySoundFileName();
      this.createRecFileName();
      r.seek(this.minor-1);
      this.playSound();

    },

    stop: function(){

      this.stopSound();

      if( this.recorderObject != undefined ){

        this.recorderObject.deleteRecorder();

      }

      this.setCurrentResult();

    },

    playSound: function(){

      this.nextflash = "question";

      var playlist = [
        {
          "name" : "list",
          "value": [
            {
               path:static_path+"mp3/exam/" + this.playSoundBaseFileName + "-question.mp3"
            }
          ]
        },
        {
            "name" : "autoplay",
            "value": true
        }
      ]

      createMP3Player( this, playlist );

    }

  }
);


/* -----------------------------------------------------------------------------

SpeakingSlideController_Qtype_tsq

----------------------------------------------------------------------------- */
SpeakingSlideController_Qtype_tsq = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_Qtype_tsq",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {
      //全スライド共通初期化処理

      this.commonInitialize(slideId,param);

    },

    play: function(){

      this.commonPlay();
      this.createPlaySoundFileName();
      this.createRecFileName();
      r.seek(this.minor-1);
      this.playSound();

    },

    stop: function(){

      this.stopSound();

      if( this.recorderObject != undefined ){
        this.recorderObject.deleteRecorder();
      }

      this.setCurrentResult();

    },


    playSound: function(){

      this.nextflash = "question";

      var playlist = [
        {
          "name" : "list",
          "value": [
            {
               path:static_path+"mp3/exam/" + this.playSoundBaseFileName + "-question.mp3"
            }
          ]
        },
        {
            "name" : "autoplay",
            "value": true
        }
      ]

      createMP3Player( this, playlist );

    }

  }
);


/* -----------------------------------------------------------------------------

SpeakingSlideController_Qtype_sq

----------------------------------------------------------------------------- */
SpeakingSlideController_Qtype_sq = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_Qtype_sq",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      this.commonInitialize(slideId,param);

    },

    play: function(){

      this.commonPlay();
      this.createPlaySoundFileName();
      this.createRecFileName();
      r.seek(this.minor-1);
      this.playSound();

    },

    stop: function(){

      this.stopSound();

      if( this.recorderObject != undefined ){
        this.recorderObject.deleteRecorder();
      }

      this.setCurrentResult();

    },


    playSound: function(){

      this.nextflash = "question";

      var playlist = [
        {
          "name" : "list",
          "value": [
            {
               path:static_path+"mp3/exam/" + this.playSoundBaseFileName + "-question.mp3"
            }
          ]
        },
        {
            "name" : "autoplay",
            "value": true
        }
      ]

      createMP3Player( this, playlist );

    }

  }
);


/* -----------------------------------------------------------------------------

SpeakingSlideController_questionEnd

----------------------------------------------------------------------------- */
SpeakingSlideController_questionEnd = Class.extend(
  SpeakingSlideController,
  {
    //プロパティ----------------------------------------------------------------
    className: "SpeakingSlideController_questionEnd",

    //メソッド------------------------------------------------------------------
    initialize: function(slideId,param) {

      this.commonInitialize(slideId,param);

    },

    play: function(){

      this.commonPlay();

    },

    stop: function(){

      //成績・進捗を更新
      this.setCurrentResult();

    }

  }
);

