代码代写|CSE252 A Practice Final Exam – Questions and Answers

这是一篇来自美国的关于开发一个简单的问答网站的代码代写

 

1. Database (20%)

Within our practice database, create a questions table and an answers table according to the following fields, using appropriate data types and primary keys/foreign key. The relationship is one-to-many between questions and answers (one question may have many answers). Update the ( migrate.js) file to create the necessary tables.

Run
npm run refresh) to update the database.
questions
id
question
created_ at
answers
id
question_ id .
answer
created_ at

2. HTML (20%)

Your HTML will be structured based on the following wireframe and should be generated via the ( views/index . hbs ) file. Note that some of this structure will be dynamically created in the Handlebars view based on passed-in variables via section 4 below.

Each border represents a div.

In the “Questions and Answers” div, create an HTML form that contains a new question textarea that will be submitted back to the ” /question ” endpoint via the POST method.

In each “Question” div (dynamically generated via data passed into the view from the database),
create an HTML form that contains a new answer textarea that will be submitted back to the /question/: id/answer) endpoint via the POST method, replacing ‘:id’ with the id of the question.

The “Answer” divs will also be dynamically generated via variables passed into the view.

3. CSS (20%)

Implement the following styling within an external stylesheet which is linked into your main layout .hbs ) file.

●Overall black background
●Overall white text
。Excepting header tags, which should be #70b8ff.
●Main content div (Questions and Answers):
。#222222 background

o 1px solid white border
。20px margin
05px padding .
●Question div
0 #444444 background
o 1 px solid white border
0 10px margin
。5px padding
●Answer div
o #666666 background
o 1px solid white border
010px margin
。5px padding
Sample with styling: