Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heuristic issues #456

Merged
merged 14 commits into from
Apr 23, 2024
41 changes: 10 additions & 31 deletions src/components/atoms/ListComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<v-avatar tile :color="generateColor()" style="color: #545454">
<span
v-if="type === 'myTemplates' || type === 'publicTemplates'"
>{{ item.header.templateTitle[0].toUpperCase() }}</span>
>{{ item.header.templateTitle[0].toUpperCase() }}</span
>
<span v-else>{{ item.testTitle[0].toUpperCase() }}</span>
</v-avatar>
</v-list-item-avatar>
Expand Down Expand Up @@ -41,8 +42,8 @@
item.testAdmin
? item.testAdmin.email
: item.header
? item.header.templateAuthor.userEmail
: ''
? item.header.templateAuthor.userEmail
: ''
}}</strong>
</v-list-item-subtitle>
</v-list-item-content>
Expand All @@ -52,14 +53,6 @@
<v-list-item-action-text
v-if="item.accessLevel != null && item.accessLevel != undefined"
>
<v-chip
label
outlined
class="my-1"
:color="getAccessLevelColor(item.accessLevel)"
>
{{ getAccessLevelText(item.accessLevel) }}
</v-chip>
</v-list-item-action-text>
<v-list-item-action-text v-if="item.updateDate">
<v-row class="ma-0" align="center">
Expand All @@ -86,10 +79,8 @@
</v-tooltip>
<v-tooltip v-else-if="type === 'sharedWithMe'" top>
<template v-slot:activator="{ on, attrs }">
<v-row v-bind="attrs" v-on="on">
<div class="caption">
{{ item.progress }}%
</div>
<v-row class="mr-3" v-bind="attrs" v-on="on">
<div class="caption">{{ item.progress }}%</div>

<v-progress-circular
rotate="-90"
Expand Down Expand Up @@ -134,10 +125,12 @@
type === 'publicTests' ||
type === 'sharedWithMe'
"
>{{ $t('pages.listTests.noTests') }}</span>
>{{ $t('pages.listTests.noTests') }}</span
>
<span
v-else-if="type === 'myTemplates' || type === 'publicTemplates'"
>{{ $t('pages.listTests.noTemplates') }}</span>
>{{ $t('pages.listTests.noTemplates') }}</span
>
</v-row>
</v-list>
</div>
Expand Down Expand Up @@ -200,20 +193,6 @@ export default {
const d = new Date(date)
return d.toLocaleString()
},
getAccessLevelText(accessLevel) {
return accessLevel === 0
? 'Administrator'
: accessLevel === 1
? 'Evaluator'
: 'Guest'
},
getAccessLevelColor(accessLevel) {
return accessLevel === 0
? 'primary'
: accessLevel === 1
? 'secondary'
: 'warning'
},
generateColor() {
const hue = Math.floor(Math.random() * 360)
const color = 'hsl(' + hue + ', 80%, 80%)'
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/NotificationButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default {
user: this.user,
})
// Redirect to notification url
window.open(notification.redirectsTo)
this.$router.go(`${notification.redirectsTo}`)
},
checkIfHasNewNotifications() {
const newNot = this.user.notifications.filter((n) => n.read === false)
Expand Down
2 changes: 0 additions & 2 deletions src/components/molecules/FeedbackView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export default {
},
methods: {
async toggleScreen() {
console.log('toggleScreen')
if (!this.isSharingScreen) {
await this.$refs.VideoCall.switchMediaStream()
this.isSharingScreen = true
Expand All @@ -119,7 +118,6 @@ export default {
const audioTrack = this.localStream
.getTracks()
.find((track) => track.kind == 'audio')
console.log(audioTrack)
audioTrack.enabled = !audioTrack.enabled
this.isMicrophoneMuted = !audioTrack.enabled
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/molecules/ListTasks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ export default {
},
deleteItem(item) {
const index = this.allTasks.indexOf(item)
console.log(index)
confirm('Are you sure you want to delete this task?')
console.log(item)
this.allTasks.splice(index, 1)
},
addTask() {
Expand Down
6 changes: 3 additions & 3 deletions src/components/molecules/TemplateInfoDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
template.header.templateVersion == '1.0.0'
? ` on ${getFormattedDate(template.header.creationDate)}`
: ` - Last updated: ${getFormattedDate(
template.header.updateDate,
)}`
template.header.updateDate,
)}`
}}
({{
$t('pages.listTests.version') +
Expand Down Expand Up @@ -185,7 +185,7 @@ export default {

methods: {
async deleteTemplate() {
if (!confirm($t('alerts.deleteTest'))) return
if (!confirm('are you sure, you to delete the template?')) return

await this.$store.dispatch('deleteTemplate', this.template.id)
this.reset()
Expand Down
7 changes: 0 additions & 7 deletions src/components/molecules/VideoCall.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export default {

const roomSnapshot = await getDoc(roomRef)

console.log('Got room:', roomSnapshot.exists)

if (roomSnapshot.exists) {
this.peerConnection = new RTCPeerConnection(this.configuration)
Expand Down Expand Up @@ -273,7 +272,6 @@ export default {
}
},
async hangUp() {
console.log('hang up')
const tracks = this.localStream.getTracks()
tracks.forEach((track) => {
track.stop()
Expand Down Expand Up @@ -302,28 +300,23 @@ export default {
// Verificando se o documento da sala existe antes de tentar excluí-lo
const roomSnapshot = await getDoc(roomRef)
if (roomSnapshot.exists()) {
console.log('Room document exists. Deleting...')

const calleeCandidatesSnapshot = await getDocs(
collection(roomRef, 'calleeCandidates'),
)
calleeCandidatesSnapshot.forEach(async (candidate) => {
await deleteDoc(candidate.ref)
console.log('Deleted callee candidate:', candidate.id)
})

const callerCandidatesSnapshot = await getDocs(
collection(roomRef, 'callerCandidates'),
)
callerCandidatesSnapshot.forEach(async (candidate) => {
await deleteDoc(candidate.ref)
console.log('Deleted caller candidate:', candidate.id)
})

await deleteDoc(roomRef)
console.log('Deleted room document:', this.roomId)
} else {
console.log('Room document does not exist.')
}
} catch (error) {
console.error('Error deleting room and candidates:', error)
Expand Down
2 changes: 0 additions & 2 deletions src/components/organisms/GeneralAnalytics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ export default {
},
},
created() {
console.log(this.test)
let i = 0
this.testStructure.userTasks.forEach((task) => {
this.testTasks[i] = task.taskName
Expand Down Expand Up @@ -400,7 +399,6 @@ export default {

this.taskAnswers.forEach((answer) => {
if (answer.lastUpdate > this.taskAnswers[0].lastUpdate) {
console.log('entrou no for')
latestResponse = answer.userDocId
lastUpdate = answer.lastUpdate
}
Expand Down
22 changes: 2 additions & 20 deletions src/components/organisms/HeuristicsAnalytics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
<v-col class="ma-0 pa-0" cols="2">
<v-list outlined rounded dense height="560px">
<v-subheader>Heuristics</v-subheader>
{{ resultHeuristics.length }}
{{ heuristicsLength }}
<v-divider />
<v-list
color="grey-lighten-3"
Expand All @@ -23,7 +21,6 @@
class="list-scroll"
>
<v-list-item-group v-model="heuristicSelect" color="#fca326">

<v-list-item v-for="(item, i) in resultHeuristics" :key="i">
<v-list-item-content>
<v-list-item-title>{{ item.id }}</v-list-item-title>
Expand Down Expand Up @@ -85,6 +82,7 @@
test.testStructure[heuristicSelect]
"
class="ma-0 pa-0"
cols="7"
>
<v-card outlined rounded flat height="560px" elevation-0>
<v-subheader v-if="questionSelect != -1" class="pa-2">
Expand Down Expand Up @@ -253,6 +251,7 @@ export default {
},
)
}

return header
},
itemsHeuristic() {
Expand All @@ -270,7 +269,6 @@ export default {
})
},
)
console.log('aaaaaa ', this.resultHeuristics)
}
return items
},
Expand Down Expand Up @@ -307,12 +305,6 @@ export default {
test() {
return this.$store.getters.test
},
heuristics() {
return this.$store.state.Tests.Test.testStructure || []
},
heuristicsLength() {
return this.heuristics.length
},
},
watch: {
answers() {
Expand Down Expand Up @@ -344,9 +336,6 @@ export default {
let index = 0

for (const uid in this.answers) {

//console.log('answers ', this.answers)

if (!this.answers[uid]) {
continue
}
Expand All @@ -356,8 +345,6 @@ export default {
let SelectHeuristic = this.resultHeuristics.find(
(h) => h.id === `H${index}`,
)
//console.log('heuristic ' , heuristic)
//console.log('resultHeuristics ', this.resultHeuristics)

if (!SelectHeuristic) {
this.resultHeuristics.push({
Expand All @@ -370,9 +357,6 @@ export default {
]
}

//console.log('SelectHeuristic ',SelectHeuristic)
//console.log('heuristicQuestions', heuristic.heuristicQuestions)

heuristic.heuristicQuestions.forEach((hQuestion) => {
hQuestion.heuristicQuestions.forEach((question, qIndex) => {
const selectQuestion = SelectHeuristic.questions.find(
Expand Down Expand Up @@ -401,9 +385,7 @@ export default {
})

index++
// console.log(uid)
}

},
goToCoops() {
this.$emit('goToCoops')
Expand Down
1 change: 1 addition & 0 deletions src/components/organisms/UnmoderatedCoopsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ export default {
author: `${this.test.testAdmin.email}`,
read: false,
testId: this.test.id,
accessLevel: this.roleOptions[this.selectedRole].value,
}),
})
}
Expand Down
1 change: 0 additions & 1 deletion src/controllers/TestController.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default class TestController extends Controller {
// return await super.delete(COLLECTION, payload.id)
// }
async deleteTest(payload) {
console.log(payload)
try {
console.log('Inicio do delete test')
const testToDelete = await super.readOne(COLLECTION, payload.id)
Expand Down
9 changes: 3 additions & 6 deletions src/controllers/UserController.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export default class UserController extends Controller {

async markNotificationAsRead(payload) {
const userToUpdate = new User(payload.user)
console.log(userToUpdate)
const index = userToUpdate.notifications.findIndex(
(n) => n.createdDate === payload.notification.createdDate,
)
Expand Down Expand Up @@ -80,9 +79,10 @@ export default class UserController extends Controller {
userData.notifications = userData.notifications.filter(
(notification) => notification.testId !== testId,
)
console.log('depois do filtro: ', userData.notifications)
// Atualizar o documento do usuário com as notificações filtradas
await super.update('users', userId, { notifications: userData.notifications })
await super.update('users', userId, {
notifications: userData.notifications,
})
}
} else {
console.log(`User document with ID ${userDocID} not found.`)
Expand Down Expand Up @@ -114,7 +114,6 @@ export default class UserController extends Controller {
delete userData.myAnswers[testIdToRemove]
}


await super.update('users', userId, userData)

console.log(`Test ${testIdToRemove} removed from user ${userId}'s data.`)
Expand All @@ -123,6 +122,4 @@ export default class UserController extends Controller {
throw error
}
}


}
Loading
Loading