mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Feedback Form Improvement
This commit is contained in:
@@ -20,9 +20,11 @@ class ExportsFeedback implements FromQuery, WithHeadings, WithHeadingRow, WithMa
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Version',
|
||||
'Question Set',
|
||||
'Question Text',
|
||||
'Answer',
|
||||
'Answer Text',
|
||||
'Answer Value',
|
||||
'Source System',
|
||||
'Source Marking',
|
||||
'Source Email',
|
||||
@@ -56,11 +58,14 @@ class ExportsFeedback implements FromQuery, WithHeadings, WithHeadingRow, WithMa
|
||||
$companyModule = $user->companyModule()->first();
|
||||
$user_marking = $companyModule ? $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference : "";
|
||||
}
|
||||
$answer = $userAnswer->answer;
|
||||
|
||||
return [
|
||||
$userAnswer->question->questionnaire->version,
|
||||
$userAnswer->question->questionnaire->description,
|
||||
$userAnswer->question->question_text,
|
||||
$userAnswer->free_text_answer,
|
||||
$answer->value,
|
||||
$user ? QASystemSourceType::getText(QASystemSourceType::IZYIM) : QASystemSourceType::getText($source->system),
|
||||
$user ? $user_marking : $source->marking,
|
||||
$user ? $user->email : $source->email,
|
||||
|
||||
@@ -34,7 +34,7 @@ class HelpMenuQuestionResource extends JsonResource
|
||||
'question_number' => $q->question_number,
|
||||
'question_text' => $q->question_text,
|
||||
'question_type' => $q->question_type,
|
||||
'question_answers' => HelpMenuAnswerOptionsResource::collection(QAAnswerOptions::where('question_number', $q->question_number)->where('questionnaire_set_id', $q->questionnaire_set_id)->get()),
|
||||
'question_answers' => HelpMenuAnswerOptionsResource::collection(QAAnswerOptions::where('question_number', $q->question_number)->where('questionnaire_set_id', $q->questionnaire_set_id)->orderBy('order', 'ASC')->get()),
|
||||
'questionnaire_set_id' => $q->questionnaire_set_id,
|
||||
'next_nested_question' => $q->next_nested_question,
|
||||
'next_main_question' => $q->next_main_question,
|
||||
|
||||
@@ -18,6 +18,7 @@ class HelpMenuQuestionnaireSetsResource extends JsonResource
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'group' => $this->group,
|
||||
'version' => $this->version,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use App\Classes\ValueObjects\Constants\QASystemSourceType;
|
||||
use App\Models\QAAnswerOptions;
|
||||
use App\Models\QAQuestions;
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -20,6 +21,7 @@ class HelpMenuQuestionsAnswersResource extends JsonResource
|
||||
$question = QAQuestions::where('id', $this->question_id)->first();
|
||||
$source = new HelpMenuUserSourceResource($this->userSource);
|
||||
$user = $this->source_id === 0 ? new UserResource($this->user) : null;
|
||||
$answerOption = QAAnswerOptions::where('id', $this->answer_option_id)->first();
|
||||
|
||||
$user_marking = '';
|
||||
if($user){
|
||||
@@ -32,6 +34,7 @@ class HelpMenuQuestionsAnswersResource extends JsonResource
|
||||
'questionnaire' => new HelpMenuQuestionnaireSetsResource($this->question->questionnaire),
|
||||
'question_text' => $question ? $question->question_text : null,
|
||||
'free_text_answer' => $this->free_text_answer,
|
||||
'answer_value' => $answerOption ? $answerOption->value : null,
|
||||
'source_system' => $user ? QASystemSourceType::getText(QASystemSourceType::IZYIM) : QASystemSourceType::getText($source->system),
|
||||
'source_marking' => $user ? $user_marking : $source->marking,
|
||||
'source_email' => $user ? $user->email : $source->email,
|
||||
|
||||
@@ -46,4 +46,13 @@ class QAUserAnswerSelected extends AbstractModel implements Documentable
|
||||
return $this->BelongsTo(QAQuestions::class, 'question_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function answer(): BelongsTo
|
||||
{
|
||||
return $this->BelongsTo(QAAnswerOptions::class, 'answer_option_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,12 @@ class DatabaseSeeder extends Seeder
|
||||
// $this->call(QAQuestionsDemoSeeder::class); //DEMO POC
|
||||
// $this->call(QAAnswerOptionsDemoSeeder::class); //DEMO POC
|
||||
|
||||
// 20230928 Set 1 to Set 3
|
||||
// $this->call(QAQuestionsSeeder::class);
|
||||
// $this->call(QAAnswerOptionsSeeder::class);
|
||||
|
||||
// 20231121 Set 4 to Set 6
|
||||
// $this->call(QAQuestions2Seeder::class);
|
||||
// $this->call(QAAnswerOptions2Seeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,395 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\QAAnswerOptions;
|
||||
|
||||
class QAAnswerOptions2Seeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
// Set 1
|
||||
// Option 1 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Dissatisfied";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Dissatisfied";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Neutral";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Satisfied";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Satisfied";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 1
|
||||
// Option 1 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Yes";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Partially";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "No";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 1
|
||||
// Option 1 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Clear";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Clear";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Neutral";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Unclear";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Unclear";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Set 2
|
||||
// Option 1 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Yes";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Somewhat";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "No";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 2
|
||||
// Option 1 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Exceeded Expectations";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Met Expectations";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Below Expectations";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 2
|
||||
// Option 1 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Dissatisfied";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Dissatisfied";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Neutral";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Satisfied";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Satisfied";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Set 3
|
||||
// Option 1 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Immediately";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Within a few hours";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Within a day";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "More than a day";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Never received a response";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 3
|
||||
// Option 1 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Clear";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Clear";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Neutral";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Unclear";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Unclear";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 3
|
||||
// Option 1 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Likely";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Likely";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Neutral";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Unlikely";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Unlikely";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\QAQuestionnaireSet;
|
||||
use App\Models\QAQuestions;
|
||||
use App\Classes\ValueObjects\Constants\QAType;
|
||||
|
||||
class QAQuestions2Seeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$questionnaireSets = [
|
||||
[
|
||||
'name' => 'Set 1',
|
||||
'description' => 'Customer Support Satisfaction Survey',
|
||||
'group' => 'feedback',
|
||||
'version' => 2
|
||||
],
|
||||
[
|
||||
'name' => 'Set 2',
|
||||
'description' => 'First Order Experience Feedback',
|
||||
'group' => 'feedback',
|
||||
'version' => 2
|
||||
],
|
||||
[
|
||||
'name' => 'Set 3',
|
||||
'description' => 'Sales Inquiry Experience',
|
||||
'group' => 'feedback',
|
||||
'version' => 2
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($questionnaireSets as $set) {
|
||||
$questionnaireSet = QAQuestionnaireSet::create([
|
||||
'name' => $set['name'],
|
||||
'description' => $set['description'],
|
||||
'group' => $set['group'],
|
||||
'version' => $set['version'],
|
||||
]);
|
||||
|
||||
$questions = [];
|
||||
|
||||
switch ($set['name']) {
|
||||
case 'Set 1':
|
||||
$questions = [
|
||||
[
|
||||
'question_number' => 10,
|
||||
'question_text' => 'On a scale of 1 to 5, how satisfied are you with the time it took to receive a response?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => true,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 20,
|
||||
'question_text' => 'Was your issue resolved during this interaction?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 30,
|
||||
'question_text' => 'How clear and understandable was the communication from the support team?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => true,
|
||||
]
|
||||
];
|
||||
break;
|
||||
case 'Set 2':
|
||||
$questions = [
|
||||
[
|
||||
'question_number' => 10,
|
||||
'question_text' => 'Did you find what you were looking for without any issues?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => true,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 20,
|
||||
'question_text' => 'Did the service meet your expectations?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 30,
|
||||
'question_text' => 'On a scale of 1 to 5, how satisfied are you with the delivery time?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => true,
|
||||
]
|
||||
];
|
||||
break;
|
||||
case 'Set 3':
|
||||
$questions = [
|
||||
[
|
||||
'question_number' => 10,
|
||||
'question_text' => 'How quickly did our sales team respond to your inquiry?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => true,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 20,
|
||||
'question_text' => 'Was the information provided by our sales team clear and easy to understand?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 30,
|
||||
'question_text' => 'After interacting with our sales team, how likely are you to use our service?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => true,
|
||||
]
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($questions as $key => $questionData) {
|
||||
$question = new QAQuestions;
|
||||
$question->question_number = $questionData['question_number'];
|
||||
$question->question_text = $questionData['question_text'];
|
||||
$question->question_type = $questionData['question_type'];
|
||||
$question->questionnaire_set_id = $questionnaireSet->id;
|
||||
|
||||
if (isset($questionData['next_nested_question'])) {
|
||||
$question->next_nested_question = $questionData['next_nested_question'];
|
||||
}
|
||||
if (isset($questionData['next_main_question'])) {
|
||||
$question->next_main_question = $questionData['next_main_question'];
|
||||
}
|
||||
|
||||
$question->is_start = $questionData['is_start'];
|
||||
$question->is_end = $questionData['is_end'];
|
||||
if (isset($questionData['end_text'])) {
|
||||
$question->end_text = $questionData['end_text'];
|
||||
}
|
||||
|
||||
$question->order = $key + 1;
|
||||
$question->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
<template>
|
||||
<div class="row parentContainer">
|
||||
<div class="col-1">{{ item.questionnaire.version }}</div>
|
||||
<div class="col-1">{{ item.questionnaire.description }}</div>
|
||||
<div class="col-2"> <p>{{ item.question_text }}</p> </div>
|
||||
<div class="col-1">{{ item.free_text_answer }}</div>
|
||||
<div class="col-1">{{ item.answer_value }}</div>
|
||||
<div class="col-1">{{ item.source_system }}</div>
|
||||
<div class="col-1">{{ item.source_marking }}</div>
|
||||
<div class="col-2">{{ item.source_email }}</div>
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
<div class="col-12 col-md-8">
|
||||
<validation-wrapper-component selectable class="m-b-15" :validator="$v.parameters.question_set">
|
||||
<label class="text-primary">Question Set</label>
|
||||
<select-component :options="[{'id': 1, 'text': 'Customer Support Satisfaction Survey'}, {'id': 2, 'text': 'First Order Experience Feedback'}, {'id': 3, 'text': 'Sales Inquiry Experience'}]" v-model="parameters.question_set"></select-component>
|
||||
<select-component :options="[{'id': 4, 'text': 'Customer Support Satisfaction Survey'}, {'id': 5, 'text': 'First Order Experience Feedback'}, {'id': 6, 'text': 'Sales Inquiry Experience'}]" v-model="parameters.question_set"></select-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,9 +25,11 @@
|
||||
</button>
|
||||
</anchor-link-component>
|
||||
<div class="row align-items-center m-t-10 p-t-10 p-b-10 b-t b-grey muted all-caps fs-10">
|
||||
<div class="col-1">Version</div>
|
||||
<div class="col-1">Question Set</div>
|
||||
<div class="col-2">Question Text</div>
|
||||
<div class="col-1">Answer</div>
|
||||
<div class="col-1">Answer Text</div>
|
||||
<div class="col-1">Answer Value</div>
|
||||
<div class="col-1">Source System</div>
|
||||
<div class="col-1">Source Marking</div>
|
||||
<div class="col-2">Source Email</div>
|
||||
|
||||
Reference in New Issue
Block a user