Skip to content

Commit

Permalink
added weights to module and question and some refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
susantp committed Dec 17, 2023
1 parent dc8913d commit 950dae5
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/DTO/Questionnaire/ModuleData.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function __construct(
public Optional|Carbon|null $created_at,
public Optional|Carbon|null $updated_at,
public Optional|Carbon|null $deleted_at,
public Optional|string|null $assessment_id
public Optional|string|null $assessment_id,
public int $weight = 0
) {
$this->slug ??= Str::slug($this->name);
}
Expand Down
1 change: 1 addition & 0 deletions app/DTO/Questionnaire/QuestionData.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function __construct(
public Optional|Carbon|null $deleted_at,
public Optional|string|null $module_id,
public QuestionType $type,
public int $weight = 0,
public int $order = 0,
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function up(): void
$table->string('slug')->index();
$table->text('description')->nullable();
$table->string('material')->nullable();
$table->integer('weight')->default(0);
$table->timestamps();
$table->softDeletes();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function up(): void
$table->text('body');
$table->integer('order')->default(0);
$table->string('type', 2);
$table->integer('weight')->default(0);
$table->timestamps();
$table->softDeletes();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class="progress-bar"
<div class="col-10">
<input id="id1" type="hidden" name="questions[0][id]" value="{{\Illuminate\Support\Str::uuid()}}">
<input name="questions[0][body]" type="text" class="form-control mb-2" placeholder="Write question 1"
@required(true) minlength="5" pattern="[a-zA-Z0-9]+"
@required(true) minlength="5"
id="questions1">
</div>
<div class="col-2" onclick="removeInputBox(this)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class="progress-bar"
<input name="questions[{{$loop->index}}][body]"
value="{{$item['body']}}"
type="text"
@required(true) minlength="5" pattern="[a-zA-Z0-9]+"
@required(true) minlength="5"
class="form-control mb-2"
placeholder="Write question 1"
id="questions{{$loop->iteration}}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="col-10">
<input id="id1" type="hidden" name="questions[0][id]" value="{{\Illuminate\Support\Str::uuid()}}">
<input name="questions[0][body]" type="text" class="form-control mb-2" placeholder="Write question 1"
@required(true) minlength="5" pattern="[a-zA-Z0-9]+"
@required(true) minlength="5"
id="questions1">
</div>
<div class="col-2" onclick="removeInputBox(this)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<input name="questions[{{$loop->index}}][body]"
value="{{$item['body']}}"
type="text"
@required(true) minlength="5" pattern="[a-zA-Z0-9]+"
@required(true) minlength="5"
class="form-control mb-2"
placeholder="Write question 1"
id="questions{{$loop->iteration}}">
Expand Down

0 comments on commit 950dae5

Please sign in to comment.