Commit 72659ae3 authored by ZeMKI's avatar ZeMKI
Browse files

Interview view updated

* now you see the column of the token in the interview view.
* now the position saved starts with one as well as the row.
* inserted legend in the interview.view page.
* export adapted to new column values.
parent 418d3e99
......@@ -47,6 +47,7 @@ class InterviewQsortExport implements FromCollection, WithMapping, WithHeadings
array_push($columnNames, "position column/row");
array_push($columnNames, "position base");
array_push($columnNames, "token description");
array_push($columnNames, "Interviewee");
$columns = explode('|separator|', substr($this->study()->sortings[0]->pivot->details, strpos($this->study()->sortings[0]->pivot->details, 'qsort|') + 6));
array_pop($columns);
$baseArray = [];
......@@ -77,7 +78,7 @@ class InterviewQsortExport implements FromCollection, WithMapping, WithHeadings
$tempValuesArray["token_id"] = $token->token_id;
$tempValuesArray["token_name"] = Token::where('id', $token->token_id)->first()->name;
$tempValuesArray["position column/row"] = $position;
$tempValuesArray["position base"] = $this->columnValues[$position[0]];
$tempValuesArray["position base"] = $this->columnValues[($position[0] - 1)];
$tempValuesArray["token description"] = json_decode($token->properties) ? json_decode($token->properties)->description : '';
$tempValuesArray["interviewee name"] = $token->interview->interviewed;
return $tempValuesArray;
......
......@@ -40,6 +40,8 @@ class InterviewController extends Controller
$data['study'] = $interview->study;
$data['questions'] = $interview->study->questions;
$data['sorting'] = $interview->study->sortings[0];
$data['author'] = User::where('id', $interview->author)->first()->email ?? $interview->author;
Answer::assignAnswersToQuestion($interview, $data);
......
......@@ -201,7 +201,7 @@ export default {
this.$store.commit('updateselectedtoken', {});
tokenToChange.position = [key, Math.abs(n - (this.arrayOfQsort[key].length - 1))]
tokenToChange.position = [key + 1, Math.abs(n - (this.arrayOfQsort[key].length - 1))]
}
else {
......
......@@ -2,6 +2,18 @@
@section('content')
<?php
$columns = explode('|separator|', substr($study->sortings[0]->pivot->details, strpos($study->sortings[0]->pivot->details, 'qsort|') + 6));
array_pop($columns);
$baseArray = [];
foreach ($columns as $key => $value)
{
$c = explode('|',$value);
$columns[$key] = $c;
array_push($baseArray,$c[1]);
}
$columnValues = $baseArray;
?>
<div class="w-2/3 mx-auto">
......@@ -48,10 +60,10 @@
@if($study->sortings[0]->id !== 3)
<h1 class="text-2xl font-bold">{{__('0 Created Tokens')}}</h1>
@else
<h1>TOKEN NAME - {{$study->sortings[0]->id === 3 ? 'POSITION (COLUMN,ROW) - COLUMN VALUE' : 'POSITION'}}</h1>
@foreach($sortingtoken as $token)
@if(is_array(json_decode($token->getOriginal()['pivot_valutation'])->position))
{{$token->name}} - {{__('Position')}}: {{implode(",",json_decode($token->getOriginal()['pivot_valutation'])->position)}} <br>
{{$token->name}} - {{__('Position')}}: {{implode(",",json_decode($token->getOriginal()['pivot_valutation'])->position)}} - {{array_key_exists(json_decode($token->getOriginal()['pivot_valutation'])->position[0] - 1,$columnValues) ?? $columnValues[json_decode($token->getOriginal()['pivot_valutation'])->position[0] - 1]}}<br>
@else
{{$token->name}} - {{__('No Position Specified')}}<br>
@endif
......
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