S
S
SashaYasha2018-05-24 16:00:02
PHP
SashaYasha, 2018-05-24 16:00:02

Are there tutorials or sample code on how to implement such a test?

Hello. Who can tell how it is implemented - such a test ? I have a task at the university: to develop a test. Each multiple-choice question is displayed in turn. And the page is not updated, only questions with answers are updated. This, as I understand it, is implemented in AJAX.
So far I have created a database and there are two tables in it: questions and answers. In the first field id | question. In the second field id | answer | parent_question | true_question. But since I'm not strong in php and database, I can display the table on the screen and that's it. Tell me how can this be done? To alternately display one question with answer options.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-05-24
@webinar

This, as I understand it, is implemented in AJAX.

no, just a post request sends a form, a normal request, in response it gives html with a new one. js is basically missing (php + html)
The answer is obvious, or rather there are two of them, choose:
- pull up php
- contact a specialist (for freelance)
The form sends a post request, we process the data in it, write it somewhere (session, database, cookies, file, as an option, just in a hidden input), after the last question has come, we count the points and display it.
With ajax, the situation will be a little different, but as I understand it, you don’t know js either, so I don’t suggest it.

K
Kirill Gorelov, 2018-05-24
@Kirill-Gorelov

I think it can be done even easier. If the problem is with php.
https://yandex.ru/search/?text=%20jquery%20step&lr...
And there are a lot of ready-made options))
You display all your questions, and display them step by step to the user.
When the questions are all passed, you check whether all the fields are filled in and send it to the server.
Simply and easily. It's easier if you don't do it one by one)))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question