Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask, render_template, request, session, url_for, redirect
- app = Flask(__name__)
- app.config["SECRET_KEY"] = "iniSecretKey"
- nilaiku = 100
- qpertama = "ya"
- suasana = "senang"
- # Hasil Analisa
- M01 = "PRESENSI TIDAK TERBACA"
- M02 = "Pindah lokasi absen"
- M03 = "Tidak bisa absen"
- M04 = "Absen non OPD"
- M05 = "Tidak bisa login aplikasi e-Kinerja"
- M06 = "Tidak bisa input aktifitas aplikasi e-Kinerja"
- M07 = "Tambahan Penghasilan Pegawai (TPP) kurang di aplikasi e-Kinerja"
- M08 = "Tidak bisa login aplikasi e-SPPD"
- M09 = "Data salah di aplikasi e-SPPD"
- M10 = "Pembatalan Telahanan Staf (TS)"
- M11 = "Mesin Finger tidak terhubung"
- M12 = "Jaringan Internet terputus"
- M13 = "Problems tidak diketahui"
- # halaman depan
- @app.route("/")
- def index():
- return render_template("depan.html")
- # halaman login
- @app.route("/login", methods=["POST", "GET"])
- def login():
- if "email" in session:
- return redirect(url_for('sukses_req'))
- else:
- # jika tombol di klik -> request post
- if request.method == 'POST':
- email = request.form['email']
- password = request.form['password']
- if email == 'admin@gmail.com' and password == 'pass':
- session['email'] = email
- return redirect(url_for('userai'))
- else:
- #harus login dulu
- return redirect(url_for('login'))
- return render_template("login.html")
- # halaman logout
- @app.route("/logout")
- def logout_akun():
- try:
- session.pop("email")
- session.pop("nip")
- session.pop("nama")
- session.pop("pangkat")
- session.pop("jabatan")
- return redirect(url_for("login"))
- except :
- return redirect(url_for("login"))
- # halaman sukses
- @app.route("/sukses")
- def sukses_req():
- nilai = " Anda Sukses Login"
- return render_template("sukses.html", nilai=nilai)
- # halaman input data pengguna
- @app.route("/user", methods=["POST", "GET"])
- def userai():
- if request.method == 'POST':
- nip = request.form['fnip']
- nama = request.form['fnama']
- jabatan = request.form['fjabatan']
- pangkat = request.form['fpangkat']
- session['nip'] = nip
- session['nama'] = nama
- session['jabatan'] = jabatan
- session['pangkat'] = pangkat
- return render_template("sukses.html")
- else:
- return render_template("user.html")
- # halaman YA1
- @app.route("/suksesya")
- def Ya_req():
- nilai = " Anda Sukses Pilih Ya"
- return render_template("sukses.html", nilai=nilai)
- # halaman petunjuk
- @app.route("/petunjuk")
- def petunjuk():
- return render_template("petunjuk.html")
- # halaman hasil 1
- @app.route("/hasil")
- def hasil():
- session['report'] = M01
- datahasil = session['report']
- datanip = session['nip']
- datanama = session['nama']
- datajabatan = session['jabatan']
- datapangkat = session['pangkat']
- return render_template("hasil.html", nilai=M01, datanip=datanip, datanama=datanama, datajabatan=datajabatan, datapangkat=datapangkat )
- # halaman hasil 2
- @app.route("/hasil2")
- def hasil2():
- return render_template("m02.html", nilai=M02)
- # halaman hasil 3
- @app.route("/hasil3")
- def hasil3():
- return render_template("m03.html", nilai=M03)
- # halaman hasil 4
- @app.route("/hasil4")
- def hasil4():
- return render_template("m04.html", nilai=M04)
- # halaman hasil 5
- @app.route("/hasil5")
- def hasil5():
- return render_template("m05.html", nilai=M05)
- # halaman hasil 6
- @app.route("/hasil6")
- def hasil6():
- return render_template("m06.html", nilai=M06)
- # halaman hasil 7
- @app.route("/hasil7")
- def hasil7():
- return render_template("m07.html", nilai=M07)
- # halaman hasil 8
- @app.route("/hasil8")
- def hasil8():
- return render_template("m08.html", nilai=M08)
- # halaman hasil 9
- @app.route("/hasil9")
- def hasil9():
- return render_template("m09.html", nilai=M09)
- # halaman hasil 10
- @app.route("/hasil10")
- def hasil10():
- return render_template("m10.html", nilai=M10)
- # halaman hasil 11
- @app.route("/hasil11")
- def hasil11():
- return render_template("m11.html", nilai=M11)
- # halaman hasil 12
- @app.route("/hasil12")
- def hasil12():
- return render_template("m12.html", nilai=M12)
- # halaman hasil 12
- @app.route("/hasilbaru")
- def hasilbaru():
- return render_template("mbaru.html", nilai=M13)
- ###### JALANKAN PROGRAM PERTAMA DISINI
- @app.route("/checkuppertama", methods=["POST", "GET"])
- def checkuppertama():
- return render_template("index.html")
- ###### JALANKAN PROGRAM PERTANYAAN PERTAMA
- @app.route("/indexku", methods=["POST", "GET"])
- def checkup():
- # looping
- # hari = ['senin', 'selasa', 'rabu', 'kamis', 'jumat', 'sabtu', 'minggu']
- # return render_template("index.html", value=hari, nilai=nilaiku, suasana=suasana, qpertama=qpertama)
- #jika tombol button di klik -> request POST
- if request.method == 'POST':
- jawaban1 = request.form['qsatu']
- if jawaban1 == 'Ya' :
- session['qsatu'] = jawaban1
- return redirect(url_for('question2'))
- elif jawaban1 == 'Pilih Jawaban' :
- session['qsatu'] = jawaban1
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question2'))
- return render_template("index.html")
- @app.route("/contact")
- def contactku():
- return render_template("contact.html")
- @app.route("/about")
- def aboutku():
- if "email" in session:
- return render_template("about.html")
- else:
- return redirect(url_for('login'))
- # session
- @app.route("/halaman/<int:angka>")
- def session_1(angka):
- session["nilaiku"] = angka
- return "Berhasil mengeset isi nilaiku"
- @app.route("/halaman/lihat")
- def view_session_1():
- try:
- data = session["nilaiku"]
- return "Nilai yang sudah di set adalah = {}".format(data)
- except:
- return "Anda tidak memiliki nilaiku lagi"
- @app.route("/halaman/logout")
- def logout_session_1():
- session.pop("nilaiku")
- return "Session berhasil dihapus"
- @app.route("/Pertanyaan02", methods=["POST", "GET"])
- def question2():
- if request.method == 'POST':
- jawaban2 = request.form['qdua']
- if jawaban2 == 'Ya' :
- session['qdua'] = jawaban2
- return redirect(url_for('hasil'))
- elif jawaban2 == 'Pilih Jawaban' :
- session['qdua'] = jawaban2
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question3'))
- return render_template("s02.html")
- @app.route("/Pertanyaan03", methods=["POST", "GET"])
- def question3():
- if request.method == 'POST':
- jawaban3 = request.form['qtiga']
- if jawaban3 == 'Ya' :
- session['qtiga'] = jawaban3
- return redirect(url_for('hasil'))
- elif jawaban3 == 'Pilih Jawaban' :
- session['qtiga'] = jawaban3
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question4'))
- return render_template("s03.html")
- @app.route("/Pertanyaan04", methods=["POST", "GET"])
- def question4():
- if request.method == 'POST':
- jawaban4 = request.form['qempat']
- if jawaban4 == 'Ya' :
- session['qempat'] = jawaban4
- return redirect(url_for('hasil'))
- elif jawaban4 == 'Pilih Jawaban' :
- session['qempat'] = jawaban4
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question5'))
- return render_template("s04.html")
- @app.route("/Pertanyaan05", methods=["POST", "GET"])
- def question5():
- if request.method == 'POST':
- jawaban5 = request.form['qlima']
- if jawaban5 == 'Ya' :
- session['qlima'] = jawaban5
- return redirect(url_for('hasil'))
- elif jawaban5 == 'Pilih Jawaban' :
- session['qlima'] = jawaban5
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question6'))
- return render_template("s05.html")
- @app.route("/Pertanyaan06", methods=["POST", "GET"])
- def question6():
- if request.method == 'POST':
- jawaban6 = request.form['qenam']
- if jawaban6 == 'Ya' :
- session['qenam'] = jawaban6
- return redirect(url_for('question7'))
- elif jawaban6 == 'Pilih Jawaban' :
- session['qenam'] = jawaban6
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question9'))
- return render_template("s06.html")
- @app.route("/Pertanyaan07", methods=["POST", "GET"])
- def question7():
- if request.method == 'POST':
- jawaban7 = request.form['qtujuh']
- if jawaban7 == 'Ya' :
- session['qtujuh'] = jawaban7
- return redirect(url_for('question8'))
- elif jawaban7 == 'Pilih Jawaban' :
- session['qtujuh'] = jawaban7
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question9'))
- return render_template("s07.html")
- @app.route("/Pertanyaan08", methods=["POST", "GET"])
- def question8():
- if request.method == 'POST':
- jawaban8 = request.form['qdelapan']
- if jawaban8 == 'Ya' :
- session['qdelapan'] = jawaban8
- return redirect(url_for('hasil2'))
- elif jawaban8 == 'Pilih Jawaban' :
- session['qdelapan'] = jawaban8
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question9'))
- return render_template("s08.html")
- @app.route("/Pertanyaan09", methods=["POST", "GET"])
- def question9():
- if request.method == 'POST':
- jawaban9 = request.form['qsembilan']
- if jawaban9 == 'Ya' :
- session['qsembilan'] = jawaban9
- return redirect(url_for('hasil3'))
- elif jawaban9 == 'Pilih Jawaban' :
- session['qsembilan'] = jawaban9
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question10'))
- return render_template("s09.html")
- @app.route("/Pertanyaan010", methods=["POST", "GET"])
- def question10():
- if request.method == 'POST':
- jawaban10 = request.form['qsepuluh']
- if jawaban10 == 'Ya' :
- session['qsepuluh'] = jawaban10
- return redirect(url_for('question11'))
- elif jawaban10 == 'Pilih Jawaban' :
- session['qsepuluh'] = jawaban10
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question13'))
- return render_template("s10.html")
- @app.route("/Pertanyaan011", methods=["POST", "GET"])
- def question11():
- if request.method == 'POST':
- jawaban11 = request.form['qsebelas']
- if jawaban11 == 'Ya' :
- session['qsebelas'] = jawaban11
- return redirect(url_for('hasil3'))
- elif jawaban11 == 'Pilih Jawaban' :
- session['qsebelas'] = jawaban11
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question13'))
- return render_template("s11.html")
- @app.route("/Pertanyaan012", methods=["POST", "GET"])
- def question12():
- if request.method == 'POST':
- jawaban12 = request.form['qduabelas']
- if jawaban12 == 'Ya' :
- session['qduabelas'] = jawaban12
- return redirect(url_for('hasil4'))
- elif jawaban12 == 'Pilih Jawaban' :
- session['qduabelas'] = jawaban12
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question14'))
- return render_template("s12.html")
- @app.route("/Pertanyaan013", methods=["POST", "GET"])
- def question13():
- if request.method == 'POST':
- jawaban13 = request.form['qtigabelas']
- if jawaban13 == 'Ya' :
- session['qtigabelas'] = jawaban13
- return redirect(url_for('hasil5'))
- elif jawaban13 == 'Pilih Jawaban' :
- session['qtigabelas'] = jawaban13
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question11A'))
- return render_template("s13.html")
- @app.route("/Pertanyaan11A", methods=["POST", "GET"])
- def question11A():
- if request.method == 'POST':
- jawaban11A = request.form['qsebelasA']
- if jawaban11A == 'Ya' :
- session['qsebelasA'] = jawaban11A
- return redirect(url_for('question12'))
- elif jawaban11A == 'Pilih Jawaban' :
- session['qsebelasA'] = jawaban11A
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question14'))
- return render_template("s11A.html")
- @app.route("/Pertanyaan014", methods=["POST", "GET"])
- def question14():
- if request.method == 'POST':
- jawaban14 = request.form['qempatbelas']
- if jawaban14 == 'Ya' :
- session['qempatbelas'] = jawaban14
- return redirect(url_for('question15'))
- elif jawaban14 == 'Pilih Jawaban' :
- session['qempatbelas'] = jawaban14
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question16'))
- return render_template("s14.html")
- @app.route("/Pertanyaan015", methods=["POST", "GET"])
- def question15():
- if request.method == 'POST':
- jawaban15 = request.form['qlimabelas']
- if jawaban15 == 'Ya' :
- session['qlimabelas'] = jawaban15
- return redirect(url_for('hasil5'))
- elif jawaban15 == 'Pilih Jawaban' :
- session['qlimabelas'] = jawaban15
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question16'))
- return render_template("s15.html")
- @app.route("/Pertanyaan016", methods=["POST", "GET"])
- def question16():
- if request.method == 'POST':
- jawaban16 = request.form['qenambelas']
- if jawaban16 == 'Ya' :
- session['qenambelas'] = jawaban16
- return redirect(url_for('hasil5'))
- elif jawaban16 == 'Pilih Jawaban' :
- session['qenambelas'] = jawaban16
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question5A'))
- return render_template("s16.html")
- @app.route("/Pertanyaan05A", methods=["POST", "GET"])
- def question5A():
- if request.method == 'POST':
- jawaban5A = request.form['qlimaA']
- if jawaban5A == 'Ya' :
- session['qlimaA'] = jawaban5A
- return redirect(url_for('question19'))
- elif jawaban5A == 'Pilih Jawaban' :
- session['qlimaA'] = jawaban5A
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question17'))
- return render_template("s05A.html")
- @app.route("/Pertanyaan12A", methods=["POST", "GET"])
- def question12A():
- if request.method == 'POST':
- jawaban12A = request.form['qduabelasA']
- if jawaban12A == 'Ya' :
- session['qduabelasA'] = jawaban12A
- return redirect(url_for('hasil4'))
- elif jawaban12A == 'Pilih Jawaban' :
- session['qduabelasA'] = jawaban12A
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question17'))
- return render_template("s12A.html")
- @app.route("/Pertanyaan017", methods=["POST", "GET"])
- def question17():
- if request.method == 'POST':
- jawaban17 = request.form['qtujuhbelas']
- if jawaban17 == 'Ya' :
- session['qtujuhbelas'] = jawaban17
- return redirect(url_for('question18'))
- elif jawaban17 == 'Pilih Jawaban' :
- session['qtujuhbelas'] = jawaban17
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question21'))
- return render_template("s17.html")
- @app.route("/Pertanyaan018", methods=["POST", "GET"])
- def question18():
- if request.method == 'POST':
- jawaban18 = request.form['qdelapanbelas']
- if jawaban18 == 'Ya' :
- session['qdelapanbelas'] = jawaban18
- return redirect(url_for('question20'))
- elif jawaban18 == 'Pilih Jawaban' :
- session['qdelapanbelas'] = jawaban18
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question21'))
- return render_template("s18.html")
- @app.route("/Pertanyaan019", methods=["POST", "GET"])
- def question19():
- if request.method == 'POST':
- jawaban19 = request.form['qsembilanbelas']
- if jawaban19 == 'Ya' :
- session['qsembilanbelas'] = jawaban19
- return redirect(url_for('hasil6'))
- elif jawaban19 == 'Pilih Jawaban' :
- session['qsembilanbelas'] = jawaban19
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question17'))
- return render_template("s19.html")
- @app.route("/Pertanyaan020", methods=["POST", "GET"])
- def question20():
- if request.method == 'POST':
- jawaban20 = request.form['qduapuluh']
- if jawaban20 == 'Ya' :
- session['qduapuluh'] = jawaban20
- return redirect(url_for('hasil6'))
- elif jawaban20 == 'Pilih Jawaban' :
- session['qduapuluh'] = jawaban20
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question21'))
- return render_template("s20.html")
- @app.route("/Pertanyaan021", methods=["POST", "GET"])
- def question21():
- if request.method == 'POST':
- jawaban21 = request.form['qduapuluhsatu']
- if jawaban21 == 'Ya' :
- session['qduapuluhsatu'] = jawaban21
- return redirect(url_for('question22'))
- elif jawaban21 == 'Pilih Jawaban' :
- session['qduapuluhsatu'] = jawaban21
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question13A'))
- return render_template("s21.html")
- @app.route("/Pertanyaan022", methods=["POST", "GET"])
- def question22():
- if request.method == 'POST':
- jawaban22 = request.form['qduapuluhdua']
- if jawaban22 == 'Ya' :
- session['qduapuluhdua'] = jawaban22
- return redirect(url_for('hasil7'))
- elif jawaban22 == 'Pilih Jawaban' :
- session['qduapuluhdua'] = jawaban22
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question13A'))
- return render_template("s22.html")
- @app.route("/Pertanyaan013A", methods=["POST", "GET"])
- def question13A():
- if request.method == 'POST':
- jawaban13A = request.form['qtigabelasA']
- if jawaban13A == 'Ya' :
- session['qtigabelasA'] = jawaban13A
- return redirect(url_for('question23'))
- elif jawaban13A == 'Pilih Jawaban' :
- session['qtigabelas'] = jawaban13A
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question24'))
- return render_template("s13A.html")
- @app.route("/Pertanyaan023", methods=["POST", "GET"])
- def question23():
- if request.method == 'POST':
- jawaban23 = request.form['qduapuluhtiga']
- if jawaban23 == 'Ya' :
- session['qduapuluhtiga'] = jawaban23
- return redirect(url_for('hasil8'))
- elif jawaban23 == 'Pilih Jawaban' :
- session['qduapuluhtiga'] = jawaban23
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question24'))
- return render_template("s23.html")
- @app.route("/Pertanyaan024", methods=["POST", "GET"])
- def question24():
- if request.method == 'POST':
- jawaban24 = request.form['qduapuluhempat']
- if jawaban24 == 'Ya' :
- session['qduapuluhempat'] = jawaban24
- return redirect(url_for('hasil8'))
- elif jawaban24 == 'Pilih Jawaban' :
- session['qduapuluhempat'] = jawaban24
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question25'))
- return render_template("s24.html")
- @app.route("/Pertanyaan025", methods=["POST", "GET"])
- def question25():
- if request.method == 'POST':
- jawaban25 = request.form['qduapuluhlima']
- if jawaban25 == 'Ya' :
- session['qduapuluhlima'] = jawaban25
- return redirect(url_for('question26'))
- elif jawaban25 == 'Pilih Jawaban' :
- session['qduapuluhlima'] = jawaban25
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question28'))
- return render_template("s25.html")
- @app.route("/Pertanyaan026", methods=["POST", "GET"])
- def question26():
- if request.method == 'POST':
- jawaban26 = request.form['qduapuluhenam']
- if jawaban26 == 'Ya' :
- session['qduapuluhenam'] = jawaban26
- return redirect(url_for('question27'))
- elif jawaban26 == 'Pilih Jawaban' :
- session['qduapuluhenam'] = jawaban26
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question28'))
- return render_template("s26.html")
- @app.route("/Pertanyaan027", methods=["POST", "GET"])
- def question27():
- if request.method == 'POST':
- jawaban27 = request.form['qduapuluhtujuh']
- if jawaban27 == 'Ya' :
- session['qduapuluhtujuh'] = jawaban27
- return redirect(url_for('hasil9'))
- elif jawaban27 == 'Pilih Jawaban' :
- session['qduapuluhtujuh'] = jawaban27
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question28'))
- return render_template("s27.html")
- @app.route("/Pertanyaan028", methods=["POST", "GET"])
- def question28():
- if request.method == 'POST':
- jawaban28 = request.form['qduapuluhdelapan']
- if jawaban28 == 'Ya' :
- session['qduapuluhdelapan'] = jawaban28
- return redirect(url_for('question29'))
- elif jawaban28 == 'Pilih Jawaban' :
- session['qduapuluhdelapan'] = jawaban28
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question30'))
- return render_template("s28.html")
- @app.route("/Pertanyaan029", methods=["POST", "GET"])
- def question29():
- if request.method == 'POST':
- jawaban29 = request.form['qduapuluhsembilan']
- if jawaban29 == 'Ya' :
- session['qduapuluhsembilan'] = jawaban29
- return redirect(url_for('hasil10'))
- elif jawaban29 == 'Pilih Jawaban' :
- session['qduapuluhsembilan'] = jawaban29
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question30'))
- return render_template("s29.html")
- @app.route("/Pertanyaan030", methods=["POST", "GET"])
- def question30():
- if request.method == 'POST':
- jawaban30 = request.form['qtigapuluh']
- if jawaban30 == 'Ya' :
- session['qtigapuluh'] = jawaban30
- return redirect(url_for('question31'))
- elif jawaban30 == 'Pilih Jawaban' :
- session['qtigapuluh'] = jawaban30
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question32'))
- return render_template("s30.html")
- @app.route("/Pertanyaan031", methods=["POST", "GET"])
- def question31():
- if request.method == 'POST':
- jawaban31 = request.form['qtigapuluhsatu']
- if jawaban31 == 'Ya' :
- session['qtigapuluhsatu'] = jawaban31
- return redirect(url_for('hasil11'))
- elif jawaban31 == 'Pilih Jawaban' :
- session['qtigapuluhsatu'] = jawaban31
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question32'))
- return render_template("s31.html")
- @app.route("/Pertanyaan032", methods=["POST", "GET"])
- def question32():
- if request.method == 'POST':
- jawaban32 = request.form['qtigapuluhdua']
- if jawaban32 == 'Ya' :
- session['qtigapuluhdua'] = jawaban32
- return redirect(url_for('question34'))
- elif jawaban32 == 'Pilih Jawaban' :
- session['qtigapuluhdua'] = jawaban32
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question33'))
- return render_template("s32.html")
- @app.route("/Pertanyaan033", methods=["POST", "GET"])
- def question33():
- if request.method == 'POST':
- jawaban33 = request.form['qtigapuluhtiga']
- if jawaban33 == 'Ya' :
- session['qtigapuluhtiga'] = jawaban33
- return redirect(url_for('hasil12'))
- elif jawaban33 == 'Pilih Jawaban' :
- session['qtigapuluhtiga'] = jawaban33
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('question34'))
- return render_template("s33.html")
- @app.route("/Pertanyaan034", methods=["POST", "GET"])
- def question34():
- if request.method == 'POST':
- jawaban34 = request.form['qtigapuluhempat']
- if jawaban34 == 'Ya' :
- session['qtigapuluhempat'] = jawaban34
- return redirect(url_for('hasil12'))
- elif jawaban34 == 'Pilih Jawaban' :
- session['qtigapuluhempat'] = jawaban34
- return redirect(url_for('hasil'))
- else:
- #harus pilih jawaban dulu
- return redirect(url_for('hasilbaru'))
- return render_template("s34.html")
- if __name__ == "__main__":
- app.run(debug=True)
Add Comment
Please, Sign In to add comment