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
6e5c87ee
Commit
6e5c87ee
authored
Sep 06, 2021
by
Hasitha Samarasekara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Home page Filters added ann create class UI change,
Connect flak api
parent
828e015e
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1356 additions
and
77 deletions
+1356
-77
BackEnd/WebBackEnd/models/TutorRatingAndReviews.model.js
BackEnd/WebBackEnd/models/TutorRatingAndReviews.model.js
+17
-0
BackEnd/WebBackEnd/models/createClass.model.js
BackEnd/WebBackEnd/models/createClass.model.js
+0
-0
BackEnd/WebBackEnd/models/studentALResult.model.js
BackEnd/WebBackEnd/models/studentALResult.model.js
+2
-1
BackEnd/WebBackEnd/models/tutor.user.model.js
BackEnd/WebBackEnd/models/tutor.user.model.js
+2
-2
BackEnd/WebBackEnd/package-lock.json
BackEnd/WebBackEnd/package-lock.json
+347
-0
BackEnd/WebBackEnd/package.json
BackEnd/WebBackEnd/package.json
+2
-1
BackEnd/WebBackEnd/routes/filteredList.route.js
BackEnd/WebBackEnd/routes/filteredList.route.js
+158
-0
BackEnd/WebBackEnd/routes/studentALResult.route.js
BackEnd/WebBackEnd/routes/studentALResult.route.js
+3
-1
BackEnd/WebBackEnd/routes/tutor.route.js
BackEnd/WebBackEnd/routes/tutor.route.js
+20
-19
BackEnd/WebBackEnd/routes/tutorRatings.route.js
BackEnd/WebBackEnd/routes/tutorRatings.route.js
+32
-0
BackEnd/WebBackEnd/server.js
BackEnd/WebBackEnd/server.js
+5
-1
WebFrontEnd/smartcoach-frontend/package-lock.json
WebFrontEnd/smartcoach-frontend/package-lock.json
+5
-0
WebFrontEnd/smartcoach-frontend/package.json
WebFrontEnd/smartcoach-frontend/package.json
+1
-0
WebFrontEnd/smartcoach-frontend/src/App.js
WebFrontEnd/smartcoach-frontend/src/App.js
+2
-0
WebFrontEnd/smartcoach-frontend/src/Components/Admin/Dashboard.js
...End/smartcoach-frontend/src/Components/Admin/Dashboard.js
+1
-0
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
...tcoach-frontend/src/Components/Admin/add_class_details.js
+112
-42
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
+245
-7
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorCard.js
.../smartcoach-frontend/src/Components/HomePage/TutorCard.js
+1
-2
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorProfileView.js
...oach-frontend/src/Components/HomePage/TutorProfileView.js
+394
-0
WebFrontEnd/smartcoach-frontend/src/Components/Student/ALResults.js
...d/smartcoach-frontend/src/Components/Student/ALResults.js
+6
-0
WebFrontEnd/smartcoach-frontend/src/Config/config.js
WebFrontEnd/smartcoach-frontend/src/Config/config.js
+1
-1
No files found.
BackEnd/WebBackEnd/models/TutorRatingAndReviews.model.js
0 → 100644
View file @
6e5c87ee
const
mongoose
=
require
(
'
mongoose
'
);
const
Schema
=
mongoose
.
Schema
;
const
TutorRatingSchema
=
new
Schema
({
tutor_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
Post
'
},
student_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
Post
'
},
rating
:
{
type
:
String
},
review
:{
type
:
String
},
version
:{
type
:
String
},
},
{
timestamps
:
true
,
});
const
TutorRatings
=
mongoose
.
model
(
'
TutorRatings
'
,
TutorRatingSchema
);
module
.
exports
=
TutorRatings
;
\ No newline at end of file
BackEnd/WebBackEnd/models/createClass.model.js
0 → 100644
View file @
6e5c87ee
BackEnd/WebBackEnd/models/studentALResult.model.js
View file @
6e5c87ee
...
...
@@ -3,9 +3,10 @@ const mongoose = require('mongoose');
const
Schema
=
mongoose
.
Schema
;
const
ALResultsSchema
=
new
Schema
({
student_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
Post
'
},
student_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
students
'
},
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
},
...
...
BackEnd/WebBackEnd/models/tutor.user.model.js
View file @
6e5c87ee
...
...
@@ -19,11 +19,11 @@ const userSchema = new Schema({
tutor_main_city
:[{
type
:
String
}],
tutor_medium
:{
type
:
String
},
tutor_qualification
:{
type
:
String
},
tutor_instituteIDList
:[{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
Post
'
}],
tutor_instituteIDList
:[{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
institute
'
}],
},
{
timestamps
:
true
,
});
//const institute = mongoose.model('institute',userSchema);
const
User
=
mongoose
.
model
(
'
tutor
'
,
userSchema
);
module
.
exports
=
User
;
\ No newline at end of file
BackEnd/WebBackEnd/package-lock.json
View file @
6e5c87ee
...
...
@@ -35,11 +35,65 @@
"negotiator"
:
"0.6.2"
}
},
"ajv"
:
{
"version"
:
"6.12.6"
,
"resolved"
:
"https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz"
,
"integrity"
:
"sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="
,
"dev"
:
true
,
"requires"
:
{
"fast-deep-equal"
:
"^3.1.1"
,
"fast-json-stable-stringify"
:
"^2.0.0"
,
"json-schema-traverse"
:
"^0.4.1"
,
"uri-js"
:
"^4.2.2"
}
},
"array-flatten"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz"
,
"integrity"
:
"sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
"asn1"
:
{
"version"
:
"0.2.4"
,
"resolved"
:
"https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz"
,
"integrity"
:
"sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg=="
,
"dev"
:
true
,
"requires"
:
{
"safer-buffer"
:
"~2.1.0"
}
},
"assert-plus"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz"
,
"integrity"
:
"sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
,
"dev"
:
true
},
"asynckit"
:
{
"version"
:
"0.4.0"
,
"resolved"
:
"https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz"
,
"integrity"
:
"sha1-x57Zf380y48robyXkLzDZkdLS3k="
,
"dev"
:
true
},
"aws-sign2"
:
{
"version"
:
"0.7.0"
,
"resolved"
:
"https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz"
,
"integrity"
:
"sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
,
"dev"
:
true
},
"aws4"
:
{
"version"
:
"1.11.0"
,
"resolved"
:
"https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz"
,
"integrity"
:
"sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
,
"dev"
:
true
},
"bcrypt-pbkdf"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz"
,
"integrity"
:
"sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4="
,
"dev"
:
true
,
"requires"
:
{
"tweetnacl"
:
"^0.14.3"
}
},
"bl"
:
{
"version"
:
"2.2.1"
,
"resolved"
:
"https://registry.npmjs.org/bl/-/bl-2.2.1.tgz"
,
...
...
@@ -81,6 +135,21 @@
"resolved"
:
"https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz"
,
"integrity"
:
"sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
},
"caseless"
:
{
"version"
:
"0.12.0"
,
"resolved"
:
"https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz"
,
"integrity"
:
"sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
,
"dev"
:
true
},
"combined-stream"
:
{
"version"
:
"1.0.8"
,
"resolved"
:
"https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz"
,
"integrity"
:
"sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="
,
"dev"
:
true
,
"requires"
:
{
"delayed-stream"
:
"~1.0.0"
}
},
"content-disposition"
:
{
"version"
:
"0.5.3"
,
"resolved"
:
"https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz"
,
...
...
@@ -118,6 +187,15 @@
"vary"
:
"^1"
}
},
"dashdash"
:
{
"version"
:
"1.14.1"
,
"resolved"
:
"https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz"
,
"integrity"
:
"sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA="
,
"dev"
:
true
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
}
},
"debug"
:
{
"version"
:
"2.6.9"
,
"resolved"
:
"https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
,
...
...
@@ -126,6 +204,12 @@
"ms"
:
"2.0.0"
}
},
"delayed-stream"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
,
"integrity"
:
"sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
,
"dev"
:
true
},
"denque"
:
{
"version"
:
"1.5.0"
,
"resolved"
:
"https://registry.npmjs.org/denque/-/denque-1.5.0.tgz"
,
...
...
@@ -146,6 +230,16 @@
"resolved"
:
"https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz"
,
"integrity"
:
"sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q=="
},
"ecc-jsbn"
:
{
"version"
:
"0.1.2"
,
"resolved"
:
"https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz"
,
"integrity"
:
"sha1-OoOpBOVDUyh4dMVkt1SThoSamMk="
,
"dev"
:
true
,
"requires"
:
{
"jsbn"
:
"~0.1.0"
,
"safer-buffer"
:
"^2.1.0"
}
},
"ee-first"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz"
,
...
...
@@ -203,6 +297,30 @@
"vary"
:
"~1.1.2"
}
},
"extend"
:
{
"version"
:
"3.0.2"
,
"resolved"
:
"https://registry.npmjs.org/extend/-/extend-3.0.2.tgz"
,
"integrity"
:
"sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
,
"dev"
:
true
},
"extsprintf"
:
{
"version"
:
"1.3.0"
,
"resolved"
:
"https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz"
,
"integrity"
:
"sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
,
"dev"
:
true
},
"fast-deep-equal"
:
{
"version"
:
"3.1.3"
,
"resolved"
:
"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"
,
"integrity"
:
"sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
,
"dev"
:
true
},
"fast-json-stable-stringify"
:
{
"version"
:
"2.1.0"
,
"resolved"
:
"https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz"
,
"integrity"
:
"sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
,
"dev"
:
true
},
"finalhandler"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz"
,
...
...
@@ -217,6 +335,23 @@
"unpipe"
:
"~1.0.0"
}
},
"forever-agent"
:
{
"version"
:
"0.6.1"
,
"resolved"
:
"https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
,
"integrity"
:
"sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
,
"dev"
:
true
},
"form-data"
:
{
"version"
:
"2.3.3"
,
"resolved"
:
"https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz"
,
"integrity"
:
"sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ=="
,
"dev"
:
true
,
"requires"
:
{
"asynckit"
:
"^0.4.0"
,
"combined-stream"
:
"^1.0.6"
,
"mime-types"
:
"^2.1.12"
}
},
"forwarded"
:
{
"version"
:
"0.2.0"
,
"resolved"
:
"https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz"
,
...
...
@@ -227,6 +362,31 @@
"resolved"
:
"https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz"
,
"integrity"
:
"sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"getpass"
:
{
"version"
:
"0.1.7"
,
"resolved"
:
"https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz"
,
"integrity"
:
"sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo="
,
"dev"
:
true
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
}
},
"har-schema"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz"
,
"integrity"
:
"sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
,
"dev"
:
true
},
"har-validator"
:
{
"version"
:
"5.1.5"
,
"resolved"
:
"https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz"
,
"integrity"
:
"sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w=="
,
"dev"
:
true
,
"requires"
:
{
"ajv"
:
"^6.12.3"
,
"har-schema"
:
"^2.0.0"
}
},
"http-errors"
:
{
"version"
:
"1.7.2"
,
"resolved"
:
"https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz"
,
...
...
@@ -239,6 +399,17 @@
"toidentifier"
:
"1.0.0"
}
},
"http-signature"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz"
,
"integrity"
:
"sha1-muzZJRFHcvPZW2WmCruPfBj7rOE="
,
"dev"
:
true
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
,
"jsprim"
:
"^1.2.2"
,
"sshpk"
:
"^1.7.0"
}
},
"iconv-lite"
:
{
"version"
:
"0.4.24"
,
"resolved"
:
"https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz"
,
...
...
@@ -257,11 +428,59 @@
"resolved"
:
"https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz"
,
"integrity"
:
"sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
},
"is-typedarray"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz"
,
"integrity"
:
"sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
,
"dev"
:
true
},
"isarray"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
,
"integrity"
:
"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"isstream"
:
{
"version"
:
"0.1.2"
,
"resolved"
:
"https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"
,
"integrity"
:
"sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
,
"dev"
:
true
},
"jsbn"
:
{
"version"
:
"0.1.1"
,
"resolved"
:
"https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz"
,
"integrity"
:
"sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
,
"dev"
:
true
},
"json-schema"
:
{
"version"
:
"0.2.3"
,
"resolved"
:
"https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz"
,
"integrity"
:
"sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
,
"dev"
:
true
},
"json-schema-traverse"
:
{
"version"
:
"0.4.1"
,
"resolved"
:
"https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz"
,
"integrity"
:
"sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
,
"dev"
:
true
},
"json-stringify-safe"
:
{
"version"
:
"5.0.1"
,
"resolved"
:
"https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz"
,
"integrity"
:
"sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
,
"dev"
:
true
},
"jsprim"
:
{
"version"
:
"1.4.1"
,
"resolved"
:
"https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz"
,
"integrity"
:
"sha1-MT5mvB5cwG5Di8G3SZwuXFastqI="
,
"dev"
:
true
,
"requires"
:
{
"assert-plus"
:
"1.0.0"
,
"extsprintf"
:
"1.3.0"
,
"json-schema"
:
"0.2.3"
,
"verror"
:
"1.10.0"
}
},
"kareem"
:
{
"version"
:
"2.3.2"
,
"resolved"
:
"https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz"
,
...
...
@@ -398,6 +617,12 @@
"integrity"
:
"sha512-YSzu7TLbI+bsjCis/TZlAXBoM4y93HhlIgo0P5oiA2ua9Z4k+E2Fod//ybIzdJxOlXGRcHIh/WaeCBehvxZb/Q=="
,
"dev"
:
true
},
"oauth-sign"
:
{
"version"
:
"0.9.0"
,
"resolved"
:
"https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz"
,
"integrity"
:
"sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
,
"dev"
:
true
},
"object-assign"
:
{
"version"
:
"4.1.1"
,
"resolved"
:
"https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
,
...
...
@@ -426,6 +651,12 @@
"resolved"
:
"https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz"
,
"integrity"
:
"sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"performance-now"
:
{
"version"
:
"2.1.0"
,
"resolved"
:
"https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz"
,
"integrity"
:
"sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
,
"dev"
:
true
},
"process-nextick-args"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz"
,
...
...
@@ -440,6 +671,18 @@
"ipaddr.js"
:
"1.9.1"
}
},
"psl"
:
{
"version"
:
"1.8.0"
,
"resolved"
:
"https://registry.npmjs.org/psl/-/psl-1.8.0.tgz"
,
"integrity"
:
"sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
,
"dev"
:
true
},
"punycode"
:
{
"version"
:
"2.1.1"
,
"resolved"
:
"https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"
,
"integrity"
:
"sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
,
"dev"
:
true
},
"qs"
:
{
"version"
:
"6.7.0"
,
"resolved"
:
"https://registry.npmjs.org/qs/-/qs-6.7.0.tgz"
,
...
...
@@ -480,6 +723,42 @@
"resolved"
:
"https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz"
,
"integrity"
:
"sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw=="
},
"request"
:
{
"version"
:
"2.88.2"
,
"resolved"
:
"https://registry.npmjs.org/request/-/request-2.88.2.tgz"
,
"integrity"
:
"sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw=="
,
"dev"
:
true
,
"requires"
:
{
"aws-sign2"
:
"~0.7.0"
,
"aws4"
:
"^1.8.0"
,
"caseless"
:
"~0.12.0"
,
"combined-stream"
:
"~1.0.6"
,
"extend"
:
"~3.0.2"
,
"forever-agent"
:
"~0.6.1"
,
"form-data"
:
"~2.3.2"
,
"har-validator"
:
"~5.1.3"
,
"http-signature"
:
"~1.2.0"
,
"is-typedarray"
:
"~1.0.0"
,
"isstream"
:
"~0.1.2"
,
"json-stringify-safe"
:
"~5.0.1"
,
"mime-types"
:
"~2.1.19"
,
"oauth-sign"
:
"~0.9.0"
,
"performance-now"
:
"^2.1.0"
,
"qs"
:
"~6.5.2"
,
"safe-buffer"
:
"^5.1.2"
,
"tough-cookie"
:
"~2.5.0"
,
"tunnel-agent"
:
"^0.6.0"
,
"uuid"
:
"^3.3.2"
},
"dependencies"
:
{
"qs"
:
{
"version"
:
"6.5.2"
,
"resolved"
:
"https://registry.npmjs.org/qs/-/qs-6.5.2.tgz"
,
"integrity"
:
"sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
,
"dev"
:
true
}
}
},
"safe-buffer"
:
{
"version"
:
"5.1.2"
,
"resolved"
:
"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz"
,
...
...
@@ -561,6 +840,23 @@
"memory-pager"
:
"^1.0.2"
}
},
"sshpk"
:
{
"version"
:
"1.16.1"
,
"resolved"
:
"https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz"
,
"integrity"
:
"sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg=="
,
"dev"
:
true
,
"requires"
:
{
"asn1"
:
"~0.2.3"
,
"assert-plus"
:
"^1.0.0"
,
"bcrypt-pbkdf"
:
"^1.0.0"
,
"dashdash"
:
"^1.12.0"
,
"ecc-jsbn"
:
"~0.1.1"
,
"getpass"
:
"^0.1.1"
,
"jsbn"
:
"~0.1.0"
,
"safer-buffer"
:
"^2.0.2"
,
"tweetnacl"
:
"~0.14.0"
}
},
"statuses"
:
{
"version"
:
"1.5.0"
,
"resolved"
:
"https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz"
,
...
...
@@ -579,6 +875,31 @@
"resolved"
:
"https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz"
,
"integrity"
:
"sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
},
"tough-cookie"
:
{
"version"
:
"2.5.0"
,
"resolved"
:
"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz"
,
"integrity"
:
"sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g=="
,
"dev"
:
true
,
"requires"
:
{
"psl"
:
"^1.1.28"
,
"punycode"
:
"^2.1.1"
}
},
"tunnel-agent"
:
{
"version"
:
"0.6.0"
,
"resolved"
:
"https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz"
,
"integrity"
:
"sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0="
,
"dev"
:
true
,
"requires"
:
{
"safe-buffer"
:
"^5.0.1"
}
},
"tweetnacl"
:
{
"version"
:
"0.14.5"
,
"resolved"
:
"https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz"
,
"integrity"
:
"sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
,
"dev"
:
true
},
"type-is"
:
{
"version"
:
"1.6.18"
,
"resolved"
:
"https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz"
,
...
...
@@ -593,6 +914,15 @@
"resolved"
:
"https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz"
,
"integrity"
:
"sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"uri-js"
:
{
"version"
:
"4.4.1"
,
"resolved"
:
"https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz"
,
"integrity"
:
"sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="
,
"dev"
:
true
,
"requires"
:
{
"punycode"
:
"^2.1.0"
}
},
"util-deprecate"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
,
...
...
@@ -603,10 +933,27 @@
"resolved"
:
"https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz"
,
"integrity"
:
"sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"uuid"
:
{
"version"
:
"3.4.0"
,
"resolved"
:
"https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz"
,
"integrity"
:
"sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
,
"dev"
:
true
},
"vary"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
,
"integrity"
:
"sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
},
"verror"
:
{
"version"
:
"1.10.0"
,
"resolved"
:
"https://registry.npmjs.org/verror/-/verror-1.10.0.tgz"
,
"integrity"
:
"sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA="
,
"dev"
:
true
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
,
"core-util-is"
:
"1.0.2"
,
"extsprintf"
:
"^1.2.0"
}
}
}
}
BackEnd/WebBackEnd/package.json
View file @
6e5c87ee
...
...
@@ -16,6 +16,7 @@
"mongoose"
:
"^5.12.15"
},
"devDependencies"
:
{
"nodemailer"
:
"^6.6.2"
"nodemailer"
:
"^6.6.2"
,
"request"
:
"^2.88.2"
}
}
BackEnd/WebBackEnd/routes/filteredList.route.js
0 → 100644
View file @
6e5c87ee
const
router
=
require
(
'
express
'
).
Router
();
let
tutor
=
require
(
'
../models/tutor.user.model
'
);
let
tutorRating
=
require
(
'
../models/TutorRatingAndReviews.model
'
);
const
mongoose
=
require
(
"
mongoose
"
);
const
express
=
require
(
'
express
'
)
const
request
=
require
(
'
request
'
);
router
.
route
(
'
/getFilteredList
'
).
post
((
req
,
res
)
=>
{
let
tutorReviewResults
=
[];
tutor
.
find
({
"
tutor_Stream
"
:
{
'
$regex
'
:
req
.
body
.
selectedStream
,
'
$options
'
:
'
i
'
},
"
tutor_subjects
"
:
{
'
$regex
'
:
req
.
body
.
selectedSubject
,
'
$options
'
:
'
i
'
},
"
tutor_main_district
"
:
{
'
$regex
'
:
req
.
body
.
selectedDistrict
,
'
$options
'
:
'
i
'
},
"
tutor_main_city
"
:
{
'
$regex
'
:
req
.
body
.
selectedCity
,
'
$options
'
:
'
i
'
},
"
tutor_medium
"
:
{
'
$regex
'
:
req
.
body
.
selectedLanguage
,
'
$options
'
:
'
i
'
},
"
tutor_class_type
"
:
{
'
$regex
'
:
req
.
body
.
selectedClassType
,
'
$options
'
:
'
i
'
},
})
.
then
(
async
tutors
=>
{
// async function getTutorData(tutor) {
// for (let i = 0; i < tutor.length; i++) {
// // var docregistrationnumber = arr[i].docregistrationnumber
// // var registrationAuthority = arr[i].docregistrationauthority
// // var data = await doctorData.getDoctorByRegNumber(docregistrationnumber, registrationAuthority);
// tutorRating.find(()=>{
// tutor_id : tutor._id
// })
// .then(reviews => {
// let reviewsList = [];
//
// reviewsList = await Get
// for (const oneReview of reviews){
// reviewsList.push(oneReview.review);
// //console.log("oneReview review");
// //console.log(oneReview.review);
// }
// console.log("Reviews : " + reviewsList)
//
//
// let options = {
// uri: 'http://localhost:5000/review_prediction_for_tutor',
// body: JSON.stringify(reviewsList),
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json'
// }
// }
// request(options, function (error, response) {
// // console.log(error, response.body);
// //tutor.tutor_main_district = "Test";
// //tutorReviewResults.tutor_reviewValue = response.body;
// let payload = {
// "tutor_id" : tutor._id,
// "tutor_name" : tutor.tutor_name,
// "tutor_nic" : tutor.tutor_nic,
// "tutor_email" : tutor.tutor_email,
// "tutor_phone" : tutor.tutor_phone,
// "tutor_address" : tutor.tutor_address,
// "tutor_password" : tutor.tutor_password,
// "tutor_gender" : tutor.tutor_gender,
// "tutor_status" : tutor.tutor_status,
// "tutor_image" : tutor.tutor_image,
// "tutor_Stream" : tutor.tutor_Stream,
// "tutor_subjects" : tutor.tutor_subjects,
// "tutor_class_type" : tutor.tutor_class_type,
// "tutor_main_district" : tutor.tutor_main_district,
// "tutor_main_city" : tutor.tutor_main_city,
// "tutor_medium" : tutor.tutor_medium,
// "tutor_qualification" : tutor.tutor_qualification,
// "tutor_reviewValue" : JSON.parse(response.body).result,
//
// };
// tutorReviewResults.push(payload);
// console.log(tutorReviewResults.length)
// });
// reviewsList = [];
// })
//
// arra.push(data);
// }
//
// return arra;
// }
let
reviewFinalResults
=
[]
for
(
let
tutor
of
tutors
){
tutorRating
.
find
(()
=>
{
tutor_id
:
tutor
.
_id
})
.
then
(
reviews
=>
{
let
reviewsList
=
[];
for
(
const
oneReview
of
reviews
){
reviewsList
.
push
(
oneReview
.
review
);
//console.log("oneReview review");
//console.log(oneReview.review);
}
console
.
log
(
"
Reviews :
"
+
reviewsList
)
let
options
=
{
uri
:
'
http://localhost:5000/review_prediction_for_tutor
'
,
body
:
JSON
.
stringify
(
reviewsList
),
method
:
'
POST
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
}
request
(
options
,
function
(
error
,
response
)
{
// console.log(error, response.body);
//tutor.tutor_main_district = "Test";
//tutorReviewResults.tutor_reviewValue = response.body;
let
payload
=
{
"
tutor_id
"
:
tutor
.
_id
,
"
tutor_name
"
:
tutor
.
tutor_name
,
"
tutor_nic
"
:
tutor
.
tutor_nic
,
"
tutor_email
"
:
tutor
.
tutor_email
,
"
tutor_phone
"
:
tutor
.
tutor_phone
,
"
tutor_address
"
:
tutor
.
tutor_address
,
"
tutor_password
"
:
tutor
.
tutor_password
,
"
tutor_gender
"
:
tutor
.
tutor_gender
,
"
tutor_status
"
:
tutor
.
tutor_status
,
"
tutor_image
"
:
tutor
.
tutor_image
,
"
tutor_Stream
"
:
tutor
.
tutor_Stream
,
"
tutor_subjects
"
:
tutor
.
tutor_subjects
,
"
tutor_class_type
"
:
tutor
.
tutor_class_type
,
"
tutor_main_district
"
:
tutor
.
tutor_main_district
,
"
tutor_main_city
"
:
tutor
.
tutor_main_city
,
"
tutor_medium
"
:
tutor
.
tutor_medium
,
"
tutor_qualification
"
:
tutor
.
tutor_qualification
,
"
tutor_reviewValue
"
:
JSON
.
parse
(
response
.
body
).
result
,
};
tutorReviewResults
.
push
(
payload
);
console
.
log
(
tutorReviewResults
.
length
)
});
reviewsList
=
[];
})
// console.log(reviewFinalResults)
}
console
.
log
(
"
Last
"
+
tutorReviewResults
.
length
)
//res.json(tutorReviewResults)
}).
then
(()
=>
{
console
.
log
(
"
Then
"
+
tutorReviewResults
.
length
)
res
.
json
(
tutorReviewResults
)
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
module
.
exports
=
router
;
BackEnd/WebBackEnd/routes/studentALResult.route.js
View file @
6e5c87ee
...
...
@@ -13,6 +13,7 @@ router.route('/add').post(async(req,res) =>{
const
student_id
=
mongoose
.
Types
.
ObjectId
(
req
.
body
.
student_id
);
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
;
...
...
@@ -27,6 +28,7 @@ router.route('/add').post(async(req,res) =>{
student_id
,
year
,
stream
,
Subjects
,
subject01
,
subject02
,
subject03
,
...
...
@@ -49,7 +51,7 @@ router.route('/add').post(async(req,res) =>{
else
{
ALevelResults
.
findById
(
req
.
body
.
student_id
,
function
(
err
,
details
){
if
(
!
details
){
re
q
.
status
(
404
).
send
(
"
data is not found
"
);
re
s
.
status
(
404
).
send
(
"
data is not found
"
);
}
else
{
details
.
year
=
year
;
...
...
BackEnd/WebBackEnd/routes/tutor.route.js
View file @
6e5c87ee
...
...
@@ -30,31 +30,32 @@ transporter.verify((error, success) => {
router
.
route
(
'
/
'
).
get
((
req
,
res
)
=>
{
tutor
.
find
()
.
then
(
tutors
=>
res
.
json
(
tutors
))
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
router
.
route
(
'
/getFilteredList
'
).
post
((
req
,
res
)
=>
{
console
.
log
(
req
.
body
);
tutor
.
find
({
"
tutor_Stream
"
:
{
'
$regex
'
:
req
.
body
.
selectedStream
,
'
$options
'
:
'
i
'
},
"
tutor_subjects
"
:
{
'
$regex
'
:
req
.
body
.
selectedSubject
,
'
$options
'
:
'
i
'
},
"
tutor_main_district
"
:
{
'
$regex
'
:
req
.
body
.
selectedDistrict
,
'
$options
'
:
'
i
'
},
"
tutor_main_city
"
:
{
'
$regex
'
:
req
.
body
.
selectedCity
,
'
$options
'
:
'
i
'
},
"
tutor_medium
"
:
{
'
$regex
'
:
req
.
body
.
selectedLanguage
,
'
$options
'
:
'
i
'
},
"
tutor_class_type
"
:
{
'
$regex
'
:
req
.
body
.
selectedClassType
,
'
$options
'
:
'
i
'
},
})
.
then
(
tutors
=>
{
//
console.log(tutors);
console
.
log
(
tutors
);
res
.
json
(
tutors
)
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
router
.
route
(
'
/:id
'
).
get
(
function
(
req
,
res
)
{
let
id
=
req
.
params
.
id
;
console
.
log
(
"
TutorId :
"
+
id
)
tutor
.
findById
(
id
).
populate
([
'
tutor_instituteIDList
'
]).
then
(
tutor
=>
{
console
.
log
(
tutor
);
res
.
json
(
tutor
);
}).
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
// router.route('/:id').get(function (req, res) {
// let id = req.params.id;
// console.log("TutorId : " + id)
// tutor.findById(id).populate("tutor_instituteIDList").then(tutor => {
// console.log(tutor);
// res.json(tutor);
// }).catch(err => res.status(400).json('Eroor: '+ err));
// });
router
.
route
(
'
/add
'
).
post
(
async
(
req
,
res
)
=>
{
console
.
log
(
"
Tutor Registration began
"
)
...
...
BackEnd/WebBackEnd/routes/tutorRatings.route.js
0 → 100644
View file @
6e5c87ee
const
router
=
require
(
'
express
'
).
Router
();
let
tutorRatingsRoute
=
require
(
'
../models/TutorRatingAndReviews.model
'
);
const
mongoose
=
require
(
"
mongoose
"
);
router
.
route
(
'
/add
'
).
post
(
async
(
req
,
res
)
=>
{
const
tutor_id
=
mongoose
.
Types
.
ObjectId
(
req
.
body
.
tutor_id
);
const
student_id
=
mongoose
.
Types
.
ObjectId
(
req
.
body
.
student_id
);
const
rating
=
req
.
body
.
rating
;
const
review
=
req
.
body
.
review
;
const
version
=
req
.
body
.
version
;
const
newTutorRating
=
new
tutorRatingsRoute
({
tutor_id
,
student_id
,
rating
,
review
,
version
,
});
newTutorRating
.
save
()
.
then
(
()
=>
{
res
.
json
(
'
New Review Added
'
);
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
});
module
.
exports
=
router
;
BackEnd/WebBackEnd/server.js
View file @
6e5c87ee
...
...
@@ -4,7 +4,7 @@ const bodyParser = require('body-parser');
const
mongoose
=
require
(
'
mongoose
'
);
require
(
'
dotenv
'
).
config
();
const
app
=
express
();
const
port
=
process
.
env
.
PORT
||
500
0
;
const
port
=
process
.
env
.
PORT
||
500
1
;
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
true
}));
...
...
@@ -29,6 +29,8 @@ const userAccount = require('./routes/userAccount.route');
const
questionManage
=
require
(
'
./routes/question.route
'
);
const
financeRouter
=
require
(
'
./routes/finance.route
'
);
const
studentResult
=
require
(
'
./routes/studentALResult.route
'
);
const
tutorRating
=
require
(
'
./routes/tutorRatings.route
'
);
const
filteredList
=
require
(
'
./routes/filteredList.route
'
);
app
.
use
(
'
/studentSingUp
'
,
studentRouter
);
app
.
use
(
'
/tutorSingUp
'
,
tutorRouter
);
...
...
@@ -37,6 +39,8 @@ app.use('/userAccount',userAccount);
app
.
use
(
'
/questions
'
,
questionManage
);
app
.
use
(
'
/admin/finance
'
,
financeRouter
);
app
.
use
(
'
/studentResults
'
,
studentResult
);
app
.
use
(
'
/tutorRatings
'
,
tutorRating
);
app
.
use
(
'
/filteredList
'
,
filteredList
);
app
.
listen
(
port
,
()
=>
{
console
.
log
(
`Server is running on Port:
${
port
}
`
);
...
...
WebFrontEnd/smartcoach-frontend/package-lock.json
View file @
6e5c87ee
...
...
@@ -12473,6 +12473,11 @@
"resolved"
:
"https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.9.tgz"
,
"integrity"
:
"sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew=="
},
"react-icons"
:
{
"version"
:
"4.2.0"
,
"resolved"
:
"https://registry.npmjs.org/react-icons/-/react-icons-4.2.0.tgz"
,
"integrity"
:
"sha512-rmzEDFt+AVXRzD7zDE21gcxyBizD/3NqjbX6cmViAgdqfJ2UiLer8927/QhhrXQV7dEj/1EGuOTPp7JnLYVJKQ=="
},
"react-is"
:
{
"version"
:
"16.13.1"
,
"resolved"
:
"https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
,
...
...
WebFrontEnd/smartcoach-frontend/package.json
View file @
6e5c87ee
...
...
@@ -10,6 +10,7 @@
"react"
:
"^17.0.2"
,
"react-dom"
:
"^17.0.2"
,
"react-dropdown"
:
"^1.9.2"
,
"react-icons"
:
"^4.2.0"
,
"react-router-dom"
:
"^5.2.0"
,
"react-scripts"
:
"4.0.3"
,
"react-select-search"
:
"^3.0.8"
,
...
...
WebFrontEnd/smartcoach-frontend/src/App.js
View file @
6e5c87ee
...
...
@@ -16,6 +16,7 @@ import QuestionDetails from "./Components/IT18050240/question_details"
import
QuestionLayout
from
"
./Components/IT18050240/question_layout
"
//import AdminQuestionManagement from "./Components/IT18050240/admin_question_management.js"
import
QuestionBank
from
"
./Components/IT18050240/question_bank
"
import
TutorProfileView
from
"
./Components/HomePage/TutorProfileView
"
;
function
App
()
{
return
(
...
...
@@ -27,6 +28,7 @@ function App() {
<
Route
path
=
"
/SignUp
"
exact
component
=
{
SignUp
}
/
>
<
Route
path
=
"
/beforeConfirm
"
exact
component
=
{
beforeConfirmation
}
/
>
<
Route
path
=
"
/AccountVerified/:id
"
exact
component
=
{
VerifiedAccount
}
/
>
<
Route
path
=
"
/Home/ViewProfile/:id
"
exact
component
=
{
TutorProfileView
}
/
>
{
/*<Route path="/studentDashboard" exact component={StudentDashboard}/>*/
}
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/Dashboard.js
View file @
6e5c87ee
...
...
@@ -343,6 +343,7 @@ export default class Dashboard extends Component {
{
/*</Link>*/
}
<
/li
>
<
li
>
<
a
href
=
"
#
"
>
<
i
className
=
"
metismenu-icon fa fa-calendar
"
><
/i
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
View file @
6e5c87ee
...
...
@@ -15,21 +15,40 @@ export default class AddClassDetails extends Component{
super
(
props
);
this
.
state
=
{
instituteList
:
[
'
Sakya Nugegoda
'
,
'
Montana Kiribathgoda
'
,
'
Wasiti Kiribathgoda
'
]
tutorID
:
'
6127b1d7ed4ff23bb0344538
'
,
instituteList
:
[],
ClassMethods
:
[],
subjectList
:
[],
selectedClassMethod
:
''
,
isSelectInstitute
:
false
,
HomeClassType
:
[
"
Group Class
"
,
"
Individual Class
"
],
OtherClassTypes
:
[
"
Group Class
"
,
"
Mass Class
"
,
"
Revision Class
"
,
"
Paper Class
"
,
"
Individual Class
"
]
}
this
.
onChangeClassMethod
=
this
.
onChangeClassMethod
.
bind
(
this
);
}
// this.onChangeInstituteDropDown = this.onChangeInstituteDropDown.bind(this);
componentDidMount
()
{
axios
.
get
(
configs
.
BASE_URL
+
'
/
instituteSingUp/
'
)
axios
.
get
(
configs
.
BASE_URL
+
'
/
tutorSingUp/
'
+
this
.
state
.
tutorID
)
.
then
(
response
=>
{
if
(
response
.
data
.
length
>
0
){
console
.
log
(
response
.
data
);
console
.
log
(
response
.
data
);
//console.log(response.data);
this
.
setState
({
instituteList
:
response
.
data
instituteList
:
response
.
data
.
tutor_instituteIDList
,
ClassMethods
:
response
.
data
.
tutor_class_type
,
subjectList
:
response
.
data
.
tutor_subjects
,
},
()
=>
{
console
.
log
(
this
.
state
.
instituteList
);
})
}
})
}
...
...
@@ -39,6 +58,25 @@ export default class AddClassDetails extends Component{
})
}
onChangeClassMethod
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
.
target
.
value
);
this
.
setState
({
selectedClassMethod
:
e
.
target
.
value
},()
=>
{
if
(
e
.
target
.
value
===
"
Institute
"
){
this
.
setState
({
isSelectInstitute
:
true
})
}
else
{
this
.
setState
({
isSelectInstitute
:
false
})
}
})
}
render
()
{
return
(
...
...
@@ -64,62 +102,94 @@ export default class AddClassDetails extends Component{
<
div
className
=
"
col-md-6
"
>
<
div
className
=
"
card-body
"
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Class
Type
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
>
<
option
>
Select
Class
Type
<
/option
>
<
option
>
Mass
Class
<
/option
>
<
option
>
Revision
Class
<
/option
>
<
option
>
Group
Class
<
/option
>
<
option
>
Individual
Class
<
/option
>
<
label
>
Class
Method
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeClassMethod
(
e
)}
>
<
option
value
=
""
disabled
selected
>
Select
Class
Method
<
/option
>
{
this
.
state
.
ClassMethods
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
{
this
.
state
.
selectedClassMethod
===
"
Home Visit
"
?
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Class
Type
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
>
<
option
value
=
""
disabled
selected
>
Select
Class
Type
<
/option
>
{
this
.
state
.
HomeClassType
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
:
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Class
Type
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
>
<
option
value
=
""
disabled
selected
>
Select
Class
Type
<
/option
>
{
this
.
state
.
OtherClassTypes
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
}
{
this
.
state
.
isSelectInstitute
===
true
?
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Institute
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
>
onChange
=
{
e
=>
this
.
onChangeInstituteDropDown
(
e
)}
<
option
value
=
""
disabled
selected
>
Select
Institute
<
/option
>
<
label
>
Institute
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
>
onChange
=
{
e
=>
this
.
onChangeInstituteDropDown
(
e
)}
<
option
value
=
""
disabled
selected
>
Select
the
Institute
<
/option
>
{
this
.
state
.
instituteList
.
map
((
dis
)
=>
<
option
key
=
{
dis
.
_id
}
id
=
{
dis
.
_id
}
value
=
{
dis
.
institute_name
}
>
{
dis
.
institute_name
}
<
/option>
)
}
{
/*<option>Select Institute</option>*/
}
{
/*<option>Sakya Nugegoda</option>*/
}
{
/*<option>Minasko Malabe</option>*/
}
{
/*<option>Rotary Nugegoda</option>*/
}
{
/*<option>Sasip Nugegoda</option>*/
}
<
/select
>
<
option
value
=
{
dis
}
>
{
dis
.
institute_name
}
<
/option>
)
}
<
/select
>
<
/div
>
:
<
div
><
/div>
}
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Batch
N
umber
<
/label
>
<
label
>
Batch
N
ame
<
/label
>
<
input
type
=
"
text
"
className
=
"
form-control
"
/>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Year
<
/label
>
<
input
type
=
"
month
"
className
=
"
form-control
"
/>
<
label
>
Class
Starting
Date
<
/label
>
<
input
type
=
"
date
"
className
=
"
form-control
"
/>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Subject
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
>
<
option
>
Select
Subject
<
/option
>
<
option
><
/option
>
<
option
><
/option
>
<
option
><
/option
>
<
option
><
/option
>
<
option
value
=
""
disabled
selected
>
Select
the
Subject
<
/option
>
{
this
.
state
.
subjectList
.
map
((
dis
)
=
>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Class
Fee
<
/label
>
<
input
type
=
"
text
"
className
=
"
form-control
"
/>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
col-md-6
"
>
<
div
className
=
"
card-body
"
>
<
div
className
=
"
position-relative form-group
"
>
<
label
htmlFor
=
"
exampleEmail
"
className
>
Students
<
/label
>
<
SelectSearch
options
=
{
options
}
multiple
search
filterOptions
=
{
fuzzySearch
}
placeholder
=
"
Select students
"
/>
{
/*<label htmlFor="exampleEmail" className>Students</label>*/
}
{
/*<SelectSearch*/
}
{
/* options={options}*/
}
{
/* multiple*/
}
{
/* search*/
}
{
/* filterOptions={fuzzySearch}*/
}
{
/* placeholder="Select students"*/
}
{
/*/>*/
}
<
/div
>
<
/div
>
<
/div
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
View file @
6e5c87ee
...
...
@@ -15,6 +15,7 @@ import Calender from "../Images/calender.png";
import
axios
from
"
axios
"
;
import
*
as
configs
from
"
../Config/config
"
;
import
TutorCard
from
"
./HomePage/TutorCard
"
;
import
swal
from
"
sweetalert
"
;
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
...
...
@@ -43,7 +44,16 @@ export default class Home extends Component{
selectedClassType
:
''
,
selectedLanguage
:
''
,
TutorFilteredList
:
[],
RVPastResults
:
25
,
RVRatings
:
25
,
RVReviews
:
25
,
RVStudentCount
:
25
,
isRVPastResults
:
true
,
isRVRatings
:
true
,
isRVReviews
:
true
,
isStudentCount
:
true
,
TotalRecommendationCount
:
0
,
passResultsSubCategory
:
2
,
};
this
.
FindCities
=
this
.
FindCities
.
bind
(
this
);
...
...
@@ -55,6 +65,16 @@ export default class Home extends Component{
this
.
OnChangeCity
=
this
.
OnChangeCity
.
bind
(
this
);
this
.
OnChangeClassType
=
this
.
OnChangeClassType
.
bind
(
this
);
this
.
OnChangeLanguage
=
this
.
OnChangeLanguage
.
bind
(
this
);
this
.
OnChangeIsCRPastResults
=
this
.
OnChangeIsCRPastResults
.
bind
(
this
);
this
.
OnChangeIsCRRatings
=
this
.
OnChangeIsCRRatings
.
bind
(
this
);
this
.
OnChangeIsCRReviews
=
this
.
OnChangeIsCRReviews
.
bind
(
this
);
this
.
OnChangeIsCRStudentCount
=
this
.
OnChangeIsCRStudentCount
.
bind
(
this
);
this
.
OnChangeCRPastResults
=
this
.
OnChangeCRPastResults
.
bind
(
this
);
this
.
OnChangeCRRatings
=
this
.
OnChangeCRRatings
.
bind
(
this
);
this
.
OnChangeCRReviews
=
this
.
OnChangeCRReviews
.
bind
(
this
);
this
.
OnChangeCRStudentCount
=
this
.
OnChangeCRStudentCount
.
bind
(
this
);
this
.
calculateTotalRecommendationCount
=
this
.
calculateTotalRecommendationCount
.
bind
(
this
);
this
.
onChangeRadioButton
=
this
.
onChangeRadioButton
.
bind
(
this
);
}
componentDidMount
()
{
...
...
@@ -67,7 +87,87 @@ export default class Home extends Component{
})
}
})
this
.
calculateTotalRecommendationCount
();
}
onChangeRadioButton
(
e
){
if
(
e
.
target
.
value
===
"
By pass rate
"
){
this
.
setState
({
passResultsSubCategory
:
1
});
}
else
{
this
.
setState
({
passResultsSubCategory
:
2
});
}
}
calculateTotalRecommendationCount
(){
let
finalResult
=
this
.
state
.
RVPastResults
+
this
.
state
.
RVRatings
+
this
.
state
.
RVReviews
+
this
.
state
.
RVStudentCount
;
this
.
setState
({
TotalRecommendationCount
:
finalResult
});
}
OnChangeCRPastResults
(
e
)
{
this
.
setState
({
RVPastResults
:
Number
(
e
.
target
.
value
),
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
OnChangeCRRatings
(
e
)
{
this
.
setState
({
RVRatings
:
Number
(
e
.
target
.
value
),
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
OnChangeCRReviews
(
e
)
{
this
.
setState
({
RVReviews
:
Number
(
e
.
target
.
value
),
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
OnChangeCRStudentCount
(
e
)
{
this
.
setState
({
RVStudentCount
:
Number
(
e
.
target
.
value
),
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
OnChangeIsCRPastResults
(
e
)
{
this
.
setState
({
isRVPastResults
:
e
.
target
.
value
});
}
OnChangeIsCRRatings
(
e
)
{
this
.
setState
({
isRVRatings
:
e
.
target
.
value
});
}
OnChangeIsCRReviews
(
e
)
{
this
.
setState
({
isRVReviews
:
e
.
target
.
value
});
}
OnChangeIsCRStudentCount
(
e
)
{
this
.
setState
({
isStudentCount
:
e
.
target
.
value
});
}
OnChangeStream
(
e
)
{
...
...
@@ -130,23 +230,28 @@ export default class Home extends Component{
selectedCity
:
this
.
state
.
selectedCity
,
selectedClassType
:
this
.
state
.
selectedClassType
,
selectedLanguage
:
this
.
state
.
selectedLanguage
,
RVPastResults
:
this
.
state
.
RVPastResults
,
RVRatings
:
this
.
state
.
RVRatings
,
RVReviews
:
this
.
state
.
RVReviews
,
RVStudentCount
:
this
.
state
.
RVStudentCount
,
passResultsSubCategory
:
this
.
state
.
passResultsSubCategory
,
}
if
(
this
.
state
.
selectedStream
!=
""
&&
this
.
state
.
selectedSubject
!=
""
){
axios
.
post
(
configs
.
BASE_URL
+
'
/
tutorSingUp
/getFilteredList
'
,
Filters
)
axios
.
post
(
configs
.
BASE_URL
+
'
/
filteredList
/getFilteredList
'
,
Filters
)
.
then
(
res
=>
{
this
.
setState
({
TutorFilteredList
:
res
.
data
})
// console.log(this.state.TutorFilteredList
);
console
.
log
(
res
.
data
);
})
}
else
{
alert
(
"
Please at least select Stream and Subject
"
);
swal
(
"
Sorry
"
,
"
Please select Stream and Subject
"
,
"
warning
"
);
// alert("Please at least select Stream and Subject");
}
...
...
@@ -261,11 +366,144 @@ export default class Home extends Component{
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginRight
:
'
50px
'
,
marginLeft
:
'
50px
'
,
marginTop
:
'
10px
'
,
padding
:
'
10px
'
,
background
:
'
#1E4258
'
}}
>
<
h5
style
=
{{
color
:
"
white
"
,
float
:
'
left
'
}}
>
Customized
Recommendation
<
/h5
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginRight
:
'
50px
'
,
marginLeft
:
'
50px
'
,
marginTop
:
'
5px
'
,
padding
:
'
5px
'
,
background
:
'
#1E4258
'
}}
>
<
div
className
=
"
col
"
style
=
{{
margin
:
'
5px
'
,
border
:
'
solid
'
,
padding
:
'
10px
'
,
borderColor
:
'
#216E9B
'
}}
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
input
type
=
"
checkbox
"
id
=
"
PastResults
"
className
=
"
form-control
"
defaultChecked
=
{
this
.
state
.
isRVPastResults
}
onChange
=
{
this
.
OnChangeIsCRPastResults
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
float
:
'
left
'
,
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
color
:
"
white
"
}}
>
Past
Results
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
input
type
=
"
number
"
id
=
"
pastResultsTxt
"
className
=
"
form-control
"
value
=
{
this
.
state
.
RVPastResults
}
onChange
=
{
this
.
OnChangeCRPastResults
}
style
=
{{
width
:
'
30%
'
,
marginLeft
:
'
20px
'
}}
required
/>
<
label
style
=
{{
marginTop
:
'
10px
'
,
float
:
'
left
'
,
marginLeft
:
'
10px
'
,
color
:
"
white
"
}}
>%<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
style
=
{{
color
:
'
white
'
,
padding
:
'
8px
'
}}
onChange
=
{
this
.
onChangeRadioButton
}
>
<
input
type
=
"
radio
"
value
=
"
By pass rate
"
name
=
"
results
"
style
=
{{
marginLeft
:
'
11px
'
}}
checked
=
{
this
.
state
.
passResultsSubCategory
===
1
}
/> By pass rat
e
<
br
/>
<
input
type
=
"
radio
"
value
=
"
By grade A
"
name
=
"
results
"
style
=
{{
marginLeft
:
'
12px
'
}}
checked
=
{
this
.
state
.
passResultsSubCategory
===
2
}
/> By grade 'A
'
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
input
type
=
"
checkbox
"
id
=
"
PastResults
"
className
=
"
form-control
"
defaultChecked
=
{
this
.
state
.
isRVRatings
}
onChange
=
{
this
.
OnChangeIsCRRatings
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
float
:
'
left
'
,
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
color
:
"
white
"
}}
>
Ratings
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
input
type
=
"
number
"
id
=
"
pastResultsTxt
"
className
=
"
form-control
"
value
=
{
this
.
state
.
RVRatings
}
onChange
=
{
this
.
OnChangeCRRatings
}
style
=
{{
width
:
'
30%
'
,
marginLeft
:
'
20px
'
}}
required
/>
<
label
style
=
{{
marginTop
:
'
10px
'
,
float
:
'
left
'
,
marginLeft
:
'
10px
'
,
color
:
"
white
"
}}
>%<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
input
type
=
"
checkbox
"
id
=
"
PastResults
"
className
=
"
form-control
"
defaultChecked
=
{
this
.
state
.
isRVReviews
}
onChange
=
{
this
.
OnChangeIsCRReviews
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
float
:
'
left
'
,
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
color
:
"
white
"
}}
>
Reviews
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
input
type
=
"
number
"
id
=
"
pastResultsTxt
"
className
=
"
form-control
"
value
=
{
this
.
state
.
RVReviews
}
onChange
=
{
this
.
OnChangeCRReviews
}
style
=
{{
width
:
'
30%
'
,
marginLeft
:
'
20px
'
}}
required
/>
<
label
style
=
{{
marginTop
:
'
10px
'
,
float
:
'
left
'
,
marginLeft
:
'
10px
'
,
color
:
"
white
"
}}
>%<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
input
type
=
"
checkbox
"
id
=
"
PastResults
"
className
=
"
form-control
"
defaultChecked
=
{
this
.
state
.
isStudentCount
}
onChange
=
{
this
.
OnChangeIsCRStudentCount
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
float
:
'
left
'
,
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
color
:
"
white
"
}}
>
Student
Count
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
input
type
=
"
number
"
id
=
"
pastResultsTxt
"
className
=
"
form-control
"
value
=
{
this
.
state
.
RVStudentCount
}
onChange
=
{
this
.
OnChangeCRStudentCount
}
style
=
{{
width
:
'
30%
'
,
marginLeft
:
'
20px
'
}}
required
/>
<
label
style
=
{{
marginTop
:
'
10px
'
,
float
:
'
left
'
,
marginLeft
:
'
10px
'
,
color
:
"
white
"
}}
>%<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
label
>
<
span
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
color
:
"
white
"
}}
>
{
this
.
state
.
TotalRecommendationCount
}
/ 100</
span
>
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
background
:
'
#F5F4ED
'
,
marginLeft
:
'
50px
'
,
marginRight
:
'
50px
'
,
marginTop
:
'
10px
'
}}
>
<
h5
style
=
{{
margin
:
'
10px
'
}}
>
0
Results
<
/h5
>
<
h5
style
=
{{
margin
:
'
10px
'
}}
>
{
this
.
state
.
TutorFilteredList
.
length
}
Results
<
/h5
>
<
/div
>
<
div
className
=
""
>
{
this
.
state
.
TutorFilteredList
.
length
>
0
?
this
.
state
.
TutorFilteredList
.
map
(
(
card
)
=>
{
return
(
<
TutorCard
data
=
{
card
}
/>
)
}
)
: <div>
Empty
</
div
>
}
{
this
.
state
.
TutorFilteredList
.
length
>
0
?
this
.
state
.
TutorFilteredList
.
map
(
(
card
)
=>
{
return
(
<
TutorCard
data
=
{
card
}
/>
)
}
)
: <div>
No Result Found
</
div
>
}
<
/div
>
<
div
className
=
"
app-main__outer
"
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorCard.js
View file @
6e5c87ee
...
...
@@ -97,8 +97,7 @@ export default class TutorCard extends Component{
<
img
src
=
{
RecommendIcon
}
style
=
{{
width
:
'
100px
'
,
height
:
'
90px
'
,
float
:
'
left
'
,
margin
:
'
10px
'
}}
/
>
<
/div
>
<
/div
>
{
/*{console.log("In Tutor Card")}*/
}
{
/*{console.log(this.props)}*/
}
<
/div
>
)
}
...
...
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorProfileView.js
0 → 100644
View file @
6e5c87ee
import
React
,
{
Component
}
from
"
react
"
;
import
ItemNav
from
"
../Navbar
"
;
import
TestTeacher
from
"
../../Images/teacher.jpg
"
;
import
{
FaStar
}
from
"
react-icons/fa
"
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
"
../../Config/config
"
;
export
default
class
TutorProfileView
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
rating
:
0
,
overRollRating
:
3.5
,
ratingCount
:
20
,
ratingFive
:
4
,
ratingFour
:
2
,
ratingThree
:
5
,
ratingTwo
:
1
,
ratingOne
:
1
,
alreadyRate
:
false
,
review
:
''
,
student_id
:
''
,
tutor_id
:
''
,
version
:
'
1
'
,
};
this
.
onClickRatingValue
=
this
.
onClickRatingValue
.
bind
(
this
);
this
.
onMouseEnter
=
this
.
onMouseEnter
.
bind
(
this
);
this
.
onMouseOut
=
this
.
onMouseOut
.
bind
(
this
);
this
.
onChangeComment
=
this
.
onChangeComment
.
bind
(
this
);
this
.
onSID
=
this
.
onSID
.
bind
(
this
);
this
.
onTutorID
=
this
.
onTutorID
.
bind
(
this
);
this
.
submitRating
=
this
.
submitRating
.
bind
(
this
);
}
onClickRatingValue
(
e
)
{
console
.
log
(
e
.
target
.
value
);
this
.
setState
({
rating
:
e
.
target
.
value
})
}
onMouseEnter
(
e
)
{
console
.
log
(
e
);
this
.
setState
({
hover
:
e
})
}
onMouseOut
()
{
this
.
setState
({
hover
:
0
})
}
onChangeComment
(
e
)
{
this
.
setState
({
review
:
e
.
target
.
value
})
}
onSID
(
e
)
{
this
.
setState
({
student_id
:
e
.
target
.
value
})
}
onTutorID
(
e
)
{
this
.
setState
({
tutor_id
:
e
.
target
.
value
})
}
submitRating
()
{
const
payload
=
{
tutor_id
:
this
.
state
.
tutor_id
,
student_id
:
this
.
state
.
student_id
,
rating
:
this
.
state
.
rating
,
review
:
this
.
state
.
review
,
version
:
this
.
state
.
version
}
// console.log("payload");
console
.
log
(
payload
);
axios
.
post
(
configs
.
BASE_URL
+
'
/tutorRatings/add
'
,
payload
)
.
then
(
response
=>
{
alert
(
"
One Review added!!!
"
)
});
}
render
()
{
return
(
<
div
className
=
"
App
"
style
=
{{
padding
:
'
10px
'
,
paddingTop
:
'
0px
'
}}
>
<
div
className
=
"
row
"
style
=
{{
width
:
'
100%
'
}}
>
<
ItemNav
/>
<
/div
>
<
div
className
=
"
App
"
style
=
{{
marginTop
:
'
80px
'
,
paddingTop
:
'
0px
'
}}
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-4
"
>
<
img
src
=
{
TestTeacher
}
style
=
{{
width
:
'
160px
'
,
height
:
'
160px
'
,
float
:
'
left
'
,
margin
:
'
30px
'
}}
/
>
<
/div
>
<
div
className
=
"
col
"
style
=
{{
padding
:
'
20px
'
,
float
:
'
left
'
,
marginTop
:
'
20px
'
}}
>
<
div
className
=
"
row
"
>
<
h5
>
Sanath
Kumara
<
/h5
>
<
/div
>
<
div
className
=
"
row
"
>
<
label
>
B
.
Sc
(
Mgt
)
Special
,
University
of
Sri
Jayawardanapura
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
{[...
Array
(
5
)].
map
((
star
,
i
)
=>
{
const
ratingValue
=
i
+
1.0
;
return
<
label
style
=
{{
marginLeft
:
'
5px
'
,
faloat
:
'
center
'
}}
>
<
input
type
=
"
radio
"
name
=
"
rating
"
style
=
{{
display
:
"
none
"
,
cursor
:
"
pointer
"
}}
value
=
{
ratingValue
}
//onClick={this.onClickRatingValue}
/
>
<
FaStar
size
=
{
20
}
color
=
{
ratingValue
<=
(
this
.
state
.
overRollRating
)
?
"
#ffc107
"
:
"
#e4e5e9
"
}
//onMouseEnter={() => this.onMouseEnter(i + 1)}
style
=
{{
cursor
:
"
pointer
"
}}
/
>
<
/label
>
})}
<
/div
>
<
div
className
=
"
row
"
>
<
label
>
11
reviews
<
/label
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
h6
>
About
Me
<
/h6
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
textAlign
:
'
justify
'
}}
>
I
graduated
in
2019
from
an
undergraduate
degree
in
English
Literature
from
Cambridge
University
,
and
,
after
working
for
two
years
full
time
as
a
private
tutor
,
am
currently
reading
for
an
MPhil
in
Renaissance
Literature
(
also
at
Cambridge
)
–
my
dissertation
being
an
attempt
to
taxonomise
the
syntactical
forms
of
the
simile
in
Shakespeare
’
s
Complete
Works
,
and
,
with
a
corresponding
database
,
thus
(
I
hope
)
to
chart
its
evolution
.
I
hope
to
continue
in
academia
afterwards
,
and
,
throughout
and
beyond
this
degree
,
to
remain
tutoring
.
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
h6
>
About
My
Class
<
/h6
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
textAlign
:
'
justify
'
}}
>
I
graduated
in
2019
from
an
undergraduate
degree
in
English
Literature
from
Cambridge
University
,
and
,
after
working
for
two
years
full
time
as
a
private
tutor
,
am
currently
reading
for
an
MPhil
in
Renaissance
Literature
(
also
at
Cambridge
)
–
my
dissertation
being
an
attempt
to
taxonomise
the
syntactical
forms
of
the
simile
in
Shakespeare
’
s
Complete
Works
,
and
,
with
a
corresponding
database
,
thus
(
I
hope
)
to
chart
its
evolution
.
I
hope
to
continue
in
academia
afterwards
,
and
,
throughout
and
beyond
this
degree
,
to
remain
tutoring
.
<
/label
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
h4
>
Rating
and
Reviews
<
/h4
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
div
className
=
"
col-4
"
>
<
div
className
=
"
row
"
style
=
{{
padding
:
'
15px
'
}}
>
<
h2
style
=
{{
marginLeft
:
'
15px
'
}}
><
span
style
=
{{
color
:
'
gray
'
}}
><
b
style
=
{{
fontSize
:
'
40px
'
,
color
:
"
black
"
}}
>
{
this
.
state
.
overRollRating
}
<
/b>/
5
<
/span></
h2
>
<
/div
>
<
div
className
=
"
row
"
>
{[...
Array
(
5
)].
map
((
star
,
i
)
=>
{
const
ratingValue
=
i
+
1
;
return
<
label
style
=
{{
marginLeft
:
'
20px
'
,
float
:
'
left
'
}}
>
<
input
type
=
"
radio
"
name
=
"
rating
"
style
=
{{
display
:
"
none
"
,
cursor
:
"
pointer
"
}}
value
=
{
ratingValue
}
//onClick={this.onClickRatingValue}
/
>
<
FaStar
size
=
{
40
}
color
=
{
ratingValue
<=
(
this
.
state
.
overRollRating
)
?
"
#ffc107
"
:
"
#e4e5e9
"
}
//onMouseEnter={() => this.onMouseEnter(i + 1)}
style
=
{{
cursor
:
"
pointer
"
}}
/
>
<
/label
>
})}
<
/div
>
<
div
className
=
"
row
"
style
=
{{
padding
:
'
15px
'
}}
>
<
span
style
=
{{
marginLeft
:
'
15px
'
}}
>
{
this
.
state
.
ratingCount
}
Ratings
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"
col-6
"
>
<
div
className
=
"
row
"
style
=
{{
padding
:
'
5px
'
}}
>
<
div
className
=
"
col-
"
>
{[...
Array
(
5
)].
map
((
star
,
i
)
=>
{
const
ratingValue
=
i
+
1
;
return
<
label
style
=
{{
marginLeft
:
'
15px
'
,
float
:
'
left
'
}}
>
<
input
type
=
"
radio
"
name
=
"
rating
"
style
=
{{
display
:
"
none
"
,
cursor
:
"
pointer
"
}}
value
=
{
ratingValue
}
/
>
<
FaStar
size
=
{
20
}
color
=
{
ratingValue
<=
5
?
"
#ffc107
"
:
"
#e4e5e9
"
}
style
=
{{
cursor
:
"
pointer
"
}}
/
>
<
/label
>
})}
<
/div
>
<
div
className
=
"
col
"
>
<
span
style
=
{{
float
:
'
left
'
,
marginLeft
:
'
10px
'
}}
>
{
this
.
state
.
ratingFive
}
rate
(
s
)
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
padding
:
'
5px
'
}}
>
<
div
className
=
"
col-
"
>
{[...
Array
(
5
)].
map
((
star
,
i
)
=>
{
const
ratingValue
=
i
+
1
;
return
<
label
style
=
{{
marginLeft
:
'
15px
'
,
float
:
'
left
'
}}
>
<
input
type
=
"
radio
"
name
=
"
rating
"
style
=
{{
display
:
"
none
"
,
cursor
:
"
pointer
"
}}
value
=
{
ratingValue
}
/
>
<
FaStar
size
=
{
20
}
color
=
{
ratingValue
<=
4
?
"
#ffc107
"
:
"
#e4e5e9
"
}
style
=
{{
cursor
:
"
pointer
"
}}
/
>
<
/label
>
})}
<
/div
>
<
div
className
=
"
col
"
>
<
span
style
=
{{
float
:
'
left
'
,
marginLeft
:
'
10px
'
}}
>
{
this
.
state
.
ratingFour
}
rate
(
s
)
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
padding
:
'
5px
'
}}
>
<
div
className
=
"
col-
"
>
{[...
Array
(
5
)].
map
((
star
,
i
)
=>
{
const
ratingValue
=
i
+
1
;
return
<
label
style
=
{{
marginLeft
:
'
15px
'
,
float
:
'
left
'
}}
>
<
input
type
=
"
radio
"
name
=
"
rating
"
style
=
{{
display
:
"
none
"
,
cursor
:
"
pointer
"
}}
value
=
{
ratingValue
}
/
>
<
FaStar
size
=
{
20
}
color
=
{
ratingValue
<=
3
?
"
#ffc107
"
:
"
#e4e5e9
"
}
style
=
{{
cursor
:
"
pointer
"
}}
/
>
<
/label
>
})}
<
/div
>
<
div
className
=
"
col
"
>
<
span
style
=
{{
float
:
'
left
'
,
marginLeft
:
'
10px
'
}}
>
{
this
.
state
.
ratingThree
}
rate
(
s
)
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
padding
:
'
5px
'
}}
>
<
div
className
=
"
col-
"
>
{[...
Array
(
5
)].
map
((
star
,
i
)
=>
{
const
ratingValue
=
i
+
1
;
return
<
label
style
=
{{
marginLeft
:
'
15px
'
,
float
:
'
left
'
}}
>
<
input
type
=
"
radio
"
name
=
"
rating
"
style
=
{{
display
:
"
none
"
,
cursor
:
"
pointer
"
}}
value
=
{
ratingValue
}
/
>
<
FaStar
size
=
{
20
}
color
=
{
ratingValue
<=
2
?
"
#ffc107
"
:
"
#e4e5e9
"
}
style
=
{{
cursor
:
"
pointer
"
}}
/
>
<
/label
>
})}
<
/div
>
<
div
className
=
"
col
"
>
<
span
style
=
{{
float
:
'
left
'
,
marginLeft
:
'
10px
'
}}
>
{
this
.
state
.
ratingTwo
}
rate
(
s
)
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
padding
:
'
5px
'
}}
>
<
div
className
=
"
col-
"
>
{[...
Array
(
5
)].
map
((
star
,
i
)
=>
{
const
ratingValue
=
i
+
1
;
return
<
label
style
=
{{
marginLeft
:
'
15px
'
,
float
:
'
left
'
}}
>
<
input
type
=
"
radio
"
name
=
"
rating
"
style
=
{{
display
:
"
none
"
,
cursor
:
"
pointer
"
}}
value
=
{
ratingValue
}
/
>
<
FaStar
size
=
{
20
}
color
=
{
ratingValue
<=
1
?
"
#ffc107
"
:
"
#e4e5e9
"
}
style
=
{{
cursor
:
"
pointer
"
}}
/
>
<
/label
>
})}
<
/div
>
<
div
className
=
"
col
"
>
<
span
style
=
{{
float
:
'
left
'
,
marginLeft
:
'
10px
'
}}
>
{
this
.
state
.
ratingOne
}
rate
(
s
)
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
{[...
Array
(
5
)].
map
((
star
,
i
)
=>
{
const
ratingValue
=
i
+
1
;
return
<
label
style
=
{{
marginLeft
:
'
20px
'
}}
>
<
input
type
=
"
radio
"
name
=
"
rating
"
style
=
{{
display
:
"
none
"
,
cursor
:
"
pointer
"
}}
value
=
{
ratingValue
}
onClick
=
{
this
.
onClickRatingValue
}
/
>
<
FaStar
size
=
{
40
}
color
=
{
ratingValue
<=
(
this
.
state
.
rating
||
this
.
state
.
hover
)
?
"
#ffc107
"
:
"
#e4e5e9
"
}
onMouseEnter
=
{()
=>
this
.
onMouseEnter
(
i
+
1
)}
style
=
{{
cursor
:
"
pointer
"
}}
/
>
<
/label
>
})}
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
span
style
=
{{
marginLeft
:
'
20px
'
}}
>
You
Rate
[{
this
.
state
.
rating
}]
stars
for
the
product
.
<
/span
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
h5
style
=
{{
marginLeft
:
'
20px
'
}}
>
You
can
review
to
this
Tutor
<
/h5
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
input
type
=
"
text
"
id
=
"
tutorAddress
"
className
=
"
form-control
"
placeholder
=
"
Tutor ID
"
onChange
=
{
this
.
onTutorID
}
style
=
{{
width
:
'
50%
'
}}
required
/>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
input
type
=
"
text
"
id
=
"
tutorAddress
"
className
=
"
form-control
"
placeholder
=
"
SID
"
onChange
=
{
this
.
onSID
}
style
=
{{
width
:
'
50%
'
}}
required
/>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
textarea
style
=
{{
width
:
'
50%
'
,
marginLeft
:
'
20px
'
}}
value
=
{
this
.
state
.
comments
}
onChange
=
{
this
.
onChangeComment
}
/
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
{
this
.
state
.
alreadyRate
===
false
?
<
a
type
=
"
submit
"
onClick
=
{
this
.
submitRating
}
className
=
"
profile-edit-btn nav-link btn btn-primary stop-color-final
"
name
=
"
btnAddMore
"
style
=
{{
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
marginTop
:
'
00px
'
,
marginBottom
:
'
20px
'
,
backgroundColor
:
'
orange
'
,
borderColor
:
'
orange
'
,
fontSize
:
'
20px
'
,
width
:
'
25%
'
}}
>
Add
Comment
<
/a
>
:
<
a
type
=
"
submit
"
onClick
=
{
this
.
updateRating
}
className
=
"
profile-edit-btn nav-link btn btn-primary stop-color-final
"
name
=
"
btnAddMore
"
style
=
{{
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
marginTop
:
'
00px
'
,
marginBottom
:
'
20px
'
,
backgroundColor
:
'
orange
'
,
borderColor
:
'
orange
'
,
fontSize
:
'
20px
'
,
width
:
'
25%
'
}}
>
Update
Comment
<
/a
>
}
<
/div
>
<
/div
>
<
/div
>
)
}
}
\ No newline at end of file
WebFrontEnd/smartcoach-frontend/src/Components/Student/ALResults.js
View file @
6e5c87ee
...
...
@@ -113,11 +113,17 @@ export default class ALResults extends Component{
onSubmitResults
(
e
){
//let student_id = '60fc1aaf718c264214061846';
let
Subject
=
{
[
this
.
state
.
sub01
]
:
this
.
state
.
sub01Result
,
[
this
.
state
.
sub02
]
:
this
.
state
.
sub02Result
,
[
this
.
state
.
sub03
]
:
this
.
state
.
sub03Result
,
}
const
newResult
=
{
student_id
:
this
.
state
.
studentID
,
year
:
this
.
state
.
year
,
stream
:
this
.
state
.
stream
,
Subjects
:
Subject
,
subject01
:
this
.
state
.
sub01
,
subject02
:
this
.
state
.
sub02
,
subject03
:
this
.
state
.
sub03
,
...
...
WebFrontEnd/smartcoach-frontend/src/Config/config.js
View file @
6e5c87ee
const
configs
=
{
BASE_URL
:
'
http://localhost:500
0
'
,
BASE_URL
:
'
http://localhost:500
1
'
,
};
module
.
exports
=
configs
;
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