Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-136
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
1
Merge Requests
1
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-136
2021-136
Commits
11ee80e4
Commit
11ee80e4
authored
Nov 26, 2021
by
Ariyasuthan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload Front end
parent
7350d2db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
0 deletions
+109
-0
Front End/ShowQuestions.vue
Front End/ShowQuestions.vue
+109
-0
No files found.
Front End/ShowQuestions.vue
0 → 100644
View file @
11ee80e4
<
template
>
<TopBar></TopBar>
<div
class=
"show-questions"
>
<p>
Questions
</p>
<template
v-for=
"n in showQuestions"
:key=
"n"
style=
"font-size:20px;"
>
{{
n
}}
<br
/>
<!--
<option
v-for=
"n in subtopicsList.உயிரியல் "
:key=
"n"
>
{{
n
}}
</option>
-->
</
template
>
<!-- <h7>{{showQuestions}}</h7> -->
<div>
<router-link
to=
"/quiz"
style=
"color: blue; font-size: 25px; font-weight: bold; "
>
next
</router-link>
</div>
</div>
</template>
<
script
>
// import axios from 'axios'
import
TopBar
from
"
../components/TopBar.vue
"
export
default
{
name
:
'
Show Questions
'
,
components
:{
TopBar
},
data
(){
return
{
questions
:
[]
,
AllQuestions
:[],
showQuestions
:[]
}
},
async
beforeCreate
(){
const
result
=
await
axios
.
get
(
"
https://8683-35-196-1-82.ngrok.io/predict
"
)
// this.questions=Object.values(result.data)
const
ques
=
result
.
data
fetch
(
"
http://localhost:3000/RecommendationQuestions
"
)
.
then
((
response
)
=>
response
.
json
())
.
then
((
question
)
=>
{
for
(
var
value
of
Object
.
values
(
question
))
{
this
.
AllQuestions
.
push
(
value
)
}
for
(
let
i
=
0
;
i
<
ques
.
length
;
i
++
)
{
// Loop for array2
for
(
let
j
=
0
;
j
<
this
.
AllQuestions
.
length
;
j
++
)
{
// Compare the element of each and
// every element from both of the
// arrays
if
(
ques
[
i
]
===
this
.
AllQuestions
[
j
].
id
)
{
// Return if common element found
this
.
showQuestions
.
push
({
question
:
this
.
AllQuestions
[
j
].
question
,
answer
:
this
.
AllQuestions
[
j
].
answer
})
}
}
}
});
console
.
log
(
'
success
'
)
.
catch
(
error
=>
console
.
log
(
error
))
},
methods
:{
}
}
</
script
>
<
style
scoped
>
.show-questions
{
max-height
:
100%
;
background-color
:
white
!important
;
border
:
black
!important
;
width
:
60%
;
justify-content
:
center
!important
;
left
:
20%
!important
;
margin
:
5%
20%
;
border-radius
:
8px
;
}
p
{
color
:
black
;
font-size
:
75px
;
position
:
relative
;
font-weight
:
bolder
;
}
h7
{
color
:
red
;
position
:
relative
;
font-size
:
6vh
;
font-weight
:
bolder
;
}
.router-link-text
{
color
:
blue
;
font-size
:
2vh
;
font-weight
:
bold
;
}
</
style
>
\ No newline at end of file
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