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
bf893f1b
Commit
bf893f1b
authored
Nov 24, 2021
by
Hasitha Samarasekara
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT18050240' into 'master'
It18050240 See merge request
!25
parents
cee4a70a
0f8cb343
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
500 additions
and
23159 deletions
+500
-23159
BackEnd/WebBackEnd/package-lock.json
BackEnd/WebBackEnd/package-lock.json
+2
-1370
BackEnd/WebBackEnd/routes/pdf.route.js
BackEnd/WebBackEnd/routes/pdf.route.js
+1
-1
BackEnd/WebBackEnd/routes/question.route.js
BackEnd/WebBackEnd/routes/question.route.js
+1
-1
WebFrontEnd/smartcoach-frontend/package-lock.json
WebFrontEnd/smartcoach-frontend/package-lock.json
+55
-21658
WebFrontEnd/smartcoach-frontend/src/App.js
WebFrontEnd/smartcoach-frontend/src/App.js
+16
-4
WebFrontEnd/smartcoach-frontend/src/Components/Admin/Dashboard.js
...End/smartcoach-frontend/src/Components/Admin/Dashboard.js
+21
-2
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/UploadPage.tsx
...rtcoach-frontend/src/Components/IT18050240/UploadPage.tsx
+56
-54
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/admin_question_management.js.js
...src/Components/IT18050240/admin_question_management.js.js
+12
-18
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/automatic_question.js
...-frontend/src/Components/IT18050240/automatic_question.js
+49
-28
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/exampage.js
...smartcoach-frontend/src/Components/IT18050240/exampage.js
+118
-0
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/lesson_bank.js
...rtcoach-frontend/src/Components/IT18050240/lesson_bank.js
+112
-0
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/lessonandexampage.js
...h-frontend/src/Components/IT18050240/lessonandexampage.js
+4
-4
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/question_bank.js
...coach-frontend/src/Components/IT18050240/question_bank.js
+5
-5
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/question_layout.js
...ach-frontend/src/Components/IT18050240/question_layout.js
+1
-1
WebFrontEnd/smartcoach-frontend/src/Components/Student/StudentDashboard.js
...coach-frontend/src/Components/Student/StudentDashboard.js
+47
-13
No files found.
BackEnd/WebBackEnd/package-lock.json
View file @
bf893f1b
This diff is collapsed.
Click to expand it.
BackEnd/WebBackEnd/routes/pdf.route.js
View file @
bf893f1b
...
...
@@ -68,7 +68,7 @@ module.exports = (upload) => {
GET: Delete an image from the collection
*/
imageRouter
.
route
(
'
/delete/:id
'
)
.
get
((
req
,
res
,
next
)
=>
{
.
delete
((
req
,
res
,
next
)
=>
{
Image
.
findOne
({
_id
:
req
.
params
.
id
})
.
then
((
image
)
=>
{
if
(
image
)
{
...
...
BackEnd/WebBackEnd/routes/question.route.js
View file @
bf893f1b
...
...
@@ -74,7 +74,7 @@ questionRouter.route('/update/:id').post((req, res) => {
});
});
questionRouter
.
route
(
'
c
'
).
get
(
function
(
req
,
res
)
{
questionRouter
.
route
(
'
/quiz/:id
'
).
get
(
function
(
req
,
res
)
{
console
.
log
(
"
Product Item ID
"
);
console
.
log
(
req
.
params
.
id
);
let
id
=
req
.
params
.
id
;
...
...
WebFrontEnd/smartcoach-frontend/package-lock.json
View file @
bf893f1b
This diff is collapsed.
Click to expand it.
WebFrontEnd/smartcoach-frontend/src/App.js
View file @
bf893f1b
...
...
@@ -14,8 +14,12 @@ import Dashboard from "./Components/Admin/Dashboard";
import
StudentDashboard
from
"
./Components/Student/StudentDashboard
"
;
import
QuestionDetails
from
"
./Components/IT18050240/question_details
"
import
QuestionLayout
from
"
./Components/IT18050240/question_layout
"
//
import AdminQuestionManagement from "./Components/IT18050240/admin_question_management.js"
import
AdminQuestionManagement
from
"
./Components/IT18050240/admin_question_management.js
"
import
QuestionBank
from
"
./Components/IT18050240/question_bank
"
import
LessonAndExam
from
"
./Components/IT18050240/lessonandexampage
"
;
import
AutomaticQuestion
from
"
./Components/IT18050240/automatic_question
"
import
Upload
from
"
./Components/IT18050240/UploadPage
"
;
import
Exampage
from
"
./Components/IT18050240/exampage
"
;
import
TutorProfileView
from
"
./Components/HomePage/TutorProfileView
"
;
function
App
()
{
...
...
@@ -28,6 +32,7 @@ function App() {
<
Route
path
=
"
/SignUp
"
exact
component
=
{
SignUp
}
/
>
<
Route
path
=
"
/beforeConfirm
"
exact
component
=
{
beforeConfirmation
}
/
>
<
Route
path
=
"
/AccountVerified/:id
"
exact
component
=
{
VerifiedAccount
}
/
>
<
Route
path
=
"
/studentDashboard
"
exact
component
=
{
StudentDashboard
}
/
>
<
Route
path
=
"
/Home/ViewProfile/:id
"
exact
component
=
{
TutorProfileView
}
/
>
<
Route
path
=
"
/studentDashboard
"
exact
component
=
{
StudentDashboard
}
/
>
...
...
@@ -37,10 +42,17 @@ function App() {
<
Route
path
=
"
/admin
"
><
Dashboard
/><
/Route
>
<
Route
path
=
"
/studentDashboard
"
><
StudentDashboard
/><
/Route
>
<
Route
path
=
"
/questiondetails
"
exact
component
=
{
QuestionDetails
}
/
>
<
Route
path
=
"
/question
"
exact
component
=
{
QuestionLayout
}
/
>
{
/*<Route path="/questionmanagement" exact component={AdminQuestionManagement}/>*/
}
<
Route
path
=
"
/question
s/quiz/:id
"
exact
component
=
{
QuestionLayout
}
/
>
<
Route
path
=
"
/questionmanagement/:id
"
exact
component
=
{
AdminQuestionManagement
}
/
>
<
Route
path
=
"
/questionbank
"
exact
component
=
{
QuestionBank
}
/
>
{
/*<Route path="/edititem/:id" exact component={AdminQuestionManagement}/>*/
}
<
Route
path
=
"
/questionmanagement
"
exact
component
=
{
AdminQuestionManagement
}
/
>
<
Route
path
=
"
/automaticquestion
"
exact
component
=
{
AutomaticQuestion
}
/
>
<
Route
path
=
"
/upload
"
exact
component
=
{
Upload
}
/
>
<
Route
path
=
"
/exampage
"
exact
component
=
{
Exampage
}
/
>
<
/Switch
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/Dashboard.js
View file @
bf893f1b
...
...
@@ -9,6 +9,11 @@ import AddClass from './add_class_details';
import
Analytics
from
"
./analytics
"
;
import
studentRequest
from
'
./StudentRequestForClass
'
;
import
TestTeacher
from
"
../../Images/defaultimageicon.jpg
"
;
import
QuestionBank
from
"
../IT18050240/question_bank
"
;
import
AdminQuestionManagement
from
"
../IT18050240/admin_question_management.js
"
;
import
AutomaticQuestion
from
"
../IT18050240/automatic_question
"
;
import
Upload
from
"
../IT18050240/UploadPage
"
;
import
LessonBank
from
"
../IT18050240/lesson_bank
"
;
import
AddStudPer
from
'
./add_stud_perf_details
'
;
import
ProgressStudents
from
"
./progress_students
"
;
import
ViewProgress
from
"
./view_progress
"
;
...
...
@@ -396,7 +401,7 @@ export default class Dashboard extends Component {
<
/a
>
<
ul
>
<
li
>
<
NavLink
to
=
{
"
/questionbank
"
}
>
<
NavLink
to
=
{
"
/
admin/exam/
questionbank
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
Question
Bank
<
/NavLink
>
...
...
@@ -412,11 +417,18 @@ export default class Dashboard extends Component {
<
/a
>
<
ul
>
<
li
>
<
NavLink
to
=
{
"
/upload
"
}
>
<
NavLink
to
=
{
"
/admin/lesson/lessonbank
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
Lesson
Bank
<
/NavLink
>
<
/li
>
<
li
>
<
NavLink
to
=
{
"
/admin/lesson/upload
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
Lesson
upload
<
/NavLink
>
<
/li
>
<
/ul
>
<
/li
>
...
...
@@ -536,6 +548,13 @@ export default class Dashboard extends Component {
<
Route
path
=
{
"
/admin/finance/edit/:id
"
}
exact
component
=
{
EditFinance
}
/
>
<
Route
path
=
"
/admin/classes/add
"
exact
component
=
{
AddClass
}
/
>
<
Route
path
=
"
/admin/classes/studentRequests
"
exact
component
=
{
studentRequest
}
/
>
<
Route
path
=
"
/admin/exam/questionbank
"
exact
component
=
{
QuestionBank
}
/
>
<
Route
path
=
"
/admin/exam/questionmanagement
"
exact
component
=
{
AdminQuestionManagement
}
/
>
<
Route
path
=
"
/admin/exam/automaticquestion
"
exact
component
=
{
AutomaticQuestion
}
/
>
<
Route
path
=
"
/admin/exam/questionmanagement/:id
"
exact
component
=
{
AdminQuestionManagement
}
/
>
<
Route
path
=
"
/admin/lesson/upload
"
exact
component
=
{
Upload
}
/
>
<
Route
path
=
"
/admin/lesson/lessonbank
"
exact
component
=
{
LessonBank
}
/
>
<
Route
path
=
"
/admin/studper/add
"
exact
component
=
{
AddStudPer
}
/
>
<
Route
path
=
"
/admin/studper/tutor/:id
"
exact
component
=
{
ProgressStudents
}
/
>
<
Route
path
=
"
/admin/studper/student/:id
"
exact
component
=
{
ViewProgress
}
/
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/UploadPage.tsx
View file @
bf893f1b
...
...
@@ -5,6 +5,7 @@ import PDF from '../../Images/pdficon.png';
import
PW
from
'
../../Images/pptxicon.png
'
;
interface
UploadState
{
recentImage
:
any
;
caption
:
string
;
...
...
@@ -13,8 +14,7 @@ interface UploadState {
imagename
:
string
;
filetype
:
string
,
lessonname
:
string
,
lessonno
:
any
,
filename
:
string
lessonno
:
string
,
};
class
UploadPage
extends
PureComponent
<
{},
UploadState
>
{
...
...
@@ -30,7 +30,6 @@ class UploadPage extends PureComponent<{}, UploadState> {
filetype
:
''
,
lessonname
:
''
,
lessonno
:
''
,
filename
:
''
};
}
...
...
@@ -38,35 +37,24 @@ class UploadPage extends PureComponent<{}, UploadState> {
this
.
fetchRecent
();
}
componentDidUpdate
=
()
=>
{
this
.
fetchRecent
();
}
fetchRecent
=
()
=>
{
axios
.
get
(
'
http://localhost:5000/recent
'
)
.
then
((
response
)
=>
{
this
.
setState
({
filename
:
response
.
data
.
filename
,
lessonname
:
response
.
data
.
lessonname
,
lessonno
:
response
.
data
.
lessonno
});
this
.
setState
({
recentImage
:
response
.
data
.
image
});
})
.
catch
(
err
=>
alert
(
'
Error:
'
+
err
));
if
(
this
.
state
.
filetype
==
""
){
this
.
setState
({
//let str = this.state.filename;
//
// if (str.includes(".pdf")) {
// this.setState({
// imagename: PDF,
// filetype : ".pdf"
// });
// }else if (str.includes(".pptx")) {
// this.setState({
// imagename: PW,
// filetype :".pptx"
// });
// }
filetype
:
""
,
lessonname
:
""
,
lessonno
:
""
,
});
}
}
uploadImage
=
()
=>
{
...
...
@@ -92,32 +80,49 @@ class UploadPage extends PureComponent<{}, UploadState> {
return
(
<
div
className=
"UploadPage"
>
<
div
className=
"Recent"
>
<
div
className=
"container text-left"
>
<
div
className=
"col-10"
>
<
hr
/>
<
div
className=
"row"
>
<
div
className=
"col-sm-6"
>
<
label
>
Lesson name:
</
label
>
<
div
className=
"col-sm-5"
>
<
label
>
Lesson No:
</
label
>
<
div
style=
{
{
padding
:
'
0px
'
}
}
>
<
input
type=
"text"
required
className=
"form-control"
onChange=
{
event
=>
this
.
setState
({
lessonname
:
event
.
target
.
value
})
}
value=
{
this
.
state
.
lessonname
}
/>
<
select
style=
{
{
width
:
'
100%
'
}
}
className=
"browser-default custom-select"
value=
{
this
.
state
.
lessonno
}
onChange=
{
event
=>
this
.
setState
({
lessonno
:
event
.
target
.
value
})
}
>
<
option
>
Select Lesson No
</
option
>
<
option
>
1
</
option
>
<
option
>
2
</
option
>
<
option
>
3
</
option
>
<
option
>
4
</
option
>
<
option
>
5
</
option
>
</
select
>
</
div
>
</
div
>
<
div
className=
"col-sm-6"
>
<
label
>
Lesson no:
</
label
>
<
div
className=
"col-sm-5"
>
<
label
>
Lesson name:
</
label
>
<
div
style=
{
{
padding
:
'
0px
'
}
}
>
<
input
type=
"text"
required
className=
"form-control"
onChange=
{
event
=>
this
.
setState
({
lessonn
o
:
event
.
target
.
value
})
}
value=
{
this
.
state
.
lessonn
o
}
/>
onChange=
{
event
=>
this
.
setState
({
lessonn
ame
:
event
.
target
.
value
})
}
value=
{
this
.
state
.
lessonn
ame
}
/>
</
div
>
</
div
>
</
div
>
<
div
className=
"row"
>
<
div
className=
"col-sm-
6
"
>
<
div
className=
"col-sm-
5
"
>
<
label
>
Lesson caption:
</
label
>
<
div
style=
{
{
padding
:
'
0px
'
}
}
>
<
input
...
...
@@ -130,7 +135,7 @@ class UploadPage extends PureComponent<{}, UploadState> {
</
div
>
</
div
>
<
div
className=
"col-sm-
6
"
>
<
div
className=
"col-sm-
5
"
>
<
label
>
Upload file:
</
label
>
<
div
style=
{
{
padding
:
'
0px
'
}
}
>
<
input
...
...
@@ -153,34 +158,31 @@ class UploadPage extends PureComponent<{}, UploadState> {
<
div
className=
"row"
>
<
div
className=
"col-sm-12"
>
<
div
className=
"col-sm-10"
>
<
button
type
="
submit
"
value
="
Submit
"
className
=
"
btn
btn
-
block
btn
-
success
mt
-3"
onClick=
{
this
.
uploadImage
}
>
ADD
className
=
"
btn
btn
-
block
btn
-
success
mt
-3"
onClick=
{
this
.
uploadImage
}
>
ADD
</
button
>
</
div
>
</
div
>
</
div
>
<
br
/><
br
/>
<
div
className=
"border"
>
<
div
style=
{
{
margin
:
"
15px
"
}
}
>
<
h5
className=
"text-center"
>
Recent Upload File
</
h5
>
<
p
className=
"text-center"
>
File type : (.pdf)
<
img
src=
{
PDF
}
alt=
"upload-image"
style=
{
{
width
:
'
30px
'
}
}
/>
</
p
>
<
p
className=
"text-center"
>
Lesson No: 1
{
this
.
state
.
lessonno
}
</
p
>
<
p
className=
"text-center"
>
Lesson Name: Accounting
{
this
.
state
.
lessonname
}
</
p
>
<
br
/><
br
/>
</
div
>
<
div
className=
"border"
>
<
div
className=
"text-left"
style=
{
{
margin
:
"
15px
"
}
}
>
<
h5
className=
"text-left"
>
Recent Upload File
</
h5
>
<
p
>
Filename :
{
this
.
state
.
recentImage
.
filename
}
</
p
>
<
p
>
Lesson Name :
{
this
.
state
.
recentImage
.
lessonname
}
</
p
>
<
p
>
Lesson Number :
{
this
.
state
.
recentImage
.
lessonno
}
</
p
>
</
div
>
</
div
>
</
div
>
<
br
/><
br
/>
</
div
></
div
>
</
div
>
);
}
}
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/admin_question_management.js.js
View file @
bf893f1b
...
...
@@ -97,7 +97,7 @@ export default class AdminUI extends Component {
lesson_name
:
this
.
state
.
lesson_name
,
question_text
:
this
.
state
.
question_text
,
question_answer
:
this
.
state
.
question_answer
,
defult_mark
:
this
.
state
.
defult_mark
,
defult_mark
:
3
,
time_createdby
:
this
.
state
.
currentTime
,
time_modifiedby
:
this
.
state
.
currentTime
,
general_feedback
:
this
.
state
.
general_feedback
,
...
...
@@ -111,6 +111,13 @@ export default class AdminUI extends Component {
);
swal
(
"
Data Saved Successfully!
"
,
"
Your Details has been Saved Successfully!
"
,
"
success
"
);
this
.
state
.
lesson_no
=
""
;
this
.
state
.
lesson_name
=
""
;
this
.
state
.
question_text
=
""
;
this
.
state
.
question_answer
=
""
;
this
.
state
.
currentTime
=
""
;
this
.
state
.
currentTime
=
""
;
this
.
state
.
general_feedback
=
""
;
}
...
...
@@ -161,7 +168,7 @@ export default class AdminUI extends Component {
lesson_name
:
this
.
state
.
lesson_name
,
question_text
:
this
.
state
.
question_text
,
question_answer
:
this
.
state
.
question_answer
,
defult_mark
:
this
.
state
.
defult_mark
,
defult_mark
:
3
,
time_modifiedby
:
this
.
state
.
currentTime
,
general_feedback
:
this
.
state
.
general_feedback
,
};
...
...
@@ -180,6 +187,7 @@ export default class AdminUI extends Component {
// }else{
// alert("You must fill in all of the fields.");
// }
}}
render
(){
...
...
@@ -188,10 +196,6 @@ export default class AdminUI extends Component {
<
div
className
=
"
container text-left
"
>
<
div
className
=
"
col-sm-10
"
>
<
h4
>
Business
Studies
<
/h4
>
<
h6
>
Dashboard
/
My
courses
/
Business
Studies
/
Question
bank
/
Questions
<
/h6
>
<
hr
/>
<
/div
>
<
form
onSubmit
=
{
this
.
state
.
submitStatus
...
...
@@ -214,6 +218,7 @@ export default class AdminUI extends Component {
<
label
>
Lesson
No
:
<
/label
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
select
style
=
{{
width
:
'
100%
'
}}
className
=
"
browser-default custom-select
"
value
=
{
this
.
state
.
lesson_no
}
onChange
=
{(
e
)
=>
this
.
onChangeLessonNo
(
e
)}
>
<
option
>
Select
Lesson
No
<
/option
>
<
option
>
1
<
/option
>
...
...
@@ -263,18 +268,7 @@ export default class AdminUI extends Component {
/
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-sm-10
"
>
<
label
>
Default
mark
:
<
/label
>
<
input
type
=
"
text
"
className
=
"
form-control
"
value
=
{
this
.
state
.
defult_mark
}
onChange
=
{
this
.
onChangeDefultMark
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
...
...
@@ -305,7 +299,7 @@ export default class AdminUI extends Component {
<
div
className
=
"
row
"
>
<
div
className
=
"
col-sm-5
"
>
<
Link
style
=
{{
textDecoration
:
"
none
"
}}
to
=
{
"
/admin/
itemlist
"
}
><
button
className
=
"
btn btn-block btn-warning
"
style
=
{{
color
:
"
white
"
}}
>
BACK
<
/button></
Link
>
<
Link
style
=
{{
textDecoration
:
"
none
"
}}
to
=
{
"
/admin/
exam/questionbank
"
}
><
button
className
=
"
btn btn-block btn-warning
"
style
=
{{
color
:
"
white
"
}}
>
BACK
<
/button></
Link
>
<
/div
>
<
div
className
=
"
col-sm-5
"
>
<
button
type
=
"
submit
"
value
=
"
Submit
"
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/automatic_question.js
View file @
bf893f1b
...
...
@@ -12,7 +12,8 @@ export default class Automatic_question extends Component {
this
.
onChangeLessonName
=
this
.
onChangeLessonName
.
bind
(
this
);
this
.
onChangeDefultMark
=
this
.
onChangeDefultMark
.
bind
(
this
);
this
.
onChangeFeedBack
=
this
.
onChangeFeedBack
.
bind
(
this
);
this
.
onChangeQuestionText
=
this
.
onChangeQuestionText
.
bind
(
this
);
this
.
onChangeFileName
=
this
.
onChangeFileName
.
bind
(
this
)
this
.
onSubmit
=
this
.
onSubmit
.
bind
(
this
);
this
.
state
=
{
...
...
@@ -20,9 +21,15 @@ export default class Automatic_question extends Component {
lesson_name
:
''
,
defult_mark
:
''
,
general_feedback
:
''
,
question_text
:
''
,
file
:
null
}
}
onChangeFileName
(
event
)
{
this
.
setState
({
file
:
event
.
target
.
value
})
}
onChangeLessonNo
(
e
){
this
.
setState
({
lesson_no
:
e
.
target
.
value
...
...
@@ -47,6 +54,12 @@ export default class Automatic_question extends Component {
});
}
onChangeQuestionText
(
e
){
this
.
setState
({
question_text
:
e
.
target
.
value
});
}
async
onSubmit
(
e
)
{
e
.
preventDefault
();
...
...
@@ -57,12 +70,14 @@ export default class Automatic_question extends Component {
console
.
log
(
`Lesson No:
${
this
.
state
.
lesson_no
}
`
);
console
.
log
(
`Defualt mark:
${
this
.
state
.
defult_mark
}
`
);
console
.
log
(
`Genaral Feedback:
${
this
.
state
.
general_feedback
}
`
);
console
.
log
(
`Question Text:
${
this
.
state
.
question_text
}
`
);
const
newQuestion
=
{
lesson_no
:
this
.
state
.
lesson_no
,
lesson_name
:
this
.
state
.
lesson_name
,
defult_mark
:
this
.
state
.
defult_mark
,
defult_mark
:
3
,
general_feedback
:
this
.
state
.
general_feedback
,
file
:
this
.
state
.
file
,
};
let
options
=
{
...
...
@@ -84,6 +99,9 @@ export default class Automatic_question extends Component {
// );
// swal("Data Saved Successfully!", "Your Details has been Saved Successfully!", "success");
swal
(
"
Good job!
"
,
"
Questions added Successfully!
"
,
"
success
"
);
}
render
()
{
...
...
@@ -92,16 +110,28 @@ export default class Automatic_question extends Component {
<
form
onSubmit
=
{
this
.
onSubmit
}
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-sm-5
"
>
<
label
>
Lesson
no
:
<
/label
>
<
label
>
Lesson
No
:
<
/label
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
input
type
=
"
text
"
required
className
=
"
form-control
"
value
=
{
this
.
state
.
lesson_no
}
onChange
=
{
this
.
onChangeLessonNo
}
/
>
<
select
style
=
{{
width
:
'
100%
'
}}
className
=
"
browser-default custom-select
"
value
=
{
this
.
state
.
lesson_no
}
onChange
=
{(
e
)
=>
this
.
onChangeLessonNo
(
e
)}
>
<
option
>
Select
Lesson
No
<
/option
>
<
option
>
1
<
/option
>
<
option
>
2
<
/option
>
<
option
>
3
<
/option
>
<
option
>
4
<
/option
>
<
option
>
5
<
/option
>
<
/select
>
<
/div
>
<
/div
>
<
div
className
=
"
col-sm-5
"
>
<
label
>
Lesson
name
:
<
/label
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
...
...
@@ -114,46 +144,37 @@ export default class Automatic_question extends Component {
<
/div
>
<
div
className
=
"
col-sm-5
"
>
<
label
>
defult_mar
k
:
<
/label
>
<
label
>
general_feedbac
k
:
<
/label
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
input
type
=
"
text
"
required
className
=
"
form-control
"
value
=
{
this
.
state
.
defult_mar
k
}
onChange
=
{
this
.
onChange
DefultMar
k
}
value
=
{
this
.
state
.
general_feedbac
k
}
onChange
=
{
this
.
onChange
FeedBac
k
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"
col-sm-5
"
>
<
label
>
general_feedback
:
<
/label
>
<
label
>
Browse
file
:
<
/label
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
input
type
=
"
text
"
required
className
=
"
form-control
"
value
=
{
this
.
state
.
general_feedback
}
onChange
=
{
this
.
onChangeFeedBack
}
/
>
<
input
type
=
"
file
"
onChange
=
{
this
.
onChangeFileName
}
/
>
<
/div
>
<
/div
>
<
br
/>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-sm-10
"
>
<
label
style
=
{{
textAlign
:
'
left
'
}}
>
Question
text
:
<
/label
>
<
textarea
className
=
"
form-control
"
required
/>
<
br
/>
<
button
className
=
"
btn btn-block btn btn-secondary
"
type
=
"
submit
"
value
=
"
Submit
"
style
=
{{
color
:
"
white
"
}}
>
Create
New
Quiz
<
/button
>
<
/div
>
<
/div
>
<
/div> <div
>
<
/div
>
<
/form
>
<
/div
>
)
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/exampage.js
0 → 100644
View file @
bf893f1b
import
React
,
{
Component
}
from
'
react
'
;
import
axios
from
'
axios
'
;
import
{
Link
}
from
"
react-router-dom
"
;
import
EX
from
'
../../Images/exam.png
'
;
import
LS
from
'
../../Images/lesson.png
'
;
export
default
class
LessonAndExam
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
lessonList
:[]
}
}
componentDidMount
=
()
=>
{
let
quizLessonTemp
=
[]
axios
.
get
(
'
http://localhost:5000/
'
)
.
then
(
response
=>
{
console
.
log
(
response
);
this
.
setState
({
lessonList
:
response
.
data
.
images
});
console
.
log
(
this
.
state
.
lessonList
.
length
)
})
.
catch
(
err
=>
alert
(
err
));
}
render
(){
return
(
<
div
className
=
"
container
"
>
<
div
className
=
""
>
<
div
className
=
"
p-3 mb-2 bg-light text-dark text-left
"
>
Accounting
Exam
<
/div
>
<
div
className
=
"
text-left ml-3
"
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-1
"
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
img
src
=
{
LS
}
alt
=
"
upload-image
"
style
=
{{
width
:
'
35px
'
}}
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
a
href
=
{
'
/questions/quiz/
'
+
1
}
><
p
style
=
{{
marginTop
:
'
7px
'
}}
>
Exam
1
<
/p></
a
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
""
>
<
div
className
=
"
p-3 mb-2 bg-light text-dark text-left
"
>
Accounting
Exam
<
/div
>
<
div
className
=
"
text-left ml-3
"
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-1
"
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
img
src
=
{
LS
}
alt
=
"
upload-image
"
style
=
{{
width
:
'
35px
'
}}
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
a
href
=
{
'
/questions/quiz/
'
+
2
}
><
p
style
=
{{
marginTop
:
'
7px
'
}}
>
Exam
2
<
/p></
a
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
""
>
<
div
className
=
"
p-3 mb-2 bg-light text-dark text-left
"
>
Accounting
Exam
<
/div
>
<
div
className
=
"
text-left ml-3
"
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-1
"
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
img
src
=
{
LS
}
alt
=
"
upload-image
"
style
=
{{
width
:
'
35px
'
}}
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
a
href
=
{
'
/questions/quiz/
'
+
3
}
><
p
style
=
{{
marginTop
:
'
7px
'
}}
>
Exam
3
<
/p></
a
>
<
br
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
}
}
\ No newline at end of file
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/lesson_bank.js
0 → 100644
View file @
bf893f1b
import
React
,
{
Component
}
from
'
react
'
;
import
axios
from
'
axios
'
;
import
{
Link
}
from
"
react-router-dom
"
;
const
Quantity
=
props
=>
(
<
tr
>
<
td
>
{
props
.
lessons
.
lessonno
}
<
/td
>
<
td
>
{
props
.
lessons
.
lessonname
}
<
/td
>
<
td
>
{
props
.
lessons
.
filename
}
<
/td
>
<
td
>
<
div
>
<
span
className
=
"
mx-1 text-danger fas fa-trash
"
href
=
'
#
'
onClick
=
{()
=>
{
props
.
deleteProduct
(
props
.
lessons
.
_id
)}}
><
/span
>
<
/div
>
<
/td
>
<
/tr
>
);
export
default
class
QuestionBankUI
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
deleteProduct
=
this
.
deleteProduct
.
bind
(
this
);
this
.
onSubmit
=
this
.
onSubmit
.
bind
(
this
);
this
.
state
=
{
lessons
:
[]
}
}
quantityList
()
{
return
this
.
state
.
lessons
.
map
(
currentTodo
=>
{
return
<
Quantity
lessons
=
{
currentTodo
}
deleteProduct
=
{
this
.
deleteProduct
}
key
=
{
currentTodo
.
_id
}
/
>
});
}
componentDidUpdate
()
{
axios
.
get
(
'
http://localhost:5000/
'
)
.
then
(
response
=>
{
this
.
setState
({
lessons
:
response
.
data
.
images
});
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
}
componentDidMount
()
{
axios
.
get
(
'
http://localhost:5000/
'
)
.
then
(
response
=>
{
this
.
setState
({
lessons
:
response
.
data
.
images
});
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
})
}
onSubmit
(
e
)
{
e
.
preventDefault
();
}
deleteProduct
(
pid
){
axios
.
delete
(
'
http://localhost:5000/delete/
'
+
pid
)
.
then
(
res
=>
console
.
log
(
res
.
data
));
this
.
setState
({
lessons
:
this
.
state
.
lessons
.
filter
(
el
=>
el
.
pid
!==
pid
)
});
}
render
()
{
return
(
<
div
className
=
"
container text-left
"
>
<
div
className
=
"
col-sm-10
"
>
<
hr
/>
<
/div
>
<
br
/>
<
div
className
=
"
col-sm-10
"
>
<
table
className
=
"
table
"
>
<
thead
>
<
tr
>
<
th
><
h6
>
Lesson
No
<
/h6></
th
>
<
th
><
h6
>
Lesson
Name
<
/h6></
th
>
<
th
><
h6
>
File
Name
<
/h6></
th
>
<
th
className
=
"
col-sm-1
"
><
h6
>
Action
<
/h6></
th
>
<
/tr
>
<
/thead
>
<
tbody
>
{
this
.
quantityList
()}
<
/tbody
>
<
/table
>
<
/div
>
<
/div
>
)
}
}
\ No newline at end of file
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/lessonandexampage.js
View file @
bf893f1b
...
...
@@ -44,8 +44,8 @@ export default class LessonAndExam extends Component {
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
img
src
=
{
EX
}
alt
=
"
upload-image
"
style
=
{{
width
:
'
35px
'
}}
/
>
<
hr
/>
<
img
src
=
{
LS
}
alt
=
"
upload-image
"
style
=
{{
width
:
'
35px
'
}}
/
>
<
/div
>
<
/div
>
...
...
@@ -54,8 +54,8 @@ export default class LessonAndExam extends Component {
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
a
href
=
{
'
http://localhost:5000/pdf/
'
+
file
.
filename
}
><
p
style
=
{{
marginTop
:
'
7px
'
}}
>
{
file
.
lessonname
}
<
/p></
a
>
<
br
/>
<
a
href
=
{
'
/question/
'
+
file
.
lessonno
}
><
p
style
=
{{
marginTop
:
'
7px
'
}}
>
Exam
{
file
.
lessonno
}
<
/p></
a
>
<
/div
>
<
/div
>
<
/div
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/question_bank.js
View file @
bf893f1b
...
...
@@ -8,10 +8,10 @@ const Quantity = props => (
<
tr
>
<
td
>
{
props
.
questions
.
lesson_no
}
<
/td
>
<
td
>
{
props
.
questions
.
question_text
}
<
/td
>
<
td
>
{
props
.
questions
.
question_answer
}
<
/td
>
<
td
>
{
props
.
questions
.
question_answer
.
replace
(
"
<pad>
"
,
""
)
}
<
/td
>
<
td
>
<
div
>
<
Link
className
=
"
text-success fas fa-edit
"
to
=
{
"
/questionmanagement/
"
+
props
.
questions
.
_id
}
><
/Link> <span className=" mx-1 text-danger fas fa-trash" href='#' onClick={
()
=>{props.deleteProduct
(
props.questions._id
)
}} ></
span
>
<
Link
className
=
"
text-success fas fa-edit
"
to
=
{
"
/
admin/exam/
questionmanagement/
"
+
props
.
questions
.
_id
}
><
/Link> <span className=" mx-1 text-danger fas fa-trash" href='#' onClick={
()
=>{props.deleteProduct
(
props.questions._id
)
}} ></
span
>
<
/div
>
<
/td
>
<
/tr
>
...
...
@@ -100,12 +100,12 @@ export default class QuestionBankUI extends Component {
<
div
className
=
"
row
"
>
<
div
className
=
"
col-sm-3
"
>
<
Link
style
=
{{
textDecoration
:
"
none
"
}}
to
=
{
"
/questionmanagement
"
}
><
button
className
=
"
btn btn-block btn btn-secondary
"
style
=
{{
color
:
"
white
"
}}
>
Create
new
Question
<
/button></
Link
>
<
Link
style
=
{{
textDecoration
:
"
none
"
}}
to
=
{
"
/
admin/exam/
questionmanagement
"
}
><
button
className
=
"
btn btn-block btn btn-secondary
"
style
=
{{
color
:
"
white
"
}}
>
Create
new
Question
<
/button></
Link
>
<
/div
>
<
div
className
=
"
col-sm-
3
"
>
<
Link
style
=
{{
textDecoration
:
"
none
"
}}
to
=
{
"
/automaticquestion
"
}
><
button
className
=
"
btn btn-block btn btn-info
"
style
=
{{
color
:
"
white
"
}}
>
Auto
Genarate
Question
<
/button></
Link
>
<
div
className
=
"
col-sm-
4
"
>
<
Link
style
=
{{
textDecoration
:
"
none
"
}}
to
=
{
"
/a
dmin/exam/a
utomaticquestion
"
}
><
button
className
=
"
btn btn-block btn btn-info
"
style
=
{{
color
:
"
white
"
}}
>
Auto
Genarate
Question
<
/button></
Link
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/question_layout.js
View file @
bf893f1b
...
...
@@ -99,7 +99,7 @@ export default class QuestionLayout extends Component {
// if (this.state.item_id != null) {
axios
.
get
(
'
http://localhost:5000/questions/
lessonNo/1
'
)
axios
.
get
(
'
http://localhost:5000/questions/
quiz/
'
+
this
.
props
.
match
.
params
.
id
)
.
then
(
response
=>
{
//this.setState({productQuantities: response.data});
let
CategoryList
=
[];
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Student/StudentDashboard.js
View file @
bf893f1b
...
...
@@ -4,6 +4,8 @@ import {Link, Route} from "react-router-dom";
import
{
NavLink
}
from
"
react-router-dom
"
;
import
ALResults
from
"
./ALResults
"
;
import
TestTeacher
from
"
../../Images/defaultimageicon.jpg
"
;
import
LessonAndExam
from
"
../IT18050240/lessonandexampage
"
;
import
Exampage
from
"
../IT18050240/exampage
"
;
export
default
class
StudentDashboard
extends
Component
{
...
...
@@ -383,23 +385,29 @@ export default class StudentDashboard extends Component {
<
li
>
<
a
href
=
"
#
"
>
<
i
className
=
"
metismenu-icon fa fa-
calendar
"
><
/i
>
Discussion
Form
s
<
i
className
=
"
metismenu-icon fa fa-
graduation-cap
"
><
/i
>
My
classe
s
<
i
className
=
"
metismenu-state-icon fa fa-caret-down
"
><
/i
>
<
/a
>
<
ul
>
<
li
>
<
a
href
=
"
#
"
>
<
i
className
=
"
metismenu-icon
"
>
<
/i
>
<
NavLink
to
=
{
"
/studentDashboard
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
19
-
Acc
-
Sasip
<
/a
>
<
/NavLink
>
<
/li
>
<
li
>
<
a
href
=
"
#
"
>
<
NavLink
to
=
{
"
/studentDashboard
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
19
-
Econ
-
Skya
<
/a
>
<
/NavLink
>
<
/li
>
<
li
>
<
NavLink
to
=
{
"
/studentDashboard/lesson
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
19
-
BS
-
Skya
<
/NavLink
>
<
/li
>
<
/ul
>
<
/li
>
...
...
@@ -407,26 +415,50 @@ export default class StudentDashboard extends Component {
<
li
>
<
a
href
=
"
#
"
>
<
i
className
=
"
metismenu-icon fa fa-graduation-cap
"
><
/i
>
My
classes
My
Exam
<
i
className
=
"
metismenu-state-icon fa fa-caret-down
"
><
/i
>
<
/a
>
<
ul
>
<
li
>
<
a
href
=
"
/lesson
"
>
<
NavLink
to
=
{
"
/studentDashboard
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
19
-
Acc
-
Sasip
<
/
a
>
<
/
NavLink
>
<
/li
>
<
li
>
<
a
href
=
"
#
"
>
<
NavLink
to
=
{
"
/studentDashboard
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
19
-
Econ
-
Skya
<
/NavLink
>
<
/li
>
<
li
>
<
NavLink
to
=
{
"
/studentDashboard/exampage
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
19
-
BS
-
Skya
<
/NavLink
>
<
/li
>
<
/ul
>
<
/li
>
<
li
>
<
a
href
=
"
#
"
>
<
i
className
=
"
metismenu-icon fa fa-calendar
"
><
/i
>
Discussion
Forms
<
i
className
=
"
metismenu-state-icon fa fa-caret-down
"
><
/i
>
<
/a
>
<
ul
>
<
li
>
<
a
href
=
"
#
"
>
<
i
className
=
"
metismenu-icon
"
>
<
/i
>
19
-
Acc
-
Sasip
<
/a
>
<
/li
>
<
li
>
<
a
href
=
"
#
"
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
19
-
BS
-
Skya
19
-
Econ
-
Skya
<
/a
>
<
/li
>
<
/ul
>
...
...
@@ -496,6 +528,8 @@ export default class StudentDashboard extends Component {
<
Route
path
=
"
/studentDashboard/ALResults
"
exact
component
=
{
ALResults
}
/
>
{
/* <Route path="/admin/finance/add" exact component={AddFinance} />*/
}
{
/* <Route path={"/admin/finance/edit/:id"} exact component={EditFinance}/>*/
}
<
Route
path
=
"
/studentDashboard/exampage
"
exact
component
=
{
Exampage
}
/
>
<
Route
path
=
"
/studentDashboard/lesson
"
exact
component
=
{
LessonAndExam
}
/
>
<
/div
>
{
/* Footer */
}
...
...
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