title: flask - how to send data and get it back
body: <p>i am developing a little app in flask and i need to let the user to answer 20 shuffled questions one by one.
  i have a list of question and i want to send one question to the html each time the user push "next" button.</p>
  
  <pre><code>    @app.route('/handleQuestions', methods=['GET', 'POST'])
      def handleQuestions():
          #first time - first question
          if not request.method == 'POST':
              try:
                  pdQuestions = GetShuffeledQuestions()
                  session['pdQuestions'] = pdQuestions
                  i=0
                  session['qindex']=i
                  questionTosend = session.get('pdQuestions').iloc[[i]]['question'].item()
                  print(questionTosend)
                  return  render_template('questionsTemplate.html',progress=round((i/24)*100), sent=questionTosend)
              except Exception as ex:
                  print(ex)
          else:
              answer = request.form.to_dict(flat=False)       
              print(answer)
              #next question
              i=session['qindex']+1
              session['qindex']=i
              questionTosend = session.get('pdQuestions').iloc[[i]]['question'].item()
              print(questionTosend)
              return  render_template('questionsTemplate.html',progress=round((i/24)*100), sent=questionTosend)
              print('done')
  </code></pre>
  
  <p>where can i keep the list?
  and how can iterate it to the page?
  i want the user to get 1 question each time, i will save the answer and give him the next question.</p>
  
  <p>i have tried to save it on the session, but the list is too big and it crash when i save it to the session.</p>