I currently have this setup in my view:

                               {{for question in all_questions:}}
                    {{if question['difficulty']=='Hard':}}
                    <li class="padded"><a 
href="{{=question['id']}}">{{=question['title']}}</a></li>
                    {{pass}}
                    {{else:}}
                    {{pass}}

I want to be able to click on the link and load the question related to the 
database id in another div. To help with my question from earlier... what 
is the best way to achieve this?

On Monday, October 13, 2014 9:58:57 AM UTC-4, LoveWeb2py wrote:
>
> Hello,
>
> I'm trying to create an application to help my teacher ask students 
> questions but I'm not quite sure how to structure the MVC. 
>
> Let's say I have 10 entries in the SQL database and my sql database looks 
> something like this:
>
> db.define_table('teacher_questions',
>                 Field('id','integer'),
>                 Field('title','string'),
>                 Field('question','string'),
>                 Field('answer','string'),
>                 Field('hint','string'),
>                 Field('comments','string'),
>                 migrate=False)
>
> I could do a for loop to return all of the questions, but how could I make 
> a link which points to specific questions. I also want the teacher to be 
> able to add a new question and the list of questions will update 
> automatically. In the page that pops up I want to have an input field which 
> will take the students question and compare it against the answer in the 
> database. If it is right it will use bootstrap success and say correct. If 
> it is wrong it will use the bootstrap error. Is there an app that is 
> already created or a model of a web page I could look at for guidance? I've 
> been struggling with this concept for about a week now which is why I'm 
> reaching out to the experts
>
> Any help is greatly appreciated...
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to