forked from its-swats/TasteMaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestions.js
More file actions
63 lines (51 loc) · 2.75 KB
/
questions.js
File metadata and controls
63 lines (51 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// MOVED TO WINE_SEARCHING.JS, FUNCTIONS COULD NOT BE CALLED CROSS-FILE
// // Sample questions for the 2nd and 3rd user questions.
// var questions = {
// "bold": [{"question": "Did you like that this wine had bold flavors?", "values":[-5,5]}, {"question": "Did you think the wines flavors were too bold?", "values":[5,-5]}],
// "light": [{"question": "Did you like that this wine had a light flavor?", "values":[-5,5]}, {"question": "Did you think the wines flavors were too bold?", "values":[5,-5]}],
// "fruity": [{"question": "Did you like that this wine had fruity flavors?", "values":[-5,5]}, {"question": "Did you think the wines flavors were too fruity?", "values":[5,-5]}],
// "earthy": [{"question": "Did you like that this wine had earthy flavors?", "values":[-5,5]}, {"question": "Did you think the wines flavors were too earthy?", "values":[5,-5]}]
// }
// // Chooses random question from array when passed a flavorElement ('bold','light','fruity','earthy')
// function questionGenerator(flavorElement) {
// var x = Math.floor((Math.random() * 1));
// var question = questions[flavorElement][x].question;
// var values = questions[flavorElement][x].values;
// var selection = [question, values]
// return selection
// };
// function questionServer(wineCoordinates) {
// var questionsFinal = []
// if (wineCoordinates[0] >= 0) {
// if (wineCoordinates[1] >= 0){
// // return array with both question generators(earthy, bold)
// console.log("return array with both question generators(earthy, bold)")
// questionsFinal.push(questionGenerator("earthy"))
// questionsFinal.push(questionGenerator("bold"))
// return questionsFinal
// } else {
// // return array with both question generators (earthy, light)
// console.log("return array with both question generators (earthy, light)")
// questionsFinal.push(questionGenerator("earthy"))
// questionsFinal.push(questionGenerator("light"))
// return questionsFinal
// }
// } else {
// if (wineCoordinates[1] >= 0){
// // return array with both question generators(fruity, bold)
// console.log("return array with both question generators(fruity, bold)")
// questionsFinal.push(questionGenerator("fruity"))
// questionsFinal.push(questionGenerator("bold"))
// return questionsFinal
// } else {
// // return array with both question generators (fruity, light)
// console.log("return array with both question generators (fruity, light)")
// questionsFinal.push(questionGenerator("fruity"))
// questionsFinal.push(questionGenerator("light"))
// return questionsFinal
// }
// }
// }
// // Driver test code for questionServer
// // var bobo = [30,-30]
// // console.log(questionServer(bobo))