[IMP] Quizz mode
bzr revid: rim@openerp.com-20140205081626-0e1r5g71c53r5x5w
This commit is contained in:
parent
e910dc758d
commit
c8a320553c
|
@ -162,7 +162,8 @@ class WebsiteSurvey(http.Controller):
|
|||
return request.website.render('survey.survey', data)
|
||||
elif user_input.state == 'done': # Display success message
|
||||
return request.website.render('survey.sfinished', {'survey': survey,
|
||||
'token': token})
|
||||
'token': token,
|
||||
'user_input': user_input})
|
||||
elif user_input.state == 'skip':
|
||||
flag = (True if prev and prev == 'prev' else False)
|
||||
page, page_nr, last = survey_obj.next_page(cr, uid, user_input, user_input.last_displayed_page_id.id, go_back=flag, context=context)
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<!-- Attendre les data de pbo
|
||||
+ faire un script qui les traduit en record survey/page/question/label -->
|
||||
</data>
|
||||
</openerp>
|
|
@ -391,7 +391,7 @@ class survey_question(osv.Model):
|
|||
|
||||
# Question
|
||||
'question': fields.char('Question', required=1, translate=True),
|
||||
'description': fields.char('Description', help="Use this field to add \
|
||||
'description': fields.html('Description', help="Use this field to add \
|
||||
additional explanations about your question", translate=True,
|
||||
oldname='descriptive_text'),
|
||||
|
||||
|
@ -837,10 +837,17 @@ class survey_user_input_line(osv.Model):
|
|||
'date_create': fields.datetime.now()
|
||||
}
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
value_suggested = vals.get('value_suggested')
|
||||
if value_suggested:
|
||||
mark = self.pool.get('survey.label').browse(cr, uid, int(value_suggested), context=context).quizz_mark
|
||||
vals.update({'quizz_mark': mark})
|
||||
return super(survey_user_input_line, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
value_suggested = vals.get('value_suggested')
|
||||
if value_suggested:
|
||||
mark = self.pool.get('survey.label').browse(cr, uid, value_suggested, context=context).quizz_mark
|
||||
mark = self.pool.get('survey.label').browse(cr, uid, int(value_suggested), context=context).quizz_mark
|
||||
vals.update({'quizz_mark': mark})
|
||||
return super(survey_user_input_line, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
<div class="jumbotron mt32">
|
||||
<h1>Thank you!</h1>
|
||||
<div t-field="survey.thank_you_message" />
|
||||
<div t-if='survey.quizz_mode'>You scored <t t-esc="user_input.quizz_score" /> points.</div>
|
||||
<div>If you wish, you can <a t-att-href="'/survey/print/%s/%s' % (survey.id, token)">print your answers</a>.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
<field name="answer_type"/>
|
||||
<field name="skipped"/>
|
||||
<field name="date_create"/>
|
||||
<field name="quizz_mark" groups="base.group_no_one"/>
|
||||
</tree>
|
||||
</field>
|
||||
</sheet>
|
||||
|
|
Loading…
Reference in New Issue