-
Notifications
You must be signed in to change notification settings - Fork 3
/
VerbsFuture.html
139 lines (118 loc) · 14 KB
/
VerbsFuture.html
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html>
<head>
<title>
LT Exercise -- Future for Verbs
</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/tooltip.css">
<link rel="stylesheet" href="css/ToC.css">
<link rel="stylesheet" href="css/pageStructure.css">
<script type="text/javascript" src="js/Common.js"> </script>
<script type="text/javascript">
ButtonNext_OnPageLoad();
SetupArrayFunctions();
var samplesAsJson = '[{"En":"to be", "Infinitive":"būti", "FirstSingular":"busiu", "SecondSingular":"busi", "ThirdSingular":"bus", "FirstPlural":"busime", "SecondPlural":"busite", "ThirdPlural":"bus"},{"En":"to live somewhere", "Infinitive":"gyventi", "FirstSingular":"gyvensiu", "SecondSingular":"gyvensi", "ThirdSingular":"gyvens", "FirstPlural":"gyvensime", "SecondPlural":"gyvensite", "ThirdPlural":"gyvens"},{"En":"to work", "Infinitive":"dirbti", "FirstSingular":"dirbsiu", "SecondSingular":"dirbsi", "ThirdSingular":"dirbs", "FirstPlural":"dirbsime", "SecondPlural":"dirbsite", "ThirdPlural":"dirbs"},{"En":"to understand", "Infinitive":"suprasti", "FirstSingular":"suprasiu", "SecondSingular":"suprasi", "ThirdSingular":"supras", "FirstPlural":"suprasime", "SecondPlural":"suprasite", "ThirdPlural":"supras"},{"En":"to go", "Infinitive":"eiti", "FirstSingular":"eisiu", "SecondSingular":"eisi", "ThirdSingular":"eis", "FirstPlural":"eisime", "SecondPlural":"eisite", "ThirdPlural":"eis"},{"En":"to give", "Infinitive":"duoti", "FirstSingular":"duosiu", "SecondSingular":"duosi", "ThirdSingular":"duos", "FirstPlural":"duosime", "SecondPlural":"duosite", "ThirdPlural":"duos"},{"En":"to take", "Infinitive":"imti", "FirstSingular":"imsiu", "SecondSingular":"imsi", "ThirdSingular":"ims", "FirstPlural":"imsime", "SecondPlural":"imsite", "ThirdPlural":"ims"},{"En":"to put", "Infinitive":"dėti", "FirstSingular":"dėsiu", "SecondSingular":"dėsi", "ThirdSingular":"dės", "FirstPlural":"dėsime", "SecondPlural":"dėsite", "ThirdPlural":"dės"},{"En":"to like", "Infinitive":"mėgti", "FirstSingular":"mėgsiu", "SecondSingular":"mėgsi", "ThirdSingular":"mėgs", "FirstPlural":"mėgsime", "SecondPlural":"mėgsite", "ThirdPlural":"mėgs"},{"En":"to like", "Infinitive":"patikti", "FirstSingular":"patiksiu", "SecondSingular":"patiksi", "ThirdSingular":"patiks", "FirstPlural":"patiksime", "SecondPlural":"patiksite", "ThirdPlural":"patiks"},{"En":"to meet", "Infinitive":"susitikti", "FirstSingular":"susitiksiu", "SecondSingular":"susitiksi", "ThirdSingular":"susitiks", "FirstPlural":"susitiksime", "SecondPlural":"susitiksite", "ThirdPlural":"susitiks"},{"En":"to drive", "Infinitive":"važiuoti", "FirstSingular":"važiuosiu", "SecondSingular":"važiuosi", "ThirdSingular":"važiuos", "FirstPlural":"važiuosime", "SecondPlural":"važiuosite", "ThirdPlural":"važiuos"},{"En":"to be late", "Infinitive":"vėluoti", "FirstSingular":"vėluosiu", "SecondSingular":"vėluosi", "ThirdSingular":"vėluos", "FirstPlural":"vėluosime", "SecondPlural":"vėluosite", "ThirdPlural":"vėluos"},{"En":"to speak", "Infinitive":"kalbėti", "FirstSingular":"kalbėsiu", "SecondSingular":"kalbėsi", "ThirdSingular":"kalbės", "FirstPlural":"kalbėsime", "SecondPlural":"kalbėsite", "ThirdPlural":"kalbės"},{"En":"to learn", "Infinitive":"studijuoti", "FirstSingular":"studijuosiu", "SecondSingular":"studijuosi", "ThirdSingular":"studijuos", "FirstPlural":"studijuosime", "SecondPlural":"studijuosite", "ThirdPlural":"studijuos"},{"En":"to call", "Infinitive":"skambinti", "FirstSingular":"skambinsiu", "SecondSingular":"skambinsi", "ThirdSingular":"skambins", "FirstPlural":"skambinsime", "SecondPlural":"skambinsite", "ThirdPlural":"skambins"},{"En":"to familiarize", "Infinitive":"susipažinti", "FirstSingular":"susipažinsiu", "SecondSingular":"susipažinsi", "ThirdSingular":"susipažins", "FirstPlural":"susipažinsime", "SecondPlural":"susipažinsite", "ThirdPlural":"susipažins"},{"En":"to miss", "Infinitive":"pasiilgti", "FirstSingular":"pasiilgsiu", "SecondSingular":"pasiilgsi", "ThirdSingular":"pasiilgs", "FirstPlural":"pasiilgsime", "SecondPlural":"pasiilgsite", "ThirdPlural":"pasiilgs"},{"En":"to go on vacation", "Infinitive":"atostogauti", "FirstSingular":"atostogausiu", "SecondSingular":"atostogausi", "ThirdSingular":"atostogaus", "FirstPlural":"atostogausime", "SecondPlural":"atostogausite", "ThirdPlural":"atostogaus"},{"En":"to taste", "Infinitive":"ragauti", "FirstSingular":"ragausiu", "SecondSingular":"ragausi", "ThirdSingular":"ragaus", "FirstPlural":"ragausime", "SecondPlural":"ragausite", "ThirdPlural":"ragaus"},{"En":"to eat", "Infinitive":"pietauti", "FirstSingular":"pietausiu", "SecondSingular":"pietausi", "ThirdSingular":"pietaus", "FirstPlural":"pietausime", "SecondPlural":"pietausite", "ThirdPlural":"pietaus"},{"En":"to cook/to boil", "Infinitive":"virti", "FirstSingular":"virsiu", "SecondSingular":"virsi", "ThirdSingular":"virs", "FirstPlural":"virsime", "SecondPlural":"virsite", "ThirdPlural":"virs"},{"En":"to fry", "Infinitive":"kepti", "FirstSingular":"kepsiu", "SecondSingular":"kepsi", "ThirdSingular":"keps", "FirstPlural":"kepsime", "SecondPlural":"kepsite", "ThirdPlural":"keps"},{"En":"to produce", "Infinitive":"gaminti", "FirstSingular":"gaminsiu", "SecondSingular":"gaminsi", "ThirdSingular":"gamins", "FirstPlural":"gaminsime", "SecondPlural":"gaminsite", "ThirdPlural":"gamins"},{"En":"to cost", "Infinitive":"kainuoti", "FirstSingular":"kainuosiu", "SecondSingular":"kainuosi", "ThirdSingular":"kainuos", "FirstPlural":"kainuosime", "SecondPlural":"kainuosite", "ThirdPlural":"kainuos"},{"En":"to know/to pay", "Infinitive":"mokėti", "FirstSingular":"mokėsiu", "SecondSingular":"mokėsi", "ThirdSingular":"mokės", "FirstPlural":"mokėsime", "SecondPlural":"mokėsite", "ThirdPlural":"mokės"},{"En":"to sell", "Infinitive":"parduoti", "FirstSingular":"parduosiu", "SecondSingular":"parduosi", "ThirdSingular":"parduos", "FirstPlural":"parduosime", "SecondPlural":"parduosite", "ThirdPlural":"parduos"},{"En":"to buy", "Infinitive":"pirkti", "FirstSingular":"pirksiu", "SecondSingular":"pirksi", "ThirdSingular":"pirks", "FirstPlural":"pirksime", "SecondPlural":"pirksite", "ThirdPlural":"pirks"},{"En":"to have", "Infinitive":"turėti", "FirstSingular":"turėsiu", "SecondSingular":"turėsi", "ThirdSingular":"turės", "FirstPlural":"turėsime", "SecondPlural":"turėsite", "ThirdPlural":"turės"},{"En":"to be able", "Infinitive":"galėti", "FirstSingular":"galėsiu", "SecondSingular":"galėsi", "ThirdSingular":"galės", "FirstPlural":"galėsime", "SecondPlural":"galėsite", "ThirdPlural":"galės"},{"En":"to ask", "Infinitive":"klausyti", "FirstSingular":"klausysiu", "SecondSingular":"klausysi", "ThirdSingular":"klausys", "FirstPlural":"klausysime", "SecondPlural":"klausysite", "ThirdPlural":"klausys"},{"En":"to hear", "Infinitive":"girdėti", "FirstSingular":"girdėsiu", "SecondSingular":"girdėsi", "ThirdSingular":"girdės", "FirstPlural":"girdėsime", "SecondPlural":"girdėsite", "ThirdPlural":"girdės"},{"En":"to look", "Infinitive":"žiūrėti", "FirstSingular":"žiūrėsiu", "SecondSingular":"žiūrėsi", "ThirdSingular":"žiūrės", "FirstPlural":"žiūrėsime", "SecondPlural":"žiūrėsite", "ThirdPlural":"žiūrės"},{"En":"to love", "Infinitive":"mylėti", "FirstSingular":"mylėsiu", "SecondSingular":"mylėsi", "ThirdSingular":"mylės", "FirstPlural":"mylėsime", "SecondPlural":"mylėsite", "ThirdPlural":"mylės"},{"En":"to stand", "Infinitive":"stovėti", "FirstSingular":"stovėsiu", "SecondSingular":"stovėsi", "ThirdSingular":"stovės", "FirstPlural":"stovėsime", "SecondPlural":"stovėsite", "ThirdPlural":"stovės"},{"En":"to sit", "Infinitive":"sėdėti", "FirstSingular":"sėdėsiu", "SecondSingular":"sėdėsi", "ThirdSingular":"sėdės", "FirstPlural":"sėdėsime", "SecondPlural":"sėdėsite", "ThirdPlural":"sėdės"},{"En":"to want", "Infinitive":"norėti", "FirstSingular":"norėsiu", "SecondSingular":"norėsi", "ThirdSingular":"norės", "FirstPlural":"norėsime", "SecondPlural":"norėsite", "ThirdPlural":"norės"},{"En":"to drink", "Infinitive":"gerti", "FirstSingular":"gersiu", "SecondSingular":"gersi", "ThirdSingular":"gers", "FirstPlural":"gersime", "SecondPlural":"gersite", "ThirdPlural":"gers"},{"En":"to wait", "Infinitive":"laukti", "FirstSingular":"lauksiu", "SecondSingular":"lauksi", "ThirdSingular":"lauks", "FirstPlural":"lauksime", "SecondPlural":"lauksite", "ThirdPlural":"lauks"},{"En":"to play", "Infinitive":"žaisti", "FirstSingular":"žaisiu", "SecondSingular":"žaisi", "ThirdSingular":"žais", "FirstPlural":"žaisime", "SecondPlural":"žaisite", "ThirdPlural":"žais"},{"En":"to invite", "Infinitive":"kviesti", "FirstSingular":"kviesiu", "SecondSingular":"kviesi", "ThirdSingular":"kvies", "FirstPlural":"kviesime", "SecondPlural":"kviesite", "ThirdPlural":"kvies"},{"En":"to need/must", "Infinitive":"reikėti", "FirstSingular":"reikėsiu", "SecondSingular":"reikėsi", "ThirdSingular":"reikės", "FirstPlural":"reikėsime", "SecondPlural":"reikėsite", "ThirdPlural":"reikės"},{"En":"to do", "Infinitive":"daryti", "FirstSingular":"darysiu", "SecondSingular":"darysi", "ThirdSingular":"darys", "FirstPlural":"darysime", "SecondPlural":"darysite", "ThirdPlural":"darys"},{"En":"to eat", "Infinitive":"valgyti", "FirstSingular":"valgysiu", "SecondSingular":"valgysi", "ThirdSingular":"valgys", "FirstPlural":"valgysime", "SecondPlural":"valgysite", "ThirdPlural":"valgys"},{"En":"to say", "Infinitive":"sakyti", "FirstSingular":"sakysiu", "SecondSingular":"sakysi", "ThirdSingular":"sakys", "FirstPlural":"sakysime", "SecondPlural":"sakysite", "ThirdPlural":"sakys"},{"En":"to assume", "Infinitive":"manyti", "FirstSingular":"manysiu", "SecondSingular":"manysi", "ThirdSingular":"manys", "FirstPlural":"manysime", "SecondPlural":"manysite", "ThirdPlural":"manys"},{"En":"to ask", "Infinitive":"prašyti", "FirstSingular":"prašysiu", "SecondSingular":"prašysi", "ThirdSingular":"prašys", "FirstPlural":"prašysime", "SecondPlural":"prašysite", "ThirdPlural":"prašys"},{"En":"to propose", "Infinitive":"siūlyti", "FirstSingular":"siūlysiu", "SecondSingular":"siūlysi", "ThirdSingular":"siūlys", "FirstPlural":"siūlysime", "SecondPlural":"siūlysite", "ThirdPlural":"siūlys"},{"En":"to order", "Infinitive":"užsisakyti", "FirstSingular":"užsisakysiu", "SecondSingular":"užsisakysi", "ThirdSingular":"užsisakys", "FirstPlural":"užsisakysime", "SecondPlural":"užsisakysite", "ThirdPlural":"užsisakys"}]';
var pronounGroups = [
[{En : "I", Lt : "Aš"}],
[{En : "You (sing.)", Lt : "Tu"}],
[{En : "He", Lt : "Jis" }, {En : "She", Lt : "Ji"}],
[{En : "We", Lt : "Mes"}],
[{En : "You (plur.)", Lt : "Jūs"}],
[{En : "They (mixed or masc.)", Lt : "Jie" }, {En : "They (fem.)", Lt : "Jos"}]
];
// Parse verbs and group it by past type
var verbs = JSON.parse(samplesAsJson);
var currentSample = {pronounGroup : pronounGroups.random(), verb : verbs.random()};
var notification = {};
function onNextActionButtonClick(){
// Check if it's answer request or next sample request
var isAnswerRequest = false;
var button = document.getElementById('NextActionButton');
if(button.innerText == 'Check answer') {isAnswerRequest = true;}
else {isAnswerRequest = false;}
// Call the respective function based on the request type
if(isAnswerRequest){
onAnswerRequest();
}
else { onNextSampleRequest(); }
}
function onAnswerRequest(){
// Show answer
var answerDiv = document.getElementById('Answer');
var answer = "";
// Conjugate pronoun and a verb. Choose right verb form based on pronoun.
switch(currentSample.pronounGroup[0].Lt) {
case "Aš":
answer = currentSample.verb.FirstSingular;
break;
case "Tu":
answer = currentSample.verb.SecondSingular;
break;
case "Jis":
answer = currentSample.verb.ThirdSingular;
break;
case "Mes":
answer = currentSample.verb.FirstPlural;
break;
case "Jūs":
answer = currentSample.verb.SecondPlural;
break;
case "Jie":
answer = currentSample.verb.ThirdPlural;
break;
};
answerDiv.innerHTML = answer.toLowerCase();
// Amend button text
var button = document.getElementById('NextActionButton');
button.innerText = 'Next';
// Notification
notification.Answer = answer;
}
function onNextSampleRequest(){
// Clean up answer
var answerDiv = document.getElementById('Answer');
answerDiv.innerHTML = '';
// Amend button text
var button = document.getElementById('NextActionButton');
button.innerText = 'Check answer';
// Setup new sample
currentSample = {
pronounGroup : pronounGroups.notRepeatingRandom(currentSample.pronounGroup),
verb : verbs.notRepeatingRandom(currentSample.verb)};
// Setup question div
var divToAmend = document.getElementById('Question');
var pronoun = currentSample.pronounGroup.random();
var verb = currentSample.verb;
divToAmend.innerHTML = '<div class="tooltip"> ' + pronoun.Lt +' <span class="tooltiptext"> ' + pronoun.En + ' </span> </div> ' +
'<div class="tooltip"> ' + verb.Infinitive.toLowerCase() +' <span class="tooltiptext rightTooltip"> ' + verb.En + ' </span> </div> ';
// Notification
notification.Question = pronoun.Lt + ' ' + verb.Infinitive.toLowerCase();
notification.Answer = null;
}
</script>
</head>
<body>
<div id='pageStructure' class="pageStructure">
<div id='ToC' class='ToC'></div>
<script type="text/javascript" src="js/ToC.js"> </script>
<script> uploadToC(); </script>
<div id='table' class='content'>
<div id='Question'> Tu gyventi </div>
<div id='Answer'> gyvensi </div>
<div id='Button'>
<button id='NextActionButton'
onclick="onNextActionButtonClick()">
Next
</button>
</div>
<div class="issueNotificationDiv">
<button id='notifyButton'
onclick="notify(notification.Question, notification.Answer)">
Tell about an error
</button>
</div>
</div>
</div>
</body>
</html>