Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-049
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-049
2021-049
Commits
e7f90597
Commit
e7f90597
authored
Nov 18, 2021
by
Hasitha Samarasekara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize the home page
parent
77c08e17
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
889 additions
and
482 deletions
+889
-482
BackEnd/WebBackEnd/models/ClassStudentList.model.js
BackEnd/WebBackEnd/models/ClassStudentList.model.js
+1
-1
BackEnd/WebBackEnd/models/studentALResult.model.js
BackEnd/WebBackEnd/models/studentALResult.model.js
+0
-6
BackEnd/WebBackEnd/models/tutor.user.model.js
BackEnd/WebBackEnd/models/tutor.user.model.js
+1
-0
BackEnd/WebBackEnd/routes/createClass.route.js
BackEnd/WebBackEnd/routes/createClass.route.js
+2
-1
BackEnd/WebBackEnd/routes/filteredListNew.route.js
BackEnd/WebBackEnd/routes/filteredListNew.route.js
+37
-2
BackEnd/WebBackEnd/routes/studentALResult.route.js
BackEnd/WebBackEnd/routes/studentALResult.route.js
+18
-18
BackEnd/WebBackEnd/routes/tutor.route.js
BackEnd/WebBackEnd/routes/tutor.route.js
+3
-1
BackEnd/WebBackEnd/server.js
BackEnd/WebBackEnd/server.js
+1
-1
WebFrontEnd/smartcoach-frontend/package-lock.json
WebFrontEnd/smartcoach-frontend/package-lock.json
+207
-3
WebFrontEnd/smartcoach-frontend/package.json
WebFrontEnd/smartcoach-frontend/package.json
+1
-0
WebFrontEnd/smartcoach-frontend/src/Components/Admin/StudentRequestForClass.js
...h-frontend/src/Components/Admin/StudentRequestForClass.js
+3
-2
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
+615
-447
WebFrontEnd/smartcoach-frontend/src/Images/ad01.jpg
WebFrontEnd/smartcoach-frontend/src/Images/ad01.jpg
+0
-0
WebFrontEnd/smartcoach-frontend/src/Images/logo.jpeg
WebFrontEnd/smartcoach-frontend/src/Images/logo.jpeg
+0
-0
WebFrontEnd/smartcoach-frontend/src/Images/main01.jpg
WebFrontEnd/smartcoach-frontend/src/Images/main01.jpg
+0
-0
WebFrontEnd/smartcoach-frontend/src/Images/main02.jpg
WebFrontEnd/smartcoach-frontend/src/Images/main02.jpg
+0
-0
No files found.
BackEnd/WebBackEnd/models/ClassStudentList.model.js
View file @
e7f90597
...
...
@@ -5,7 +5,7 @@ const Schema = mongoose.Schema;
const
ClassStudentSchema
=
new
Schema
({
class_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
Classes
'
},
student_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
student
'
},
tutor_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
tutor
'
},
},{
timestamps
:
true
,
});
...
...
BackEnd/WebBackEnd/models/studentALResult.model.js
View file @
e7f90597
...
...
@@ -7,12 +7,6 @@ const ALResultsSchema = new Schema({
year
:{
type
:
String
,
required
:
false
},
stream
:
{
type
:
String
,
required
:
true
},
Subjects
:
{
type
:
Object
},
subject01
:{
type
:
String
,
required
:
true
},
subject02
:{
type
:
String
,
required
:
true
},
subject03
:{
type
:
String
,
required
:
true
},
subject01Result
:{
type
:
String
,
required
:
true
},
subject02Result
:{
type
:
String
,
required
:
true
},
subject03Result
:{
type
:
String
,
required
:
true
},
generalEnglish
:{
type
:
String
},
commonGeneralTest
:{
type
:
String
},
image
:{
type
:
String
},
...
...
BackEnd/WebBackEnd/models/tutor.user.model.js
View file @
e7f90597
...
...
@@ -19,6 +19,7 @@ const userSchema = new Schema({
tutor_main_city
:[{
type
:
String
}],
tutor_medium
:{
type
:
String
},
tutor_qualification
:{
type
:
String
},
tutor_student_count
:{
type
:
Number
},
tutor_instituteIDList
:[{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
institute
'
}],
},
{
timestamps
:
true
,
...
...
BackEnd/WebBackEnd/routes/createClass.route.js
View file @
e7f90597
...
...
@@ -104,6 +104,7 @@ router.route('/studentList/update').post((req, res) => {
const
class_id
=
req
.
body
.
_id
;
const
student_nic
=
req
.
body
.
student_nic
;
const
tutor_id
=
req
.
body
.
tutor_id
;
console
.
log
(
"
classID:
"
+
class_id
);
console
.
log
(
"
student_nic:
"
+
student_nic
);
...
...
@@ -126,7 +127,7 @@ router.route('/studentList/update').post((req, res) => {
const
newClassStudent
=
new
studentList
({
class_id
,
student_id
,
tutor_id
});
newClassStudent
.
save
().
then
(
result
=>
{
...
...
BackEnd/WebBackEnd/routes/filteredListNew.route.js
View file @
e7f90597
const
router
=
require
(
'
express
'
).
Router
();
let
tutor
=
require
(
'
../models/tutor.user.model
'
);
let
tutorRating
=
require
(
'
../models/TutorRatingAndReviews.model
'
);
let
tutorClasses
=
require
(
'
../models/createClass.model
'
);
let
ALResults
=
require
(
'
../models/studentALResult.model
'
);
let
classStudentList
=
require
(
'
../models/ClassStudentList.model
'
);
const
axios
=
require
(
'
axios
'
);
const
request
=
require
(
'
request
'
);
...
...
@@ -26,9 +29,34 @@ router.route('/getFilteredList').post((req, res) => {
tutors
.
reduce
(
async
(
promise
,
tutor
,
idx
)
=>
{
await
promise
;
await
tutorRating
.
find
({
"
tutor_id
"
:
tutor
.
_id
}).
then
((
reviews
)
=>
{
let
classCount
=
0
;
let
studentCount
=
0
;
await
tutorRating
.
find
({
"
tutor_id
"
:
tutor
.
_id
}).
then
(
async
(
reviews
)
=>
{
//console.log("i : " + JSON.stringify(reviews));
await
tutorClasses
.
find
({
"
tutor_id
"
:
tutor
.
_id
}).
then
(
async
(
tutorOneClass
)
=>
{
classCount
=
tutorOneClass
.
length
;
console
.
log
(
"
Class Count :
"
+
classCount
);
// let oneClassCount = 0
//
// if(tutorOneClass.length > 0){
// tutorOneClass.reduce(async (promise, tutorOneCl, idx2) =>{
// await promise;
// await classStudentList.find({"class_id": tutorOneCl._id}).then( async (stdCount)=>{
// oneClassCount = oneClassCount + stdCount.length;
//
// if(idx2 === stdCount.length - 1){
// studentCount = oneClassCount;
// }
//
// })
// }, Promise.resolve())
// }
})
console
.
log
(
"
idx :
"
+
idx
);
// console.log("tutor : " + tutors);
const
teacherReview
=
{
...
...
@@ -49,7 +77,9 @@ router.route('/getFilteredList').post((req, res) => {
"
tutor_main_city
"
:
tutor
.
tutor_main_city
,
"
tutor_medium
"
:
tutor
.
tutor_medium
,
"
tutor_registered_date
"
:
tutor
.
createdAt
,
"
tutor_class_count
"
:
classCount
,
"
tutor_qualification
"
:
tutor
.
tutor_qualification
,
"
tutor_student_count
"
:
tutor
.
tutor_student_count
,
"
review
"
:
reviews
.
map
(
review
=>
review
.
review
),
"
ratings
"
:
reviews
.
map
(
review
=>
review
.
rating
)
}
...
...
@@ -100,6 +130,8 @@ router.route('/getFilteredList').post((req, res) => {
"
tutor_medium
"
:
teacherReview
.
tutor_medium
,
"
tutor_qualification
"
:
teacherReview
.
tutor_qualification
,
"
tutor_registered_date
"
:
teacherReview
.
tutor_registered_date
,
"
tutor_class_count
"
:
teacherReview
.
tutor_class_count
,
"
tutor_student_count
"
:
teacherReview
.
tutor_student_count
,
"
tutor_reviewValue
"
:
response
.
data
.
result
,
"
tutor_avg_rating
"
:
Number
(
TotalRating
/
teacherReview
.
ratings
.
length
),
"
tutor_review_count
"
:
teacherReview
.
review
.
length
...
...
@@ -132,6 +164,8 @@ router.route('/getFilteredList').post((req, res) => {
"
tutor_main_district
"
:
teacherReview
.
tutor_main_district
,
"
tutor_main_city
"
:
teacherReview
.
tutor_main_city
,
"
tutor_registered_date
"
:
teacherReview
.
tutor_registered_date
,
"
tutor_class_count
"
:
teacherReview
.
tutor_class_count
,
"
tutor_student_count
"
:
teacherReview
.
tutor_student_count
,
"
tutor_medium
"
:
teacherReview
.
tutor_medium
,
"
tutor_qualification
"
:
teacherReview
.
tutor_qualification
,
"
tutor_reviewValue
"
:
0
,
...
...
@@ -164,4 +198,5 @@ router.route('/getFilteredList').post((req, res) => {
});
module
.
exports
=
router
;
\ No newline at end of file
BackEnd/WebBackEnd/routes/studentALResult.route.js
View file @
e7f90597
...
...
@@ -14,12 +14,12 @@ router.route('/add').post(async(req,res) =>{
const
year
=
req
.
body
.
year
;
const
stream
=
req
.
body
.
stream
;
const
Subjects
=
req
.
body
.
Subjects
;
const
subject01
=
req
.
body
.
subject01
;
const
subject02
=
req
.
body
.
subject02
;
const
subject03
=
req
.
body
.
subject03
;
const
subject01Result
=
req
.
body
.
subject01Result
;
const
subject02Result
=
req
.
body
.
subject02Result
;
const
subject03Result
=
req
.
body
.
subject03Result
;
//
const subject01 = req.body.subject01;
//
const subject02 = req.body.subject02;
//
const subject03 = req.body.subject03;
//
const subject01Result = req.body.subject01Result;
//
const subject02Result = req.body.subject02Result;
//
const subject03Result = req.body.subject03Result;
const
generalEnglish
=
req
.
body
.
generalEnglish
;
const
commonGeneralTest
=
req
.
body
.
commonGeneralTest
;
const
image
=
req
.
body
.
image
;
...
...
@@ -29,12 +29,12 @@ router.route('/add').post(async(req,res) =>{
year
,
stream
,
Subjects
,
subject01
,
subject02
,
subject03
,
subject01Result
,
subject02Result
,
subject03Result
,
//
subject01,
//
subject02,
//
subject03,
//
subject01Result,
//
subject02Result,
//
subject03Result,
generalEnglish
,
commonGeneralTest
,
image
,
...
...
@@ -56,12 +56,12 @@ router.route('/add').post(async(req,res) =>{
else
{
details
.
year
=
year
;
details
.
stream
=
stream
;
details
.
subject01
=
subject01
;
details
.
subject02
=
subject02
;
details
.
subject03
=
subject03
;
details
.
subject01Result
=
subject01Result
;
details
.
subject02Result
=
subject02Result
;
details
.
subject03Result
=
subject03Result
;
//
details.subject01 = subject01;
//
details.subject02 = subject02;
//
details.subject03 = subject03;
//
details.subject01Result = subject01Result;
//
details.subject02Result = subject02Result;
//
details.subject03Result = subject03Result;
details
.
generalEnglish
=
generalEnglish
;
details
.
commonGeneralTest
=
commonGeneralTest
;
details
.
image
=
image
;
...
...
BackEnd/WebBackEnd/routes/tutor.route.js
View file @
e7f90597
...
...
@@ -75,6 +75,7 @@ router.route('/add').post(async(req,res) =>{
const
tutor_main_city
=
req
.
body
.
tutor_main_city
;
const
tutor_medium
=
req
.
body
.
tutor_medium
;
const
tutor_qualification
=
req
.
body
.
tutor_qualification
;
const
tutor_student_count
=
0
;
let
instituteObjectIDList
=
[];
...
...
@@ -107,7 +108,8 @@ router.route('/add').post(async(req,res) =>{
tutor_main_city
,
tutor_medium
,
tutor_instituteIDList
,
tutor_qualification
tutor_qualification
,
tutor_student_count
});
newTutor
.
save
()
.
then
(
tutor
=>
{
...
...
BackEnd/WebBackEnd/server.js
View file @
e7f90597
...
...
@@ -46,4 +46,4 @@ app.use('/createClass', createClassRoute);
app
.
listen
(
port
,
()
=>
{
console
.
log
(
`Server is running on Port:
${
port
}
`
);
});
\ No newline at end of file
});
WebFrontEnd/smartcoach-frontend/package-lock.json
View file @
e7f90597
This diff is collapsed.
Click to expand it.
WebFrontEnd/smartcoach-frontend/package.json
View file @
e7f90597
...
...
@@ -10,6 +10,7 @@
"bootstrap-icons"
:
"^1.5.0"
,
"moment"
:
"^2.29.1"
,
"react"
:
"^17.0.2"
,
"react-bootstrap"
:
"^2.0.2"
,
"react-bootstrap-icons"
:
"^1.5.0"
,
"react-dom"
:
"^17.0.2"
,
"react-dropdown"
:
"^1.9.2"
,
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/StudentRequestForClass.js
View file @
e7f90597
...
...
@@ -10,7 +10,7 @@ export default class StudentRequestForClass extends Component{
super
(
props
);
this
.
state
=
{
tutorID
:
'
6127b1d7ed4ff23bb0344538
'
,
tutorID
:
''
,
instituteList
:
[],
ClassMethods
:
[],
subjectList
:
[],
...
...
@@ -130,7 +130,8 @@ export default class StudentRequestForClass extends Component{
if
(
this
.
state
.
labelClassID
!==
""
){
const
payload
=
{
_id
:
this
.
state
.
labelClassID
,
student_nic
:
this
.
state
.
typedNIC
student_nic
:
this
.
state
.
typedNIC
,
tutor_id
:
this
.
state
.
tutorID
}
axios
.
post
(
configs
.
BASE_URL
+
'
/createClass/studentList/update
'
,
payload
)
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
View file @
e7f90597
This diff is collapsed.
Click to expand it.
WebFrontEnd/smartcoach-frontend/src/Images/ad01.jpg
0 → 100644
View file @
e7f90597
53.7 KB
WebFrontEnd/smartcoach-frontend/src/Images/logo.jpeg
0 → 100644
View file @
e7f90597
106 KB
WebFrontEnd/smartcoach-frontend/src/Images/main01.jpg
0 → 100644
View file @
e7f90597
26.7 KB
WebFrontEnd/smartcoach-frontend/src/Images/main02.jpg
0 → 100644
View file @
e7f90597
38.3 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment