Best Python code snippet using autotest_python
sketch.js
Source:sketch.js
1//Creating Sprites23var back_img, q4wrong, q4wr_img;4var geniussound;5var quesarriver;6var sc25,sc25_img;7var wrongsound;8var let, let_img;9var oneinf, oneinf_img;10var during, question5, question5_image;11var question1, question1_img;12var q1op1, question3c, question3c_img;13var q1op2, q1op3, q1op4;14var c1_img, c1, correct1sound;15var C1_img, info1;16var question3, ques3_img, ques3wr, ques3wr_img;17var ques2wrong, ques2wr_img, ques2c, ques2c_img;18var wrong, wrong_img, q4correct, q4correct_image;19var Question2, Ques2_image, question4, ques4_img;20var Question5c, question5c_image;21var Question5w, question5w_img;22var score = 0;2324function preload() {25 //Assigning images and sounds26 back_img = loadImage(" First background.png");27 // during=loadImage("During game background.png");28 oneinf_img = loadImage("information_page.png");29 question1_img = loadImage("Q1.PNG");30 c1_img = loadImage("c1.PNG");31 //C1_img=loadImage("information of first question.PNG");32 wrong_img = loadImage("Wrong.PNG");33 Ques2_image = loadImage("question 2.PNG");34 ques2wr_img = loadImage("Wrong2 inf.PNG");35 ques2c_img = loadImage("op@ques2 correct.PNG");36 ques3_img = loadImage("question 3.PNG");37 question3c_img = loadImage("q3 correct.PNG");38 ques3wr_img = loadImage("q3wr.PNG");39 ques4_img = loadImage("question 4.PNG");40 q4correct_image = loadImage("q4 correct.PNG");41 q4wr_img = loadImage("q4 wrong.PNG");42 question5_image = loadImage("Question no 5.PNG");43 question5c_image = loadImage("correct5.PNG");44 question5w_img = loadImage("question 5wrong.PNG");45 correct1sound = loadSound("Sounds/right sound.mp3");46 quesarriver = loadSound("Sounds/Question arriving.mp3");47 wrongsound=loadSound("Sounds/Wrong sound.mp3");48 sc25_img=loadImage("score=25.PNG");49 geniussound=loadSound("Sounds/Genius.m4a");50}515253function setup() {54 canvas = createCanvas(displayWidth - 20, displayHeight - 30);5556 //Create the Bodies Here.57 58//Starting Button59 this.button = createButton("Let's Play");60 this.button.position(displayWidth / 2.4 + 30, displayHeight / 1.7);61 this.button.style('width', '250px');62 this.button.style('height', '50px');63 this.button.style('background', 'yellow');646566}67686970717273function draw() {74 rectMode(CENTER);75 background(rgb(198,135,103));76 image(back_img,0,-displayHeight*0,displayWidth/1, displayHeight*1)77 textSize(30);78 fill(0, 199, 255);79 text("Score=" + score, displayWidth / 1.2 + 30, displayHeight / 2.9);80 // background(rgb(198,135,103));81 //image(back_img,0,-displayHeight*0,displayWidth/1, displayHeight*1);82 //Mouse pressed over starting button.83 this.button.mousePressed(() => {84 this.button.hide();85 //this.greeting.html("Hello ");86 //Creating first info87 oneinf = createSprite(displayWidth / 2 + 30, displayHeight / 2);88 oneinf.addImage("info", oneinf_img);89 //creating start button.90 this.StartQuiz = createButton("Start Quiz");91 this.StartQuiz.position(displayWidth / 1.4 + 30, displayHeight / 1.3);92 this.StartQuiz.style('height', '30px');93 this.StartQuiz.style('background', 'lightgreen')9495 //Mouse pressed over Startquiz button96 this.StartQuiz.mousePressed(() => {97 //Question arriving sound98 quesarriver.play();99 //Making the first information invisible.100 oneinf.visible = false;101 //Hiding Startquiz button and displaying 1st question.102 this.StartQuiz.hide();103 question1 = createSprite(displayWidth / 2 + 30, displayHeight / 2);104 question1.addImage("question1", question1_img);105 //Question1 option1106 this.q1o1 = createButton("A.De-oxyribonuclieo acid");107 this.q1o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);108 //Question1 option2.109 this.q1o2 = createButton("B.Da-oxyribonuclieo antifoam")110 this.q1o2.position(displayWidth / 1.8 + 10, displayHeight / 1.7);111112 //Question1 option2 mousepressed.113 this.q1o2.mousePressed(() => {114 //Displaying wrong question.115 wrongsound.play();116 wrong = createSprite(displayWidth / 2 + 30, displayHeight / 2);117 wrong.addImage("Wrong", wrong_img);118 //Deducting score by 3.119 score = score - 3;120121 //Hiding option 1 and 2 of question1.122 this.q1o1.hide();123 this.q1o2.hide();124 //Hiding question1.125 question1.visible = false;126 //making next option for question1 wrong answer.127 this.next1 = createButton("NEXT");128 this.next1.position(displayWidth / 1.4 + 10, displayHeight / 1.3);129130//mousePressedof nextoption after giving first question wrong.131 this.next1.mousePressed(() => {132 quesarriver.play();133//Displaying question number two when first question is wrong.134 Question2 = createSprite(displayWidth / 2 + 30, displayHeight / 2);135 Question2.addImage("Question2", Ques2_image);136 wrong.visible = false;137 this.next1.hide();138 this.q2o1 = createButton("A. Solar energy");139 this.q2o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);140141 this.q2o2 = createButton("B.Earthâs magnetic field");142 this.q2o2.position(displayWidth / 1.8 + 10, displayHeight / 1.7);143//MousePressedOver of correct option of question2 when first is wrong.144 this.q2o2.mousePressed(() => {145 correct1sound.play();146 score = score + 5;147 this.q2o1.hide();148 this.q2o2.hide();149 ques2c = createSprite(displayWidth / 2 + 30, displayHeight / 2);150 ques2c.addImage("Correct2", ques2c_img);151 Question2.visible = false;152 this.next6 = createButton("NEXT");153 this.next6.position(displayWidth / 1.5 + 10, displayHeight / 1.6);154 //mousePressedover next when first is wrong and second is correct.155 this.next6.mousePressed(() => {156 this.next6.hide();157 quesarriver.play();158 ques2c.visible = false;159 question3 = createSprite(displayWidth / 2 + 30, displayHeight / 2);160 question3.addImage("Question3", ques3_img);161 this.w3q3 = createButton("A.3,285,334 sq.km");162 this.w3q3.position(displayWidth / 2.9 + 10, displayHeight / 1.8);163164 this.c3q3 = createButton("A.3,287,263 sq.km");165 this.c3q3.position(displayWidth / 1.8 + 10, displayHeight / 1.8);166//MousePressed over wrong option of question3 when first is correct and second is wrong.167 this.w3q3.mousePressed(() => {168 wrongsound.play();169 score = score - 3;170 this.w3q3.hide();171 this.c3q3.hide();172 question3.visible = false;173 ques3wr = createSprite(displayWidth / 2 + 30, displayHeight / 2);174 ques3wr.addImage("Wrongmanyook", ques3wr_img);175176 this.next15 = createButton("NEXT");177 this.next15.position(displayWidth / 1.5 + 10, displayHeight / 1.6);178//MousepressedOver next for first wrong second correct and third wrong.179 this.next15.mousePressed(() => {180 quesarriver.play();181 question4 = createSprite(displayWidth / 2 + 30, displayHeight / 2);182 question4.addImage("Nextquestion", ques4_img);183 this.next15.hide();184 ques3wr.visible = false;185 this.w3q3.visible = false;186187 this.opq4 = createButton("A.74,377.00 rupees");188 this.opq4.position(displayWidth / 2.9 + 10, displayHeight / 1.7);189190 this.op2q4 = createButton("B.74,395.10 rupees");191 this.op2q4.position(displayWidth / 1.8 + 10, displayHeight / 1.7);192//MousePressed for correct option of question4 when first worng second correct and third wrong.193 this.opq4.mousePressed(() => {194 quesarriver.play();195 score = score + 5;196 q4correct = createSprite(displayWidth / 2 + 30, displayHeight / 2);197 q4correct.addImage("Q4correct", q4correct_image);198 this.opq4.hide();199 this.op2q4.hide();200 question4.visible = false;201 this.next16 = createButton("NEXT");202 this.next16.position(displayWidth / 1.5 + 10, displayHeight / 1.6);203//MousePressed of next for first worng second correct third wrong and fourth correct.204 this.next16.mousePressed(() => {205 this.next16.hide();206 quesarriver.play();207 q4correct.visible = false;208 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)209 question5.addImage("Q5", question5_image);210 this.q5o1 = createButton("1933");211 this.q5o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);212 this.q5o2 = createButton("1948");213 this.q5o2.position(displayWidth / 2 + 10, displayHeight / 1.7);214//MousePressedOver correct option of ques5 when 1wrong,2correct,3wrong and 4correct.215 this.q5o1.mousePressed(() => {216 score = score + 5;217 correct1sound.play();218 this.q5o2.hide();219 this.q5o1.hide();220 question5.visible = false;221 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);222 Question5c.addImage("Correct5", question5c_image);223 })224 //MousePressedOver Wrong option of ques5 when 1wrong,2correct,3wrong and 4correct225 this.q5o2.mousePressed(() => {226 wrongsound.play();227 score = score - 3;228 this.q5o2.hide();229 this.q5o1.hide();230 question5.visible = false;231 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);232 Question5w.addImage("Wrong5", question5w_img);233 })234235 })236237 })238 //MousePressed for wrong option of question4 when first worng second correct and third wrong. 239 this.op2q4.mousePressed(() => {240 wrongsound.play();241 score = score - 3;242 this.op2q4.hide();243 this.opq4.hide();244 question4.visible = false;245 q4wrong = createSprite(displayWidth / 2 + 30, displayHeight / 2);246 q4wrong.addImage("Q4wrong", q4wr_img);247 this.next17 = createButton("NEXT");248 this.next17.position(displayWidth / 1.5 + 10, displayHeight / 1.6);249//NextPressedOver when 1,3,4 are wrong and 2 is correct.250 this.next17.mousePressed(() => {251 this.next17.hide();252 quesarriver.play();253 q4wrong.visible = false;254255 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)256 question5.addImage("Q5", question5_image);257 this.cq5o1 = createButton("1933");258 this.cq5o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);259 this.wq5o2 = createButton("1948");260 this.wq5o2.position(displayWidth / 2 + 10, displayHeight / 1.7);261//Correct option of question 5 selected when 1,3,4 are wrong and 2 is correct.262 this.cq5o1.mousePressed(() => {263 correct1sound.play();264 score = score + 5;265 this.wq5o2.hide();266 this.cq5o1.hide();267 question5.visible = false;268 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);269 Question5c.addImage("ACorrect5", question5c_image);270 })271 //Wrong option of question 5 selected when 1,3,4 are wrong and 2 is correct. 272 this.wq5o2.mousePressed(() => {273 wrongsound.play();274 score = score - 3;275 this.wq5o2.hide();276 this.cq5o1.hide();277 question5.visible = false;278 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);279 Question5w.addImage("AWrong5", question5w_img);280 })281282 })283284 })285286 })287 })288 //mousepressed over of correct option of question3 when first is wrong and second is correct 289 this.c3q3.mousePressed(() => {290 score=score+5;291 correct1sound.play();292 this.c3q3.hide();293 this.w3q3.hide();294 question3.visible = false;295 question3c = createSprite(displayWidth / 2 + 30, displayHeight / 2);296 question3c.addImage("Corrctansweris", question3c_img);297 this.next14 = createButton("NEXT");298 this.next14.position(displayWidth / 1.5 + 10, displayHeight / 1.6);299 //Pressing next when first is wrong second is correct and third is correct. 300 this.next14.mousePressed(() => {301 this.next14.hide();302 quesarriver.play();303 question3c.visible = false;304 question4 = createSprite(displayWidth / 2 + 30, displayHeight / 2);305 question4.addImage("Next1question", ques4_img);306 this.oq4 = createButton("A.74,377.00 rupees");307 this.oq4.position(displayWidth / 2.9 + 10, displayHeight / 1.7);308 this.o2q4 = createButton("B.74,395.10 rupees");309 this.o2q4.position(displayWidth / 1.8 + 10, displayHeight / 1.7);310 //Pressing correct option of question 4 in condition of 1 wrong and 2,3 correct. 311 this.oq4.mousePressed(() => {312 score=score+5;313 correct1sound.play();314 this.oq4.hide();315 this.o2q4.hide();316 question4.visible = false;317 q4correct = createSprite(displayWidth / 2 + 30, displayHeight / 2);318 q4correct.addImage("yesagain", q4correct_image);319 this.next18 = createButton("NEXT");320 this.next18.position(displayWidth / 1.5 + 10, displayHeight / 1.6);321//Pressing next when 1 is wrong and (2,3,4) are correct.322 this.next18.mousePressed(() => {323 this.next18.hide();324 quesarriver.play();325 q4correct.visible = false;326 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)327 question5.addImage("Q5", question5_image);328 this.Aq5o1 = createButton("1933");329 this.Aq5o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);330 this.Bq5o2 = createButton("1948");331 this.Bq5o2.position(displayWidth / 2 + 10, displayHeight / 1.7);332//Pressing question5 correct when 1 is wrong and (2,3,4) are correct.333 this.Aq5o1.mousePressed(() => {334 score=score+5;335 correct1sound.play();336 this.Bq5o2.hide();337 this.Aq5o1.hide();338 question5.visible = false;339 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);340 Question5c.addImage("BCorrect5", question5c_image);341 })342 //Pressing question5 wrong when 1 is wrong and (2,3,4) are correct. 343 this.Bq5o2.mousePressed(() => {344 score=score-3;345 wrongsound.play();346 this.Bq5o2.hide();347 this.Aq5o1.hide();348 question5.visible = false;349 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);350 Question5w.addImage("BWrong5", question5w_img);351 })352353 })354 })355 // //Pressing wrong option of ques 4 when 1 is wrong and (2,3) are correct. 356 this.o2q4.mousePressed(() => {357 score=score-3;358 wrongsound.play();359 this.o2q4.hide();360 this.oq4.hide();361 question4.visible = false;362 q4wrong = createSprite(displayWidth / 2 + 30, displayHeight / 2);363 q4wrong.addImage("notagain", q4wr_img);364365 this.next19 = createButton("NEXT");366 this.next19.position(displayWidth / 1.5 + 10, displayHeight / 1.6);367//Pressing next when (1,4)W and (2,3)C.368 this.next19.mousePressed(() => {369 quesarriver.play();370 this.next19.hide();371 q4wrong.visible = false;372 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)373 question5.addImage("Q5", question5_image);374 this.qA5o1 = createButton("1933");375 this.qA5o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);376 this.qA5o2 = createButton("1948");377 this.qA5o2.position(displayWidth / 2 + 10, displayHeight / 1.7);378//Pressing ques5 correct if (1,4)W and (2,3)C.379 this.qA5o1.mousePressed(() => {380 score=score+5;381 correct1sound.play();382 this.qA5o2.hide();383 this.qA5o1.hide();384 question5.visible = false;385 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);386 Question5c.addImage("CCorrect5", question5c_image);387 })388//Choosing question5 wrong when (1,4)W and (2,3)C. 389 this.qA5o2.mousePressed(() => {390 score=score-3;391 wrongsound.play();392 this.qA5o2.hide();393 this.qA5o1.hide();394 question5.visible = false;395 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);396 Question5w.addImage("CWrong5", question5w_img);397 })398399 })400401 })402403404 })405 })406407 })408409410 })411412 this.q2o1.mousePressed(() => {413 this.q2o1.hide();414 this.q2o2.hide();415 Question2.visible = false;416 ques2wrong = createSprite(displayWidth / 2 + 30, displayHeight / 2);417 ques2wrong.addImage("Wrong2", ques2wr_img);418 this.next5 = createButton("NEXT");419 this.next5.position(displayWidth / 1.5 + 10, displayHeight / 1.6);420421 this.next5.mousePressed(() => {422 this.next5.hide();423 ques2wrong.visible = false;424 question3 = createSprite(displayWidth / 2 + 30, displayHeight / 2);425 question3.addImage("Question 3", ques3_img);426 this.w2q3 = createButton("A.3,285,334 sq.km");427 this.w2q3.position(displayWidth / 2.9 + 10, displayHeight / 1.8);428429 this.c2q3 = createButton("B.3,287,263 sq.km");430 this.c2q3.position(displayWidth / 1.8 + 10, displayHeight / 1.8);431432 this.w2q3.mousePressed(() => {433 this.w2q3.hide();434 this.c2q3.hide();435 question3.visible = false;436 ques3wr = createSprite(displayWidth / 2 + 30, displayHeight / 2);437 ques3wr.addImage("Wrongmanyoo", ques3wr_img);438 this.next13 = createButton("NEXT");439 this.next13.position(displayWidth / 1.5 + 10, displayHeight / 1.6);440441 this.next13.mousePressed(() => {442 this.next13.hide();443 ques3wr.visible = false;444 question4 = createSprite(displayWidth / 2 + 30, displayHeight / 2);445 question4.addImage("yahoo", ques4_img);446 this.coq4 = createButton("A.74,377.00 rupees");447 this.coq4.position(displayWidth / 2.9 + 10, displayHeight / 1.7);448 this.wo2q4 = createButton("B.74,395.10 rupees");449 this.wo2q4.position(displayWidth / 1.8 + 10, displayHeight / 1.7);450 this.coq4.mousePressed(() => {451 this.coq4.hide();452 this.wo2q4.hide();453 question4.visible = false;454 q4correct = createSprite(displayWidth / 2 + 30, displayHeight / 2);455 q4correct.addImage("yesaagain", q4correct_image);456457 this.next20 = createButton("NEXT");458 this.next20.position(displayWidth / 1.5 + 10, displayHeight / 1.6);459460 this.next20.mousePressed(() => {461 this.next20.hide();462 q4correct.visible = false;463 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)464 question5.addImage("Q5", question5_image);465 this.qB5o1 = createButton("1933");466 this.qB5o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);467 this.qB5o2 = createButton("1948");468 this.qB5o2.position(displayWidth / 2 + 10, displayHeight / 1.7);469470 this.qB5o1.mousePressed(() => {471 this.qB5o2.hide();472 this.qB5o1.hide();473 question5.visible = false;474 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);475 Question5c.addImage("WCorrect5", question5c_image);476 })477 this.qB5o2.mousePressed(() => {478 this.qB5o2.hide();479 this.qB5o1.hide();480 question5.visible = false;481 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);482 Question5w.addImage("WWrong5", question5w_img);483 })484485 })486487 })488 this.wo2q4.mousePressed(() => {489 this.wo2q4.hide();490 this.coq4.hide();491 question4.visible = false;492 q4wrong = createSprite(displayWidth / 2 + 30, displayHeight / 2);493 q4wrong.addImage("notaagain", q4wr_img);494495 this.next21 = createButton("NEXT");496 this.next21.position(displayWidth / 1.5 + 10, displayHeight / 1.6);497498 this.next21.mousePressed(() => {499 this.next21.hide();500 q4wrong.visible = false;501 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)502 question5.addImage("Q5", question5_image);503 this.qC5o1 = createButton("1933");504 this.qC5o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);505 this.qC5o2 = createButton("1948");506 this.qC5o2.position(displayWidth / 2 + 10, displayHeight / 1.7);507508 this.qC5o1.mousePressed(() => {509 this.qC5o2.hide();510 this.qC5o1.hide();511 question5.visible = false;512 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);513 Question5c.addImage("DCorrect5", question5c_image);514 })515 this.qC5o2.mousePressed(() => {516 this.qC5o2.hide();517 this.qC5o1.hide();518 question5.visible = false;519 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);520 Question5w.addImage("CWrong5", question5w_img);521 })522523 })524525 })526527528 })529 })530 this.c2q3.mousePressed(() => {531 this.c2q3.hide();532 this.w2q3.hide();533 question3.visible = false;534 question3c = createSprite(displayWidth / 2 + 30, displayHeight / 2);535 question3c.addImage("Correctansweris", question3c_img);536 this.next12 = createButton("NEXT");537 this.next12.position(displayWidth / 1.5 + 10, displayHeight / 1.6);538539 })540541 })542 })543544545 })546547 })548549 this.q1o1.mousePressed(() => {550 correct1sound.play();551 c1 = createSprite(displayWidth / 2 + 30, displayHeight / 2);552 c1.addImage("correct1", c1_img);553 score = score + 5;554555 question1.visible = false;556 this.q1o1.hide();557 this.q1o2.hide();558559 //this.button4=createButton("PRESS HERE FOR MORE INFORMATION");560 //this.button4.position(displayWidth/1.8 + 10, displayHeight/1.7)561562563 this.next2 = createButton("NEXT");564 this.next2.position(displayWidth / 1.5 + 10, displayHeight / 1.6);565566 this.next2.mousePressed(() => {567 Question2 = createSprite(displayWidth / 2 + 30, displayHeight / 2);568 Question2.addImage("Question2", Ques2_image);569 this.next2.hide();570 c1.visible = false;571 this.q2o1 = createButton("A. Solar energy");572 this.q2o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);573574 this.q2o2 = createButton("B.Earthâs magnetic field");575 this.q2o2.position(displayWidth / 1.8 + 10, displayHeight / 1.7);576577 this.q2o2.mousePressed(() => {578 score=score+5;579 this.q2o2.hide();580 this.q2o1.hide();581 Question2.visible = false;582 ques2c = createSprite(displayWidth / 2 + 30, displayHeight / 2);583 ques2c.addImage("Correct2", ques2c_img);584 this.next4 = createButton("NEXT");585 this.next4.position(displayWidth / 1.5 + 10, displayHeight / 1.6);586587 this.next4.mousePressed(() => {588 this.next4.hide();589 question3 = createSprite(displayWidth / 2 + 30, displayHeight / 2);590 question3.addImage("Question 3", ques3_img);591 ques2c.visible = false;592 this.wq3 = createButton("A.3,285,334 sq.km");593 this.wq3.position(displayWidth / 2.9 + 10, displayHeight / 1.8);594595 this.cq3 = createButton("A.3,287,263 sq.km");596 this.cq3.position(displayWidth / 1.8 + 10, displayHeight / 1.8);597 this.wq3.mousePressed(() => {598 this.wq3.hide();599 this.cq3.hide();600 question3.visible = false;601 ques3wr = createSprite(displayWidth / 2 + 30, displayHeight / 2);602 ques3wr.addImage("Wrongth", ques3wr_img);603 this.next10 = createButton("NEXT");604 this.next10.position(displayWidth / 1.5 + 10, displayHeight / 1.6);605 this.next10.mousePressed(() => {606 this.next10.hide();607 ques3wr.visible = false;608 question4 = createSprite(displayWidth / 2 + 30, displayHeight / 2);609 question4.addImage("yahoo", ques4_img);610 this.co1q4 = createButton("A.74,377.00 rupees");611 this.co1q4.position(displayWidth / 2.9 + 10, displayHeight / 1.7);612 this.w1o2q4 = createButton("B.74,395.10 rupees");613 this.w1o2q4.position(displayWidth / 1.8 + 10, displayHeight / 1.7);614 this.co1q4.mousePressed(() => {615 this.co1q4.hide();616 this.w1o2q4.hide();617 question4.visible = false;618 q4correct = createSprite(displayWidth / 2 + 30, displayHeight / 2);619 q4correct.addImage("y1esaagain", q4correct_image);620621 this.next22 = createButton("NEXT");622 this.next22.position(displayWidth / 1.5 + 10, displayHeight / 1.6);623624 this.next22.mousePressed(() => {625 this.next22.hide();626 q4correct.visible = false;627 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)628 question5.addImage("Q5", question5_image);629 this.qD5o1 = createButton("1933");630 this.qD5o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);631 this.qD5o2 = createButton("1948");632 this.qD5o2.position(displayWidth / 2 + 10, displayHeight / 1.7);633634 this.qD5o1.mousePressed(() => {635 this.qD5o2.hide();636 this.qD5o1.hide();637 question5.visible = false;638 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);639 Question5c.addImage("eCorrect5", question5c_image);640 })641 this.q5o2.mousePressed(() => {642 this.q5o2.hide();643 this.q5o1.hide();644 question5.visible = false;645 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);646 Question5w.addImage("eWrong5", question5w_img);647 })648649 })650651 })652 this.w1o2q4.mousePressed(() => {653 this.w1o2q4.hide();654 this.co1q4.hide();655 question4.visible = false;656 q4wrong = createSprite(displayWidth / 2 + 30, displayHeight / 2);657 q4wrong.addImage("n1otaagain", q4wr_img);658659 this.next22 = createButton("NEXT");660 this.next22.position(displayWidth / 1.5 + 10, displayHeight / 1.6);661662 this.next22.mousePressed(() => {663 this.next22.hide();664 q4wrong.visible = false;665 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)666 question5.addImage("Q5", question5_image);667 this.qE5o1 = createButton("1933");668 this.qE5o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);669 this.qE5o2 = createButton("1948");670 this.qE5o2.position(displayWidth / 2 + 10, displayHeight / 1.7);671672 this.qE5o1.mousePressed(() => {673 this.qE5o2.hide();674 this.qE5o1.hide();675 question5.visible = false;676 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);677 Question5c.addImage("TCorrect5", question5c_image);678 })679 this.qE5o2.mousePressed(() => {680 this.qE5o2.hide();681 this.qE5o1.hide();682 question5.visible = false;683 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);684 Question5w.addImage("TWrong5", question5w_img);685 })686687 })688689 })690 })691692693 })694 this.cq3.mousePressed(() => {695 score=score+5;696 this.wq3.hide();697 this.cq3.hide();698 question3.visible = false;699 question3c = createSprite(displayWidth / 2 + 30, displayHeight / 2);700 question3c.addImage("Correctman", question3c_img);701 this.next11 = createButton("NEXT");702 this.next11.position(displayWidth / 1.5 + 10, displayHeight / 1.6);703 this.next11.mousePressed(() => {704 this.next11.hide();705 question3c.visible = false;706 question4 = createSprite(displayWidth / 2 + 30, displayHeight / 2);707 question4.addImage("1yahoo", ques4_img);708 this.co11q4 = createButton("A.74,377.00 rupees");709 this.co11q4.position(displayWidth / 2.9 + 10, displayHeight / 1.7);710 this.w1o22q4 = createButton("B.74,395.10 rupees");711 this.w1o22q4.position(displayWidth / 1.8 + 10, displayHeight / 1.7);712 this.co11q4.mousePressed(() => {713 score=score+5;714 this.co11q4.hide();715 this.w1o22q4.hide();716 question4.visible = false;717 q4correct = createSprite(displayWidth / 2 + 30, displayHeight / 2);718 q4correct.addImage("1y1esaagain", q4correct_image);719720 this.next23 = createButton("NEXT");721 this.next23.position(displayWidth / 1.5 + 10, displayHeight / 1.6);722723 this.next23.mousePressed(() => {724 this.next23.hide();725 q4correct.visible = false;726 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)727 question5.addImage("Q5", question5_image);728 this.qF5o1 = createButton("1933");729 this.qF5o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);730 this.qF5o2 = createButton("1948");731 this.qF5o2.position(displayWidth / 2 + 10, displayHeight / 1.7);732733 this.qF5o1.mousePressed(() => {734 score=score+5;735 this.qF5o2.hide();736 this.qF5o1.hide();737 question5.visible = false;738 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);739 Question5c.addImage("PCorrect5", question5c_image);740 if(score===25){741 Question5c.visible=false;742 sc25=createSprite(displayWidth/2 + 30,displayHeight/2);743 sc25.addImage("Genius",sc25_img);744 geniussound.play();745746 }747 })748 this.qF5o2.mousePressed(() => {749 this.qF5o2.hide();750 this.qF5o1.hide();751 question5.visible = false;752 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);753 Question5w.addImage("RWrong5", question5w_img);754 })755756 })757758 })759 this.w1o22q4.mousePressed(() => {760 this.w1o22q4.hide();761 this.co11q4.hide();762 question4.visible = false;763 q4wrong = createSprite(displayWidth / 2 + 30, displayHeight / 2);764 q4wrong.addImage("1n1otaagain", q4wr_img);765766 this.next24 = createButton("NEXT");767 this.next24.position(displayWidth / 1.5 + 10, displayHeight / 1.6);768769 this.next24.mousePressed(() => {770 this.next24.hide();771 q4wrong.visible = false;772 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)773 question5.addImage("Q5", question5_image);774 this.qQ5o1 = createButton("1933");775 this.qQ5o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);776 this.qQ5o2 = createButton("1948");777 this.qQ5o2.position(displayWidth / 2 + 10, displayHeight / 1.7);778779 this.qQ5o1.mousePressed(() => {780 this.qQ5o2.hide();781 this.qQ5o1.hide();782 question5.visible = false;783 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);784 Question5c.addImage("5Correct5", question5c_image);785 })786 this.qQ5o2.mousePressed(() => {787 this.qQ5o2.hide();788 this.qQ5o1.hide();789 question5.visible = false;790 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);791 Question5w.addImage("%Wrong5", question5w_img);792 })793794 })795796 })797 })798799 })800801802 })803804805 })806807 this.q2o1.mousePressed(() => {808 this.q2o1.hide();809 this.q2o2.hide();810 Question2.visible = false;811 ques2wrong = createSprite(displayWidth / 2 + 30, displayHeight / 2);812 ques2wrong.addImage("Wrong2", ques2wr_img);813 this.next7 = createButton("NEXT");814 this.next7.position(displayWidth / 1.5 + 10, displayHeight / 1.6);815816 this.next7.mousePressed(() => {817 question3 = createSprite(displayWidth / 2 + 30, displayHeight / 2);818 question3.addImage("Question 3", ques3_img);819 this.next7.hide();820 ques2wrong.visible = false;821 this.q3o1 = createButton("A.3,285,334 sq.km");822 this.q3o1.position(displayWidth / 2.9 + 10, displayHeight / 1.8);823824 this.q3o2 = createButton("A.3,287,263 sq.km");825 this.q3o2.position(displayWidth / 1.8 + 10, displayHeight / 1.8);826827 this.q3o2.mousePressed(() => {828 this.q3o1.hide();829 this.q3o2.hide();830 question3.visible = false;831 question3c = createSprite(displayWidth / 2 + 30, displayHeight / 2);832 question3c.addImage("Correctanswer", question3c_img);833 this.next8 = createButton("NEXT");834 this.next8.position(displayWidth / 1.5 + 10, displayHeight / 1.6);835836 this.next8.mousePressed(() => {837 this.next8.hide();838 question3c.visible = false;839 question4 = createSprite(displayWidth / 2 + 30, displayHeight / 2);840 question4.addImage("1yahoo", ques4_img);841 this.co111q4 = createButton("A.74,377.00 rupees");842 this.co111q4.position(displayWidth / 2.9 + 10, displayHeight / 1.7);843 this.w1o222q4 = createButton("B.74,395.10 rupees");844 this.w1o222q4.position(displayWidth / 1.8 + 10, displayHeight / 1.7);845 this.co111q4.mousePressed(() => {846 this.co111q4.hide();847 this.w1o222q4.hide();848 question4.visible = false;849 q4correct = createSprite(displayWidth / 2 + 30, displayHeight / 2);850 q4correct.addImage("1y1es1aagain", q4correct_image);851 this.next25 = createButton("NEXT");852 this.next25.position(displayWidth / 1.5 + 10, displayHeight / 1.6);853854 this.next25.mousePressed(() => {855 this.next25.hide();856 q4correct.visible = false;857 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)858 question5.addImage("Q5", question5_image);859 this.q55o1 = createButton("1933");860 this.q55o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);861 this.q55o2 = createButton("1948");862 this.q55o2.position(displayWidth / 2 + 10, displayHeight / 1.7);863864 this.q55o1.mousePressed(() => {865 this.q55o2.hide();866 this.q55o1.hide();867 question5.visible = false;868 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);869 Question5c.addImage("Co3rrect5", question5c_image);870 })871 this.q55o2.mousePressed(() => {872 this.q55o2.hide();873 this.q55o1.hide();874 question5.visible = false;875 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);876 Question5w.addImage("W3rong5", question5w_img);877 })878879 })880881882883 })884 this.w1o222q4.mousePressed(() => {885 this.w1o222q4.hide();886 this.co111q4.hide();887 question4.visible = false;888 q4wrong = createSprite(displayWidth / 2 + 30, displayHeight / 2);889 q4wrong.addImage("1n1ot1aagain", q4wr_img);890891 this.next26 = createButton("NEXT");892 this.next26.position(displayWidth / 1.5 + 10, displayHeight / 1.6);893894 this.next26.mousePressed(() => {895 this.next26.hide();896 q4wrong.visible = false;897 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)898 question5.addImage("Q5", question5_image);899 this.q51o1 = createButton("1933");900 this.q51o1.position(displayWidth / 2.9 + 10, displayHeight / 1.7);901 this.q51o2 = createButton("1948");902 this.q51o2.position(displayWidth / 2 + 10, displayHeight / 1.7);903904 this.q51o1.mousePressed(() => {905 this.q51o2.hide();906 this.q51o1.hide();907 question5.visible = false;908 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);909 Question5c.addImage("C@orrect5", question5c_image);910 })911 this.q51o2.mousePressed(() => {912 this.q51o2.hide();913 this.q51o1.hide();914 question5.visible = false;915 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);916 Question5w.addImage("@Wrong5", question5w_img);917 })918919 })920921922 })923924925 })926927 })928 this.q3o1.mousePressed(() => {929 this.q3o1.hide();930 this.q3o2.hide();931 this.next9 = createButton("NEXT");932 this.next9.position(displayWidth / 1.5 + 10, displayHeight / 1.6);933 ques3wr = createSprite(displayWidth / 2 + 30, displayHeight / 2);934 ques3wr.addImage("Wrongman", ques3wr_img);935 //question3c.visible=false;936 this.next9.mousePressed(() => {937 this.next9.hide();938 ques3wr.visible = false;939 question4 = createSprite(displayWidth / 2 + 30, displayHeight / 2);940 question4.addImage("q4", ques4_img);941 this.q4co = createButton("A.74,377.00 rupees");942 this.q4co.position(displayWidth / 2.9 + 10, displayHeight / 1.7);943 this.q4wr = createButton("B.74,395.10 rupees");944 this.q4wr.position(displayWidth / 1.8 + 10, displayHeight / 1.7);945946 this.q4co.mousePressed(() => {947 this.q4co.hide();948 this.q4wr.hide();949 question4.visible = false;950 q4correct = createSprite(displayWidth / 2 + 30, displayHeight / 2);951 q4correct.addImage("1ye1es1aagain", q4correct_image);952953 this.next27 = createButton("NEXT");954 this.next27.position(displayWidth / 1.5 + 10, displayHeight / 1.6);955956 this.next27.mousePressed(() => {957 this.next27.hide();958 q4correct.visible = false;959 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)960 question5.addImage("Q5", question5_image);961 this.q5o11 = createButton("1933");962 this.q5o11.position(displayWidth / 2.9 + 10, displayHeight / 1.7);963 this.q5o21 = createButton("1948");964 this.q5o21.position(displayWidth / 2 + 10, displayHeight / 1.7);965966 this.q5o11.mousePressed(() => {967 this.q5o21.hide();968 this.q5o11.hide();969 question5.visible = false;970 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);971 Question5c.addImage("Corre!ct5", question5c_image);972 })973 this.q5o21.mousePressed(() => {974 this.q5o21.hide();975 this.q5o11.hide();976 question5.visible = false;977 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);978 Question5w.addImage("Wr!ong5", question5w_img);979 })980981 })982983 })984 this.q4wr.mousePressed(() => {985 this.q4wr.hide();986 this.q4co.hide();987 question4.visible = false;988 q4wrong = createSprite(displayWidth / 2 + 30, displayHeight / 2);989 q4wrong.addImage("1n1ot1aagaain", q4wr_img);990991 this.next28 = createButton("NEXT");992 this.next28.position(displayWidth / 1.5 + 10, displayHeight / 1.6);993994 this.next28.mousePressed(() => {995 this.next28.hide();996 q4wrong.visible = false;997 question5 = createSprite(displayWidth / 2 + 30, displayHeight / 2)998 question5.addImage("Q5", question5_image);999 this.q5o19 = createButton("1933");1000 this.q5o19.position(displayWidth / 2.9 + 10, displayHeight / 1.7);1001 this.q5o29 = createButton("1948");1002 this.q5o29.position(displayWidth / 2 + 10, displayHeight / 1.7);10031004 this.q5o19.mousePressed(() => {1005 this.q5o29.hide();1006 this.q5o19.hide();1007 question5.visible = false;1008 Question5c = createSprite(displayWidth / 2 + 30, displayHeight / 2);1009 Question5c.addImage("&Correct5", question5c_image);1010 })1011 this.q5o29.mousePressed(() => {1012 this.q5o29.hide();1013 this.q5o19.hide();1014 question5.visible = false;1015 Question5w = createSprite(displayWidth / 2 + 30, displayHeight / 2);1016 Question5w.addImage("Wrong5*", question5w_img);1017 })10181019 })10201021 })10221023 })1024102510261027 })10281029 })1030 })10311032 })10331034 })1035103610371038 })103910401041 })10421043 drawSprites();1044}10451046
...
redWineStyle.js
Source:redWineStyle.js
1// =========nav bar=================2$('#nRoseWine').click(function () {3 $('#roseWine').css("display","block");4 $('#whitWine').css("display","none");5 $('#Home').css("display","none");6 $('#redWine').css("display","none");7 $('#selectbottle').css("display","none");8 $('#customerLog').css("display","none");9 $('#customerForm').css("display","none");10 $('#cardPayment').css("display","none");11});12$('#nWhiteWine').click(function () {13 $('#roseWine').css("display","none");14 $('#whitWine').css("display","block");15 $('#Home').css("display","none");16 $('#redWine').css("display","none");17 $('#selectbottle').css("display","none");18 $('#customerLog').css("display","none");19 $('#customerForm').css("display","none");20 $('#cardPayment').css("display","none");21});22$('#nHome').click(function () {23 $('#roseWine').css("display","none");24 $('#whitWine').css("display","none");25 $('#Home').css("display","block");26 $('#redWine').css("display","none");27 $('#selectbottle').css("display","none");28 $('#customerLog').css("display","none");29 $('#customerForm').css("display","none");30 $('#cardPayment').css("display","none");31});32// =================select combo==========================33$('#all').click(function () {34 $('#allDIV').css("display","block");35 $('#blackgrenackDIV').css("display","none");36 $('#cabernetMerlotDIV').css("display","none");37 $('#cabernetSangioveseBlendedDIV').css("display","none");38 $('#cabernetSauvignonDIV').css("display","none");39 $('#corvinaDIV').css("display","none");40 $('#corvinaBlendDIV').css("display","none");41 $('#gamayDIV').css("display","none");42 $('#merlotDIV').css("display","none");43 $('#menciaDIV').css("display","none");44 $('#mazueloDIV').css("display","none");45 $('#selectbottle').css("display","none");46 $('#customerLog').css("display","none");47 $('#customerForm').css("display","none");48 $('#cardPayment').css("display","none");49});50$('#blackGrenack').click(function () {51 $('#blackgrenackDIV').css("display","block");52 $('#allDIV').css("display","none");53 $('#cabernetMerlotDIV').css("display","none");54 $('#cabernetSangioveseBlendedDIV').css("display","none");55 $('#cabernetSauvignonDIV').css("display","none");56 $('#corvinaDIV').css("display","none");57 $('#corvinaBlendDIV').css("display","none");58 $('#gamayDIV').css("display","none");59 $('#merlotDIV').css("display","none");60 $('#menciaDIV').css("display","none");61 $('#mazueloDIV').css("display","none");62 $('#selectbottle').css("display","none");63 $('#customerLog').css("display","none");64 $('#customerForm').css("display","none");65 $('#cardPayment').css("display","none");66});67$('#cabernetMerlot').click(function () {68 $('#cabernetMerlotDIV').css("display","block");69 $('#blackgrenackDIV').css("display","none");70 $('#allDIV').css("display","none");71 $('#cabernetSangioveseBlendedDIV').css("display","none");72 $('#cabernetSauvignonDIV').css("display","none");73 $('#corvinaDIV').css("display","none");74 $('#corvinaBlendDIV').css("display","none");75 $('#gamayDIV').css("display","none");76 $('#merlotDIV').css("display","none");77 $('#menciaDIV').css("display","none");78 $('#mazueloDIV').css("display","none");79 $('#selectbottle').css("display","none");80 $('#customerLog').css("display","none");81 $('#customerForm').css("display","none");82 $('#cardPayment').css("display","none");83});84$('#cabernetSangioveseBlended').click(function () {85 $('#cabernetMerlotDIV').css("display","none");86 $('#blackgrenackDIV').css("display","none");87 $('#allDIV').css("display","none");88 $('#cabernetSangioveseBlendedDIV').css("display","block");89 $('#cabernetSauvignonDIV').css("display","none");90 $('#corvinaDIV').css("display","none");91 $('#corvinaBlendDIV').css("display","none");92 $('#gamayDIV').css("display","none");93 $('#merlotDIV').css("display","none");94 $('#menciaDIV').css("display","none");95 $('#mazueloDIV').css("display","none");96 $('#selectbottle').css("display","none");97 $('#customerLog').css("display","none");98 $('#customerForm').css("display","none");99 $('#cardPayment').css("display","none");100});101$('#cabernetSauvignon').click(function () {102 $('#cabernetMerlotDIV').css("display","none");103 $('#blackgrenackDIV').css("display","none");104 $('#allDIV').css("display","none");105 $('#cabernetSangioveseBlendedDIV').css("display","none");106 $('#cabernetSauvignonDIV').css("display","block");107 $('#corvinaDIV').css("display","none");108 $('#corvinaBlendDIV').css("display","none");109 $('#gamayDIV').css("display","none");110 $('#merlotDIV').css("display","none");111 $('#menciaDIV').css("display","none");112 $('#mazueloDIV').css("display","none");113 $('#selectbottle').css("display","none");114 $('#customerLog').css("display","none");115 $('#customerForm').css("display","none");116 $('#cardPayment').css("display","none");117});118$('#corvina').click(function () {119 $('#cabernetMerlotDIV').css("display","none");120 $('#blackgrenackDIV').css("display","none");121 $('#allDIV').css("display","none");122 $('#cabernetSangioveseBlendedDIV').css("display","none");123 $('#cabernetSauvignonDIV').css("display","none");124 $('#corvinaDIV').css("display","block");125 $('#corvinaBlendDIV').css("display","none");126 $('#gamayDIV').css("display","none");127 $('#merlotDIV').css("display","none");128 $('#menciaDIV').css("display","none");129 $('#mazueloDIV').css("display","none");130 $('#selectbottle').css("display","none");131 $('#customerLog').css("display","none");132 $('#customerForm').css("display","none");133 $('#cardPayment').css("display","none");134});135$('#corvinaBlend').click(function () {136 $('#cabernetMerlotDIV').css("display","none");137 $('#blackgrenackDIV').css("display","none");138 $('#allDIV').css("display","none");139 $('#cabernetSangioveseBlendedDIV').css("display","none");140 $('#cabernetSauvignonDIV').css("display","none");141 $('#corvinaDIV').css("display","none");142 $('#corvinaBlendDIV').css("display","block");143 $('#gamayDIV').css("display","none");144 $('#merlotDIV').css("display","none");145 $('#menciaDIV').css("display","none");146 $('#mazueloDIV').css("display","none");147 $('#selectbottle').css("display","none");148 $('#customerLog').css("display","none");149 $('#customerForm').css("display","none");150 $('#cardPayment').css("display","none");151});152$('#gamay').click(function () {153 $('#cabernetMerlotDIV').css("display","none");154 $('#blackgrenackDIV').css("display","none");155 $('#allDIV').css("display","none");156 $('#cabernetSangioveseBlendedDIV').css("display","none");157 $('#cabernetSauvignonDIV').css("display","none");158 $('#corvinaDIV').css("display","none");159 $('#corvinaBlendDIV').css("display","none");160 $('#gamayDIV').css("display","block");161 $('#merlotDIV').css("display","none");162 $('#menciaDIV').css("display","none");163 $('#mazueloDIV').css("display","none");164 $('#selectbottle').css("display","none");165 $('#customerLog').css("display","none");166 $('#customerForm').css("display","none");167 $('#cardPayment').css("display","none");168});169$('#merlot').click(function () {170 $('#cabernetMerlotDIV').css("display","none");171 $('#blackgrenackDIV').css("display","none");172 $('#allDIV').css("display","none");173 $('#cabernetSangioveseBlendedDIV').css("display","none");174 $('#cabernetSauvignonDIV').css("display","none");175 $('#corvinaDIV').css("display","none");176 $('#corvinaBlendDIV').css("display","none");177 $('#gamayDIV').css("display","none");178 $('#merlotDIV').css("display","block");179 $('#menciaDIV').css("display","none");180 $('#mazueloDIV').css("display","none");181 $('#selectbottle').css("display","none");182 $('#customerLog').css("display","none");183 $('#customerForm').css("display","none");184 $('#cardPayment').css("display","none");185});186$('#mencia').click(function () {187 $('#cabernetMerlotDIV').css("display","none");188 $('#blackgrenackDIV').css("display","none");189 $('#allDIV').css("display","none");190 $('#cabernetSangioveseBlendedDIV').css("display","none");191 $('#cabernetSauvignonDIV').css("display","none");192 $('#corvinaDIV').css("display","none");193 $('#corvinaBlendDIV').css("display","none");194 $('#gamayDIV').css("display","none");195 $('#merlotDIV').css("display","none");196 $('#menciaDIV').css("display","block");197 $('#mazueloDIV').css("display","none");198 $('#selectbottle').css("display","none");199 $('#customerLog').css("display","none");200 $('#customerForm').css("display","none");201 $('#cardPayment').css("display","none");202});203$('#mazuelo').click(function () {204 $('#cabernetMerlotDIV').css("display","none");205 $('#blackgrenackDIV').css("display","none");206 $('#allDIV').css("display","none");207 $('#cabernetSangioveseBlendedDIV').css("display","none");208 $('#cabernetSauvignonDIV').css("display","none");209 $('#corvinaDIV').css("display","none");210 $('#corvinaBlendDIV').css("display","none");211 $('#gamayDIV').css("display","none");212 $('#merlotDIV').css("display","none");213 $('#menciaDIV').css("display","none");214 $('#mazueloDIV').css("display","block");215 $('#selectbottle').css("display","none");216 $('#customerLog').css("display","none");217 $('#customerForm').css("display","none");218 $('#cardPayment').css("display","none");219});220// =======================customer wine oder===============================221$('#name01').click(function () {222 $('#selectbottle').css("display","block");223 $('#roseWine').css("display","none");224 $('#whitWine').css("display","none");225 $('#Home').css("display","none");226 $('#redWine').css("display","none");227 $('#customerLog').css("display","none");228 $('#customerForm').css("display","none");229 $('#cardPayment').css("display","none");230 $name= $('#name01').text();231 $rs= $('#rs01').text();232 $qty=$('#qty').text();233 $('#brandName').val($name);234 $('#UnitPrice').val($rs);235 $('#totale').click(function () {236 var rs=$('#UnitPrice').val();237 var qty=$('#qty').val();238 var total=rs*qty;239 $('#totale').val(total);240 });241});242$('#name02').click(function () {243 $('#selectbottle').css("display","block");244 $('#roseWine').css("display","none");245 $('#whitWine').css("display","none");246 $('#Home').css("display","none");247 $('#redWine').css("display","none");248 $('#customerLog').css("display","none");249 $('#customerForm').css("display","none");250 $('#cardPayment').css("display","none");251 $name= $('#name02').text();252 $rs= $('#rs02').text();253 $qty=$('#qty').text();254 $('#brandName').val($name);255 $('#UnitPrice').val($rs);256 $('#totale').click(function () {257 var rs=$('#UnitPrice').val();258 var qty=$('#qty').val();259 var total=rs*qty;260 $('#totale').val(total);261 });262});263$('#name03').click(function () {264 $('#selectbottle').css("display","block");265 $('#roseWine').css("display","none");266 $('#whitWine').css("display","none");267 $('#Home').css("display","none");268 $('#redWine').css("display","none");269 $('#customerLog').css("display","none");270 $('#customerForm').css("display","none");271 $('#cardPayment').css("display","none");272 $name= $('#name03').text();273 $rs= $('#rs03').text();274 $qty=$('#qty').text();275 $('#brandName').val($name);276 $('#UnitPrice').val($rs);277 $('#totale').click(function () {278 var rs=$('#UnitPrice').val();279 var qty=$('#qty').val();280 var total=rs*qty;281 $('#totale').val(total);282 });283});284$('#name04').click(function () {285 $('#selectbottle').css("display","block");286 $('#roseWine').css("display","none");287 $('#whitWine').css("display","none");288 $('#Home').css("display","none");289 $('#redWine').css("display","none");290 $('#customerLog').css("display","none");291 $('#customerForm').css("display","none");292 $('#cardPayment').css("display","none");293 $name= $('#name04').text();294 $rs= $('#rs04').text();295 $qty=$('#qty').text();296 $('#brandName').val($name);297 $('#UnitPrice').val($rs);298 $('#totale').click(function () {299 var rs=$('#UnitPrice').val();300 var qty=$('#qty').val();301 var total=rs*qty;302 $('#totale').val(total);303 });304});305$('#name05').click(function () {306 $('#selectbottle').css("display","block");307 $('#roseWine').css("display","none");308 $('#whitWine').css("display","none");309 $('#Home').css("display","none");310 $('#redWine').css("display","none");311 $('#customerLog').css("display","none");312 $('#customerForm').css("display","none");313 $('#cardPayment').css("display","none");314 $name= $('#name05').text();315 $rs= $('#rs05').text();316 $qty=$('#qty').text();317 $('#brandName').val($name);318 $('#UnitPrice').val($rs);319 $('#totale').click(function () {320 var rs=$('#UnitPrice').val();321 var qty=$('#qty').val();322 var total=rs*qty;323 $('#totale').val(total);324 });325});326$('#name06').click(function () {327 $('#selectbottle').css("display","block");328 $('#roseWine').css("display","none");329 $('#whitWine').css("display","none");330 $('#Home').css("display","none");331 $('#redWine').css("display","none");332 $('#customerLog').css("display","none");333 $('#customerForm').css("display","none");334 $('#cardPayment').css("display","none");335 $name= $('#name06').text();336 $rs= $('#rs06').text();337 $qty=$('#qty').text();338 $('#brandName').val($name);339 $('#UnitPrice').val($rs);340 $('#totale').click(function () {341 var rs=$('#UnitPrice').val();342 var qty=$('#qty').val();343 var total=rs*qty;344 $('#totale').val(total);345 });346});347$('#name07').click(function () {348 $('#selectbottle').css("display","block");349 $('#roseWine').css("display","none");350 $('#whitWine').css("display","none");351 $('#Home').css("display","none");352 $('#redWine').css("display","none");353 $('#customerLog').css("display","none");354 $('#customerForm').css("display","none");355 $('#cardPayment').css("display","none");356 $name= $('#name07').text();357 $rs= $('#rs07').text();358 $qty=$('#qty').text();359 $('#brandName').val($name);360 $('#UnitPrice').val($rs);361 $('#totale').click(function () {362 var rs=$('#UnitPrice').val();363 var qty=$('#qty').val();364 var total=rs*qty;365 $('#totale').val(total);366 });367});368$('#name08').click(function () {369 $('#selectbottle').css("display","block");370 $('#roseWine').css("display","none");371 $('#whitWine').css("display","none");372 $('#Home').css("display","none");373 $('#redWine').css("display","none");374 $('#customerLog').css("display","none");375 $('#customerForm').css("display","none");376 $('#cardPayment').css("display","none");377 $name= $('#name08').text();378 $rs= $('#rs08').text();379 $qty=$('#qty').text();380 $('#brandName').val($name);381 $('#UnitPrice').val($rs);382 $('#totale').click(function () {383 var rs=$('#UnitPrice').val();384 var qty=$('#qty').val();385 var total=rs*qty;386 $('#totale').val(total);387 });388});389$('#name09').click(function () {390 $('#selectbottle').css("display","block");391 $('#roseWine').css("display","none");392 $('#whitWine').css("display","none");393 $('#Home').css("display","none");394 $('#redWine').css("display","none");395 $('#customerLog').css("display","none");396 $('#customerForm').css("display","none");397 $('#cardPayment').css("display","none");398 $name= $('#name09').text();399 $rs= $('#rs09').text();400 $qty=$('#qty').text();401 $('#brandName').val($name);402 $('#UnitPrice').val($rs);403 $('#totale').click(function () {404 var rs=$('#UnitPrice').val();405 var qty=$('#qty').val();406 var total=rs*qty;407 $('#totale').val(total);408 });409});410$('#name10').click(function () {411 $('#selectbottle').css("display","block");412 $('#roseWine').css("display","none");413 $('#whitWine').css("display","none");414 $('#Home').css("display","none");415 $('#redWine').css("display","none");416 $('#customerLog').css("display","none");417 $('#customerForm').css("display","none");418 $('#cardPayment').css("display","none");419 $name= $('#name10').text();420 $rs= $('#rs10').text();421 $qty=$('#qty').text();422 $('#brandName').val($name);423 $('#UnitPrice').val($rs);424 $('#totale').click(function () {425 var rs=$('#UnitPrice').val();426 var qty=$('#qty').val();427 var total=rs*qty;428 $('#totale').val(total);429 });430});431$('#name11').click(function () {432 $('#selectbottle').css("display","block");433 $('#roseWine').css("display","none");434 $('#whitWine').css("display","none");435 $('#Home').css("display","none");436 $('#redWine').css("display","none");437 $('#customerLog').css("display","none");438 $('#customerForm').css("display","none");439 $('#cardPayment').css("display","none");440 $name= $('#name11').text();441 $rs= $('#rs11').text();442 $qty=$('#qty').text();443 $('#brandName').val($name);444 $('#UnitPrice').val($rs);445 $('#totale').click(function () {446 var rs=$('#UnitPrice').val();447 var qty=$('#qty').val();448 var total=rs*qty;449 $('#totale').val(total);450 });451});452$('#name12').click(function () {453 $('#selectbottle').css("display","block");454 $('#roseWine').css("display","none");455 $('#whitWine').css("display","none");456 $('#Home').css("display","none");457 $('#redWine').css("display","none");458 $('#customerLog').css("display","none");459 $('#customerForm').css("display","none");460 $('#cardPayment').css("display","none");461 $name= $('#name12').text();462 $rs= $('#rs12').text();463 $qty=$('#qty').text();464 $('#brandName').val($name);465 $('#UnitPrice').val($rs);466 $('#totale').click(function () {467 var rs=$('#UnitPrice').val();468 var qty=$('#qty').val();469 var total=rs*qty;470 $('#totale').val(total);471 });472});473$('#name13').click(function () {474 $('#selectbottle').css("display","block");475 $('#roseWine').css("display","none");476 $('#whitWine').css("display","none");477 $('#Home').css("display","none");478 $('#redWine').css("display","none");479 $('#customerLog').css("display","none");480 $('#customerForm').css("display","none");481 $('#cardPayment').css("display","none");482 $name= $('#name13').text();483 $rs= $('#rs13').text();484 $qty=$('#qty').text();485 $('#brandName').val($name);486 $('#UnitPrice').val($rs);487 $('#totale').click(function () {488 var rs=$('#UnitPrice').val();489 var qty=$('#qty').val();490 var total=rs*qty;491 $('#totale').val(total);492 });493});494$('#name14').click(function () {495 $('#selectbottle').css("display","block");496 $('#roseWine').css("display","none");497 $('#whitWine').css("display","none");498 $('#Home').css("display","none");499 $('#redWine').css("display","none");500 $('#customerLog').css("display","none");501 $('#customerForm').css("display","none");502 $('#cardPayment').css("display","none");503 $name= $('#name14').text();504 $rs= $('#rs14').text();505 $qty=$('#qty').text();506 $('#brandName').val($name);507 $('#UnitPrice').val($rs);508 $('#totale').click(function () {509 var rs=$('#UnitPrice').val();510 var qty=$('#qty').val();511 var total=rs*qty;512 $('#totale').val(total);513 });514});515$('#name15').click(function () {516 $('#selectbottle').css("display","block");517 $('#roseWine').css("display","none");518 $('#whitWine').css("display","none");519 $('#Home').css("display","none");520 $('#redWine').css("display","none");521 $('#customerLog').css("display","none");522 $('#customerForm').css("display","none");523 $('#cardPayment').css("display","none");524 $name= $('#name15').text();525 $rs= $('#rs15').text();526 $qty=$('#qty').text();527 $('#brandName').val($name);528 $('#UnitPrice').val($rs);529 $('#totale').click(function () {530 var rs=$('#UnitPrice').val();531 var qty=$('#qty').val();532 var total=rs*qty;533 $('#totale').val(total);534 });535});536$('#name16').click(function () {537 $('#selectbottle').css("display","block");538 $('#roseWine').css("display","none");539 $('#whitWine').css("display","none");540 $('#Home').css("display","none");541 $('#redWine').css("display","none");542 $('#customerLog').css("display","none");543 $('#customerForm').css("display","none");544 $('#cardPayment').css("display","none");545 $name= $('#name16').text();546 $rs= $('#rs16').text();547 $qty=$('#qty').text();548 $('#brandName').val($name);549 $('#UnitPrice').val($rs);550 $('#totale').click(function () {551 var rs=$('#UnitPrice').val();552 var qty=$('#qty').val();553 var total=rs*qty;554 $('#totale').val(total);555 });556});557$('#name17').click(function () {558 $('#selectbottle').css("display","block");559 $('#roseWine').css("display","none");560 $('#whitWine').css("display","none");561 $('#Home').css("display","none");562 $('#redWine').css("display","none");563 $('#customerLog').css("display","none");564 $('#customerForm').css("display","none");565 $('#cardPayment').css("display","none");566 $name= $('#name17').text();567 $rs= $('#rs17').text();568 $qty=$('#qty').text();569 $('#brandName').val($name);570 $('#UnitPrice').val($rs);571 $('#totale').click(function () {572 var rs=$('#UnitPrice').val();573 var qty=$('#qty').val();574 var total=rs*qty;575 $('#totale').val(total);576 });577});578$('#name18').click(function () {579 $('#selectbottle').css("display","block");580 $('#roseWine').css("display","none");581 $('#whitWine').css("display","none");582 $('#Home').css("display","none");583 $('#redWine').css("display","none");584 $('#customerLog').css("display","none");585 $('#customerForm').css("display","none");586 $('#cardPayment').css("display","none");587 $name= $('#name18').text();588 $rs= $('#rs18').text();589 $qty=$('#qty').text();590 $('#brandName').val($name);591 $('#UnitPrice').val($rs);592 $('#totale').click(function () {593 var rs=$('#UnitPrice').val();594 var qty=$('#qty').val();595 var total=rs*qty;596 $('#totale').val(total);597 });598});599$('#name19').click(function () {600 $('#selectbottle').css("display","block");601 $('#roseWine').css("display","none");602 $('#whitWine').css("display","none");603 $('#Home').css("display","none");604 $('#redWine').css("display","none");605 $('#customerLog').css("display","none");606 $('#customerForm').css("display","none");607 $('#cardPayment').css("display","none");608 $name= $('#name19').text();609 $rs= $('#rs19').text();610 $qty=$('#qty').text();611 $('#brandName').val($name);612 $('#UnitPrice').val($rs);613 $('#totale').click(function () {614 var rs=$('#UnitPrice').val();615 var qty=$('#qty').val();616 var total=rs*qty;617 $('#totale').val(total);618 });619});620$('#name20').click(function () {621 $('#selectbottle').css("display","block");622 $('#roseWine').css("display","none");623 $('#whitWine').css("display","none");624 $('#Home').css("display","none");625 $('#redWine').css("display","none");626 $('#customerLog').css("display","none");627 $('#customerForm').css("display","none");628 $('#cardPayment').css("display","none");629 $name= $('#name20').text();630 $rs= $('#rs20').text();631 $qty=$('#qty').text();632 $('#brandName').val($name);633 $('#UnitPrice').val($rs);634 $('#totale').click(function () {635 var rs=$('#UnitPrice').val();636 var qty=$('#qty').val();637 var total=rs*qty;638 $('#totale').val(total);639 });640});641$('#name21').click(function () {642 $('#selectbottle').css("display","block");643 $('#roseWine').css("display","none");644 $('#whitWine').css("display","none");645 $('#Home').css("display","none");646 $('#redWine').css("display","none");647 $('#customerLog').css("display","none");648 $('#customerForm').css("display","none");649 $('#cardPayment').css("display","none");650 $name= $('#name21').text();651 $rs= $('#rs21').text();652 $qty=$('#qty').text();653 $('#brandName').val($name);654 $('#UnitPrice').val($rs);655 $('#totale').click(function () {656 var rs=$('#UnitPrice').val();657 var qty=$('#qty').val();658 var total=rs*qty;659 $('#totale').val(total);660 });661});662$('#name22').click(function () {663 $('#selectbottle').css("display","block");664 $('#roseWine').css("display","none");665 $('#whitWine').css("display","none");666 $('#Home').css("display","none");667 $('#redWine').css("display","none");668 $('#customerLog').css("display","none");669 $('#customerForm').css("display","none");670 $('#cardPayment').css("display","none");671 $name= $('#name22').text();672 $rs= $('#rs22').text();673 $qty=$('#qty').text();674 $('#brandName').val($name);675 $('#UnitPrice').val($rs);676 $('#totale').click(function () {677 var rs=$('#UnitPrice').val();678 var qty=$('#qty').val();679 var total=rs*qty;680 $('#totale').val(total);681 });682});683$('#name23').click(function () {684 $('#selectbottle').css("display","block");685 $('#roseWine').css("display","none");686 $('#whitWine').css("display","none");687 $('#Home').css("display","none");688 $('#redWine').css("display","none");689 $('#customerLog').css("display","none");690 $('#customerForm').css("display","none");691 $('#cardPayment').css("display","none");692 $name= $('#name23').text();693 $rs= $('#rs23').text();694 $qty=$('#qty').text();695 $('#brandName').val($name);696 $('#UnitPrice').val($rs);697 $('#totale').click(function () {698 var rs=$('#UnitPrice').val();699 var qty=$('#qty').val();700 var total=rs*qty;701 $('#totale').val(total);702 });703});704$('#name24').click(function () {705 $('#selectbottle').css("display","block");706 $('#roseWine').css("display","none");707 $('#whitWine').css("display","none");708 $('#Home').css("display","none");709 $('#redWine').css("display","none");710 $('#customerLog').css("display","none");711 $('#customerForm').css("display","none");712 $('#cardPayment').css("display","none");713 $name= $('#name24').text();714 $rs= $('#rs24').text();715 $qty=$('#qty').text();716 $('#brandName').val($name);717 $('#UnitPrice').val($rs);718 $('#totale').click(function () {719 var rs=$('#UnitPrice').val();720 var qty=$('#qty').val();721 var total=rs*qty;722 $('#totale').val(total);723 });724});725$('#name25').click(function () {726 $('#selectbottle').css("display","block");727 $('#roseWine').css("display","none");728 $('#whitWine').css("display","none");729 $('#Home').css("display","none");730 $('#redWine').css("display","none");731 $('#customerLog').css("display","none");732 $('#customerForm').css("display","none");733 $('#cardPayment').css("display","none");734 $name= $('#name25').text();735 $rs= $('#rs25').text();736 $qty=$('#qty').text();737 $('#brandName').val($name);738 $('#UnitPrice').val($rs);739 $('#totale').click(function () {740 var rs=$('#UnitPrice').val();741 var qty=$('#qty').val();742 var total=rs*qty;743 $('#totale').val(total);744 });745});746$('#name26').click(function () {747 $('#selectbottle').css("display","block");748 $('#roseWine').css("display","none");749 $('#whitWine').css("display","none");750 $('#Home').css("display","none");751 $('#redWine').css("display","none");752 $('#customerLog').css("display","none");753 $('#customerForm').css("display","none");754 $('#cardPayment').css("display","none");755 $name= $('#name26').text();756 $rs= $('#rs26').text();757 $qty=$('#qty').text();758 $('#brandName').val($name);759 $('#UnitPrice').val($rs);760 $('#totale').click(function () {761 var rs=$('#UnitPrice').val();762 var qty=$('#qty').val();763 var total=rs*qty;764 $('#totale').val(total);765 });766});767$('#name27').click(function () {768 $('#selectbottle').css("display","block");769 $('#roseWine').css("display","none");770 $('#whitWine').css("display","none");771 $('#Home').css("display","none");772 $('#redWine').css("display","none");773 $('#customerLog').css("display","none");774 $('#customerForm').css("display","none");775 $('#cardPayment').css("display","none");776 $name= $('#name27').text();777 $rs= $('#rs27').text();778 $qty=$('#qty').text();779 $('#brandName').val($name);780 $('#UnitPrice').val($rs);781 $('#totale').click(function () {782 var rs=$('#UnitPrice').val();783 var qty=$('#qty').val();784 var total=rs*qty;785 $('#totale').val(total);786 });787});788$('#name28').click(function () {789 $('#selectbottle').css("display","block");790 $('#roseWine').css("display","none");791 $('#whitWine').css("display","none");792 $('#Home').css("display","none");793 $('#redWine').css("display","none");794 $('#customerLog').css("display","none");795 $('#customerForm').css("display","none");796 $('#cardPayment').css("display","none");797 $name= $('#name28').text();798 $rs= $('#rs28').text();799 $qty=$('#qty').text();800 $('#brandName').val($name);801 $('#UnitPrice').val($rs);802 $('#totale').click(function () {803 var rs=$('#UnitPrice').val();804 var qty=$('#qty').val();805 var total=rs*qty;806 $('#totale').val(total);807 });808});809$('#name29').click(function () {810 $('#selectbottle').css("display","block");811 $('#roseWine').css("display","none");812 $('#whitWine').css("display","none");813 $('#Home').css("display","none");814 $('#redWine').css("display","none");815 $('#customerLog').css("display","none");816 $('#customerForm').css("display","none");817 $('#cardPayment').css("display","none");818 $name= $('#name29').text();819 $rs= $('#rs29').text();820 $qty=$('#qty').text();821 $('#brandName').val($name);822 $('#UnitPrice').val($rs);823 $('#totale').click(function () {824 var rs=$('#UnitPrice').val();825 var qty=$('#qty').val();826 var total=rs*qty;827 $('#totale').val(total);828 });829});830$('#name30').click(function () {831 $('#selectbottle').css("display","block");832 $('#roseWine').css("display","none");833 $('#whitWine').css("display","none");834 $('#Home').css("display","none");835 $('#redWine').css("display","none");836 $('#customerLog').css("display","none");837 $('#customerForm').css("display","none");838 $('#cardPayment').css("display","none");839 $name= $('#name30').text();840 $rs= $('#rs30').text();841 $qty=$('#qty').text();842 $('#brandName').val($name);843 $('#UnitPrice').val($rs);844 $('#totale').click(function () {845 var rs=$('#UnitPrice').val();846 var qty=$('#qty').val();847 var total=rs*qty;848 $('#totale').val(total);849 });850});851$('#name31').click(function () {852 $('#selectbottle').css("display","block");853 $('#roseWine').css("display","none");854 $('#whitWine').css("display","none");855 $('#Home').css("display","none");856 $('#redWine').css("display","none");857 $('#customerLog').css("display","none");858 $('#customerForm').css("display","none");859 $('#cardPayment').css("display","none");860 $name= $('#name31').text();861 $rs= $('#rs31').text();862 $qty=$('#qty').text();863 $('#brandName').val($name);864 $('#UnitPrice').val($rs);865 $('#totale').click(function () {866 var rs=$('#UnitPrice').val();867 var qty=$('#qty').val();868 var total=rs*qty;869 $('#totale').val(total);870 });871});872$('#name32').click(function () {873 $('#selectbottle').css("display","block");874 $('#roseWine').css("display","none");875 $('#whitWine').css("display","none");876 $('#Home').css("display","none");877 $('#redWine').css("display","none");878 $('#customerLog').css("display","none");879 $('#customerForm').css("display","none");880 $('#cardPayment').css("display","none");881 $name= $('#name32').text();882 $rs= $('#rs32').text();883 $qty=$('#qty').text();884 $('#brandName').val($name);885 $('#UnitPrice').val($rs);886 $('#totale').click(function () {887 var rs=$('#UnitPrice').val();888 var qty=$('#qty').val();889 var total=rs*qty;890 $('#totale').val(total);891 });892});893$('#name33').click(function () {894 $('#selectbottle').css("display","block");895 $('#roseWine').css("display","none");896 $('#whitWine').css("display","none");897 $('#Home').css("display","none");898 $('#redWine').css("display","none");899 $('#customerLog').css("display","none");900 $('#customerForm').css("display","none");901 $('#cardPayment').css("display","none");902 $name= $('#name33').text();903 $rs= $('#rs33').text();904 $qty=$('#qty').text();905 $('#brandName').val($name);906 $('#UnitPrice').val($rs);907 $('#totale').click(function () {908 var rs=$('#UnitPrice').val();909 var qty=$('#qty').val();910 var total=rs*qty;911 $('#totale').val(total);912 });913});914$('#name34').click(function () {915 $('#selectbottle').css("display","block");916 $('#roseWine').css("display","none");917 $('#whitWine').css("display","none");918 $('#Home').css("display","none");919 $('#redWine').css("display","none");920 $('#customerLog').css("display","none");921 $('#customerForm').css("display","none");922 $('#cardPayment').css("display","none");923 $name= $('#name34').text();924 $rs= $('#rs34').text();925 $qty=$('#qty').text();926 $('#brandName').val($name);927 $('#UnitPrice').val($rs);928 $('#totale').click(function () {929 var rs=$('#UnitPrice').val();930 var qty=$('#qty').val();931 var total=rs*qty;932 $('#totale').val(total);933 });934});935$('#name35').click(function () {936 $('#selectbottle').css("display","block");937 $('#roseWine').css("display","none");938 $('#whitWine').css("display","none");939 $('#Home').css("display","none");940 $('#redWine').css("display","none");941 $('#customerLog').css("display","none");942 $('#customerForm').css("display","none");943 $('#cardPayment').css("display","none");944 $name= $('#name35').text();945 $rs= $('#rs35').text();946 $qty=$('#qty').text();947 $('#brandName').val($name);948 $('#UnitPrice').val($rs);949 $('#totale').click(function () {950 var rs=$('#UnitPrice').val();951 var qty=$('#qty').val();952 var total=rs*qty;953 $('#totale').val(total);954 });955});956// ================customer form=======================957$('#botelOder').click(function () {958 $('#selectbottle').css("display","none");959 $('#customerLog').css("display","block");960});961// ================customer Login=======================962$('#customerLogin').click(function () {963 $('#customerLog').css("display","none");964 $('#customerForm').css("display","block");...
MergedHistories.py
Source:MergedHistories.py
1################################################################################2#3# This file is part of Gato (Graph Animation Toolbox)4# You can find more information at5# http://gato.sf.net6#7# file: AnimatedDataStructures.py8# author: Alexander Schliep (alexander@schliep.org)9#10# Copyright (C) 1998-2015, Alexander Schliep, Winfried Hochstaettler and11# Copyright 1998-2001 ZAIK/ZPR, Universitaet zu Koeln12#13# Contact: alexander@schliep.org, winfried.hochstaettler@fernuni-hagen.de14#15# Information: http://gato.sf.net16#17# This library is free software; you can redistribute it and/or18# modify it under the terms of the GNU Library General Public19# License as published by the Free Software Foundation; either20# version 2 of the License, or (at your option) any later version.21#22# This library is distributed in the hope that it will be useful,23# but WITHOUT ANY WARRANTY; without even the implied warranty of24# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU25# Library General Public License for more details.26#27# You should have received a copy of the GNU Library General Public28# License along with this library; if not, write to the Free29# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA30#31#32#33# This file is version $Revision: 455 $34# from $Date: 2012-02-14 16:45:23 -0500 (Tue, 14 Feb 2012) $35# last change by $Author: smerking $.36#37################################################################################38from . import GatoGlobals39from . import AnimationHistory40import traceback41g = GatoGlobals.AnimationParameters42class MergedHistories:43 # TODO: Replace repetitive code with functions44 def __init__(self):45 self.history = []46 self.history_index = None47 self.animator1 = None48 self.animator2 = None49 self.auto_print = 050 def _check_animator_set(self, animator, display):51 if self.animator1 is None:52 if display == 1:53 self.animator1 = animator54 if self.animator2 is None:55 if display == 2:56 self.animator2 = animator57 def UpdateEdgeInfo(self, tail, head, info, animator, display):58 self._check_animator_set(animator, display)59 animation = AnimationHistory.AnimationCommand(animator.UpdateEdgeInfo, (tail, head), (info,))60 self.append(animation, display)61 def UpdateGraphInfo(self, info, animator, display):62 self._check_animator_set(animator, display)63 animation = AnimationHistory.AnimationCommand(animator.UpdateGraphInfo, (), (info,))64 self.append(animation, display)65 def UpdateVertexInfo(self, v, info, animator, display):66 self._check_animator_set(animator, display)67 animation = AnimationHistory.AnimationCommand(animator.UpdateVertexInfo, (v,), (info,))68 self.append(animation, display)69 def SetVertexColor(self, v, color, animator, display):70 self._check_animator_set(animator, display)71 animation = AnimationHistory.AnimationCommand(animator.SetVertexColor, (v,), (color,),72 undo_args=(animator.GetVertexColor(v),))73 animation.Do()74 self.append(animation, display)75 #seperate the setAllVert call into component SetVertexColor calls? Make it undoable76 def SetAllVerticesColor(self, color, animator, display, graph=None, vertices=None):77 self._check_animator_set(animator, display)78 if graph:79 vertices = graph.Vertices()80 if vertices:81 animation = AnimationHistory.AnimationCommand(animator.SetAllVerticesColor,82 (color,),(),83 kwargs={'vertices':vertices},84 canUndo=False)85 else:86 animation = AnimationHistory.AnimationCommand(animator.SetAllVerticesColor, (color,), (),87 canUndo=False)88 animation.Do()89 self.append(animation, display)90 def SetAllEdgesColor(self, color, animator, display, leaveColor=None, graph=None, edges=None):91 self._check_animator_set(animator, display)92 if graph:93 edges = graph.Edges()94 if edges:95 animation = AnimationHistory.AnimationCommand(animator.SetAllEdgesColor,96 (color,),(), kwargs={'edges':edges, 'leaveColors':leaveColor},97 canUndo=False)98 else:99 animation = AnimationHistory.AnimationCommand(animator.SetAllEdgesColor, (color,), (),100 kwargs={'leaveColors':leaveColor}, canUndo=False)101 animation.Do()102 self.append(animation, display)103 def SetEdgesColor(self, edges, color, animator, display):104 self._check_animator_set(animator, display)105 for head, tail in edges:106 animation = AnimationHistory.AnimationCommand(animator.SetEdgeColor, (tail,head),107 (color,), canUndo = False)108 animation.Do()109 self.append(animation, display)110 def SetEdgeColor(self, tail, head, color, animator, display):111 self._check_animator_set(animator, display)112 tail, head = animator.G.Edge(tail, head)113 animation = AnimationHistory.AnimationCommand(animator.SetEdgeColor, (tail,head), (color,),114 undo_args=(animator.GetEdgeColor(tail,head),))115 animation.Do()116 self.append(animation, display)117 def BlinkVertex(self, v, animator, display, color=None):118 self._check_animator_set(animator, display)119 animation = AnimationHistory.AnimationCommand(animator.BlinkVertex, (v,), (color,))120 animation.Do()121 self.append(animation, display)122 def CreateBubble(self, vertex_nums, offset_value, color, animator, display):123 self._check_animator_set(animator, display)124 animation = AnimationHistory.AnimationCommand(animator.CreateBubble, (), (vertex_nums, offset_value, color), canUndo=False)125 animation.Do()126 self.append(animation, display)127 def ResizeBubble(self, vertex_nums, new_radius, animator, display):128 self._check_animator_set(animator, display)129 animation = AnimationHistory.AnimationCommand(animator.ResizeBubble, (), (vertex_nums, new_radius), canUndo=False)130 animation.Do()131 self.append(animation, display)132 def DeleteBubble(self, vertex_nums, animator, display):133 self._check_animator_set(animator, display)134 animation = AnimationHistory.AnimationCommand(animator.DeleteBubble, (), (vertex_nums,), canUndo=False)135 animation.Do()136 self.append(animation, display)137 def CreateMoat(self, moat_id, radius, color, animator, display):138 self._check_animator_set(animator, display)139 animation = AnimationHistory.AnimationCommand(animator.CreateMoat, (moat_id,), (radius,color), canUndo=False)140 animation.Do()141 self.append(animation, display)142 def GrowMoat(self, moat_id, radius, animator, display):143 self._check_animator_set(animator, display)144 animation = AnimationHistory.AnimationCommand(animator.GrowMoat, (moat_id,), (radius,), canUndo=False)145 animation.Do()146 self.append(animation, display)147 def BlinkEdge(self, tail, head, animator, display, color=None):148 self._check_animator_set(animator, display)149 tail, head = animator.G.Edge(tail, head)150 animation = AnimationHistory.AnimationCommand(animator.BlinkEdge, (tail,head), (color,))151 animation.Do()152 self.append(animation, display)153 def SetVertexFrameWidth(self, v, val, animator, display):154 self._check_animator_set(animator, display)155 animation = AnimationHistory.AnimationCommand(animator.SetVertexFrameWidth, (v,), (val,),156 undo_args=(animator.GetVertexFrameWidth(v),))157 animation.Do()158 self.append(animation, display)159 def SetVertexAnnotation(self, v, annotation, animator, display, color="black"):160 self._check_animator_set(animator, display)161 animation = AnimationHistory.AnimationCommand(animator.SetVertexAnnotation, (v,), (annotation,),162 undo_args=(animator.GetVertexAnnotation(v),))163 animation.Do()164 self.append(animation, display)165 def AddVertex(self, x, y, animator, display, v = None):166 self._check_animator_set(animator, display)167 if v:168 animation = AnimationHistory.AnimationCommand(animator.AddVertex, (x,y), (v,),169 canUndo=False)170 else:171 animation = AnimationHistory.AnimationCommand(animator.AddVertex, (x,y), (),172 canUndo=False)173 result = animation.Do()174 if not v and result:175 animation = AnimationHistory.AnimationCommand(animator.AddVertex, (x,y), (result,),176 canUndo=False)177 self.append(animation, display)178 return result179 def AddEdge(self, tail, head, animator, display):180 self._check_animator_set(animator, display)181 animation = AnimationHistory.AnimationCommand(animator.AddEdge, (tail,head), (),182 canUndo=False)183 animation.Do()184 self.append(animation, display)185 def Wait(self, animator, display):186 self._check_animator_set(animator, display)187 animation = AnimationHistory.AnimationCommand(animator.Wait, (), (), canUndo=False)188 animation.Do()189 self.append(animation, display)190 def DeleteEdge(self, tail, head, animator, display, repaint=1):191 self._check_animator_set(animator, display)192 animation = AnimationHistory.AnimationCommand(animator.DeleteEdge, (tail,head), (repaint,),193 canUndo=False)194 animation.Do()195 self.append(animation, display)196 def DeleteVertex(self, v, animator, display):197 self._check_animator_set(animator, display)198 #Delete all edges containing v199 #Call deletevertex command200 for d in list(animator.drawEdges.keys()):201 if d[0]==v or d[1]==v:202 self.DeleteEdge(d[0], d[1], animator, display)203 animation = AnimationHistory.AnimationCommand(animator.DeleteVertex, (v,), (), canUndo=False)204 animation.Do()205 self.append(animation, display)206 def HighlightPath(self, path, color, animator, display, closed=0):207 self._check_animator_set(animator, display)208 animation = AnimationHistory.AnimationCommand(animator.HighlightPath, (path,), (color,closed), canUndo=False)209 result = animation.Do()210 self.append(animation, display)211 return result212 # # XXXIMPLEMENTME213 # if self.auto_print == 1:214 # AnimationHistory.merged.auto_print = 1215 # AnimationHistory.merged.HighlightPath(path, color, closed)216 def HidePath(self, pathID, animator, display):217 self._check_animator_set(animator, display)218 animation = AnimationHistory.AnimationCommand(animator.HidePath, (pathID,), (), canUndo=False)219 result = animation.Do()220 self.append(animation, display)221 def __getattr__(self,arg):222 print("Function tried to be called: ", arg)223 raise AttributeError('Specified function of MergedHistories does not exist.')224 def Undo(self):225 """ Undo last command if there is one and if it can be undone """226 if self.history_index == None: # Have never undone anything227 self.history_index = len(self.history) - 1228 if self.history_index >= 0:229 if self.history[self.history_index][0].CanUndo():230 self.history[self.history_index][0].Undo()231 self.history_index -= 1232 #blink the element that can't be undone233 #Need to know if it's a vertex or edge234 #if deleted no blink235 def Do(self):236 if self.history_index is None:237 return238 if self.history_index >= len(self.history):239 self.history_index = None240 else:241 self.history[self.history_index][0].Do()242 self.history_index += 1243 def DoAll(self):244 # Catchup245 if self.history_index is not None:246 for cmd, display in self.history[self.history_index:]: #formerly time, cmd247 if cmd.canUndo:248 #if cmd cannot undo, then it is the one blocking further undoes, do not do command249 cmd.Do()250 self.history_index = None251 def Replay(self):252 if len(self.history) > 1 and self.history[-1][0].CanUndo():253 if self.history[-1][1] == 1:254 self.history[-1][0].Undo()255 self.animator1.update()256 self.animator1.canvas.after(10 * g.BlinkRate)257 self.history[-1][0].Do()258 self.animator1.update()259 self.animator1.canvas.after(10 * g.BlinkRate)260 self.history[-1][0].Undo()261 self.animator1.update()262 self.animator1.canvas.after(10 * g.BlinkRate)263 self.history[-1][0].Do()264 self.animator1.update()265 elif self.history[-1][1] == 2:266 self.history[-1][0].Undo()267 self.animator2.update()268 self.animator2.canvas.after(10 * g.BlinkRate)269 self.history[-1][0].Do()270 self.animator2.update()271 self.animator2.canvas.after(10 * g.BlinkRate)272 self.history[-1][0].Undo()273 self.animator2.update()274 self.animator2.canvas.after(10 * g.BlinkRate)275 self.history[-1][0].Do()276 self.animator2.update()277 else:278 raise Error("Displaynum of function in merged history is neither 1 nor 2.")279 def append(self, animation, display):280 #if self.auto_print:281 # print "disp" , display , " " , animation.log_str()282 tup = animation, display283 self.history.append(tup)284 def clear(self):285 self.history = []286 self.history_index = None287 def getHistoryOne(self):288 firstHistory = []289 for cmd in self.history:290 if cmd[1] == 1:291 firstHistory.append(cmd[0])292 return firstHistory293 def getHistoryTwo(self):294 secondHistory = []295 for cmd in self.history:296 if cmd[1] == 2:297 secondHistory.append(cmd[0])...
exceptions.py
Source:exceptions.py
1class CreatePackageFailedException(Exception):2 """Exception raised during failed package creation.3 """4 def __init__(self, details=None):5 self.message = "An error occurred during package creation."6 self.details = details7 display = self.details8 if display is None:9 display = self.message10 super().__init__(display)11class InvalidCredentialsException(Exception):12 """Exception raised due to invalid credentials.13 """14 def __init__(self, details=None):15 self.message = "An error occurred due to invalid credentials."16 self.details = details17 display = self.details18 if display is None:19 display = self.message20 super().__init__(display)21class DeletePackageException(Exception):22 """Exception raised during package deletion.23 """24 def __init__(self, details=None):25 self.message = "An error occurred during package deletion."26 self.details = details27 display = self.details28 if display is None:29 display = self.message30 super().__init__(display)31class DeleteFileException(Exception):32 """Exception raised during package file deletion.33 """34 def __init__(self, details=None):35 self.message = "An error occurred during package file deletion."36 self.details = details37 display = self.details38 if display is None:39 display = self.message40 super().__init__(display)41class FinalizePackageFailedException(Exception):42 """Exception raised while finalizing package.43 """44 def __init__(self, details=None):45 self.message = "An error occurred during finalize package."46 self.details = details47 display = self.details48 if display is None:49 display = self.message50 super().__init__(display)51class DownloadFileException(Exception):52 """Exception raised during a file download.53 """54 def __init__(self, details=None):55 self.message = "An error occurred during file download."56 self.details = details57 display = self.details58 if display is None:59 display = self.message60 super().__init__(display)61class AddRecipientFailedException(Exception):62 """Exception raised while adding a recipient..63 """64 def __init__(self, details=None):65 self.message = "An error occurred while adding a recipient."66 self.details = details67 display = self.details68 if display is None:69 display = self.message70 super().__init__(display)71class AddFileFailedException(Exception):72 """Exception raised while adding a file to a package.73 """74 def __init__(self, details=None):75 self.message = "An error occurred while adding a file to a package."76 self.details = details77 display = self.details78 if display is None:79 display = self.message80 super().__init__(display)81class GetKeycodeFailedException(Exception):82 """Exception raised while getting keycode.83 """84 def __init__(self, details=None):85 self.message = "An error occurred while getting keycode."86 self.details = details87 display = self.details88 if display is None:89 display = self.message90 super().__init__(display)91class UpdateRecipientFailedException(Exception):92 """Exception raised while updating a recipient.93 """94 def __init__(self, details=None):95 self.message = "An error occurred while updating a recipient."96 self.details = details97 display = self.details98 if display is None:99 display = self.message100 super().__init__(display)101class UploadMessageException(Exception):102 """Exception raised while uploading a message.103 """104 def __init__(self, details=None):105 self.message = "An error occurred while uploading a message."106 self.details = details107 display = self.details108 if display is None:109 display = self.message110 super().__init__(display)111class GetPublicKeysFailedException(Exception):112 """Exception raised while getting public keys.113 """114 def __init__(self, details=None):115 self.message = "An error occurred while getting public keys."116 self.details = details117 display = self.details118 if display is None:119 display = self.message120 super().__init__(display)121class UploadFileException(Exception):122 """Exception raised during a file upload.123 """124 def __init__(self, details=None):125 self.message = "An error occurred during file upload."126 self.details = details127 display = self.details128 if display is None:129 display = self.message130 super().__init__(display)131class GetFileInformationException(Exception):132 """Exception raised while getting file information.133 """134 def __init__(self, details=None):135 self.message = "An error occurred while getting file information."136 self.details = details137 display = self.details138 if display is None:139 display = self.message140 super().__init__(display)141class GetUserInformationException(Exception):142 """Exception raised while getting user information.143 """144 def __init__(self, details=None):145 self.message = "An error occurred while getting user information."146 self.details = details147 display = self.details148 if display is None:149 display = self.message150 super().__init__(display)151class TrustedDeviceException(Exception):152 """Exception raised while generating/revoking a trusted device.153 """154 def __init__(self, details=None):155 self.message = "An error occurred while generating/revoking a trusted device."156 self.details = details157 display = self.details158 if display is None:159 display = self.message160 super().__init__(display)161class GetPackagesException(Exception):162 """Exception raised while getting packages.163 """164 def __init__(self, details=None):165 self.message = "An error occurred while retrieving packages."166 self.details = details167 display = self.details168 if display is None:169 display = self.message170 super().__init__(display)171class GetPackageMessageException(Exception):172 """Exception raised while getting package message.173 """174 def __init__(self, details=None):175 self.message = "An error occurred while getting the package message."176 self.details = details177 display = self.details178 if display is None:179 display = self.message180 super().__init__(display)181class LimitExceededException(Exception):182 """Exception that indicates an exceeded limit.183 """184 def __init__(self, details=None):185 self.message = "An error occurred because the limit was exceeded."186 self.details = details187 display = self.details188 if display is None:189 display = self.message190 super().__init__(display)191class GetPackageInformationFailedException(Exception):192 """Exception that occurs during get_package_information.193 """194 def __init__(self, details=None):195 self.message = "An error occurred while getting package information."196 self.details = details197 display = self.details198 if display is None:199 display = self.message200 super().__init__(display)201class UploadKeycodeException(Exception):202 """Exception that occurs while uploading keycode.203 """204 def __init__(self, details=None):205 self.message = "An error occurred while uploading keycode."206 self.details = details207 display = self.details208 if display is None:209 display = self.message210 super().__init__(display)211class KeycodeRequiredException(Exception):212 """Operation is blocked because the package was not initialized with a keycode213 """214 def __init__(self, details=None):215 self.message = "This operation is blocked because this package was not initialized with a keycode."216 self.details = details217 display = self.details218 if display is None:219 display = self.message...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!