Skip to content

Commit 14228cb

Browse files
2 parents 15f323a + 73efff1 commit 14228cb

File tree

9 files changed

+1029
-0
lines changed

9 files changed

+1029
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>homework_14</title>
5+
<meta charset="utf-8" />
6+
<link rel="stylesheet" type="text/css" href="style.css">
7+
8+
</head>
9+
<body>
10+
<article>
11+
<h1>Тест по програмированию</h1>
12+
<ol>
13+
<li>Вопрос №1
14+
<section>
15+
<p><input type="checkbox" id="check1-1"><label for="check1-1">Вариант ответа №1</label></p>
16+
<p><input type="checkbox" id="check2-1"><label for="check2-1">Вариант ответа №2</label></p>
17+
<p><input type="checkbox" id="check3-1"><label for="check3-1">Вариант ответа №3</label></p>
18+
</section>
19+
</li>
20+
<li>Вопрос №2
21+
<section>
22+
<p><input type="checkbox" id="check1-2"><label for="check1-2">Вариант ответа №1</label></p>
23+
<p><input type="checkbox" id="check2-2"><label for="check2-2">Вариант ответа №2</label></p>
24+
<p><input type="checkbox" id="check3-2"><label for="check3-2">Вариант ответа №3</label></p>
25+
</section>
26+
</li>
27+
<li>Вопрос №3
28+
<section>
29+
<p><input type="checkbox" id="check1-3"><label for="check1-3">Вариант ответа №1</label></p>
30+
<p><input type="checkbox" id="check2-3"><label for="check2-3">Вариант ответа №2</label></p>
31+
<p><input type="checkbox" id="check3-3"><label for="check3-3">Вариант ответа №3</label></p>
32+
</section>
33+
</li>
34+
</ol>
35+
<button>Проверить мои результаты</button>
36+
</article>
37+
<script src="index.js"></script>
38+
</body>
39+
</html>
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
//TASK 0
2+
//let solution = [12, 23, 34, 12, 12, 23, 12, 45];
3+
let solution = [4, 4, 100, 5000, 4, 4, 4, 4, 4, 100, 100,];
4+
//let solution = [3, 3, 4, 6, 4, 5, 9, 9, 21, 9];
5+
//let solution = [4, 8, 15, 16, 23, 42, 4, 15, 42, 42];
6+
//let solution = [2, 2, 44, 44];
7+
8+
function result(arr) {
9+
let resArr = [];
10+
let objNumbers = arr.reduce((done, elem) => {
11+
if(elem in done) {
12+
done[elem] += 1;
13+
} else {
14+
done[elem] = 1;
15+
};
16+
return done;
17+
}, {});
18+
for(let key in objNumbers) {
19+
if(objNumbers[key] % 2 != 0) {
20+
resArr.push(+key);
21+
};
22+
};
23+
return resArr;
24+
};
25+
console.log(result(solution));
26+
27+
28+
29+
30+
//TASK - 1
31+
const someWebpackModule = `module.exports = {
32+
context: %%HOMEDIR%%,
33+
entry: {
34+
app: "%%HOMEDIR%%/%%APP_DIR%%/%%APPNAME%%.js"
35+
},
36+
output: {
37+
path: %%HOMEDIR%% + '/app',
38+
filename: "dist/[%%APPNAME%%].js",
39+
library: '[%%APPNAME%%]'
40+
}
41+
}`;
42+
43+
//TASK - 1
44+
let regExpSetpoint = /%%HOMEDIR%%/gmi;
45+
//let regExpSetpoint = /%%APP_DIR%%/gmi;
46+
//let regExpSetpoint = /%%APPNAME%%/gmi;
47+
48+
let regExpRequiredValue = './JavaScript-Basic';
49+
//let regExpRequiredValue = 'fixtures/src';
50+
//let regExpRequiredValue = 'app.js';
51+
52+
function regExpEndParse(str, setpoints, requiredValue) {
53+
let test = str.replace(setpoints, requiredValue);
54+
return test;
55+
}
56+
57+
console.log(regExpEndParse(someWebpackModule, regExpSetpoint, regExpRequiredValue));
58+
59+
60+
61+
62+
//Task3
63+
let app = {
64+
questions: [
65+
{
66+
textQuestions:'Вопрос №1',
67+
textAnswers: ['Вариант ответа №1', 'Вариант ответа №2', 'Вариант ответа №3']
68+
},
69+
{
70+
textQuestions:'Вопрос №2',
71+
textAnswers: ['Вариант ответа №1', 'Вариант ответа №2', 'Вариант ответа №3']
72+
},
73+
{
74+
textQuestions:'Вопрос №3',
75+
textAnswers: ['Вариант ответа №1', 'Вариант ответа №2', 'Вариант ответа №3']
76+
}
77+
],
78+
createContainer() {
79+
let container = document.createElement('article');
80+
container.appendChild(this.createCaption());
81+
container.appendChild(this.createQuestions());
82+
container.appendChild(this.createButton());
83+
return container;
84+
},
85+
createCaption() {
86+
let caption = document.createElement('h1');
87+
caption.textContent = 'Тест по програмированию';
88+
return caption;
89+
},
90+
createQuestions() {
91+
let id = 0;
92+
let list = document.createElement('ol');
93+
this.questions.forEach((questAnswer) => {
94+
let question = document.createElement('li');
95+
question.textContent = questAnswer.textQuestions;
96+
let sectionAnswer = document.createElement('section');
97+
question.appendChild(sectionAnswer);
98+
99+
questAnswer.textAnswers.forEach((elem) => {
100+
let idId = id++;
101+
let answer = document.createElement('p');
102+
let input = document.createElement('input');
103+
input.setAttribute('type', 'checkbox');
104+
input.setAttribute('id', `check${idId}`);
105+
let label = document.createElement('label');
106+
label.setAttribute('for', `check${idId}`);
107+
label.textContent = elem;
108+
answer.appendChild(input);
109+
answer.appendChild(label);
110+
111+
sectionAnswer.appendChild(answer);
112+
question.appendChild(sectionAnswer);
113+
list.appendChild(question);
114+
});
115+
});
116+
return list;
117+
},
118+
createButton() {
119+
let button = document.createElement('button');
120+
button.textContent = 'Проверить мои результаты';
121+
return button;
122+
},
123+
render() {
124+
document.body.appendChild(this.createContainer());
125+
}
126+
};
127+
app.render();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
h1 {
2+
text-align: center;
3+
}
4+
5+
li {
6+
margin: 0, auto;
7+
}
8+
9+
section {
10+
margin-top: 10px;
11+
margin-bottom: 10px;
12+
}
13+
14+
p {
15+
margin: 0;
16+
}
17+
18+
button {
19+
margin-left: 500px;
20+
height: 40px;
21+
width:350px;
22+
}
23+
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>homework_15</title>
5+
<meta charset="utf-8" />
6+
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
7+
<link rel="stylesheet" type="text/css" href="style.css">
8+
</head>
9+
<body>
10+
<header class="header">
11+
<div class="container top-radius">
12+
<h2>Contacts</h2>
13+
</div>
14+
</header>
15+
16+
<main>
17+
<div class="container">
18+
<form class="form-inline search-form">
19+
<div class="form-group">
20+
<label class="sr-only" for="search">Search</label>
21+
<input type="text" class="form-control" id= "search" placeholder="Search">
22+
</div>
23+
</form>
24+
<!-- <table class="table table-hover contacts">
25+
<thead>
26+
<tr>
27+
<th>Name</th>
28+
<th>Last name</th>
29+
<th>Email</th>
30+
</tr>
31+
</thead>
32+
<tbody>
33+
<tr>
34+
<td>Иван</td>
35+
<td>Петров</td>
36+
37+
</tr>
38+
<tr>
39+
<td>Сергей</td>
40+
<td>Сергеев</td>
41+
42+
</tr>
43+
<tr>
44+
<td>Иван</td>
45+
<td>Иванов</td>
46+
47+
</tr>
48+
<tr>
49+
<td>Александр</td>
50+
<td>Александров</td>
51+
52+
</tr>
53+
<tr>
54+
<td>Алекс</td>
55+
<td>Смирнов</td>
56+
57+
</tr>
58+
<tr>
59+
<td>Сергей</td>
60+
<td>Волков</td>
61+
62+
</tr>
63+
<tr>
64+
<td>Мария</td>
65+
<td>Шарапова</td>
66+
67+
</tr>
68+
<tr>
69+
<td>Александр</td>
70+
<td>Винник</td>
71+
72+
</tr>
73+
<tr>
74+
<td>Дарий</td>
75+
<td>Смирнов</td>
76+
77+
</tr>
78+
<tr>
79+
<td>Елена</td>
80+
<td>Лещенко</td>
81+
82+
</tr>
83+
<tr>
84+
<td>Ольга</td>
85+
<td>Новикова</td>
86+
87+
</tr>
88+
<tr>
89+
<td>Наталья</td>
90+
<td>Шемякина</td>
91+
92+
</tr>
93+
<tr>
94+
<td>Анна</td>
95+
<td>Донцова</td>
96+
97+
</tr>
98+
<tr>
99+
<td>Влад</td>
100+
<td>Яма</td>
101+
102+
</tr>
103+
<tr>
104+
<td>Кира</td>
105+
<td>Воробьева</td>
106+
107+
</tr>
108+
<tr>
109+
<td>Виктор</td>
110+
<td>Кривенко</td>
111+
112+
</tr>
113+
</tbody>
114+
</table> -->
115+
</div>
116+
</main>
117+
<footer class="footer">
118+
<div class="container bottom-radius">
119+
<nav class="main-nav">
120+
<a href="index.html" class="tab active">
121+
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
122+
<span class = "tab-text">Contacts</span>
123+
</a>
124+
<a href="keypad.html" class="tab">
125+
<span class="glyphicon glyphicon-th" aria-hidden="true"></span>
126+
<span class = "tab-text">Keypad</span>
127+
</a>
128+
<a href="edit-contact.html" class="tab">
129+
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
130+
<span class = "tab-text">Edit contact</span>
131+
</a>
132+
<a href="user.html" class="tab">
133+
<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
134+
<span class = "tab-text">User</span>
135+
</a>
136+
<a href="add-user.html" class="tab">
137+
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
138+
<span class = "tab-text">Add user</span>
139+
</a>
140+
</nav>
141+
</div>
142+
</footer>
143+
144+
<script src="index.js"></script>
145+
</body>
146+
</html>

0 commit comments

Comments
 (0)