There will be a short maintenance break on Wed 27.10. at 12:00. Estimated time 30 minutes.

Commit 4958ffad authored by Ossi Laine's avatar Ossi Laine
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request tithei/pet-rating!6
parents dcfe881e e96f5aed
...@@ -13,4 +13,9 @@ config.py ...@@ -13,4 +13,9 @@ config.py
*.db *.db
/embody /embody
/app/static/lib /app/static/lib
.env
/app/static/*.png
/app/static/embody_images
.vscode/
documentation
...@@ -15,7 +15,7 @@ from flask_cors import CORS, cross_origin ...@@ -15,7 +15,7 @@ from flask_cors import CORS, cross_origin
app = Flask(__name__) app = Flask(__name__)
CORS(app) CORS(app)
#CORS(app, resources={r"/*": {"cors_allowed_origins":"*"} } ) # CORS(app, resources={r"/*": {"cors_allowed_origins":"*"} } )
#app.config['BABEL_DEFAULT_LOCALE'] = 'fin' #app.config['BABEL_DEFAULT_LOCALE'] = 'fin'
#app.config['BABEL_TRANSLATION_DIRECTORIES'] ='C:/Users/Timo/git/pet-rating/app/translations' #app.config['BABEL_TRANSLATION_DIRECTORIES'] ='C:/Users/Timo/git/pet-rating/app/translations'
...@@ -68,9 +68,6 @@ def get_locale(): ...@@ -68,9 +68,6 @@ def get_locale():
""" """
# Run flask app with socketIO
socketio = SocketIO()
socketio.init_app(app)
#mariabd mysql portti 3306 tarkista? #mariabd mysql portti 3306 tarkista?
...@@ -81,6 +78,11 @@ migrate = Migrate(app, db) ...@@ -81,6 +78,11 @@ migrate = Migrate(app, db)
login = LoginManager(app) login = LoginManager(app)
login.login_view = 'login' login.login_view = 'login'
# Run flask app with socketIO
socketio = SocketIO(app, cors_allowed_origins="*")
# socketio = SocketIO()
socketio.init_app(app)
# Register blueprints # Register blueprints
from .task.views import task_blueprint from .task.views import task_blueprint
from .experiment.views import experiment_blueprint from .experiment.views import experiment_blueprint
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
<h1 class="container mt-5 display-4 text-center"><br>Add new embody picture:</h1> <h1 class="container mt-5 display-4 text-center"><br>Add new embody picture:</h1>
<br> <br>
<p class="lead"> <p class="lead"> Upload new embody image. Submit without choosing file if you want to use default embody picture.
Upload new embody image... instructions here for admins..
</p> </p>
{% from "_formhelpers.html" import render_field %} {% from "_formhelpers.html" import render_field %}
...@@ -12,8 +11,8 @@ Upload new embody image... instructions here for admins.. ...@@ -12,8 +11,8 @@ Upload new embody image... instructions here for admins..
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
<div class="form-group"> <div class="form-group">
<label for="Background questions">image question/explanation:</label> <label for="Background questions">Image question/explanation:</label>
<textarea class="form-control" rows="5" id="embody_picture_text" name="question"></textarea> <textarea class="form-control" rows="5" id="embody_picture_text" name="question">Color the regions whose activity you feel increasing or getting stronger</textarea>
</div> </div>
<div class="custom-file"> <div class="custom-file">
...@@ -23,7 +22,7 @@ Upload new embody image... instructions here for admins.. ...@@ -23,7 +22,7 @@ Upload new embody image... instructions here for admins..
<hr> <hr>
<button type="submit" class="btn btn-primary submit-file" disabled>Submit</button> <button type="submit" class="btn btn-primary">Submit</button>
<a class="btn btn-primary" href="{{ request.referrer }}" role="button">Cancel</a> <a class="btn btn-primary" href="{{ request.referrer }}" role="button">Cancel</a>
</form> </form>
......
...@@ -36,7 +36,27 @@ ...@@ -36,7 +36,27 @@
<tr> <tr>
<td>Number of finished ratings:</td> <td>Number of finished ratings:</td>
<td>{{ finished_ratings }} <td>{{ finished_ratings }}
<a class="btn btn-primary btn-info float-right" href="{{ url_for('download_csv', exp_id=exp.idexperiment) }}" role="button">Export results (csv)</a>
<button data-value="{{ exp.idexperiment }}" class="btn btn-primary float-right get-csv-results">
export results
</button>
<div id="export-link-container" class="hidden">
<a id="export-link" class="float-right"
href="{{ url_for('experiment.download_csv', exp_id=exp.idexperiment) }}" role="button"></a>
<p id="export-error"></p>
</div>
<div class="progress hidden">
<div id="export-results-bar" class="progress-bar progress-bar-striped progress-bar-animated"
role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
</div>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -49,21 +69,21 @@ ...@@ -49,21 +69,21 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th scope="col" nowrap>Question ID:</td> <th scope="col" nowrap>Question ID:</td>
<th scope="col" nowrap>Question:</th> <th scope="col" nowrap>Question:</th>
<th scope="col" nowrap>Left scale</th> <th scope="col" nowrap>Left scale</th>
<th scope="col" nowrap>Right scale</th> <th scope="col" nowrap>Right scale</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for q in question_headers %} {% for q in question_headers %}
<tr> <tr>
<td>{{ q.idquestion }}</td> <td>{{ q.idquestion }}</td>
<td>{{ q.question }}</td> <td>{{ q.question }}</td>
<td>{{ q.left }}</td> <td>{{ q.left }}</td>
<td>{{ q.right }}</td> <td>{{ q.right }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
...@@ -74,29 +94,29 @@ ...@@ -74,29 +94,29 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th scope="col" nowrap>Participant ID:</th> <th scope="col" nowrap>Participant ID:</th>
{% for page in pages_and_questions %} {% for page in pages_and_questions %}
{% for p in pages_and_questions[page] %} {% for p in pages_and_questions[page] %}
<th scope="col" nowrap>{{ p[0]}}/{{ p[1]}}</th> <th scope="col" nowrap>{{ p[0]}}/{{ p[1]}}</th>
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for participant in participants_and_answers %} {% for participant in participants_and_answers %}
<tr> <tr>
{% if participant == 'mean' %} {% if participant == 'mean' %}
<td><b>{{ participant }}</b></td> <td><b>{{ participant }}</b></td>
{% else %} {% else %}
<td>{{ participant }}</td> <td>{{ participant }}</td>
{% endif %} {% endif %}
{% for answer in participants_and_answers[participant] %} {% for answer in participants_and_answers[participant] %}
<td>{{ answer }}</td> <td>{{ answer }}</td>
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} {% endfor %}
...@@ -109,56 +129,60 @@ ...@@ -109,56 +129,60 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th style="width:25%;%" scope="col" nowrap>Stimulus:</td> <th style="width:25%;%" scope="col" nowrap>Stimulus:</td>
<th style="width:25%;%" scope="col" nowrap>Picture:</th> <th style="width:25%;%" scope="col" nowrap>Picture:</th>
<th style="width:25%;%" scope="col" nowrap>Description:</th> <th style="width:25%;%" scope="col" nowrap>Description:</th>
<th style="width:25%;%" scope="col" nowrap></th> <th style="width:25%;%" scope="col" nowrap></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for s in stimulus_headers %} {% for s in stimulus_headers %}
{% for embody_picture in embody_questions %} {% for embody_picture in embody_questions %}
<tr> <tr>
{% if s.type == 'text' %} {% if s.type == 'text' %}
<td>{{ s.text }}</td> <td>{{ s.text }}</td>
{% elif s.type == 'picture' %} {% elif s.type == 'picture' %}
<td><img src="/{{ s.media }}" class="thumbnail" /></td> <td><img src="/{{ s.media }}" class="thumbnail" /></td>
{% elif s.type == 'video' %} {% elif s.type == 'video' %}
<td> <td>
<div class="embed-responsive embed-responsive-16by9 "> <div class="embed-responsive embed-responsive-16by9 ">
<iframe class="embed-responsive-item thumbnail" src="/{{ s.media }}" allowFullScreen></iframe> <iframe class="embed-responsive-item thumbnail" src="/{{ s.media }}" allowFullScreen></iframe>
</div> </div>
</td> </td>
{% elif s.type == 'audio' %} {% elif s.type == 'audio' %}
<td> <td>
<div class="embed-responsive embed-responsive-16by9 "> <div class="embed-responsive embed-responsive-16by9 ">
<iframe class="embed-responsive-item thumbnail" src="/{{ s.media }}" allowFullScreen></iframe> <audio class="embed-responsive-item thumbnail" controls>
</div> <source src="/{{ s.media }}">
</td> Your browser does not support the audio element.
{% else %} </audio>
<td>{{ s.text }}</td> </div>
{% endif %} </td>
{% else %}
<td><img src="{{ embody_picture.picture }}" class="thumbnail" /></td> <td>{{ s.text }}</td>
<td>{{ embody_picture.question }}</td> {% endif %}
<td> <td><img src="{{ embody_picture.picture }}" class="thumbnail" /></td>
<button data-value="{{ s.idpage }}-{{ embody_picture.idembody }}" class="btn btn-primary embody-get-drawing"> <td>{{ embody_picture.question }}</td>
<span class="spinner-border spinner-border-sm hidden"></span>
Draw <td>
</button> <button data-value="{{ s.idpage }}-{{ embody_picture.idembody }}" class="btn btn-primary embody-get-drawing">
</td> <span class="spinner-border spinner-border-sm hidden"></span>
Draw
</tr> </button>
{% endfor %} </td>
{% endfor %}
</tr>
{% endfor %}
{% endfor %}
</tbody> </tbody>
</table> </table>
<div class="progress hidden" id="plotted-image"> <div class="progress hidden" id="plotted-image">
<div id="image-loading-progress" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 0%"> <div id="image-loading-progress" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar"
aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
<!-- Creating image... --> <!-- Creating image... -->
</div> </div>
</div> </div>
...@@ -172,20 +196,20 @@ ...@@ -172,20 +196,20 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th scope="col" nowrap>Participant</th> <th scope="col" nowrap>Participant</th>
{% for bg in bg_questions %} {% for bg in bg_questions %}
<th scope="col" nowrap>{{ bg.background_question }}</th> <th scope="col" nowrap>{{ bg.background_question }}</th>
{% endfor %} {% endfor %}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for p in bg_answers_for_participants %} {% for p in bg_answers_for_participants %}
<tr> <tr>
<td>{{ p }}</td> <td>{{ p }}</td>
{% for bg_answer in bg_answers_for_participants[p] %} {% for bg_answer in bg_answers_for_participants[p] %}
<td align="center">{{ bg_answer }}</td> <td align="center">{{ bg_answer }}</td>
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} {% endfor %}
...@@ -193,7 +217,9 @@ ...@@ -193,7 +217,9 @@
</tbody> </tbody>
</table> </table>
<script src="{{ url_for('static', filename='lib/js/socket.io.js') }}" ></script> <script src="{{ url_for('static', filename='lib/js/socket.io.js') }}"></script>
<script src="{{ url_for('static', filename='js/getDrawing.js') }}" ></script> <script src="{{ url_for('static', filename='js/urls.js') }}"></script>
<script src="{{ url_for('static', filename='js/getDrawing.js') }}"></script>
<script src="{{ url_for('static', filename='js/getCSV.js') }}"></script>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -211,7 +211,6 @@ ...@@ -211,7 +211,6 @@
</table> </table>
<h1 class="container mt-5 display-4 text-left"><br>Add embody tool:</h1> <h1 class="container mt-5 display-4 text-left"><br>Add embody tool:</h1>
<table class="table"> <table class="table">
...@@ -231,15 +230,13 @@ ...@@ -231,15 +230,13 @@
{% endif %} {% endif %}
</td> </td>
<td> <td>
<a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.add_embody', exp_id=exp_id, default=true) }}" role="button">Add default</a>
<a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.add_embody', exp_id=exp_id) }}" role="button">Add new picture</a> <a class="btn btn-primary btn-block btn-sm btn-info" href="{{ url_for('experiment.add_embody', exp_id=exp_id) }}" role="button">Add new picture</a>
</td> </td>
</tr> </tr>
{% for embody_picture in embody_pictures %} {% for embody_picture in embody_pictures %}
<tr> <tr>
<td>ID: {{ embody_picture.idembody }} <br> {{ embody_picture.question }}</td> <td>ID: {{ embody_picture.idembody }} <br> {{ embody_picture.question }}</td>
<td><img src="{{ embody_picture.picture }}" class="thumbnail" /></td> <td><img src="{{ embody_picture.picture }}" class="thumbnail" /></td>
<td><a class="btn btn-primary btn-block btn-sm btn-dark" href="{{ url_for('experiment.remove_embody', exp_id=exp_id, idembody=embody_picture.idembody) }}" role="button">Remove</a></td> <td><a class="btn btn-primary btn-block btn-sm btn-dark" href="{{ url_for('experiment.remove_embody', exp_id=exp_id, idembody=embody_picture.idembody) }}" role="button">Remove</a></td>
</tr> </tr>
......
This diff is collapsed.
from sqlalchemy import and_
from flask import session
from app import db from app import db
from sqlalchemy import Column, Integer, String, Text, Boolean from sqlalchemy import Column, Integer, String, Text, Boolean
from flask_wtf import FlaskForm from flask_wtf import FlaskForm
from wtforms_sqlalchemy.fields import QuerySelectField, QuerySelectMultipleField from wtforms_sqlalchemy.fields import QuerySelectField, QuerySelectMultipleField
from werkzeug.security import generate_password_hash, check_password_hash from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin from flask_login import UserMixin
from app import login from app import login
...@@ -15,9 +17,10 @@ class background_question(db.Model): ...@@ -15,9 +17,10 @@ class background_question(db.Model):
__tablename__ = "background_question" __tablename__ = "background_question"
idbackground_question = db.Column(db.Integer, primary_key=True) idbackground_question = db.Column(db.Integer, primary_key=True)
background_question = db.Column(db.String(120)) background_question = db.Column(db.String(120))
answers = db.relationship('background_question_answer', backref='question', lazy='dynamic') answers = db.relationship(
'background_question_answer', backref='question', lazy='dynamic')
experiment_idexperiment = db.Column(db.Integer) experiment_idexperiment = db.Column(db.Integer)
def __repr__(self): def __repr__(self):
return "<idbackground_question = '%s', background_question = '%s'>" % (self.idbackground_question, self.background_question) return "<idbackground_question = '%s', background_question = '%s'>" % (self.idbackground_question, self.background_question)
...@@ -25,11 +28,12 @@ class background_question(db.Model): ...@@ -25,11 +28,12 @@ class background_question(db.Model):
class background_question_option(db.Model): class background_question_option(db.Model):
__tablename__ = "background_question_option" __tablename__ = "background_question_option"
idbackground_question_option = db.Column(db.Integer, primary_key=True) idbackground_question_option = db.Column(db.Integer, primary_key=True)
background_question_idbackground_question = db.Column(db.Integer, db.ForeignKey('background_question.idbackground_question')) background_question_idbackground_question = db.Column(
db.Integer, db.ForeignKey('background_question.idbackground_question'))
option = db.Column(db.String(120)) option = db.Column(db.String(120))
def __repr__(self): def __repr__(self):
return "<idbackground_question_option = '%s', background_question_idbackground_question = '%s', option = '%s'>" % (self.idbackground_question_option, self.background_question_idbackground_question, self.option) return "<idbackground_question_option = '%s', background_question_idbackground_question = '%s', option = '%s'>" % (self.idbackground_question_option, self.background_question_idbackground_question, self.option)
class experiment (db.Model): class experiment (db.Model):
...@@ -51,7 +55,7 @@ class experiment (db.Model): ...@@ -51,7 +55,7 @@ class experiment (db.Model):
consent_text = db.Column(db.Text, index=True) consent_text = db.Column(db.Text, index=True)
use_forced_id = db.Column(db.String(120)) use_forced_id = db.Column(db.String(120))
embody_enabled = db.Column(db.Boolean, unique=False, default=False) embody_enabled = db.Column(db.Boolean, unique=False, default=False)
def __repr__(self): def __repr__(self):
return "<idexperiment = '%s', name='%s', instruction='%s', directoryname='%s', language='%s', status='%s', randomization='%s', short_instruction='%s', single_sentence_instruction='%s', is_archived='%s', creator_name='%s', research_notification_filename='%s', creation_time='%s', stimulus_size='%s', consent_text='%s', use_forced_id='%s', embody_enabled='%s'>" % (self.idexperiment, self.name, self.instruction, self.directoryname, self.language, self.status, self.randomization, self.short_instruction, self.single_sentence_instruction, self.is_archived, self.creator_name, self.research_notification_filename, self.creation_time, self.stimulus_size, self.consent_text, self.use_forced_id, self.embody_enabled) return "<idexperiment = '%s', name='%s', instruction='%s', directoryname='%s', language='%s', status='%s', randomization='%s', short_instruction='%s', single_sentence_instruction='%s', is_archived='%s', creator_name='%s', research_notification_filename='%s', creation_time='%s', stimulus_size='%s', consent_text='%s', use_forced_id='%s', embody_enabled='%s'>" % (self.idexperiment, self.name, self.instruction, self.directoryname, self.language, self.status, self.randomization, self.short_instruction, self.single_sentence_instruction, self.is_archived, self.creator_name, self.research_notification_filename, self.creation_time, self.stimulus_size, self.consent_text, self.use_forced_id, self.embody_enabled)
...@@ -59,13 +63,16 @@ class experiment (db.Model): ...@@ -59,13 +63,16 @@ class experiment (db.Model):
class answer_set (db.Model): class answer_set (db.Model):
__tablename__ = "answer_set" __tablename__ = "answer_set"
idanswer_set = db.Column(db.Integer, primary_key=True) idanswer_set = db.Column(db.Integer, primary_key=True)
experiment_idexperiment = db.Column(db.Integer, db.ForeignKey('experiment.idexperiment')) experiment_idexperiment = db.Column(
db.Integer, db.ForeignKey('experiment.idexperiment'))
session = db.Column(db.String(120)) session = db.Column(db.String(120))
agreement = db.Column(db.String(120)) agreement = db.Column(db.String(120))
answer_counter = db.Column(db.Integer) answer_counter = db.Column(db.Integer)
answer_type = db.Column(db.String(120)) answer_type = db.Column(db.String(120))
registration_time = db.Column(db.DateTime, index=True, default=datetime.utcnow) registration_time = db.Column(
last_answer_time = db.Column(db.DateTime, index=True, default=datetime.utcnow) db.DateTime, index=True, default=datetime.utcnow)
last_answer_time = db.Column(
db.DateTime, index=True, default=datetime.utcnow)
def __repr__(self): def __repr__(self):
return "<idanswer_set = '%s', experiment_idexperiment = '%s', session = '%s', agreement = '%s', answer_counter = '%s', registration_time = '%s', last_answer_time = '%s'>" % (self.idanswer_set, self.experiment_idexperiment, self.session, self.agreement, self.answer_counter, self.registration_time, self.last_answer_time) return "<idanswer_set = '%s', experiment_idexperiment = '%s', session = '%s', agreement = '%s', answer_counter = '%s', registration_time = '%s', last_answer_time = '%s'>" % (self.idanswer_set, self.experiment_idexperiment, self.session, self.agreement, self.answer_counter, self.registration_time, self.last_answer_time)
...@@ -74,17 +81,20 @@ class answer_set (db.Model): ...@@ -74,17 +81,20 @@ class answer_set (db.Model):
class background_question_answer(db.Model): class background_question_answer(db.Model):
__tablename__ = "background_question_answer" __tablename__ = "background_question_answer"
idbackground_question_answer = db.Column(db.Integer, primary_key=True) idbackground_question_answer = db.Column(db.Integer, primary_key=True)
answer_set_idanswer_set = db.Column(db.Integer, db.ForeignKey('answer_set.idanswer_set')) answer_set_idanswer_set = db.Column(
db.Integer, db.ForeignKey('answer_set.idanswer_set'))
answer = db.Column(db.String(120)) answer = db.Column(db.String(120))
background_question_idbackground_question = db.Column(db.Integer, db.ForeignKey('background_question.idbackground_question')) background_question_idbackground_question = db.Column(
db.Integer, db.ForeignKey('background_question.idbackground_question'))
def __repr__(self): def __repr__(self):
return "<idbackground_question_answer = '%s', answer_set_idanswer_set = '%s', answer = '%s', background_question_idbackground_question = '%s'>" % (self.idbackground_question_answer, self.answer_set_idanswer_set, self.answer, self.background_question_idbackground_question) return "<idbackground_question_answer = '%s', answer_set_idanswer_set = '%s', answer = '%s', background_question_idbackground_question = '%s'>" % (self.idbackground_question_answer, self.answer_set_idanswer_set, self.answer, self.background_question_idbackground_question)
def background_question_answer_query(): def background_question_answer_query():
return background_question_answer.query return background_question_answer.query
""" """
class ChoiceForm(FlaskForm): class ChoiceForm(FlaskForm):
opts = QuerySelectField(query_factory=background_question_answer_query, allow_blank=True) opts = QuerySelectField(query_factory=background_question_answer_query, allow_blank=True)
...@@ -98,30 +108,33 @@ vastaukset = u.answers.all() ...@@ -98,30 +108,33 @@ vastaukset = u.answers.all()
class question (db.Model): class question (db.Model):
__tablename__ = "question" __tablename__ = "question"
idquestion = db.Column(db.Integer, primary_key=True) idquestion = db.Column(db.Integer, primary_key=True)
experiment_idexperiment = db.Column(db.Integer, db.ForeignKey('experiment.idexperiment')) experiment_idexperiment = db.Column(
db.Integer, db.ForeignKey('experiment.idexperiment'))
question = db.Column(db.String(120)) question = db.Column(db.String(120))
left = db.Column(db.String(120)) left = db.Column(db.String(120))
right = db.Column(db.String(120)) right = db.Column(db.String(120))
def __repr__(self): def __repr__(self):
return "<idquestion = '%s', experiment_idexperiment = '%s', question = '%s', left = '%s', right = '%s'>" % (self.idquestion, self.experiment_idexperiment, self.question, self.left, self.right) return "<idquestion = '%s', experiment_idexperiment = '%s', question = '%s', left = '%s', right = '%s'>" % (self.idquestion, self.experiment_idexperiment, self.question, self.left, self.right)
class embody_question (db.Model): class embody_question (db.Model):
__tablename__ = "embody_question" __tablename__ = "embody_question"
idembody = db.Column(db.Integer, primary_key=True) idembody = db.Column(db.Integer, primary_key=True)
experiment_idexperiment = db.Column(db.Integer, db.ForeignKey('experiment.idexperiment')) experiment_idexperiment = db.Column(
db.Integer, db.ForeignKey('experiment.idexperiment'))
picture = db.Column(db.Text) picture = db.Column(db.Text)
question = db.Column(db.Text) question = db.Column(db.Text)
def __repr__(self): def __repr__(self):
return "<idembody = '%s', experiment_idexperiment = '%s', picture = '%s', question = '%s'>" % (self.idembody, self.experiment_idexperiment, self.picture, self.question ) return "<idembody = '%s', experiment_idexperiment = '%s', picture = '%s', question = '%s'>" % (self.idembody, self.experiment_idexperiment, self.picture, self.question)
class page (db.Model): class page (db.Model):
__tablename__ = "page" __tablename__ = "page"
idpage = db.Column(db.Integer, primary_key=True) idpage = db.Column(db.Integer, primary_key=True)