Faculty of Engineering and Mathematical Sciences 
Not logged in (login)


This forum is provided to promote discussion amongst students enrolled in Agile Web Development (CITS3403).
RSS cloud
Jump to:

project 2 - flask forms

1 of 419 articles shown, currently no other people reading this forum.
Date: Mon 11th May 2020, 11:51am


Hi there, 

I have added the questions for a particular quiz to the fill out quiz html page like this:
    {% for questions in question_row %}
            <div class="form-group">
            <label id={{questions.question}} name=thisQuiz>{{questions.question}}</label>
    {% endfor %}

<div class="form-group" style="text-align: center;">
    {{ form.submit(class="btn btn-secondary ml-3") }}

The answers table in the db is set up so that each row represents an answer for a 
particular question for a particular student.
Is there a way for me to loop through the form answers in the controller, so that on submit 
i can add multiple rows of data to the answers table, so that I can add each answer to each 
question for the student filling out the quiz to the db.
Very sorry if this doesn't make sense 

Thank you

Related articles

project 2 - flask forms (all 3) RSS
├─ THIS   Mon 11th May 2020, 11:51am, ANONYMOUS
├─ reply 1   Mon 11th May 2020, 10:39pm, Haolin W.
└─ reply 2   Tue 12th May 2020, 10:05am, Timothy F.
This Page

Program written by: [email protected]
Feedback welcome
Last modified:  9:57am Nov 18 2020