diff --git a/slaeforms/SLAEForms Testing.code-workspace b/slaeforms/SLAEForms Testing.code-workspace new file mode 100644 index 0000000..3e30148 --- /dev/null +++ b/slaeforms/SLAEForms Testing.code-workspace @@ -0,0 +1,11 @@ +{ + "folders": [ + { + "path": "../.." + }, + { + "path": "../../../CSS Testing" + } + ], + "settings": {} +} \ No newline at end of file diff --git a/slaeforms/app.py b/slaeforms/app.py index 0bf2e2a..bafc2bd 100644 --- a/slaeforms/app.py +++ b/slaeforms/app.py @@ -56,24 +56,33 @@ class User(db.Model): with app.app_context(): db.create_all() -@app.route("/send", methods=["GET", "POST"]) + +@app.route("/video", methods=["GET", "POST"]) def sendpage(): - if request.method == "POST": - session_user_id = session["slaeform_user_id"] - likert_score = request.form["likertscale"] - text_input = request.form["feedback"] - question_title = session["current_question"] - new_id = uuid.uuid4() - date = datetime.today() - print("new idea: {new_id} ".format(new_id=new_id)) - new_response = Response(id=new_id,user_id = session_user_id, question_title = question_title,likert_result = likert_score,notes = text_input, date_created = date) + + return render_template( + "layout2.html" + ) + + + +@app.route("/send", methods=["POST"]) +def sendpage(): + session_user_id = session["slaeform_user_id"] + likert_score = request.form["likertscale"] + text_input = request.form["feedback"] + question_title = session["current_question"] + new_id = uuid.uuid4() + date = datetime.today() + print("new idea: {new_id} ".format(new_id=new_id)) + new_response = Response(id=new_id,user_id = session_user_id, question_title = question_title,likert_result = likert_score,notes = text_input, date_created = date) - #try: + try: db.session.add(new_response) db.session.commit() - return redirect("/form") #url_for("datapage") - #except: - #return "There was a problem while adding the response to the Database" + return redirect("/form") + except: + return "There was a problem while adding the response to the Database" @app.route("/form", methods=["GET", "POST"]) # / should not even be needed right? def formpage(): @@ -111,8 +120,6 @@ def formpage(): ) - - @app.route("/start", methods=["GET", "POST"]) def startpage(): if not "slaeform_device_id" in session: diff --git a/slaeforms/templates/SLAEForms Testing.code-workspace b/slaeforms/templates/SLAEForms Testing.code-workspace index 407c760..287ff60 100644 --- a/slaeforms/templates/SLAEForms Testing.code-workspace +++ b/slaeforms/templates/SLAEForms Testing.code-workspace @@ -1,8 +1,10 @@ -{ - "folders": [ - { - "path": "../.." - } - ], - "settings": {} +{ + "folders": [ + { + "path": ".." + }, + { + "path": "../../../CSS Testing" + } + ] } \ No newline at end of file diff --git a/slaeforms/templates/styles.css b/slaeforms/templates/styles.css deleted file mode 100644 index 1e1bfa4..0000000 --- a/slaeforms/templates/styles.css +++ /dev/null @@ -1,99 +0,0 @@ -body { - width: 100%; - height: 100vh; - margin: 0; - background-color: #a4b5ff; - color: #000000; - font-family: Tahoma; - font-size: 16px; - } - -.columncontainer { - display: flex; -} - -.columnleft { - width: 100%; - border: 3px solid black; -} -.columnright { - width: 100%; - border: 3px solid black; -} - -iframe { - display:block; - margin: auto; -} - - -.centertext { - text-align: center; -} - -h2,h3 { - text-align: center; -} - - -.likert { - --likert-rows: 5; - margin: auto; - text-align: center; - display: inline-grid; - max-width: 900px; - grid-auto-rows: 1fr; - gap: 1em; - grid-template-columns: repeat(var(--likert-rows), minmax(0, 1fr)); -} - -@media only screen and (max-width: 680px) { - .likert { - grid-template-columns: minmax(0, 400px); - justify-content: center; - } -} - -input, label { - display: block; - margin: 0.5rem 0; - } - -.likert input { - max-width: 250px; - position: fixed; - opacity: 0; - pointer-events: none; -} - -.likercontainer{ - margin: 30px auto; - text-align: center; -} -.likert span { - border-radius: 5px; - display: flex; - justify-content: center; - align-items: center; - text-align: center; - box-sizing: border-box; - width: 100%; - height: 100%; - padding: 20px; - background: #dcdcdc; - transition: background .2s ease-in-out; -} - -.likert input:checked + span { - outline: black auto 1px; - background: transparent; -} - -.likert input:focus + span { - outline: -webkit-focus-ring-color auto 1px; -} - -.likert span:hover { - background: #f1f1f1; - outline: lightgrey auto 0.5px; -} \ No newline at end of file