From 0caf896f5230b4e0c834d334773a18f61bc72d41 Mon Sep 17 00:00:00 2001 From: Daniel Molares Date: Mon, 26 Aug 2024 15:53:37 -0400 Subject: [PATCH 1/2] Added question bank value safeguarding --- src/controllers/ctl-creator.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/controllers/ctl-creator.js b/src/controllers/ctl-creator.js index 03753dd..6bfdd8d 100644 --- a/src/controllers/ctl-creator.js +++ b/src/controllers/ctl-creator.js @@ -76,8 +76,14 @@ export const ControllerThisOrThatCreator = function($scope, $timeout, $sanitize, $scope.questionBankVal ) if (qset) { + // Ensure the question bank value isn't out of bounds when the widget is saved + if($scope.questionBankVal > $scope.questions.length) { + $scope.questionBankVal = $scope.questions.length + } + return Materia.CreatorCore.save($sanitize($scope.title), qset, 2) } + } else { Materia.CreatorCore.cancelSave('Please make sure every question is complete') @@ -297,6 +303,11 @@ export const ControllerThisOrThatCreator = function($scope, $timeout, $sanitize, $timeout(_noTransition, 660, true) $scope.questions.splice(index, 1) + // Make sure questionBank value is within bounds after removing a question + if($scope.questionBankVal > $scope.questions.length) { + $scope.questionBankVal = $scope.questionBankValTemp = $scope.questions.length + } + if ($scope.currIndex === $scope.questions.length) { $timeout(() => _updateIndex('remove'), 200, true) } From 288d169afe35eb90356ac116908a7b76b3016717 Mon Sep 17 00:00:00 2001 From: Dynie Mesoneuvre Date: Mon, 16 Sep 2024 14:45:23 -0400 Subject: [PATCH 2/2] allowed score screen to handle text overflow using scroll --- src/scoreScreen.scss | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/scoreScreen.scss b/src/scoreScreen.scss index 8a5ed32..877c01b 100644 --- a/src/scoreScreen.scss +++ b/src/scoreScreen.scss @@ -13,12 +13,12 @@ body { display: block; width: 90%; margin: 15px 5% 45px 5%; - + color: #fff; font-weight: bold; text-align: center; - + h5 { position: relative; background: #2e4a87; @@ -41,7 +41,7 @@ body { font-weight: bold; } } - + .item-correct, .item-incorrect { position: relative; z-index: 2; @@ -52,9 +52,9 @@ body { height: 180px; margin-right: 12px; - + padding: 6px; - + border-radius: 6px; vertical-align: top; @@ -68,7 +68,7 @@ body { .item-audio { flex-direction: column; - + span { width: 230px; padding: 10px 5px; @@ -98,8 +98,9 @@ body { font-family: 'Buenard', serif; border-radius: 6px; + overflow-y: auto; } - + .item-image img { max-width: 240px; max-height: 180px; @@ -124,5 +125,5 @@ body { } } - + } \ No newline at end of file