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
7302e815
Commit
7302e815
authored
Nov 15, 2021
by
Devinda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add automatic_question/ lessonandexampage page
parent
8ad7b64d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
12 deletions
+92
-12
BackEnd/WebBackEnd/routes/question.route.js
BackEnd/WebBackEnd/routes/question.route.js
+1
-1
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/automatic_question.js
...-frontend/src/Components/IT18050240/automatic_question.js
+90
-11
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/lessonandexampage.js
...h-frontend/src/Components/IT18050240/lessonandexampage.js
+1
-0
No files found.
BackEnd/WebBackEnd/routes/question.route.js
View file @
7302e815
...
...
@@ -74,7 +74,7 @@ questionRouter.route('/update/:id').post((req, res) => {
});
});
questionRouter
.
route
(
'
/lessonNo/:id
'
).
get
(
function
(
req
,
res
)
{
questionRouter
.
route
(
'
c
'
).
get
(
function
(
req
,
res
)
{
console
.
log
(
"
Product Item ID
"
);
console
.
log
(
req
.
params
.
id
);
let
id
=
req
.
params
.
id
;
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/automatic_question.js
View file @
7302e815
...
...
@@ -2,36 +2,113 @@ import React, { Component } from 'react';
import
axios
from
'
axios
'
;
//import swal from 'sweetalert';
import
{
Link
}
from
"
react-router-dom
"
;
import
swal
from
"
sweetalert
"
;
export
default
class
Automatic_question
extends
Component
{
constructor
(
props
){
super
(
props
);
this
.
onChangeLessonNo
=
this
.
onChangeLessonNo
.
bind
(
this
);
this
.
onChangeLessonName
=
this
.
onChangeLessonName
.
bind
(
this
);
this
.
onChangeDefultMark
=
this
.
onChangeDefultMark
.
bind
(
this
);
this
.
onChangeFeedBack
=
this
.
onChangeFeedBack
.
bind
(
this
);
this
.
onSubmit
=
this
.
onSubmit
.
bind
(
this
);
this
.
state
=
{
lesson_no
:
''
,
lesson_name
:
''
,
defult_mark
:
''
,
general_feedback
:
''
,
}
}
onChangeLessonNo
(
e
){
this
.
setState
({
lesson_no
:
e
.
target
.
value
});
}
onChangeLessonName
(
e
){
this
.
setState
({
lesson_name
:
e
.
target
.
value
});
}
onChangeDefultMark
(
e
){
this
.
setState
({
defult_mark
:
e
.
target
.
value
});
}
onChangeFeedBack
(
e
){
this
.
setState
({
general_feedback
:
e
.
target
.
value
});
}
onSubmit
(
e
){
e
.
preventDefault
();
//if(this.state.item_name != null && this.state.item_description != null && this.state.item_category != null && this.state.item_quantity != null && this.state.item_price){
console
.
log
(
`Form submitted:`
);
console
.
log
(
`Lesson Name:
${
this
.
state
.
lesson_name
}
`
);
console
.
log
(
`Lesson No:
${
this
.
state
.
lesson_no
}
`
);
console
.
log
(
`Defualt mark:
${
this
.
state
.
defult_mark
}
`
);
console
.
log
(
`Genaral Feedback:
${
this
.
state
.
general_feedback
}
`
);
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
,
};
axios
.
post
(
'
http://127.0.0.1:5000/generate
'
)
.
then
(
res
=>
{
this
.
setState
({
question_id
:
res
.
data
.
question_id
})
})
.
catch
(
//swal("Good job!", "You clicked the button!", "warning"
);
swal
(
"
Data Saved Successfully!
"
,
"
Your Details has been Saved Successfully!
"
,
"
success
"
);
}
render
()
{
return
(
<
div
className
=
"
container
"
>
<
form
onSubmit
=
{
this
.
onSubmit
}
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-sm-5
"
>
<
label
>
Lesson
n
ame
:
<
/label
>
<
label
>
Lesson
n
o
:
<
/label
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
input
type
=
"
text
"
required
className
=
"
form-control
"
onChange
=
{
event
=>
this
.
setState
({
})}
<
input
type
=
"
text
"
required
className
=
"
form-control
"
value
=
{
this
.
state
.
lesson_no
}
onChange
=
{
this
.
onChangeLessonNo
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"
col-sm-5
"
>
<
label
>
Lesson
n
o
:
<
/label
>
<
label
>
Lesson
n
ame
:
<
/label
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
input
type
=
"
text
"
required
className
=
"
form-control
"
onChange
=
{
event
=>
this
.
setState
({
})}
/
>
<
input
type
=
"
text
"
required
className
=
"
form-control
"
value
=
{
this
.
state
.
lesson_name
}
onChange
=
{
this
.
onChangeLessonName
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"
col-sm-5
"
>
<
label
>
defult_mark
:
<
/label
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
input
type
=
"
text
"
required
className
=
"
form-control
"
onChange
=
{
event
=>
this
.
setState
({
})}
<
input
type
=
"
text
"
required
className
=
"
form-control
"
value
=
{
this
.
state
.
defult_mark
}
onChange
=
{
this
.
onChangeDefultMark
}
/
>
<
/div
>
<
/div
>
...
...
@@ -39,8 +116,10 @@ export default class Automatic_question extends Component {
<
div
className
=
"
col-sm-5
"
>
<
label
>
general_feedback
:
<
/label
>
<
div
style
=
{{
padding
:
'
0px
'
}}
>
<
input
type
=
"
text
"
required
className
=
"
form-control
"
onChange
=
{
event
=>
this
.
setState
({
})}
<
input
type
=
"
text
"
required
className
=
"
form-control
"
value
=
{
this
.
state
.
general_feedback
}
onChange
=
{
this
.
onChangeFeedBack
}
/
>
<
/div
>
<
/div
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/lessonandexampage.js
View file @
7302e815
...
...
@@ -20,6 +20,7 @@ export default class LessonAndExam extends Component {
let
quizLessonTemp
=
[]
axios
.
get
(
'
http://localhost:5000/
'
)
.
then
(
response
=>
{
console
.
log
(
response
);
this
.
setState
({
lessonList
:
response
.
data
.
images
});
console
.
log
(
this
.
state
.
lessonList
.
length
)
})
...
...
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