Compare commits
No commits in common. "4bc3a276999a525590fea2f9270f2eb6dc0cc1a7" and "ed95d6b388216f1d1b93cded53901cd5c1549be0" have entirely different histories.
4bc3a27699
...
ed95d6b388
|
@ -5,8 +5,6 @@
|
||||||
"pick_num_verses": "Pick Number of Verses:",
|
"pick_num_verses": "Pick Number of Verses:",
|
||||||
"num_verses_tested": "Number of Verses Tested:",
|
"num_verses_tested": "Number of Verses Tested:",
|
||||||
"note_num_verses": "(It will only give you as many verses as there are in selected packs)",
|
"note_num_verses": "(It will only give you as many verses as there are in selected packs)",
|
||||||
"set_review": "Set Review Mode",
|
|
||||||
"note_set_review": "Choose between test mode (default) or review mode",
|
|
||||||
"set_shuffle": "Set Shuffle:",
|
"set_shuffle": "Set Shuffle:",
|
||||||
"note_set_shuffle": "(Otherwise cards will appear in sequential order)",
|
"note_set_shuffle": "(Otherwise cards will appear in sequential order)",
|
||||||
"hide_reference": "Set Hide Reference:",
|
"hide_reference": "Set Hide Reference:",
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
"pick_num_verses": "암송 구절 선택:",
|
"pick_num_verses": "암송 구절 선택:",
|
||||||
"num_verses_tested": "구절 수 선택:",
|
"num_verses_tested": "구절 수 선택:",
|
||||||
"note_num_verses": "(It will only give you as many verses as there are in selected packs)",
|
"note_num_verses": "(It will only give you as many verses as there are in selected packs)",
|
||||||
"set_review": "Set Review Mode",
|
|
||||||
"note_set_review": "Choose between test mode (default) or review mode",
|
|
||||||
"set_shuffle": "무작위 설정:",
|
"set_shuffle": "무작위 설정:",
|
||||||
"note_set_shuffle": "(Otherwise cards will appear in sequential order)",
|
"note_set_shuffle": "(Otherwise cards will appear in sequential order)",
|
||||||
"hide_reference": "Set Hide Reference:",
|
"hide_reference": "Set Hide Reference:",
|
||||||
|
|
|
@ -1,119 +0,0 @@
|
||||||
.App {
|
|
||||||
max-width: 400px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.VersePrinter {
|
|
||||||
padding-block: 1px 10px;
|
|
||||||
border-top: 1px solid black;
|
|
||||||
max-width: 400px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reference-box {
|
|
||||||
max-width:400px;
|
|
||||||
height: 5vh;
|
|
||||||
field-sizing: content; /* not yet implemented in firefox and safari */
|
|
||||||
display: block;
|
|
||||||
width: 99%;
|
|
||||||
border: 1px solid grey;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chapter-title-box {
|
|
||||||
max-width:400px;
|
|
||||||
height: 5vh;
|
|
||||||
field-sizing: content; /* not yet implemented in firefox and safari */
|
|
||||||
display: block;
|
|
||||||
width: 99%;
|
|
||||||
border: 1px solid grey;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title-box {
|
|
||||||
max-width: 400px;
|
|
||||||
height: 5vh;
|
|
||||||
field-sizing: content; /* not yet implemented in firefox and safari */
|
|
||||||
display: block;
|
|
||||||
width: 99%;
|
|
||||||
border: 1px solid grey;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reference-label .main-title-box-label .title-box-label .verse-box-label {
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.verse-box {
|
|
||||||
max-width:400px;
|
|
||||||
min-height: 12vh;
|
|
||||||
field-sizing: content; /* not yet implemented in firefox and safari */
|
|
||||||
display: block;
|
|
||||||
width: 99%;
|
|
||||||
border: 1px solid grey;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.answer-button-box {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.answer-box {
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.diff-box {
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: light) {
|
|
||||||
.correct {
|
|
||||||
background-color: #e6ffe6; /* Change the background color as needed */
|
|
||||||
}
|
|
||||||
|
|
||||||
.partial {
|
|
||||||
background-color: #dafcff; /* Change the background color as needed */
|
|
||||||
}
|
|
||||||
|
|
||||||
.incorrect {
|
|
||||||
background-color: transparent; /* Change the background color as needed */
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--background-color-removed: #f1ebb3;
|
|
||||||
--background-color-added: #ffd7b6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
.correct {
|
|
||||||
background-color: #2e5e2e; /* Change the background color as needed */
|
|
||||||
}
|
|
||||||
|
|
||||||
.partial {
|
|
||||||
background-color: #004d5c; /* Change the background color as needed */
|
|
||||||
}
|
|
||||||
|
|
||||||
.incorrect {
|
|
||||||
background-color: transparent; /* Change the background color as needed */
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--background-color-removed: #877e2a;
|
|
||||||
--background-color-added: #7b4418;
|
|
||||||
}
|
|
||||||
|
|
||||||
.VersePrinter {
|
|
||||||
border-top: 1px solid white; /* override for dark mode */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,58 +0,0 @@
|
||||||
import { useState } from "react";
|
|
||||||
import "./VersePrinter.css";
|
|
||||||
import { StringDiff } from "react-string-diff";
|
|
||||||
import { containsKorean, jamoSubstringMatch } from './utils';
|
|
||||||
|
|
||||||
const STATE = {
|
|
||||||
INCORRECT: 0,
|
|
||||||
PARTIAL: 1,
|
|
||||||
CORRECT: 2,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// function to render and handle logic of each of the cells
|
|
||||||
const VersePrinter = ({ element: { pack, title, chapterTitle, reference, verse } , t, index}) => { // useful use of destructuring here
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="VersePrinter">
|
|
||||||
<div className="verse-number">
|
|
||||||
<h3>Verse {index}</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* This shows the difference between given and input answers*/}
|
|
||||||
<div className="diff-box">
|
|
||||||
|
|
||||||
<p></p>
|
|
||||||
<div>
|
|
||||||
<h3>Reference:</h3>
|
|
||||||
<p>{reference}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p></p>
|
|
||||||
{chapterTitle && (
|
|
||||||
<div>
|
|
||||||
<h3>Chapter Title:</h3>
|
|
||||||
<p>{chapterTitle}</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<p></p>
|
|
||||||
<div>
|
|
||||||
<h3>Title:</h3>
|
|
||||||
<p>{title}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p></p>
|
|
||||||
<div>
|
|
||||||
<h3>Verse: </h3>
|
|
||||||
<p>{verse}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export default VersePrinter
|
|
|
@ -10,7 +10,6 @@ import 'react-checkbox-tree/lib/react-checkbox-tree.css';
|
||||||
import _ from 'underscore';
|
import _ from 'underscore';
|
||||||
import './VerseSampler.css'
|
import './VerseSampler.css'
|
||||||
import VerseValidator from "./VerseValidator";
|
import VerseValidator from "./VerseValidator";
|
||||||
import VersePrinter from "./VersePrinter";
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import logo from './assets/droplet.svg';
|
import logo from './assets/droplet.svg';
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
|
@ -45,36 +44,6 @@ const ArrayTester = ({ array, toHideReference, translate}) => {
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
|
||||||
const GenerateReviewList = ({ VerseData, packs, testCount, toShuffle, translate}) => {
|
|
||||||
let testList = packs.reduce(
|
|
||||||
// grab all elements included checked in "packs"
|
|
||||||
(accumulator, currentValue) => accumulator.concat(VerseData[currentValue]),
|
|
||||||
new Array()
|
|
||||||
);
|
|
||||||
testList = toShuffle ? _.sample(testList, testCount) : _.first(testList, testCount);
|
|
||||||
return (
|
|
||||||
<ArrayPrinter
|
|
||||||
array={testList}
|
|
||||||
translate={translate}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const ArrayPrinter = ({ array, translate}) => {
|
|
||||||
const list = array.map((element, index) => (
|
|
||||||
// key needs to be unique; chose 3 elements that will separate all elements
|
|
||||||
<VersePrinter
|
|
||||||
key={element.pack + element.title + element.reference}
|
|
||||||
element={element}
|
|
||||||
t={translate} // this passes the t i18 object to the function
|
|
||||||
index={index + 1}
|
|
||||||
/>
|
|
||||||
))
|
|
||||||
return list
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const CheckboxWidget = ({nodes, checked, expanded, setChecked, setExpanded}) => {
|
const CheckboxWidget = ({nodes, checked, expanded, setChecked, setExpanded}) => {
|
||||||
return (
|
return (
|
||||||
<div className="CheckboxTree">
|
<div className="CheckboxTree">
|
||||||
|
@ -167,36 +136,18 @@ function Page() {
|
||||||
const [toShuffle, setShuffle] = useState(false);
|
const [toShuffle, setShuffle] = useState(false);
|
||||||
// Function to handle checkbox change
|
// Function to handle checkbox change
|
||||||
const handleShuffleCheckboxChange = () => {
|
const handleShuffleCheckboxChange = () => {
|
||||||
|
// Toggle the state when the checkbox is changed
|
||||||
|
setShuffle(!toShuffle);
|
||||||
// additional state change to disable HideReference when shuffling
|
// additional state change to disable HideReference when shuffling
|
||||||
if (!toShuffle) {
|
if (!toShuffle) {
|
||||||
setHideReference(false);
|
setHideReference(false);
|
||||||
}
|
}
|
||||||
// Toggle the state when the checkbox is changed
|
|
||||||
// modify state at the end
|
|
||||||
setShuffle(!toShuffle);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// state for toReview
|
|
||||||
const [toReview, setReview] = useState(false);
|
|
||||||
// Function to handle checkbox change
|
|
||||||
const handleReviewCheckboxChange = () => {
|
|
||||||
// additional state change to disable HideReference when reviewing
|
|
||||||
if (!toReview) {
|
|
||||||
setHideReference(false);
|
|
||||||
}
|
|
||||||
// Toggle the state when the checkbox is changed
|
|
||||||
// modify state at the end
|
|
||||||
setReview(!toReview);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// state for toHideReference
|
// state for toHideReference
|
||||||
const [toHideReference, setHideReference] = useState(false);
|
const [toHideReference, setHideReference] = useState(false);
|
||||||
// Function to handle checkbox change
|
// Function to handle checkbox change
|
||||||
const handleHideReferenceCheckboxChange = () => {
|
const handleHideReferenceCheckboxChange = () => {
|
||||||
if (!toHideReference) {
|
|
||||||
setHideReference(false);
|
|
||||||
}
|
|
||||||
// Toggle the state when the checkbox is changed
|
// Toggle the state when the checkbox is changed
|
||||||
setHideReference(!toHideReference);
|
setHideReference(!toHideReference);
|
||||||
};
|
};
|
||||||
|
@ -225,17 +176,6 @@ function Page() {
|
||||||
|
|
||||||
<p>{t('main.note_num_verses')}</p>
|
<p>{t('main.note_num_verses')}</p>
|
||||||
|
|
||||||
<h2>
|
|
||||||
{t('main.set_review')}
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={toReview}
|
|
||||||
onChange={handleReviewCheckboxChange}
|
|
||||||
/>
|
|
||||||
</h2>
|
|
||||||
<p>{t('main.note_set_review')}</p>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
{t('main.set_shuffle')}
|
{t('main.set_shuffle')}
|
||||||
<input
|
<input
|
||||||
|
@ -247,7 +187,7 @@ function Page() {
|
||||||
<p>{t('main.note_set_shuffle')}</p>
|
<p>{t('main.note_set_shuffle')}</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{!(toShuffle || toReview) ?
|
{!toShuffle ?
|
||||||
<>
|
<>
|
||||||
<h2>
|
<h2>
|
||||||
{t('main.hide_reference')}
|
{t('main.hide_reference')}
|
||||||
|
@ -282,14 +222,6 @@ function Page() {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1>{t('main.verses')}</h1>
|
<h1>{t('main.verses')}</h1>
|
||||||
{toReview ?
|
|
||||||
<GenerateReviewList
|
|
||||||
VerseData={VerseData}
|
|
||||||
packs={checked}
|
|
||||||
testCount={testCount}
|
|
||||||
toShuffle={toShuffle}
|
|
||||||
translate={t}
|
|
||||||
/> :
|
|
||||||
<GenerateTestList
|
<GenerateTestList
|
||||||
VerseData={VerseData}
|
VerseData={VerseData}
|
||||||
packs={checked}
|
packs={checked}
|
||||||
|
@ -298,7 +230,6 @@ function Page() {
|
||||||
toHideReference={toHideReference}
|
toHideReference={toHideReference}
|
||||||
translate={t}
|
translate={t}
|
||||||
/>
|
/>
|
||||||
}
|
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
|
|
@ -1875,7 +1875,7 @@
|
||||||
"chapterTitle": "Bridge Illustration",
|
"chapterTitle": "Bridge Illustration",
|
||||||
"title": "Man must - Hear and believe",
|
"title": "Man must - Hear and believe",
|
||||||
"reference": "John 5:24",
|
"reference": "John 5:24",
|
||||||
"verse": "I tell you the truth, whoever hears my word and believes him who sent me has eternal life and will not be condemned; he has crossed over from death to life."
|
"verse": "I tell you the truth, whoever hears my word and believes him who sent me has eternal life and will not be condemned; he hsa crossed over from death to life."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pack": "DEP6",
|
"pack": "DEP6",
|
||||||
|
|
Loading…
Reference in New Issue