0% found this document useful (0 votes)
46 views2 pages

PE SDN301m TrialTest

ll
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views2 pages

PE SDN301m TrialTest

ll
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PE_SDN301m_TRIALTEST

Subject: SDN301m
Duration: 85 minutes

INSTRUCTIONS

Please read the instructions carefully before doing the questions.

• You are NOT allowed to use any device to share data with others.
• You must use Visual Studio Code, MongoDBCompass, MongoDB V6 for your development tools.

IMPORTANT – before you start doing your solution, MUST do the following steps:

1. Please check before you submit your work, no syntax error(s) in the submitted PE.
2. The data for all collections must be gotten from courses.json, sections.json and members.json file.
3. If there are syntax errors or compilation errors in your PE program, you will not pass the PE
requirements, the mark will be 0.
4. Create a new project in Visual Studio Code named PE_SDN301m_TrialTest _StudentCodeDB.
5. You must create a MongoDB database with the name PE_SDN301m_TrialTest _StudentCodeDB.

Implement a part of Cources Learning System. The situation is described as a course that has many sections
involved and a section belongs to only one course.
Your database contains 3 collections; the database schema as the follow:
Courses ({
courseName: {String, require: true},
courseDescription: {String, require: true}
}, {timestamps: true,});
Sections ({
sectionName: {type: String, require: true},
sectionDescription: {type: String, require: true},
duration: {type: Number, require: true},
isMainTask: {type: Boolean, default: false}
course: {type: mongoose.Schema.Types.ObjectId, ref: "Courses", require: true},
},
{timestamps:true,});
Members ({
username: {type: String, require: true},
password: {type: String, require: true},
}, {timestamps: true,});

Task 01 (1.0 mark). Using Express generator for developing the REST API server, creating related models
then migrate to database named PE_SDN301m_TrialTest_StudentCodeDB (MongoDB).

Task 02 (5.0 marks) Create a full-fledged REST API server to courses collection, you must use JWT for
authenticating API.
- Implement CRUD actions with courses collection.

Task 03 (4.0 marks). Client application for sections management


Student must choose one of template engines (EJS, HANDLEBARS, PUG…) with Express for building the
views
1. Authentication function
At the login view, the member must provide the username and password correctly (password will encrypted
by bcrypt library and stored at members collection). All CRUD actions are required with authentication. In
the case login unsuccessfully, display the messages which involve the errors. The data of members should
store at members collection and come from members.json. After successful login will redirect to dashboard
view.
2. Check if logging in successfully, show the table that contains all the list of sections.
3. Check if logging in successfully, delete the selected item with the confirmation.
4. Check if login successfully, add new item with the requirements:
- All fields are required.
- The value for sectionName includes a-z, A-Z, /, space and digit 0-9. Each word of the sectionName must
begin with a capital letter.
- The isMainTask value must be a toggle control.
- The course field must be a select control, the data in the select must appear as courseName which is
taken from courses collection.
5. Check if login successfully, update the list of sections, all the controls require same of adding function.

-The end of test-

You might also like