~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/forms/qa_assessment.py

  • Committer: Benji York
  • Date: 2013-11-18 20:38:47 UTC
  • mto: This revision was merged to the branch mainline in revision 465.
  • Revision ID: benji@benjiyork.com-20131118203847-2mfs1w7b8aqy64mr
checkpoint

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        ('0', 'No'),
41
41
        ('', 'Unknown'),
42
42
    )
43
 
    validator = OneOf([x[0] for x in choices])
44
 
    for sq in score_questions:
45
 
        category = sq['name']
46
 
        category_description = sq['description']
47
 
        questions = sq['questions']
 
43
    for q in score_questions:
 
44
        category = q['name']
 
45
        category_description = q['description']
 
46
        questions = q['questions']
48
47
 
49
48
        category_schema = Schema(
50
49
            name=category,
51
50
            title=category_description)
52
 
 
53
 
        for question in questions:
54
 
            node = SchemaNode(
55
 
                String(),
56
 
                missing='',
57
 
                validator=validator,
58
 
                widget=RadioChoiceWidget(values=choices),
59
 
                name=question['id'],
60
 
                title=question['description'],
61
 
                description=question['extended_description'],
 
51
        for q in questions:
 
52
            category_schema.add(
 
53
                SchemaNode(
 
54
                    String(),
 
55
                    missing='',
 
56
                    validator=OneOf([x[0] for x in choices]),
 
57
                    widget=RadioChoiceWidget(values=choices),
 
58
                    name=q['id'],
 
59
                    title=q['description'],
 
60
                    description=q['extended_description'])
62
61
            )
63
 
            category_schema.add(node)
64
62
 
65
63
        schema.add(category_schema)
66
64