<?php 
session_start();
//引数が問題回数$couに回数を入れて
//test問題回数
$cou = 10;
$QueFunc = new QuestionFunction($cou);
$QueFunc->QuestionButtonEnd();
$QueFunc->QuestionCount($_SESSION['prevQuePage']);
$QueFunc->QuestionDBInsert($_SESSION['prevQuePage'], $_SESSION['UserAns'], $_SESSION['qAnsNum'], $_SESSION['nextQuePage']);
$QueFunc->QuestionEnd($cou);
class QuestionFunction
{
    function __construct($cou)
    {
        if (!isset($_SESSION['couQue'])) {
            //初期化設定
            $_SESSION['couDesAns'] = $cou;
            /*必要ない?
              $_SESSION['couQue']=0;
              $_SESSION['couAns']=0;
              $_SESSION['AnsRate']=0;
              $_SESSION['nextQuePage']=0;
              */
        }
        //userの答え
        if (isset($_POST['queList'])) {
            $_SESSION['UserAns'] = $_POST['queList'];
        } else {
            echo "Post失敗";
        }