Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checking questions are now ID'd by verse rather than chunk. #190

Open
da1nerd opened this issue Oct 26, 2016 · 2 comments
Open

checking questions are now ID'd by verse rather than chunk. #190

da1nerd opened this issue Oct 26, 2016 · 2 comments

Comments

@da1nerd
Copy link
Contributor

da1nerd commented Oct 26, 2016

The translation process in the app was designed to associate everything by chunks. This is required because users can manually create new questions/notes, as such there is no reliable way to associate the new question/note with a particular verse unless we specifically ask the user what verse it belongs to.

In other words: We could have the verse associations in the original source questions, but the translation of those questions would not.

Need for verse associations

  • Do we actually need questions to be linked to a particular verse?
  • The content creators wanted a way to identify questions at the verse level (why?).

Possible long term solutions

  • require users to specify which verse a particular note/question refers to. This can be problematic if it refers to a span of verses. Also, what if a user wants to add multiple questions for a single verse?
  • update the api to group questions by chunk. This won't really work because we are still losing the verse information.

Short term fix

The app will match verses to chunks so that the app can display all of the questions.
Here's a sample algorithm:

let verse = '03';
let chunks = ['01', '05', '08'];
let mappedChunk = null;

for(let chunk of chunks) {
  try { // Note: in javascript parseInt will return NaN rather than throw an exception.
    if(parseInt(chunk) > parseInt(verse)) {
      break;
    }
    mappedChunk = chunk;
  } catch (err) {
    // TRICKY: some chunks are not numbers
    if(chunk == verse) {
      mappedChunk = chunk;
      break;
    }
  }
}
return mappedChunk;

The algorithm assumes the following:

  • chunks are sorted
  • chunks may not always be numbers (e.g. it could be 'title', 'reference')
  • the mapped chunk may be null if the verse is invalid
@lrsallee
Copy link

lrsallee commented Oct 26, 2016

The references in the TQ's are NOT chunk references. They are already verse references. Each question is already associated with a specific verse or range of verses. The verse range is always within a chunk, but that is probably irrelevant to you.

@lrsallee
Copy link

The reason for the verse references is the intended use of the questions involved reading a section of a translation, asking the questions, and seeing if users knew the answer. If not, it would be helpful to show them in which verse it was found and discuss it.

@da1nerd da1nerd added the Epic label Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants