Skip to content

Commit

Permalink
Merge pull request #3 from expfactory/fix/numeric
Browse files Browse the repository at this point in the history
doing fix for survey to test generator
  • Loading branch information
vsoch authored Aug 17, 2018
2 parents 9588581 + a0bf10b commit f5388a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ubuntu:16.04

# docker build -t vanessa/survey-generator

RUN apt-get update && apt-get install -y git python3-pip python3-dev
WORKDIR /opt
RUN git clone https://www.github.com/expfactory/expfactory
Expand Down
3 changes: 1 addition & 2 deletions survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ def create_numeric_textfield(text,id_attribute,box_text=None,classes="",required
textfield_html,box_text = base_textfield(text,id_attribute,box_text)
meta = parse_meta(text)

return '%s\n<div class="%s">\n<input class="mdl-textfield__input %s %s" type="number" id="%s" name="%s" %s>\n<label class="mdl-textfield__label" for="%s">%s</label>\n<span class="mdl-textfield__error">Input is not a number!</span>\n</div><br><br><br>' %(textfield_html,class_names,classes,required,id_attribute,id_attribute,meta,id_attribute,box_text)

return '%s\n<div class="%s">\n<input class="mdl-textfield__input %s %s" type="text" id="%s" pattern="(([0-9]+)(\.[0-9]+)?)|\.?[0-9]+" name="%s" %s>\n<label class="mdl-textfield__label" for="%s">%s</label>\n<span class="mdl-textfield__error">Please enter an integer or real number</span>\n</div><br><br><br>' %(textfield_html,class_names,classes,required,id_attribute,id_attribute,meta,id_attribute,box_text)

def create_select_table(text,id_attribute,df,classes="",required=0):
'''create_select_table generates a material lite table from a pandas data frame.
Expand Down

0 comments on commit f5388a0

Please sign in to comment.