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
fcf1730d
Commit
fcf1730d
authored
Nov 24, 2021
by
Devinda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix automatic_question generation
parent
274a44c9
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
423 additions
and
105 deletions
+423
-105
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/src/App.js
WebFrontEnd/smartcoach-frontend/src/App.js
+8
-3
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
+55
-54
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/admin_question_management.js.js
...src/Components/IT18050240/admin_question_management.js.js
+1
-4
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/automatic_question.js
...-frontend/src/Components/IT18050240/automatic_question.js
+49
-17
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/routes/pdf.route.js
View file @
fcf1730d
...
...
@@ -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 @
fcf1730d
...
...
@@ -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/src/App.js
View file @
fcf1730d
...
...
@@ -19,6 +19,7 @@ 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
"
;
function
App
()
{
return
(
...
...
@@ -30,7 +31,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
=
"
/studentDashboard
"
exact
component
=
{
StudentDashboard
}
/
>
{
/*<Route path="/" exact component={Dashboard}/>*/
}
...
...
@@ -38,13 +39,17 @@ function App() {
<
Route
path
=
"
/admin
"
><
Dashboard
/><
/Route
>
<
Route
path
=
"
/studentDashboard
"
><
StudentDashboard
/><
/Route
>
<
Route
path
=
"
/questiondetails
"
exact
component
=
{
QuestionDetails
}
/
>
<
Route
path
=
"
/question/:id
"
exact
component
=
{
QuestionLayout
}
/
>
<
Route
path
=
"
/question
s/quiz
/:id
"
exact
component
=
{
QuestionLayout
}
/
>
<
Route
path
=
"
/questionmanagement/:id
"
exact
component
=
{
AdminQuestionManagement
}
/
>
<
Route
path
=
"
/questionbank
"
exact
component
=
{
QuestionBank
}
/
>
<
Route
path
=
"
/questionmanagement
"
exact
component
=
{
AdminQuestionManagement
}
/
>
<
Route
path
=
"
/lesson
"
exact
component
=
{
LessonAndExam
}
/
>
<
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 @
fcf1730d
...
...
@@ -8,6 +8,11 @@ import EditFinance from './edit_financial_details';
import
AddClass
from
'
./add_class_details
'
;
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
"
;
export
default
class
Dashboard
extends
Component
{
...
...
@@ -390,7 +395,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
>
...
...
@@ -406,11 +411,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
>
...
...
@@ -523,6 +535,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
}
/
>
<
/div
>
{
/* Footer */
}
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/UploadPage.tsx
View file @
fcf1730d
...
...
@@ -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,30 @@ 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 @
fcf1730d
...
...
@@ -188,10 +188,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 +210,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
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/automatic_question.js
View file @
fcf1730d
...
...
@@ -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
,
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
'
}}
>
...
...
@@ -134,26 +164,28 @@ export default class Automatic_question extends Component {
/
>
<
/div
>
<
/div
>
<
div
className
=
"
col-sm-5
"
>
<
label
>
Browse
file
:
<
/label
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
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 @
fcf1730d
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 @
fcf1730d
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 @
fcf1730d
...
...
@@ -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 @
fcf1730d
...
...
@@ -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 @
fcf1730d
...
...
@@ -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 @
fcf1730d
...
...
@@ -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
{
...
...
@@ -381,23 +383,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
>
...
...
@@ -405,26 +413,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
>
...
...
@@ -494,6 +526,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