diff --git a/app/Http/Controllers/EvaluationGridTemplateController.php b/app/Http/Controllers/EvaluationGridTemplateController.php index e1640414..749df66b 100644 --- a/app/Http/Controllers/EvaluationGridTemplateController.php +++ b/app/Http/Controllers/EvaluationGridTemplateController.php @@ -122,13 +122,13 @@ protected function createNewRowTemplates(Collection $data, EvaluationGridTemplat ); EvaluationGridRow::insert( - collect($evaluationGridTemplate->evaluation_grids) + collect($evaluationGridTemplate->evaluationGrids()->get()) ->crossJoin($newRowTemplates) ->map(function ($input) { /** @var EvaluationGrid $evaluationGrid */ /** @var EvaluationGridRowTemplate $rowTemplate */ [$evaluationGrid, $rowTemplate] = $input; - return ['evaluation_grid_id' => $evaluationGrid->id, 'evaluation_grid_row_template' => $rowTemplate->id]; + return ['evaluation_grid_id' => $evaluationGrid->id, 'evaluation_grid_row_template_id' => $rowTemplate->id]; }) ->all() ); diff --git a/app/Http/Requests/EvaluationGridTemplateRequest.php b/app/Http/Requests/EvaluationGridTemplateRequest.php index 1b030b7c..d9d120c1 100644 --- a/app/Http/Requests/EvaluationGridTemplateRequest.php +++ b/app/Http/Requests/EvaluationGridTemplateRequest.php @@ -20,7 +20,6 @@ public function rules() { 'row_templates' => 'required', 'row_templates.*.criterion' => 'required|max:65535', 'row_templates.*.control_type' => 'required|in:' . implode(',', EvaluationGridRowTemplate::CONTROL_TYPES), - 'row_templates.*.control_config' => 'required|json' /*'required|json|validControlConfig'*/, ]; } diff --git a/app/Models/EvaluationGridRowTemplate.php b/app/Models/EvaluationGridRowTemplate.php index 0476b1a0..f90dde90 100644 --- a/app/Models/EvaluationGridRowTemplate.php +++ b/app/Models/EvaluationGridRowTemplate.php @@ -8,7 +8,6 @@ * @property int $order * @property string $criterion * @property string $control_type - * @property string $control_config * @property EvaluationGridTemplate $evaluation_grid_template * @property EvaluationGridRow[] $evaluation_grid_rows */ diff --git a/app/Providers/ValidationServiceProvider.php b/app/Providers/ValidationServiceProvider.php index 2bd5edd4..5343a7db 100644 --- a/app/Providers/ValidationServiceProvider.php +++ b/app/Providers/ValidationServiceProvider.php @@ -5,7 +5,6 @@ use App\Services\Validation\AllExistInCourse; use App\Services\Validation\ExistsInCourse; use App\Services\Validation\MaxEntries; -use App\Services\Validation\ValidControlConfig; use App\Services\Validation\ValidFeedbackContent; use App\Services\Validation\ValidFeedbackContentWithoutObservations; use Illuminate\Support\Facades\Validator; @@ -26,7 +25,6 @@ public function boot(): void { Validator::extend('allExistInCourse', AllExistInCourse::class . '@validate'); Validator::extend('validFeedbackContent', ValidFeedbackContent::class . '@validate'); Validator::extend('validFeedbackContentWithoutObservations', ValidFeedbackContentWithoutObservations::class . '@validate'); - Validator::extend('validControlConfig', ValidControlConfig::class . '@validate'); Validator::extend('maxEntries', MaxEntries::class . '@validate'); Validator::replacer('maxEntries', function ($message, $attribute, $rule, $parameters, $validator) { diff --git a/app/Services/Validation/ValidControlConfig.php b/app/Services/Validation/ValidControlConfig.php deleted file mode 100644 index ab4664f8..00000000 --- a/app/Services/Validation/ValidControlConfig.php +++ /dev/null @@ -1,37 +0,0 @@ -course = $route->parameter('course'); - } - - /** - * Determine if the validation rule passes. - * - * @param $attribute - * @param mixed $value - * @param $parameters - * @param $validator Validator - * @return bool - */ - public function validate($attribute, $value, $parameters, $validator) { - if (!is_array($value)) return false; - - // TODO validate correctly using a suitable business logic class here - //return true; - throw new \Exception('Validating control config is not yet implemented'); - } - -} diff --git a/database/migrations/2024_07_02_222023_create_evaluation_grids.php b/database/migrations/2024_07_02_222023_create_evaluation_grids.php index 44548435..e468ba57 100644 --- a/database/migrations/2024_07_02_222023_create_evaluation_grids.php +++ b/database/migrations/2024_07_02_222023_create_evaluation_grids.php @@ -24,7 +24,6 @@ public function up(): void { $table->integer('order'); $table->text('criterion'); $table->string('control_type'); - $table->json('control_config'); $table->timestamps(); $table->foreign('evaluation_grid_template_id', 'fk_egrt_grid_template')->references('id')->on('evaluation_grid_templates')->onDelete('CASCADE'); diff --git a/lang/de/t.php b/lang/de/t.php index e3eb2c0a..fee26e66 100644 --- a/lang/de/t.php +++ b/lang/de/t.php @@ -116,7 +116,7 @@ "control_type" => "Typ", "control_types" => array( "checkbox" => "Checkbox", - "radiobuttons" => "Nicht erfüllt / erfüllt / übertroffen", + "radiobuttons" => "✘ / ✔ / ✨", "slider" => "Skala von 1 - 10", ), "criterion" => "Kriterium", diff --git a/resources/js/components/evaluationGrid/InputEvaluationGridRowControl.vue b/resources/js/components/evaluationGrid/InputEvaluationGridRowControl.vue index 92859465..3799dc83 100644 --- a/resources/js/components/evaluationGrid/InputEvaluationGridRowControl.vue +++ b/resources/js/components/evaluationGrid/InputEvaluationGridRowControl.vue @@ -3,7 +3,7 @@