currently i have a CPT "course" and a cpt "evaluation".
these two posts are in a "one to many" relationship.
I would like to create a system that allows the user to save an new "evaluation" through a cred form.
obviously the questions must not be modifiable, while the answers must be select with a numerical mark from 10 to 50 (10,20,30,40,50)
I am in trouble because if I create custom "evaluation" fields: "questions" and "answer", and then I create a form that creates a new post "evaluations", both the questions and the answers are editable.
I wish users could only apply the vote to the questions.
==>
OK
The thing is that you should try to configure the Questions and Answers as different post types and with the Answers post type you should add a custom field that holds the reply/vode from the user.
If you check with my test site: hidden link
User: demo
PWD: Admin@123
I've configured the Questions and Asnwers as post types:
=> hidden link
Then, I've created one to many relationships between Question and Answers:
=> hidden link
I've added the custom field that will hold the reply/vote from the user:
=> hidden link
Then, I've created the following form for the answers:
=> hidden link
Then I've created the following view which will display the questions and form to take the answer for that question:
=> hidden link
And I've added the view on the following page:
=> hidden link
[As you can see, it displays all questions and a select box to reply the vote (10,20,30,40,50) and another field (Questions Answers) which is used to relate for which question you are answering. Obviously, we can hide it using simple CSS or we can make a hidden field.
Once you submit, it will create a new entry for answer post type and hold the vote value as well as to what question you submit the answer.
I hope this is clear and help you to understand how you can build the question and answers system.
In addition to that, you can also create a block view to build you view to display the same questions and answers:
=> hidden link
=> hidden link