Commit b00e131e authored by ZeMKI's avatar ZeMKI
Browse files

Bug smashing

* removed column duplicates from network sorting exports.
* now the network sorting interview check for the center of the "person" token to check if it's inside a section or not.
* now you can upload token without image during interview.
* same site cookies improved to Laravel 8 standards.
parent d96d0c56
......@@ -50,12 +50,10 @@ class AllInterviewTokenExport implements FromCollection, WithMapping, WithHeadin
array_push($columnNames, "sorting number");
array_push($columnNames, "position (pixels)");
array_push($columnNames, "% percentage position");
array_push($columnNames, "Interviewee Name");
array_push($columnNames, "classifiers");
}else{
array_push($columnNames, "position column/row");
array_push($columnNames, "token description");
array_push($columnNames, "Interviewee Name");
}
......@@ -132,15 +130,13 @@ class AllInterviewTokenExport implements FromCollection, WithMapping, WithHeadin
$toPrint['interview id'] = $token->interview_id;
$toPrint['interviewee'] = $interviewee;
ray($token);
if($token->interview->study->sortings[0]->id == 3)
{
ray("sorting 3");
$toPrint["position column/row"] = $position;
$toPrint["token description"] = json_decode($token->properties) ? json_decode($token->properties)->description : '' ;
}else{
ray("not sorting 3");
$toPrint["circle"] = $token->valutation->circle;
$toPrint["distance from center (pixels)"] = $token->valutation->distance;
$toPrint["sorting number"] = $token->valutation->sorting;
......
......@@ -35,7 +35,7 @@ class InterviewTokenExport implements FromCollection, WithMapping, WithHeadings
public function headings(): array
{
$columnNames = ["#"];
$columnNames = ["token_id"];
array_push($columnNames, "token_name");
if($this->sorting == 1 || $this->sorting == 2)
{
......@@ -45,9 +45,7 @@ class InterviewTokenExport implements FromCollection, WithMapping, WithHeadings
array_push($columnNames, "position (pixels)");
array_push($columnNames, "% percentage position");
array_push($columnNames, "Interviewee Name");
array_push($columnNames, "classifiers");;
array_push($columnNames, "section number");;
array_push($columnNames, "section name");;
array_push($columnNames, "classifiers");
}else{
array_push($columnNames, "position column/row");
......@@ -80,25 +78,24 @@ class InterviewTokenExport implements FromCollection, WithMapping, WithHeadings
}
}
$tempValuesArray = [];
$tempValuesArray["#"] = $token->token_id;
$tempValuesArray["token_id"] = $token->token_id;
$tempValuesArray["token_name"] = Token::where('id', $token->token_id)->first()->name;
if($token->interview->study->sortings[0]->id == 3)
{
$tempValuesArray["position column/row"] = $position;
$tempValuesArray["token description"] = json_decode($token->properties) ? json_decode($token->properties)->description : '' ;
$tempValuesArray["interviewee name"] = $token->interview->interviewed;
}else{
$tempValuesArray["circle"] = $token->valutation->circle;
$tempValuesArray["distance from center (pixels)"] = $token->valutation->distance;
$tempValuesArray["sorting number"] = $token->valutation->sorting;
$tempValuesArray["position (pixels)"] = $position;
$tempValuesArray["% percentage position"] = $percentagePosition;
$tempValuesArray["interviewee name"] = $token->interview->interviewed;
$tempValuesArray["classifiers"] = $classifiers;
}
$tempValuesArray["interviewee name"] = $token->interview->interviewed;
if ($token->interview->study->sortings[0]->id === 2)
{
$tempValuesArray['section number'] = strval($token->valutation->section);
......
......@@ -86,9 +86,9 @@ class Token extends Model
{
$thereIsImageToUpload = isset($tokenToSave['base64']) || isset($tokenToSave['fileUpload']);
$thereIsImageToUpload = isset($tokenToSave['base64']) || isset($tokenToSave['fileUpload']) || isset($tokenToSave['file']['base64']);
if ($thereIsImageToUpload || $isInterview)
if ($thereIsImageToUpload)
{
if($isInterview) $image = $tokenToSave['file']['base64'];
else $image = isset($tokenToSave['fileUpload']) && $tokenToSave['fileUpload'] != [] ? $tokenToSave['fileUpload']['base64'] : $tokenToSave['base64'];
......@@ -101,6 +101,7 @@ class Token extends Model
$base64FirstPart = $arr[0];
$studyPath = storage_path('app/study' . $study->id . '/tokens/');
File::isDirectory($studyPath) or File::makeDirectory($studyPath, 0775, true, true);
self::saveImage($image, $studyPath, $name, $base64FirstPart, $study, $tokenToSave, $token);
}
......
......@@ -194,6 +194,6 @@ return [
|
*/
'same_site' => null,
'same_site' => "lax",
];
......@@ -4,7 +4,7 @@
<div v-if="currentsorting === sorting" :class="'modal'+currentsorting +' opacity-0 pointer-events-none fixed w-full h-full top-0 left-0 flex items-center justify-center z-50 '">
<div class="absolute w-full h-full bg-gray-900 opacity-50" @click.prevent="togglePersonModal()"></div>
<div class="modal-container bg-white w-1/3 mx-auto rounded shadow-lg z-50 overflow-y-auto">
<div class="modal-container bg-white w-1/3 mx-auto z-50">
<div class="absolute top-0 right-0 cursor-pointer flex flex-col items-center mt-4 mr-4 text-white text-sm z-50" @click.prevent="togglePersonModal()">
X
......@@ -12,7 +12,7 @@
</div>
<!-- Add margin if you want to see some of the overlay behind the modal-->
<div class="modal-content py-4 text-left px-6">
<div class="modal-content py-4 text-left w-auto px-6 py-4">
<!--Title-->
<div class="flex justify-between items-center pb-3">
<p class="text-2xl font-bold">{{ trans('Create a Person') }}</p>
......@@ -22,7 +22,7 @@
</div>
<!--Body-->
<div class="w-1/2 mx-auto">
<div class="w-2/3 mx-auto">
<img :src="newtoken.file.base64"
alt="person"
class="m-auto w-25"
......@@ -339,9 +339,10 @@ export default {
},
isInsideSector: function (point, center, sectorStart, sectorEnd, radiusSquared) {
// 25 is the half of the size of the token
let relPoint = {
x: point.x - center.x,
y: point.y - center.y,
x: point.x - center.x + 25,
y: point.y - center.y - 25,
};
return this.areClockwise(sectorStart, relPoint) &&
......
......@@ -455,7 +455,7 @@ export default {
self.createcircles();
}
self.loading = false;
}, 50);
}, 250);
if (this.gotos) {
this.interview.currentpage = 1;
......@@ -1135,6 +1135,7 @@ export default {
let isNetworkSorting = self.sorting[0].id === 2
let isQsort = self.sorting[0].id === 3
if (isNetworkSorting) {
self.loading = true;
setTimeout(function () {
self.interview.center_x = self.$refs['sortingContainer' + self.sortingtotal][0].center_x;
......@@ -1173,7 +1174,7 @@ export default {
});*/
}, 1500);
}, 2000);
}
else if (isQsort) {
......
......@@ -23,7 +23,7 @@
</h1>
<h6 class="text-red-600 mt-1 text-xl">
{{
trans('To create a new study, you should provide some general information, choose a sorting scheme you wish to use and can add additional questions for your interviewees. To navigate between these options please use the three tabs provided below.')
trans('To create a new study, you should provide some general information, choose a sorting scheme you wish to use and add additional questions for your interviewees. To navigate between these options please use the three tabs provided below.')
}}</h6>
<div
class="w-full mx-auto">
......
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