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
274a44c9
Commit
274a44c9
authored
Nov 17, 2021
by
Devinda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix automatic_question
parent
7302e815
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/automatic_question.js
...-frontend/src/Components/IT18050240/automatic_question.js
+23
-12
No files found.
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/automatic_question.js
View file @
274a44c9
...
...
@@ -48,7 +48,7 @@ export default class Automatic_question extends Component {
}
onSubmit
(
e
)
{
async
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){
...
...
@@ -59,19 +59,30 @@ export default class Automatic_question extends Component {
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
,
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
"
);
let
options
=
{
uri
:
'
http://127.0.0.1:5000/generate
'
,
body
:
JSON
.
stringify
(
newQuestion
),
method
:
'
POST
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
}
let
response
=
await
axios
.
post
(
options
.
uri
,
options
.
body
);
console
.
log
(
response
.
data
.
result
);
// 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");
}
...
...
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