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

help3403


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

project 2 - flask forms

1 of 419 articles shown, currently no other people reading this forum.
photo
From: ANONYMOUS
Date: Mon 11th May 2020, 11:51am
Actions: 
        Login-to-reply

 

Hi there, 

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

<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: 11:27am Sep 21 2020