more help text for question number, choices; Less help for question additional checks

EmailTemplateFixes
Ian Ward 2010-04-19 17:06:28 -04:00
parent 8650bf742c
commit c3e14048d2
2 changed files with 21 additions and 3 deletions

View File

@ -208,7 +208,9 @@ class Question(models.Model):
__metaclass__ = TransMeta
questionset = models.ForeignKey(QuestionSet)
number = models.CharField(max_length=8) # 1, 2a, 2b, 3c - also used for sorting
number = models.CharField(max_length=8, help_text=
"eg. <tt>1</tt>, <tt>2a</tt>, <tt>2b</tt>, <tt>3c</tt><br /> "
"Number is also used for ordering questions.")
text = models.TextField(blank=True)
type = models.CharField(u"Type of question", max_length=32,
choices = QuestionChoices,
@ -219,7 +221,13 @@ class Question(models.Model):
"this user can choose from below'.")
extra = models.CharField(u"Extra information", max_length=128, blank=True, null=True, help_text=u"Extra information (use on question type)")
checks = models.CharField(u"Additional checks", max_length=64, blank=True,
null=True, help_text=u"""Additional checks to be performed for this value (space separated). You may also specify an entry as key=value or key="value with spaces".<br /><br />For text fields, <tt>required</tt> is a valid check.<br />For yes/no comment, "required", <tt>required-yes</tt>, and <tt>required-no</tt> are valid.<br />For Time period, you may supply <tt>units=hour,day,month,year</tt>.<br /><br />If this question is only valid if another question's answer is something specific, use <tt>requiredif="QuestionNumber,Value"</tt>. Requiredif also takes boolean expressions using <tt>and</tt>, <tt>or</tt>, and <tt>not</tt>, as well as grouping with parenthesis. eg. <tt>requiredif="5,yes or (6,no and 1,yes)"</tt>, where the values in parenthesis are evaluated first.""")
null=True, help_text="Additional checks to be performed for this "
"value (space separated) <br /><br />"
"For text fields, <tt>required</tt> is a valid check.<br />"
"For yes/no choice, <tt>required</tt>, <tt>required-yes</tt>, "
"and <tt>required-no</tt> are valid.<br /><br />"
"If this question is only required if another question's answer is "
'something specific, use <tt>requiredif="QuestionNumber,Value"</tt>.')
def questionnaire(self):

View File

@ -1,7 +1,17 @@
{% extends "admin/change_form.html" %}
{% load questionnaire %}
{% load i18n questionnaire %}
{% block object-tools %}
{% if original %}
<a href="{{ original|qtesturl }}">Show on Site</a>
{% endif %}
{% endblock %}
{% block after_field_sets %}
<h2>{% trans "Choices" %}</h2>
<ul>
<li>{% blocktrans %}Sortid determines the choice order.{% endblocktrans %}</li>
<li>{% blocktrans %}Short values will appear in exported data and are
referenced in 'Additional checks' fields. Numbers, letters
or single words are valid.{% endblocktrans %}</li>
</ul>
{% endblock %}