Commit 49389ede authored by ZeMKI's avatar ZeMKI
Browse files

bugfix q-sort view interview

* while viewing interview results, qsort was not showing correct values
* remove console.log
parent 1b22f591
......@@ -255,6 +255,7 @@
>
<img
v-for="(image, index) in classifiers[0]"
:key="index"
v-show="classifier == image.name"
:id="'class' + index"
:alt="image.dirname"
......@@ -273,6 +274,7 @@
<div class="w-full h-screen">
<div
v-for="(x, index) in questions.postsort"
:key="index"
v-show="interview.postsortindex == index"
class="flex flex-wrap items-center justify-center mx-auto text-center transition"
>
......@@ -295,6 +297,7 @@
<div
v-for="(sorting, key) in interview.structure
.sorting"
:key="key"
class="w-full h-full"
style="margin-top: -75px"
>
......@@ -311,6 +314,7 @@
<div class="flex flex-wrap w-full text-center field">
<div
v-for="(a, answerindex) in x.answer"
:key="answerindex"
class="flex-none w-full"
>
<a
......@@ -1858,7 +1862,6 @@ export default {
for (let i = 1; i <= this.sortingtotal; i++) {
if (this.sorting[0].id == 2) {
console.log("clearing storage");
clearInterval(
this.$refs["sortingContainer" + i][0].interval
);
......@@ -1896,7 +1899,7 @@ export default {
let interview = {};
if (this.sorting[0].id === 3 && this.extremeQuestion !== "") {
/// save the extreme questions, if any.
/// Q-Sort save the extreme questions, if any.
_.forEach(
this.$refs["sortingContainer" + this.sortingtotal][0]
.extremes.answers,
......
......@@ -371,14 +371,12 @@ export default {
replaceExistingToken.answer = this.extremes.temporaryAnswer;
replaceExistingToken.question = this.extremeQuestion;
} else if (!existingAnswer) {
console.log("brend new token");
this.extremes.answers.push({
token_id: this.extremes.tokenId,
answer: this.extremes.temporaryAnswer,
question: this.extremeQuestion,
});
} else {
console.log("same token sorted again.");
existingAnswer.token_id = this.extremes.tokenId;
existingAnswer.answer = this.extremes.temporaryAnswer;
existingAnswer.question = this.extremeQuestion;
......@@ -434,7 +432,8 @@ export default {
element.style.top = top.toString() + "%";
},
assignTokenToCell: function (key, n, skip) {
if (!_.isEmpty(this.selectedToken) && !skip) {
let tokenReadyToBeSorted = !_.isEmpty(this.selectedToken) && !skip;
if (tokenReadyToBeSorted) {
if (
(key === 0 || key === this.columns.length - 1) &&
this.extremeQuestion !== ""
......
......@@ -13,6 +13,7 @@ foreach ($columns as $key => $value)
array_push($baseArray,$c[1]);
}
$columnValues = $baseArray;
ray($columnValues);
?>
<div class="w-2/3 mx-auto print:w-full">
......@@ -100,10 +101,10 @@ $columnValues = $baseArray;
{{implode(",",json_decode($token->getOriginal()['pivot_valutation'])->position)}}
</td>
<td class="p-4 text-sm text-gray-500 whitespace-nowrap">
{{array_key_exists(json_decode($token->getOriginal()['pivot_valutation'])->position[0]
- 1,$columnValues) ??
$columnValues[json_decode($token->getOriginal()['pivot_valutation'])->position[0]
- 1]}}
{{array_key_exists(intval(json_decode($token->getOriginal()['pivot_valutation'])->position[0])
- 1,$columnValues) ?
$columnValues[intval(json_decode($token->getOriginal()['pivot_valutation'])->position[0])
- 1] : ""}}
</td>
<td class="py-4 pl-4 pr-4 text-sm text-gray-500 whitespace-nowrap sm:pr-6">
{{$token->answer}}
......
Supports Markdown
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