Hello,

I have a fair amount of HTML I would like to convert, but I would like to 
turn it into a function so I can use LOAD and have it automatically update 
each time a student guesses a question. I've tried implementing javascript, 
but couldn't get it to work.

Is there an automated HTML Helper converter? I could use to wrap all of 
these div's together? What would be the best way to approach this problem?

Here is my code:                         
<div id="challenge-accordion" class="styled-accordion panel-group">

                                <div class="panel panel-default">
                                    <div class="panel-heading">
                                        <a class="accordion-toggle toggle" 
data-toggle="collapse" data-parent="#answer-accordion" 
href="#collapseAnswer">{{
                                         last_ten = 
db(db.questions_answered.question==request.vars['chal']).select(db.questions_answered.ALL,
 
orderby=~db.questions_answered.id, limitby=(0,10))}}

                                            <span class="chevron glyphicon 
glyphicon-chevron-up icon-white icon-small"></span> Previous Submissions
                                        </a>
                                    </div>
                                    <div id="collapseFlag" 
class="panel-body collapse">
                                        <div class="panel-body">
                                            <ul>{{for answer in last_ten:
                                            if answer['correct'] == True:}}
                                                <li 
class="correct">{{=answer['submitted']}}</li>
                                            {{else:}}
                                            <li 
class="incorrect">{{=answer['submitted']}}
                                            </li>
                                            {{pass}}
                                            {{pass}}
                                            </ul>
                                        </div>
                                    </div>
                                </div>

                            </div>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to