From c7fb298e4f74dd528567ed60b67ce148ff86b015 Mon Sep 17 00:00:00 2001 From: dev sp Date: Sat, 2 Dec 2023 16:16:02 +0000 Subject: [PATCH] cha --- src/components/MCQQuestion.vue | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/components/MCQQuestion.vue b/src/components/MCQQuestion.vue index 0745330..035ae57 100644 --- a/src/components/MCQQuestion.vue +++ b/src/components/MCQQuestion.vue @@ -40,6 +40,10 @@ +
+

Now you can submit your answer

+ +
No Data Found
@@ -94,6 +98,25 @@ export default { this.getNextQs(); } }, + submitAnswer(){ + fetch(`https://api8.siliconpin.com/items/users_answers`, { + method: 'POST', + headers: { + 'Content-Type' : 'application/json', + }, + body: JSON.stringify({ answers: this.totalAnswer }) + }) + .then(response => { + if(response.ok){ + console.log('Data Saved Succesfully') + } else{ + console.log('Something Wrong') + } + }) + .catch(error => { + console.error('an error occoured', error) + }) + }, getNextQs() { this.qPoint++; this.qsActive=this.qsData[this.qPoint];