Skip to content

Commit 221747d

Browse files
committed
add another pages for questions
1 parent ad2e88c commit 221747d

File tree

11 files changed

+89
-30
lines changed

11 files changed

+89
-30
lines changed

src/controllers/question1.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = (req, res, next) => {
2+
res.render('question1', { title : ' السؤال الاول ' });
3+
}

src/controllers/question2.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = (req, res, next) => {
2+
res.render('question2', { title : ' السؤال الثاني ' });
3+
}

src/controllers/question3.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = (req, res, next) => {
2+
res.render('question3', { title : 'السؤال الثالث' });
3+
}

src/controllers/questions.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/router.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
const router = require('express').Router();
22

33
const homeController = require('./controllers/home.js');
4-
const questionsController = require('./controllers/questions.js');
4+
const question1Controller = require('./controllers/question1.js');
5+
const question2Controller = require('./controllers/question2.js');
6+
const question3Controller = require('./controllers/question3.js');
57
const finishController = require('./controllers/finish.js');
68
const resultController = require('./controllers/result.js');
79

810
router.get('/', homeController);
9-
router.get('/questions', questionsController);
11+
router.get('/question1', question1Controller);
12+
router.get('/question2', question2Controller);
13+
router.get('/question3', question3Controller);
1014
router.get('/finish', finishController)
1115
router.get('/result', resultController)
1216

src/views/finish.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<nav aria-label="...">
99
<ul class="pager">
1010
<li><a href="/result"> تم </a></li>
11-
<li><a href="/questions"> السابق </a></li>
11+
<li><a href="/question3"> السابق </a></li>
1212
</ul>
1313
</nav>
1414

src/views/home.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</p>
1313
</section>
1414

15-
<a href="/questions">
15+
<a href="/question1">
1616
<button id="start" type="button" class="btn btn-default btn-lg btn-block"> إبدأ </button>
1717

1818
</a>

src/views/question1.hbs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<body>
2+
<section>
3+
<p class="information">
4+
إختر إجابة واحده فقط
5+
</p>
6+
7+
<h2 class="question"> كيف تقدّر تحصيلك في المواضيع العلمية؟ </h2>
8+
9+
<div class="answers list-group">
10+
<button type="button" class="list-group-item"> مرتفع جداً </button>
11+
<button type="button" class="list-group-item"> مرتفع </button>
12+
<button type="button" class="list-group-item"> متوسط </button>
13+
<button type="button" class="list-group-item"> ضعيف </button>
14+
</div>
15+
</section>
16+
17+
<nav aria-label="...">
18+
<ul class="pager">
19+
<li><a href="/question2"> تم </a></li>
20+
<li><a href="/"> السابق </a></li>
21+
</ul>
22+
</nav>
23+
24+
</body>

src/views/question2.hbs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<body>
2+
<section>
3+
<p class="information">
4+
إختر إجابة واحده فقط
5+
</p>
6+
7+
<h2 class="question">كيف تقدّر تحصيلك في المواضيع الأدبية ؟ </h2>
8+
9+
<div class="answers list-group">
10+
<button type="button" class="list-group-item"> مرتفع جداً </button>
11+
<button type="button" class="list-group-item"> مرتفع </button>
12+
<button type="button" class="list-group-item"> متوسط </button>
13+
<button type="button" class="list-group-item"> ضعيف </button>
14+
</div>
15+
</section>
16+
17+
<nav aria-label="...">
18+
<ul class="pager">
19+
<li><a href="/question3"> تم </a></li>
20+
<li><a href="/question1"> السابق </a></li>
21+
</ul>
22+
</nav>
23+
24+
</body>

src/views/question3.hbs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<body>
2+
<section>
3+
<p class="information">
4+
إختر إجابة واحده فقط
5+
</p>
6+
7+
<h2 class="question">كيف تقدّر تحصيلك في اللغات ؟ </h2>
8+
9+
<div class="answers list-group">
10+
<button type="button" class="list-group-item"> مرتفع جداً </button>
11+
<button type="button" class="list-group-item"> مرتفع </button>
12+
<button type="button" class="list-group-item"> متوسط </button>
13+
<button type="button" class="list-group-item"> ضعيف </button>
14+
</div>
15+
</section>
16+
17+
<nav aria-label="...">
18+
<ul class="pager">
19+
<li><a href="/finish"> تم </a></li>
20+
<li><a href="/question2"> السابق </a></li>
21+
</ul>
22+
</nav>
23+
24+
</body>

0 commit comments

Comments
 (0)