Spaces:
Sleeping
Sleeping
Merge pull request #12 from CascoArcilla/HU10
Browse files- tecnicas/controllers/models_controller/palabras_controller.py +1 -0
- tecnicas/controllers/views_controller/main_tester_form_controller.py +14 -8
- tecnicas/static/js/created-scale.js +1 -1
- tecnicas/static/js/start-tester-test.js +6 -0
- tecnicas/templates/tecnicas/auth.html +27 -21
- tecnicas/templates/tecnicas/cata-login.html +45 -39
- tecnicas/templates/tecnicas/forms_tester/convencional.html +73 -24
- tecnicas/templates/tecnicas/forms_tester/main_tester.html +14 -14
- tecnicas/views/sessions_config/create_session.py +7 -1
- tecnicas/views/tester_forms/main_tester_form.py +5 -1
- theme/static_src/src/styles.css +4 -0
tecnicas/controllers/models_controller/palabras_controller.py
CHANGED
|
@@ -18,6 +18,7 @@ class PalabrasController():
|
|
| 18 |
searched_words = list(Palabra.objects.filter(id__in=self.ids_words))
|
| 19 |
if not len(searched_words):
|
| 20 |
return controller_error("no se han encontrado registros")
|
|
|
|
| 21 |
return self.words
|
| 22 |
|
| 23 |
@staticmethod
|
|
|
|
| 18 |
searched_words = list(Palabra.objects.filter(id__in=self.ids_words))
|
| 19 |
if not len(searched_words):
|
| 20 |
return controller_error("no se han encontrado registros")
|
| 21 |
+
self.words = searched_words
|
| 22 |
return self.words
|
| 23 |
|
| 24 |
@staticmethod
|
tecnicas/controllers/views_controller/main_tester_form_controller.py
CHANGED
|
@@ -51,6 +51,14 @@ class MainTesterFormController():
|
|
| 51 |
try:
|
| 52 |
participation = Participacion.objects.get(id=id_participation)
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
if participation.finalizado:
|
| 55 |
num_products = Producto.objects.filter(
|
| 56 |
id_tecnica=self.session.tecnica).count()
|
|
@@ -60,20 +68,18 @@ class MainTesterFormController():
|
|
| 60 |
num_words: int
|
| 61 |
|
| 62 |
if style_words.nombre_estilo == "atributos":
|
| 63 |
-
|
| 64 |
-
id_tecnica=self.session.tecnica)
|
| 65 |
-
num_words = e_atribues.palabras.count()
|
| 66 |
elif style_words.nombre_estilo == "vocabulario":
|
| 67 |
-
|
| 68 |
-
id_tecnica=self.session.tecnica)
|
| 69 |
-
num_words = e_vocabulary.id_vocabulario.palabras.count()
|
| 70 |
|
| 71 |
num_ratings_now = Calificacion.objects.filter(
|
| 72 |
id_tecnica=self.session.tecnica, id_catador=self.tester, num_repeticion=repetition).count()
|
| 73 |
|
| 74 |
-
|
| 75 |
|
| 76 |
-
return
|
| 77 |
else:
|
| 78 |
return participation.finalizado
|
| 79 |
except Participacion.DoesNotExist:
|
|
|
|
| 51 |
try:
|
| 52 |
participation = Participacion.objects.get(id=id_participation)
|
| 53 |
|
| 54 |
+
# ////////////////////////////////////////////////////////////// #
|
| 55 |
+
#
|
| 56 |
+
# Si numero_calificaciones_esperadas = productos * palabras
|
| 57 |
+
# Es igual a numero_calificaciones_actuales en la repetcion R
|
| 58 |
+
# Ha terminado la repeticion
|
| 59 |
+
#
|
| 60 |
+
# ////////////////////////////////////////////////////////////// #
|
| 61 |
+
|
| 62 |
if participation.finalizado:
|
| 63 |
num_products = Producto.objects.filter(
|
| 64 |
id_tecnica=self.session.tecnica).count()
|
|
|
|
| 68 |
num_words: int
|
| 69 |
|
| 70 |
if style_words.nombre_estilo == "atributos":
|
| 71 |
+
num_words = EsAtributo.objects.get(
|
| 72 |
+
id_tecnica=self.session.tecnica).palabras.count()
|
|
|
|
| 73 |
elif style_words.nombre_estilo == "vocabulario":
|
| 74 |
+
num_words = EsVocabulario.objects.get(
|
| 75 |
+
id_tecnica=self.session.tecnica).id_vocabulario.palabras.count()
|
|
|
|
| 76 |
|
| 77 |
num_ratings_now = Calificacion.objects.filter(
|
| 78 |
id_tecnica=self.session.tecnica, id_catador=self.tester, num_repeticion=repetition).count()
|
| 79 |
|
| 80 |
+
expected_ratings_repetition = num_products * num_words
|
| 81 |
|
| 82 |
+
return num_ratings_now >= expected_ratings_repetition
|
| 83 |
else:
|
| 84 |
return participation.finalizado
|
| 85 |
except Participacion.DoesNotExist:
|
tecnicas/static/js/created-scale.js
CHANGED
|
@@ -117,7 +117,7 @@ function addBtnNextWord() {
|
|
| 117 |
|
| 118 |
const btnNesxtWord = document.createElement("button");
|
| 119 |
btnNesxtWord.classList.add(...BTN_CLASS_STYLE, "ct-btn-next-word");
|
| 120 |
-
btnNesxtWord.textContent = "Siguiente
|
| 121 |
btnNesxtWord.addEventListener("click", nextWord);
|
| 122 |
|
| 123 |
const articleContainer = document.createElement("article");
|
|
|
|
| 117 |
|
| 118 |
const btnNesxtWord = document.createElement("button");
|
| 119 |
btnNesxtWord.classList.add(...BTN_CLASS_STYLE, "ct-btn-next-word");
|
| 120 |
+
btnNesxtWord.textContent = "Siguiente producto";
|
| 121 |
btnNesxtWord.addEventListener("click", nextWord);
|
| 122 |
|
| 123 |
const articleContainer = document.createElement("article");
|
tecnicas/static/js/start-tester-test.js
CHANGED
|
@@ -2,3 +2,9 @@ function startTest() {
|
|
| 2 |
const actionForms = document.querySelector(".ct-action-form");
|
| 3 |
actionForms.submit();
|
| 4 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
const actionForms = document.querySelector(".ct-action-form");
|
| 3 |
actionForms.submit();
|
| 4 |
}
|
| 5 |
+
|
| 6 |
+
function closeSession() {
|
| 7 |
+
const actionForms = document.querySelector(".ct-action-form");
|
| 8 |
+
actionForms.querySelector(".action-option").value = "close_session"
|
| 9 |
+
actionForms.submit();
|
| 10 |
+
}
|
tecnicas/templates/tecnicas/auth.html
CHANGED
|
@@ -3,29 +3,35 @@
|
|
| 3 |
{% block title %}Login{% endblock %}
|
| 4 |
|
| 5 |
{% block content %}
|
| 6 |
-
<article class="
|
| 7 |
-
<
|
| 8 |
-
<
|
| 9 |
-
<
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
<
|
| 14 |
-
<
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
|
|
|
| 30 |
</article>
|
| 31 |
{% endblock %}
|
|
|
|
| 3 |
{% block title %}Login{% endblock %}
|
| 4 |
|
| 5 |
{% block content %}
|
| 6 |
+
<article class="cts-container-main">
|
| 7 |
+
<article class="cts-wrap-content">
|
| 8 |
+
<form action="" method="post" class="p-8 rounded-xl text-black">
|
| 9 |
+
<header class="text-center">
|
| 10 |
+
<h1 class="text-5xl max-sm:text-3xl font-bold">Cata System</h1>
|
| 11 |
+
<p class="text-2xl max-sm:text-xl font-semibold mt-3">Presentador</p>
|
| 12 |
+
</header>
|
| 13 |
+
<section class="flex flex-col gap-6 items-center w-full mt-5">
|
| 14 |
+
<label for="id">
|
| 15 |
+
<input type="text" name="id" id="id" placeholder="Ingrese Indentifiacion"
|
| 16 |
+
class="placeholder:text-gray-400 placeholder:font-semibold text-xl max-sm:text-base bg-surface-ligt py-3 px-6 rounded-xl lg:w-sm border-b-2 border-surface-sweet"
|
| 17 |
+
required>
|
| 18 |
+
</label>
|
| 19 |
|
| 20 |
+
<label for="id">
|
| 21 |
+
<input type="text" name="id" id="id" placeholder="Ingrese Contraseña"
|
| 22 |
+
class="placeholder:text-gray-400 placeholder:font-semibold text-xl max-sm:text-base bg-surface-ligt py-3 px-6 rounded-xl lg:w-sm border-b-2 border-surface-sweet"
|
| 23 |
+
required>
|
| 24 |
+
</label>
|
| 25 |
|
| 26 |
+
<section class="flex flex-row flex-wrap gap-4 w-f ull justify-center">
|
| 27 |
+
<button type="submit"
|
| 28 |
+
class="cts-btn-general cts-btn-primary btn-push uppercase lg:w-sm">
|
| 29 |
+
Ingresar
|
| 30 |
+
</button>
|
| 31 |
+
</section>
|
| 32 |
|
| 33 |
+
</section>
|
| 34 |
+
</form>
|
| 35 |
+
</article>
|
| 36 |
</article>
|
| 37 |
{% endblock %}
|
tecnicas/templates/tecnicas/cata-login.html
CHANGED
|
@@ -3,50 +3,56 @@
|
|
| 3 |
{% block title %}Login{% endblock %}
|
| 4 |
|
| 5 |
{% block content %}
|
| 6 |
-
<article class="
|
| 7 |
-
<
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
<
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
<
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
</article>
|
| 43 |
{% endblock %}
|
| 44 |
|
| 45 |
{% block extra_js %}
|
| 46 |
<script>
|
| 47 |
const error = document.querySelector(".ct-notification-error")
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
| 51 |
</script>
|
| 52 |
{% endblock %}
|
|
|
|
| 3 |
{% block title %}Login{% endblock %}
|
| 4 |
|
| 5 |
{% block content %}
|
| 6 |
+
<article class="cts-container-main">
|
| 7 |
+
<article class="cts-wrap-content">
|
| 8 |
+
<form action="" method="post" class="p-8 rounded-xl text-black">
|
| 9 |
+
{% csrf_token %}
|
| 10 |
+
<header class="text-center">
|
| 11 |
+
<h1 class="text-5xl max-sm:text-3xl font-bold">Cata System</h1>
|
| 12 |
+
<p class="text-2xl max-sm:text-xl font-semibold mt-3">Catadores</p>
|
| 13 |
+
</header>
|
| 14 |
+
|
| 15 |
+
{% if error %}
|
| 16 |
+
<article class="bg-ct-error p-4 text-white rounded-xl ct-notification-error">
|
| 17 |
+
<p
|
| 18 |
+
class="block font-sans text-white text-xl antialiased font-bold uppercase tracking-wider text-center">
|
| 19 |
+
{{ error }}
|
| 20 |
+
</p>
|
| 21 |
+
</article>
|
| 22 |
+
{% endif %}
|
| 23 |
+
|
| 24 |
+
<article class="flex flex-col gap-6 items-center w-full mt-5">
|
| 25 |
+
<label for="id">
|
| 26 |
+
<input type="text" name="code_session" id="id" placeholder="Codigo de sesion"
|
| 27 |
+
class="placeholder:text-gray-400 placeholder:font-semibold text-xl max-sm:text-base bg-surface-ligt py-3 px-6 rounded-xl lg:w-sm border-b-2 border-surface-sweet"
|
| 28 |
+
required>
|
| 29 |
+
</label>
|
| 30 |
+
|
| 31 |
+
<label for="id">
|
| 32 |
+
<input type="text" name="user_tester" id="id" placeholder="Nombre de usuario"
|
| 33 |
+
class="placeholder:text-gray-400 placeholder:font-semibold text-xl max-sm:text-base bg-surface-ligt py-3 px-6 rounded-xl lg:w-sm border-b-2 border-surface-sweet"
|
| 34 |
+
required>
|
| 35 |
+
</label>
|
| 36 |
+
|
| 37 |
+
<section class="flex flex-row flex-wrap gap-4 w-f ull justify-center">
|
| 38 |
+
<button type="submit" class="cts-btn-general cts-btn-primary btn-push uppercase lg:w-sm">
|
| 39 |
+
Ingresar
|
| 40 |
+
</button>
|
| 41 |
+
</section>
|
| 42 |
+
|
| 43 |
+
</article>
|
| 44 |
+
</form>
|
| 45 |
+
</article>
|
| 46 |
</article>
|
| 47 |
{% endblock %}
|
| 48 |
|
| 49 |
{% block extra_js %}
|
| 50 |
<script>
|
| 51 |
const error = document.querySelector(".ct-notification-error")
|
| 52 |
+
if (error) {
|
| 53 |
+
setTimeout(() => {
|
| 54 |
+
error.classList.add("hidden")
|
| 55 |
+
}, 4000)
|
| 56 |
+
}
|
| 57 |
</script>
|
| 58 |
{% endblock %}
|
tecnicas/templates/tecnicas/forms_tester/convencional.html
CHANGED
|
@@ -27,26 +27,19 @@
|
|
| 27 |
@media (width < 40rem) {
|
| 28 |
.container-forms {
|
| 29 |
width: inherit;
|
| 30 |
-
|
| 31 |
-
}
|
| 32 |
-
|
| 33 |
-
.container-input {
|
| 34 |
-
overflow-x: scroll;
|
| 35 |
}
|
| 36 |
}
|
| 37 |
</style>
|
| 38 |
{% endblock %}
|
| 39 |
|
| 40 |
{% block content %}
|
| 41 |
-
<article class="
|
| 42 |
-
<article class="
|
| 43 |
<header class="text-center flex-row w-full items-stretch flex justify-around flex-wrap gap-2">
|
| 44 |
-
<h1 class="
|
| 45 |
Sesión usando <br>técnica Convencional
|
| 46 |
</h1>
|
| 47 |
-
<button
|
| 48 |
-
class="text-lg font-bold tracking-wider p-2 px-8 border-b-4 active:border-b-0 active:border-t-2 active:border-blue-500 border-blue-800 transition-all rounded-xl bg-blue-500 text-gray-300"
|
| 49 |
-
onclick="exit_sesion('form-actions')">
|
| 50 |
Salir de la sesión
|
| 51 |
</button>
|
| 52 |
</header>
|
|
@@ -68,13 +61,13 @@
|
|
| 68 |
{% endif %}
|
| 69 |
|
| 70 |
<article class="rounded flex flex-col gap-4">
|
| 71 |
-
<section class="flex items-center justify-center bg-
|
| 72 |
<p class="text-lg font-medium text-center">
|
| 73 |
{{ session.tecnica.instrucciones }}
|
| 74 |
</p>
|
| 75 |
</section>
|
| 76 |
<section class="flex items-center justify-center flex-wrap gap-4">
|
| 77 |
-
<div class="bg-
|
| 78 |
<p class="text-lg font-bold text-center">
|
| 79 |
Producto:
|
| 80 |
</p>
|
|
@@ -83,7 +76,7 @@
|
|
| 83 |
<span class="hidden id-product">{{ product.id }}</span>
|
| 84 |
</p>
|
| 85 |
</div>
|
| 86 |
-
<div class="bg-
|
| 87 |
<p class="text-lg font-bold text-center">
|
| 88 |
Repetición:
|
| 89 |
</p>
|
|
@@ -101,23 +94,22 @@
|
|
| 101 |
</article>
|
| 102 |
|
| 103 |
<article
|
| 104 |
-
class="scales-container [&>*:not(:last-child)]:mb-5 min-lg:grid min-lg:items-start grid-cols-2 gap-3
|
| 105 |
{% if type_scale == "continua" %}
|
| 106 |
{% for word in words %}
|
| 107 |
<form action="" method="post" class="form-rating-{{word}} w-full">
|
| 108 |
{% csrf_token %}
|
| 109 |
-
<article class="
|
| 110 |
-
<article class="bg-
|
| 111 |
<label for="id-range-word-{{word}}"
|
| 112 |
class="text-xl font-bold tracking-wide block mb-6 first-letter:uppercase">{{ word }}</label>
|
| 113 |
|
| 114 |
<span class="hidden id-word">{{ word.id }}</span>
|
| 115 |
|
| 116 |
<section class="block">
|
| 117 |
-
<div class="relative">
|
| 118 |
-
<input
|
| 119 |
-
|
| 120 |
-
class="h-2 bg-gray-400 rounded-lg appearance-none cursor-pointer slider"
|
| 121 |
style="width: {{scale.longitud}}cm;">
|
| 122 |
|
| 123 |
<div
|
|
@@ -156,15 +148,72 @@
|
|
| 156 |
<article class="flex flex-col justify-center gap-2 items-end actions-{{word}}">
|
| 157 |
<section class="flex justify-end items-center gap-2 btns-container">
|
| 158 |
<button type="button" onclick="checkSendRating('{{word}}')"
|
| 159 |
-
class="ct-btn-check-{{word}}
|
| 160 |
¿Guardar calificación?
|
| 161 |
</button>
|
| 162 |
<button type="button" onclick="sendRating('{{word}}')"
|
| 163 |
-
class="ct-btn-submit-{{word}}
|
| 164 |
Estoy seguro
|
| 165 |
</button>
|
| 166 |
<button type="button" onclick="cancelSendRating('{{word}}')"
|
| 167 |
-
class="ct-btn-cancel-{{word}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
Cancelar
|
| 169 |
</button>
|
| 170 |
</section>
|
|
|
|
| 27 |
@media (width < 40rem) {
|
| 28 |
.container-forms {
|
| 29 |
width: inherit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
}
|
| 31 |
}
|
| 32 |
</style>
|
| 33 |
{% endblock %}
|
| 34 |
|
| 35 |
{% block content %}
|
| 36 |
+
<article class="cts-container-main">
|
| 37 |
+
<article class="cts-wrap-content text-black">
|
| 38 |
<header class="text-center flex-row w-full items-stretch flex justify-around flex-wrap gap-2">
|
| 39 |
+
<h1 class="rounded font-bold text-2xl bg-surface-ligt p-4 flex-1">
|
| 40 |
Sesión usando <br>técnica Convencional
|
| 41 |
</h1>
|
| 42 |
+
<button class="cts-btn-general cts-btn-error btn-push" onclick="exit_sesion('form-actions')">
|
|
|
|
|
|
|
| 43 |
Salir de la sesión
|
| 44 |
</button>
|
| 45 |
</header>
|
|
|
|
| 61 |
{% endif %}
|
| 62 |
|
| 63 |
<article class="rounded flex flex-col gap-4">
|
| 64 |
+
<section class="flex items-center justify-center bg-surface-ligt p-2 rounded-lg">
|
| 65 |
<p class="text-lg font-medium text-center">
|
| 66 |
{{ session.tecnica.instrucciones }}
|
| 67 |
</p>
|
| 68 |
</section>
|
| 69 |
<section class="flex items-center justify-center flex-wrap gap-4">
|
| 70 |
+
<div class="bg-surface-ligt p-2 rounded-lg flex-1">
|
| 71 |
<p class="text-lg font-bold text-center">
|
| 72 |
Producto:
|
| 73 |
</p>
|
|
|
|
| 76 |
<span class="hidden id-product">{{ product.id }}</span>
|
| 77 |
</p>
|
| 78 |
</div>
|
| 79 |
+
<div class="bg-surface-ligt p-2 rounded-lg flex-1">
|
| 80 |
<p class="text-lg font-bold text-center">
|
| 81 |
Repetición:
|
| 82 |
</p>
|
|
|
|
| 94 |
</article>
|
| 95 |
|
| 96 |
<article
|
| 97 |
+
class="scales-container [&>*:not(:last-child)]:mb-5 min-lg:grid min-lg:items-start grid-cols-2 gap-3 justify-center items-center">
|
| 98 |
{% if type_scale == "continua" %}
|
| 99 |
{% for word in words %}
|
| 100 |
<form action="" method="post" class="form-rating-{{word}} w-full">
|
| 101 |
{% csrf_token %}
|
| 102 |
+
<article class="overflow-x-scroll w-full">
|
| 103 |
+
<article class="bg-surface-card p-6 rounded-lg mb-3 w-fit">
|
| 104 |
<label for="id-range-word-{{word}}"
|
| 105 |
class="text-xl font-bold tracking-wide block mb-6 first-letter:uppercase">{{ word }}</label>
|
| 106 |
|
| 107 |
<span class="hidden id-word">{{ word.id }}</span>
|
| 108 |
|
| 109 |
<section class="block">
|
| 110 |
+
<div class="relative mx-6">
|
| 111 |
+
<input type="range" type="range" min="0" max="1000" value="500" name="rating-word"
|
| 112 |
+
class="range range-md text-blue-400 [--range-bg:orange] [--range-thumb:blue] [--range-fill:0]"
|
|
|
|
| 113 |
style="width: {{scale.longitud}}cm;">
|
| 114 |
|
| 115 |
<div
|
|
|
|
| 148 |
<article class="flex flex-col justify-center gap-2 items-end actions-{{word}}">
|
| 149 |
<section class="flex justify-end items-center gap-2 btns-container">
|
| 150 |
<button type="button" onclick="checkSendRating('{{word}}')"
|
| 151 |
+
class="ct-btn-check-{{word}} cts-btn-general-compress py-2 px-4 cts-btn-secondary btn-push">
|
| 152 |
¿Guardar calificación?
|
| 153 |
</button>
|
| 154 |
<button type="button" onclick="sendRating('{{word}}')"
|
| 155 |
+
class="ct-btn-submit-{{word}} cts-btn-general-compress py-2 px-4 cts-btn-primary btn-push hidden">
|
| 156 |
Estoy seguro
|
| 157 |
</button>
|
| 158 |
<button type="button" onclick="cancelSendRating('{{word}}')"
|
| 159 |
+
class="ct-btn-cancel-{{word}} cts-btn-general-compress py-2 px-4 cts-btn-error btn-push hidden">
|
| 160 |
+
Cancelar
|
| 161 |
+
</button>
|
| 162 |
+
</section>
|
| 163 |
+
</article>
|
| 164 |
+
</form>
|
| 165 |
+
{% endfor %}
|
| 166 |
+
{% elif type_scale == "estructurada" %}
|
| 167 |
+
{% for word in words %}
|
| 168 |
+
<form action="" method="post" class="form-rating-{{ word }} w-full">
|
| 169 |
+
{% csrf_token %}
|
| 170 |
+
<article class="overflow-x-scroll w-full">
|
| 171 |
+
<article class="bg-surface-card p-6 rounded-lg mb-3 w-fit">
|
| 172 |
+
<label for="id-scale-word-{{ word }}"
|
| 173 |
+
class="text-xl font-bold tracking-wide block mb-6 first-letter:uppercase">{{ word }}</label>
|
| 174 |
+
<span class="hidden id-word">{{ word.id }}</span>
|
| 175 |
+
|
| 176 |
+
<section>
|
| 177 |
+
<div class="w-full min-w-xs">
|
| 178 |
+
<div class="relative mx-6">
|
| 179 |
+
<input type="range" min="1" max="{{scale.longitud}}" step="1" name="rating-word"
|
| 180 |
+
class="w-full range range-md text-blue-400 [--range-bg:orange] [--range-thumb:blue] [--range-fill:0] z-5">
|
| 181 |
+
<div
|
| 182 |
+
class="absolute top-0 left-0 w-full h-full z-10 flex justify-between pointer-events-none">
|
| 183 |
+
{% for tag in tags %}
|
| 184 |
+
<div class="w-0.5 transform -translate-x-1/2 h-full bg-red-500">
|
| 185 |
+
</div>
|
| 186 |
+
{% endfor %}
|
| 187 |
+
</div>
|
| 188 |
+
</div>
|
| 189 |
+
|
| 190 |
+
<div class="flex justify-between mt-4 text-xs gap-1">
|
| 191 |
+
{% for tag in tags %}
|
| 192 |
+
<div class="flex items-center justify-center text-center w-[70px]">
|
| 193 |
+
<span
|
| 194 |
+
class="text-xs font-medium text-gray-700 break-words first-letter:capitalize">
|
| 195 |
+
{{ tag.id_etiqueta }}
|
| 196 |
+
</span>
|
| 197 |
+
</div>
|
| 198 |
+
{% endfor %}
|
| 199 |
+
</div>
|
| 200 |
+
</div>
|
| 201 |
+
</section>
|
| 202 |
+
</article>
|
| 203 |
+
</article>
|
| 204 |
+
|
| 205 |
+
<article class="flex flex-col justify-center gap-2 items-end actions-{{ word }}">
|
| 206 |
+
<section class="flex justify-end items-center gap-2 btns-container">
|
| 207 |
+
<button type="button" onclick="checkSendRating('{{ word }}')"
|
| 208 |
+
class="ct-btn-check-{{ word }} cts-btn-general-compress py-2 px-4 cts-btn-secondary btn-push">
|
| 209 |
+
¿Guardar calificación?
|
| 210 |
+
</button>
|
| 211 |
+
<button type="button" onclick="sendRating('{{ word }}')"
|
| 212 |
+
class="ct-btn-submit-{{ word }} cts-btn-general-compress py-2 px-4 cts-btn-primary btn-push hidden">
|
| 213 |
+
Estoy seguro
|
| 214 |
+
</button>
|
| 215 |
+
<button type="button" onclick="cancelSendRating('{{ word }}')"
|
| 216 |
+
class="ct-btn-cancel-{{ word }} cts-btn-general-compress py-2 px-4 cts-btn-error btn-push hidden">
|
| 217 |
Cancelar
|
| 218 |
</button>
|
| 219 |
</section>
|
tecnicas/templates/tecnicas/forms_tester/main_tester.html
CHANGED
|
@@ -4,16 +4,16 @@
|
|
| 4 |
{% block title %}Detalles Sesion{% endblock %}
|
| 5 |
|
| 6 |
{% block content %}
|
| 7 |
-
<article class="
|
| 8 |
-
<article class="
|
| 9 |
<header class="text-center flex-row w-full flex justify-around items-center flex-wrap gap-10">
|
| 10 |
-
<h1 class="
|
| 11 |
Panel principal de Catadores
|
| 12 |
</h1>
|
| 13 |
</header>
|
| 14 |
|
| 15 |
<article>
|
| 16 |
-
<p class="text-2xl font-medium text-center bg-
|
| 17 |
Información sobre la sesión en la que participa
|
| 18 |
</p>
|
| 19 |
</article>
|
|
@@ -31,8 +31,8 @@
|
|
| 31 |
{% if message %}
|
| 32 |
<hr>
|
| 33 |
|
| 34 |
-
<article class="bg-
|
| 35 |
-
<p class="block
|
| 36 |
{{ message }}
|
| 37 |
</p>
|
| 38 |
</article>
|
|
@@ -41,7 +41,7 @@
|
|
| 41 |
<hr>
|
| 42 |
|
| 43 |
<article
|
| 44 |
-
class="
|
| 45 |
{% if session %}
|
| 46 |
<section>
|
| 47 |
<p class="text-xl font-bold">
|
|
@@ -99,13 +99,12 @@
|
|
| 99 |
|
| 100 |
<article class="flex flex-wrap gap-10">
|
| 101 |
{% if has_ended %}
|
| 102 |
-
<
|
| 103 |
-
class="
|
| 104 |
-
|
| 105 |
-
</button>
|
| 106 |
{% else %}
|
| 107 |
<button
|
| 108 |
-
class="ct-btn-start-repition flex-1 uppercase text-lg tracking-wider
|
| 109 |
onclick="startTest()">
|
| 110 |
Iniciar técnica
|
| 111 |
<figure class="w-10">
|
|
@@ -114,7 +113,8 @@
|
|
| 114 |
</button>
|
| 115 |
{% endif %}
|
| 116 |
<button
|
| 117 |
-
class="flex-1 uppercase text-lg tracking-wider
|
|
|
|
| 118 |
Salir se la sesión
|
| 119 |
<figure class="w-10">
|
| 120 |
<img src="{% static 'img/exit.svg' %}" alt="bote de basura" class="invert">
|
|
@@ -124,7 +124,7 @@
|
|
| 124 |
|
| 125 |
<form action="" method="post" class="hidden ct-action-form">
|
| 126 |
{% csrf_token %}
|
| 127 |
-
<input type="hidden" name="action" value="start_posting">
|
| 128 |
</form>
|
| 129 |
</article>
|
| 130 |
</article>
|
|
|
|
| 4 |
{% block title %}Detalles Sesion{% endblock %}
|
| 5 |
|
| 6 |
{% block content %}
|
| 7 |
+
<article class="cts-container-main">
|
| 8 |
+
<article class="cts-wrap-content text-black">
|
| 9 |
<header class="text-center flex-row w-full flex justify-around items-center flex-wrap gap-10">
|
| 10 |
+
<h1 class="rounded-xl font-bold text-2xl bg-surface-ligt p-4 flex-1">
|
| 11 |
Panel principal de Catadores
|
| 12 |
</h1>
|
| 13 |
</header>
|
| 14 |
|
| 15 |
<article>
|
| 16 |
+
<p class="text-2xl font-medium text-center bg-surface-sweet p-4 rounded-lg">
|
| 17 |
Información sobre la sesión en la que participa
|
| 18 |
</p>
|
| 19 |
</article>
|
|
|
|
| 31 |
{% if message %}
|
| 32 |
<hr>
|
| 33 |
|
| 34 |
+
<article class="bg-surface-alter-card p-4 rounded-xl max-w-2xl">
|
| 35 |
+
<p class="block text-xl antialiased font-bold text-center">
|
| 36 |
{{ message }}
|
| 37 |
</p>
|
| 38 |
</article>
|
|
|
|
| 41 |
<hr>
|
| 42 |
|
| 43 |
<article
|
| 44 |
+
class="rounded-xl grid grid-cols-1 gap-3 text-center *:bg-surface-card *:flex *:flex-wrap *:items-center *:justify-center *:gap-x-2 *:p-4 *:rounded-2xl">
|
| 45 |
{% if session %}
|
| 46 |
<section>
|
| 47 |
<p class="text-xl font-bold">
|
|
|
|
| 99 |
|
| 100 |
<article class="flex flex-wrap gap-10">
|
| 101 |
{% if has_ended %}
|
| 102 |
+
<div class="text-2xl font-semibold flex-1 cts-btn-secondary p-4 flex justify-center items-center rounded-lg select-none">
|
| 103 |
+
<p class=" text-black">Finalizaste la repetición</p>
|
| 104 |
+
</div>
|
|
|
|
| 105 |
{% else %}
|
| 106 |
<button
|
| 107 |
+
class="ct-btn-start-repition flex-1 uppercase text-lg tracking-wider cts-btn-general cts-btn-primary btn-push flex flex-col justify-center items-center gap-2"
|
| 108 |
onclick="startTest()">
|
| 109 |
Iniciar técnica
|
| 110 |
<figure class="w-10">
|
|
|
|
| 113 |
</button>
|
| 114 |
{% endif %}
|
| 115 |
<button
|
| 116 |
+
class="flex-1 uppercase text-lg tracking-wider cts-btn-general cts-btn-error btn-push flex flex-col justify-center items-center gap-2"
|
| 117 |
+
onclick="closeSession()">
|
| 118 |
Salir se la sesión
|
| 119 |
<figure class="w-10">
|
| 120 |
<img src="{% static 'img/exit.svg' %}" alt="bote de basura" class="invert">
|
|
|
|
| 124 |
|
| 125 |
<form action="" method="post" class="hidden ct-action-form">
|
| 126 |
{% csrf_token %}
|
| 127 |
+
<input type="hidden" class="action-option" name="action" value="start_posting">
|
| 128 |
</form>
|
| 129 |
</article>
|
| 130 |
</article>
|
tecnicas/views/sessions_config/create_session.py
CHANGED
|
@@ -118,7 +118,7 @@ def createSession(req: HttpRequest):
|
|
| 118 |
words_using = style_controller.relatedWords()
|
| 119 |
if isinstance(words_using, dict):
|
| 120 |
controllerTechnique.deleteTechnique()
|
| 121 |
-
return general_error("error")
|
| 122 |
|
| 123 |
# //////////////////////////////////////////////////////// #
|
| 124 |
#
|
|
@@ -148,6 +148,12 @@ def createSession(req: HttpRequest):
|
|
| 148 |
}
|
| 149 |
}
|
| 150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
keys_forms = [
|
| 152 |
"form_basic",
|
| 153 |
"form_tags",
|
|
|
|
| 118 |
words_using = style_controller.relatedWords()
|
| 119 |
if isinstance(words_using, dict):
|
| 120 |
controllerTechnique.deleteTechnique()
|
| 121 |
+
return general_error(words_using["error"])
|
| 122 |
|
| 123 |
# //////////////////////////////////////////////////////// #
|
| 124 |
#
|
|
|
|
| 148 |
}
|
| 149 |
}
|
| 150 |
|
| 151 |
+
# /////////////////////////////// #
|
| 152 |
+
#
|
| 153 |
+
# Final step: Delete session keys #
|
| 154 |
+
#
|
| 155 |
+
# /////////////////////////////// #
|
| 156 |
+
|
| 157 |
keys_forms = [
|
| 158 |
"form_basic",
|
| 159 |
"form_tags",
|
tecnicas/views/tester_forms/main_tester_form.py
CHANGED
|
@@ -20,7 +20,11 @@ def mainTesterForm(req: HttpRequest):
|
|
| 20 |
|
| 21 |
if not isinstance(order, dict):
|
| 22 |
req.session["id_order"] = order.id
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
context["message"] = "El catador ha terminado de realizar su evaluación, espere instrucciones del presentador"
|
| 25 |
context["has_ended"] = True
|
| 26 |
|
|
|
|
| 20 |
|
| 21 |
if not isinstance(order, dict):
|
| 22 |
req.session["id_order"] = order.id
|
| 23 |
+
is_end = view_controller.isEndedSession(
|
| 24 |
+
id_participation=req.session["id_participation"], repetition=session.tecnica.repeticion)
|
| 25 |
+
|
| 26 |
+
if is_end:
|
| 27 |
+
print("Estoy dentro y termine [0_0]")
|
| 28 |
context["message"] = "El catador ha terminado de realizar su evaluación, espere instrucciones del presentador"
|
| 29 |
context["has_ended"] = True
|
| 30 |
|
theme/static_src/src/styles.css
CHANGED
|
@@ -14,6 +14,10 @@
|
|
| 14 |
@apply font-bold rounded-lg text-xl p-4 text-center;
|
| 15 |
}
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
.cts-btn-primary {
|
| 18 |
@apply text-white bg-btn-primary border-green-800;
|
| 19 |
}
|
|
|
|
| 14 |
@apply font-bold rounded-lg text-xl p-4 text-center;
|
| 15 |
}
|
| 16 |
|
| 17 |
+
.cts-btn-general-compress {
|
| 18 |
+
@apply font-bold rounded-lg text-xl text-center;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
.cts-btn-primary {
|
| 22 |
@apply text-white bg-btn-primary border-green-800;
|
| 23 |
}
|