questionnaire.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:a-plus-rst-tools 作者: Aalto-LeTech 项目源码 文件源码
def generate_options(self, env, node):
        options = []
        for i, key in enumerate(['agreement4', 'agreement3', 'agreement2', 'agreement1', 'agreement0']):
            options.append({
                u'value': 4 - i,
                u'label|i18n': translations.opt(key),
            })
            choice = aplus_nodes.html(u'div', {u'class':u'radio'})
            label = aplus_nodes.html(u'label', {})
            label.append(aplus_nodes.html(u'input', {
                u'type': u'radio',
                u'name': u'field_{:d}'.format(env.question_count - 1),
                u'value': 4 - i,
            }))
            label.append(nodes.Text(translations.get(env, key)))
            choice.append(label)
            node.append(choice)
        return options
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号