Spaces:
Sleeping
Sleeping
Guardado de calificaciones con sus respectivos valores en tecnica escalas
Browse files- tecnicas/admin.py +13 -17
- tecnicas/controllers/models_controller/calificacion_controller.py +20 -10
- tecnicas/controllers/models_controller/dato_controller.py +44 -3
- tecnicas/controllers/views_controller/api_rating_controller.py +68 -4
- tecnicas/models/dato_valor.py +2 -2
- tecnicas/static/js/created-scale.js +4 -2
- tecnicas/views/apis/rating_word.py +21 -13
- tecnicas/views/login_tester.py +2 -0
- tecnicas/views/tester_forms/convencional_scales.py +3 -3
tecnicas/admin.py
CHANGED
|
@@ -1,29 +1,20 @@
|
|
| 1 |
from django.contrib import admin
|
| 2 |
|
| 3 |
-
from .models import CategoriaTecnica
|
| 4 |
-
from .models import TipoTecnica
|
| 5 |
-
from .models import TipoEscala
|
| 6 |
-
from .models import EstiloPalabra
|
| 7 |
|
| 8 |
-
from .models import Catador
|
| 9 |
-
from .models import Presentador
|
| 10 |
|
| 11 |
-
from .models import Tecnica
|
| 12 |
-
from .models import SesionSensorial
|
| 13 |
|
| 14 |
-
from .models import EsAtributo
|
| 15 |
-
from .models import Palabra
|
| 16 |
|
| 17 |
-
from .models import Etiqueta
|
| 18 |
|
| 19 |
-
from .models import
|
| 20 |
-
from .models import EtiquetasEscala
|
| 21 |
|
| 22 |
-
from .models import
|
| 23 |
-
from .models import Participacion
|
| 24 |
|
| 25 |
-
from .models import
|
| 26 |
-
from .models import Posicion
|
| 27 |
|
| 28 |
# Register your models here.
|
| 29 |
admin.site.register(CategoriaTecnica)
|
|
@@ -49,3 +40,8 @@ admin.site.register(Participacion)
|
|
| 49 |
|
| 50 |
admin.site.register(Orden)
|
| 51 |
admin.site.register(Posicion)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from django.contrib import admin
|
| 2 |
|
| 3 |
+
from .models import CategoriaTecnica, TipoTecnica, TipoEscala, EstiloPalabra
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
from .models import Catador, Presentador
|
|
|
|
| 6 |
|
| 7 |
+
from .models import Tecnica, SesionSensorial
|
|
|
|
| 8 |
|
| 9 |
+
from .models import EsAtributo, Palabra
|
|
|
|
| 10 |
|
| 11 |
+
from .models import Etiqueta, Escala, EtiquetasEscala
|
| 12 |
|
| 13 |
+
from .models import Producto, Participacion
|
|
|
|
| 14 |
|
| 15 |
+
from .models import Orden, Posicion
|
|
|
|
| 16 |
|
| 17 |
+
from .models import Dato, ValorDecimal, ValorBooleano, Calificacion
|
|
|
|
| 18 |
|
| 19 |
# Register your models here.
|
| 20 |
admin.site.register(CategoriaTecnica)
|
|
|
|
| 40 |
|
| 41 |
admin.site.register(Orden)
|
| 42 |
admin.site.register(Posicion)
|
| 43 |
+
|
| 44 |
+
admin.site.register(Dato)
|
| 45 |
+
admin.site.register(ValorDecimal)
|
| 46 |
+
admin.site.register(ValorBooleano)
|
| 47 |
+
admin.site.register(Calificacion)
|
tecnicas/controllers/models_controller/calificacion_controller.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
-
from ...models import Calificacion, Tecnica, Posicion, Producto, Catador
|
| 2 |
-
from ...utils import controller_error, getId
|
| 3 |
from django.core.exceptions import ValidationError
|
|
|
|
| 4 |
from collections import defaultdict
|
|
|
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
class CalificacionController():
|
|
@@ -15,21 +16,30 @@ class CalificacionController():
|
|
| 15 |
|
| 16 |
self.rating = Calificacion(**atributes)
|
| 17 |
|
| 18 |
-
def
|
| 19 |
try:
|
| 20 |
-
self.rating.
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
self.rating.num_repeticion = self.rating.id_tecnica.repeticion
|
|
|
|
|
|
|
| 23 |
except ValidationError as e:
|
| 24 |
-
return controller_error(e
|
| 25 |
|
| 26 |
def saveRating(self):
|
| 27 |
try:
|
| 28 |
-
self.rating.full_clean()
|
| 29 |
self.rating.save()
|
| 30 |
return self.rating
|
| 31 |
except ValidationError as e:
|
| 32 |
-
return controller_error(e
|
| 33 |
|
| 34 |
@staticmethod
|
| 35 |
def getRatingsByTechnique(technique: Tecnica):
|
|
@@ -120,9 +130,9 @@ class CalificacionController():
|
|
| 120 |
ratings_dict[rat.id_producto.id].append(rat)
|
| 121 |
|
| 122 |
for index, product in enumerate(check_products):
|
| 123 |
-
|
| 124 |
|
| 125 |
-
if
|
| 126 |
return positions[index]
|
| 127 |
|
| 128 |
return controller_error("Sin productos por calificar")
|
|
|
|
|
|
|
|
|
|
| 1 |
from django.core.exceptions import ValidationError
|
| 2 |
+
from django.db import DatabaseError
|
| 3 |
from collections import defaultdict
|
| 4 |
+
from ...models import Calificacion, Tecnica, Posicion, Producto, Catador
|
| 5 |
+
from ...utils import controller_error, getId
|
| 6 |
|
| 7 |
|
| 8 |
class CalificacionController():
|
|
|
|
| 16 |
|
| 17 |
self.rating = Calificacion(**atributes)
|
| 18 |
|
| 19 |
+
def validateRating(self):
|
| 20 |
try:
|
| 21 |
+
self.rating.clean()
|
| 22 |
+
return self.rating
|
| 23 |
+
except ValidationError as e:
|
| 24 |
+
return controller_error("No es posible validar la calificación")
|
| 25 |
+
|
| 26 |
+
def setRepetition(self, repetition: int = None) -> int | dict:
|
| 27 |
+
try:
|
| 28 |
+
if repetition is not None:
|
| 29 |
+
self.rating.num_repeticion = repetition
|
| 30 |
+
else:
|
| 31 |
self.rating.num_repeticion = self.rating.id_tecnica.repeticion
|
| 32 |
+
|
| 33 |
+
return self.rating.num_repeticion
|
| 34 |
except ValidationError as e:
|
| 35 |
+
return controller_error(e)
|
| 36 |
|
| 37 |
def saveRating(self):
|
| 38 |
try:
|
|
|
|
| 39 |
self.rating.save()
|
| 40 |
return self.rating
|
| 41 |
except ValidationError as e:
|
| 42 |
+
return controller_error(e)
|
| 43 |
|
| 44 |
@staticmethod
|
| 45 |
def getRatingsByTechnique(technique: Tecnica):
|
|
|
|
| 130 |
ratings_dict[rat.id_producto.id].append(rat)
|
| 131 |
|
| 132 |
for index, product in enumerate(check_products):
|
| 133 |
+
ratings_of_product = ratings_dict.get(product.id, [])
|
| 134 |
|
| 135 |
+
if len(ratings_of_product) < num_words or len(ratings_of_product) == 0:
|
| 136 |
return positions[index]
|
| 137 |
|
| 138 |
return controller_error("Sin productos por calificar")
|
tecnicas/controllers/models_controller/dato_controller.py
CHANGED
|
@@ -1,27 +1,68 @@
|
|
| 1 |
-
from ...models import Calificacion, Dato, Palabra
|
| 2 |
from ...utils import controller_error, getId
|
| 3 |
from django.core.exceptions import ValidationError
|
| 4 |
|
| 5 |
|
| 6 |
class DatoController():
|
| 7 |
-
def __init__(self, word: Palabra | int, rating: Calificacion | int):
|
| 8 |
atributes = {
|
| 9 |
"id_palabra_id": getId(word),
|
| 10 |
"id_calificacion_id": getId(rating)
|
| 11 |
}
|
| 12 |
|
| 13 |
self.data = Dato(**atributes)
|
|
|
|
| 14 |
|
| 15 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
try:
|
| 17 |
self.data.full_clean()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
self.data.save()
|
| 19 |
return self.data
|
| 20 |
except ValidationError as e:
|
| 21 |
return controller_error(e.message)
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
@staticmethod
|
| 24 |
def getRerecordedData(ratings: list[Calificacion]):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
if not ratings:
|
| 26 |
return []
|
| 27 |
|
|
|
|
| 1 |
+
from ...models import Calificacion, Dato, Palabra, ValorDecimal, ValorBooleano
|
| 2 |
from ...utils import controller_error, getId
|
| 3 |
from django.core.exceptions import ValidationError
|
| 4 |
|
| 5 |
|
| 6 |
class DatoController():
|
| 7 |
+
def __init__(self, word: Palabra | int, rating: Calificacion | int, value_rating: int | bool):
|
| 8 |
atributes = {
|
| 9 |
"id_palabra_id": getId(word),
|
| 10 |
"id_calificacion_id": getId(rating)
|
| 11 |
}
|
| 12 |
|
| 13 |
self.data = Dato(**atributes)
|
| 14 |
+
self.value_data = ValorDecimal(valor=value_rating)
|
| 15 |
|
| 16 |
+
def setRating(self, new_rating: Calificacion):
|
| 17 |
+
try:
|
| 18 |
+
self.data.id_calificacion = new_rating
|
| 19 |
+
return self.data.id_calificacion
|
| 20 |
+
except ValidationError as e:
|
| 21 |
+
return controller_error(e.message)
|
| 22 |
+
|
| 23 |
+
def validateRating(self):
|
| 24 |
try:
|
| 25 |
self.data.full_clean()
|
| 26 |
+
return self.data
|
| 27 |
+
except ValidationError as e:
|
| 28 |
+
return controller_error(e.message)
|
| 29 |
+
|
| 30 |
+
def saveData(self):
|
| 31 |
+
try:
|
| 32 |
self.data.save()
|
| 33 |
return self.data
|
| 34 |
except ValidationError as e:
|
| 35 |
return controller_error(e.message)
|
| 36 |
|
| 37 |
+
def setInstanceValue(self):
|
| 38 |
+
technique = self.data.id_calificacion.id_tecnica
|
| 39 |
+
|
| 40 |
+
if technique.tipo_tecnica == "cata":
|
| 41 |
+
self.value_data = ValorBooleano(
|
| 42 |
+
id_dato=self.data,
|
| 43 |
+
valor=self.value_data.valor
|
| 44 |
+
)
|
| 45 |
+
else:
|
| 46 |
+
self.value_data = ValorDecimal(
|
| 47 |
+
id_dato=self.data,
|
| 48 |
+
valor=self.value_data.valor
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
return self.value_data
|
| 52 |
+
|
| 53 |
+
def saveValue(self):
|
| 54 |
+
try:
|
| 55 |
+
self.value_data.save()
|
| 56 |
+
return self.value_data
|
| 57 |
+
except ValidationError as e:
|
| 58 |
+
return controller_error(e.message)
|
| 59 |
+
|
| 60 |
@staticmethod
|
| 61 |
def getRerecordedData(ratings: list[Calificacion]):
|
| 62 |
+
'''
|
| 63 |
+
Get Datos' registers for each Calificacion.
|
| 64 |
+
Datos' registers no contain the value of rating.
|
| 65 |
+
'''
|
| 66 |
if not ratings:
|
| 67 |
return []
|
| 68 |
|
tecnicas/controllers/views_controller/api_rating_controller.py
CHANGED
|
@@ -1,8 +1,72 @@
|
|
| 1 |
-
from ...models import Calificacion
|
| 2 |
from ...controllers import CalificacionController, DatoController
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
class ApiRatingController():
|
| 6 |
-
def __init__(self,
|
| 7 |
-
self.rating_controller =
|
| 8 |
-
self.data_controller =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from ...controllers import CalificacionController, DatoController
|
| 2 |
+
from ...utils import controller_error
|
| 3 |
|
| 4 |
|
| 5 |
class ApiRatingController():
|
| 6 |
+
def __init__(self, rating_controller: CalificacionController, data_controller: DatoController):
|
| 7 |
+
self.rating_controller = rating_controller
|
| 8 |
+
self.data_controller = data_controller
|
| 9 |
+
|
| 10 |
+
def setRating(self) -> int | dict:
|
| 11 |
+
repetition = self.rating_controller.setRepetition()
|
| 12 |
+
if isinstance(repetition, dict):
|
| 13 |
+
return controller_error(repetition["error"])
|
| 14 |
+
return repetition
|
| 15 |
+
|
| 16 |
+
def saveRating(self):
|
| 17 |
+
rating = self.rating_controller.saveRating()
|
| 18 |
+
if isinstance(rating, dict):
|
| 19 |
+
return controller_error(rating["error"])
|
| 20 |
+
return rating
|
| 21 |
+
|
| 22 |
+
def setRatingInData(self):
|
| 23 |
+
update_rating = self.data_controller.setRating(
|
| 24 |
+
self.rating_controller.rating)
|
| 25 |
+
if isinstance(update_rating, dict):
|
| 26 |
+
return controller_error(update_rating["error"])
|
| 27 |
+
return update_rating
|
| 28 |
+
|
| 29 |
+
def saveData(self):
|
| 30 |
+
data = self.data_controller.saveData()
|
| 31 |
+
if isinstance(data, dict):
|
| 32 |
+
return controller_error(data["error"])
|
| 33 |
+
return data
|
| 34 |
+
|
| 35 |
+
def setValueRating(self):
|
| 36 |
+
self.data_controller.setInstanceValue()
|
| 37 |
+
|
| 38 |
+
def saveValue(self):
|
| 39 |
+
value = self.data_controller.saveValue()
|
| 40 |
+
if isinstance(value, dict):
|
| 41 |
+
return controller_error(value["error"])
|
| 42 |
+
|
| 43 |
+
def logicView(self) -> dict:
|
| 44 |
+
validate = self.rating_controller.validateRating()
|
| 45 |
+
if isinstance(validate, dict):
|
| 46 |
+
return controller_error(validate["error"])
|
| 47 |
+
|
| 48 |
+
reptition = self.setRating()
|
| 49 |
+
if isinstance(reptition, dict):
|
| 50 |
+
return controller_error(reptition["error"])
|
| 51 |
+
|
| 52 |
+
rating = self.saveRating()
|
| 53 |
+
if isinstance(rating, dict):
|
| 54 |
+
return controller_error(rating["error"])
|
| 55 |
+
|
| 56 |
+
rating_data = self.setRatingInData()
|
| 57 |
+
if isinstance(rating_data, dict):
|
| 58 |
+
return controller_error(rating_data["error"])
|
| 59 |
+
|
| 60 |
+
data = self.saveData()
|
| 61 |
+
if isinstance(data, dict):
|
| 62 |
+
return controller_error(data["error"])
|
| 63 |
+
|
| 64 |
+
value = self.setValueRating()
|
| 65 |
+
if isinstance(value, dict):
|
| 66 |
+
return controller_error(value["error"])
|
| 67 |
+
|
| 68 |
+
value_save = self.saveValue()
|
| 69 |
+
if isinstance(value_save, dict):
|
| 70 |
+
return controller_error(value_save["error"])
|
| 71 |
+
|
| 72 |
+
return {"message": "La calificación se ha guardado"}
|
tecnicas/models/dato_valor.py
CHANGED
|
@@ -7,11 +7,11 @@ class ValorDecimal(models.Model):
|
|
| 7 |
valor = models.FloatField()
|
| 8 |
|
| 9 |
def __str__(self):
|
| 10 |
-
return self.valor
|
| 11 |
|
| 12 |
class ValorBooleano(models.Model):
|
| 13 |
id_dato = models.OneToOneField(Dato, on_delete=models.CASCADE, related_name="dato_boolean")
|
| 14 |
valor = models.BooleanField()
|
| 15 |
|
| 16 |
def __str__(self):
|
| 17 |
-
return self.valor
|
|
|
|
| 7 |
valor = models.FloatField()
|
| 8 |
|
| 9 |
def __str__(self):
|
| 10 |
+
return f"{self.id} - {self.id_dato.id_palabra}: {self.valor}"
|
| 11 |
|
| 12 |
class ValorBooleano(models.Model):
|
| 13 |
id_dato = models.OneToOneField(Dato, on_delete=models.CASCADE, related_name="dato_boolean")
|
| 14 |
valor = models.BooleanField()
|
| 15 |
|
| 16 |
def __str__(self):
|
| 17 |
+
return f"{self.id} - {self.id_dato.id_palabra}: {self.valor}"
|
tecnicas/static/js/created-scale.js
CHANGED
|
@@ -55,8 +55,10 @@ async function sendRating(word) {
|
|
| 55 |
|
| 56 |
const idWord = formRatingWord.querySelector(".id-word").textContent;
|
| 57 |
|
| 58 |
-
dataForm.set("
|
| 59 |
-
dataForm.set("
|
|
|
|
|
|
|
| 60 |
|
| 61 |
try {
|
| 62 |
const respone = await fetch(url, {
|
|
|
|
| 55 |
|
| 56 |
const idWord = formRatingWord.querySelector(".id-word").textContent;
|
| 57 |
|
| 58 |
+
dataForm.set("code-product", codeProduct);
|
| 59 |
+
dataForm.set("id-product", idProduct);
|
| 60 |
+
dataForm.set("name-word", word);
|
| 61 |
+
dataForm.set("id-word", idWord);
|
| 62 |
|
| 63 |
try {
|
| 64 |
const respone = await fetch(url, {
|
tecnicas/views/apis/rating_word.py
CHANGED
|
@@ -29,26 +29,34 @@
|
|
| 29 |
'''
|
| 30 |
from django.http import HttpRequest, JsonResponse
|
| 31 |
from ...controllers import ApiRatingController, CalificacionController, DatoController
|
|
|
|
|
|
|
| 32 |
|
| 33 |
|
| 34 |
def reatingWord(req: HttpRequest):
|
| 35 |
if req.method == "POST":
|
| 36 |
-
if not req.POST["rating-word"] or not req.POST["
|
| 37 |
return JsonResponse({"error": "No se mandó información necesaria para la calificación"})
|
| 38 |
|
| 39 |
-
received_rating = req.POST
|
| 40 |
-
|
| 41 |
-
|
| 42 |
|
| 43 |
view_controller = ApiRatingController(
|
| 44 |
-
CalificacionController(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
)
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
"cata_ser": req.session["cata_username"]
|
| 53 |
-
}
|
| 54 |
-
})
|
|
|
|
| 29 |
'''
|
| 30 |
from django.http import HttpRequest, JsonResponse
|
| 31 |
from ...controllers import ApiRatingController, CalificacionController, DatoController
|
| 32 |
+
from ...utils import general_error
|
| 33 |
+
import json
|
| 34 |
|
| 35 |
|
| 36 |
def reatingWord(req: HttpRequest):
|
| 37 |
if req.method == "POST":
|
| 38 |
+
if not req.POST["rating-word"] or not req.POST["id-word"] or not req.POST["id-product"]:
|
| 39 |
return JsonResponse({"error": "No se mandó información necesaria para la calificación"})
|
| 40 |
|
| 41 |
+
received_rating = json.loads(req.POST.get("rating-word"))
|
| 42 |
+
received_id_word = json.loads(req.POST.get("id-word"))
|
| 43 |
+
received_id_product = json.loads(req.POST.get("id-product"))
|
| 44 |
|
| 45 |
view_controller = ApiRatingController(
|
| 46 |
+
rating_controller=CalificacionController(
|
| 47 |
+
technique=req.session["id_techniqe"],
|
| 48 |
+
product=received_id_product,
|
| 49 |
+
tester=req.session["id_cata"]
|
| 50 |
+
),
|
| 51 |
+
data_controller=DatoController(
|
| 52 |
+
word=received_id_word,
|
| 53 |
+
rating=0,
|
| 54 |
+
value_rating=received_rating
|
| 55 |
)
|
| 56 |
+
)
|
| 57 |
|
| 58 |
+
response_data = view_controller.logicView()
|
| 59 |
+
|
| 60 |
+
return JsonResponse(response_data)
|
| 61 |
+
else:
|
| 62 |
+
return general_error("No puede usar este método aquí")
|
|
|
|
|
|
|
|
|
tecnicas/views/login_tester.py
CHANGED
|
@@ -22,6 +22,7 @@ def testerLogin(req: HttpRequest):
|
|
| 22 |
context = {"error": existCredentials["error"]}
|
| 23 |
return render(req, "tecnicas/cata-login.html", context)
|
| 24 |
|
|
|
|
| 25 |
session = existCredentials[1]
|
| 26 |
|
| 27 |
taster_participation = login_controller.validateEntry()
|
|
@@ -30,6 +31,7 @@ def testerLogin(req: HttpRequest):
|
|
| 30 |
return render(req, "tecnicas/cata-login.html", context)
|
| 31 |
|
| 32 |
req.session["cata_username"] = tester_user
|
|
|
|
| 33 |
req.session["code_session"] = session_code
|
| 34 |
req.session["id_techniqe"] = session.tecnica.id
|
| 35 |
req.session["id_participation"] = taster_participation.id
|
|
|
|
| 22 |
context = {"error": existCredentials["error"]}
|
| 23 |
return render(req, "tecnicas/cata-login.html", context)
|
| 24 |
|
| 25 |
+
tester = existCredentials[0]
|
| 26 |
session = existCredentials[1]
|
| 27 |
|
| 28 |
taster_participation = login_controller.validateEntry()
|
|
|
|
| 31 |
return render(req, "tecnicas/cata-login.html", context)
|
| 32 |
|
| 33 |
req.session["cata_username"] = tester_user
|
| 34 |
+
req.session["id_cata"] = tester.id
|
| 35 |
req.session["code_session"] = session_code
|
| 36 |
req.session["id_techniqe"] = session.tecnica.id
|
| 37 |
req.session["id_participation"] = taster_participation.id
|
tecnicas/views/tester_forms/convencional_scales.py
CHANGED
|
@@ -115,9 +115,9 @@ def convencionalScales(req: HttpRequest):
|
|
| 115 |
recoreded_data = DatoController.getRerecordedData(ratings=ratings_product)
|
| 116 |
if not recoreded_data:
|
| 117 |
context["words"] = words
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
|
| 122 |
scale = EscalaController.getScaleByTechnique(technique=technique)
|
| 123 |
context["scale"] = scale
|
|
|
|
| 115 |
recoreded_data = DatoController.getRerecordedData(ratings=ratings_product)
|
| 116 |
if not recoreded_data:
|
| 117 |
context["words"] = words
|
| 118 |
+
else:
|
| 119 |
+
words_to_use = PalabrasController.getWordsWithoutData(recoreded_data=recoreded_data, words=words)
|
| 120 |
+
context["words"] = words_to_use
|
| 121 |
|
| 122 |
scale = EscalaController.getScaleByTechnique(technique=technique)
|
| 123 |
context["scale"] = scale
|