Commit 371e1ed9 authored by Jérémie Passerat's avatar Jérémie Passerat

Correction bug affichage note d'un contenu

parent 722cf5cf
...@@ -287,7 +287,9 @@ export default { ...@@ -287,7 +287,9 @@ export default {
calculerNoteContenu: function() { calculerNoteContenu: function() {
if (this.sourceContenu !== "moodle" && this.contenuCliqueProvenance !== "") { if (this.sourceContenu !== "moodle" && this.contenuCliqueProvenance !== "") {
console.log (parseInt(this.versionChoisie) + " " + this.versionMax)
if (parseInt(this.versionChoisie) !== this.versionMax) { if (parseInt(this.versionChoisie) !== this.versionMax) {
console.log("Ici")
for (let it in this.contenuClique.historique) { for (let it in this.contenuClique.historique) {
if (this.contenuClique.historique[it].numero === parseInt(this.versionChoisie)) { if (this.contenuClique.historique[it].numero === parseInt(this.versionChoisie)) {
if (this.contenuClique.historique[it].note === 0) { if (this.contenuClique.historique[it].note === 0) {
...@@ -298,6 +300,7 @@ export default { ...@@ -298,6 +300,7 @@ export default {
} }
return -1 return -1
} else { } else {
console.log("Là")
if (this.contenuClique.versionEnCours.note === 0) { if (this.contenuClique.versionEnCours.note === 0) {
return 0 return 0
} }
...@@ -328,9 +331,11 @@ export default { ...@@ -328,9 +331,11 @@ export default {
if (this.contenuCliqueProvenance === 'perso') { if (this.contenuCliqueProvenance === 'perso') {
this.versionMax = this.contenuClique.versionEnCours.numero this.versionMax = this.contenuClique.versionEnCours.numero
alert(this.versionMax)
this.versionChoisie = this.versionMax this.versionChoisie = this.versionMax
} else { } else {
this.versionChoisie = this.contenuClique.version this.versionChoisie = this.contenuClique.version
this.versionMax = this.versionChoisie
} }
let that = this let that = this
...@@ -342,7 +347,7 @@ export default { ...@@ -342,7 +347,7 @@ export default {
if (nombre !== '-') { if (nombre !== '-') {
//nombre = JSON.parse(nombre) //nombre = JSON.parse(nombre)
//that.rating = nombre.note //that.rating = nombre.note
that.rating = nombre that.rating = parseInt(nombre)
that.notePresente = true that.notePresente = true
} }
}) })
......
...@@ -2,8 +2,8 @@ import axios from 'axios' ...@@ -2,8 +2,8 @@ import axios from 'axios'
import jwt from "jsonwebtoken"; import jwt from "jsonwebtoken";
//import Service from "@/service/Service"; //import Service from "@/service/Service";
const urlBase = "http://127.0.0.1:5000/" //const urlBase = "http://127.0.0.1:5000/"
//const urlBase = "http://193.70.2.155/api/" const urlBase = "http://193.70.2.155/api/"
const users = "utilisateurs/" const users = "utilisateurs/"
const contenus = "contenus/" const contenus = "contenus/"
const en_cours = "en_cours/" const en_cours = "en_cours/"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment