Skip to content

Update logic for choosing prompt and correct answer for pre- and post-tests. #56

@davidharting

Description

@davidharting

Update Please see my next comment that outlines a better approach for dealing with this.


For normal book reading, we decide if we are using a number or size prompt based on the "mode" (which is in turn based on the "treatment" that is set up at the beginning).

However, for pre- and post-tests there is only one prompt and correct answer per question.

So when choosing a prompt and when grading answers, the logic will need to be updated by passing in the "type" (pre-test, post-test, or regular book) so that we can update the logic.

Effected places:

  • Getting the choices
    Currently, this based on difficulty. However, for pre- and post-tests, difficulty is not relevant. So we need to detect that we are in a pre- or post-test and simply select the one difficulty level that is present.
    src/models/Question.ts#getDifficulty
  • Getting the prompt: src/models/Question.ts getPrompt
  • Grading a selection
    src/models/Question.ts#isSelectionCorrect which in turn depends on src/models/Choice.ts#isSelectionCorrect.
    For a regular book, identifying the correct answer depends on the mode. However, for pre- and post-tests, we will make the assumption that only one of the fields is specified - either the correct number stimulus or the correct size stimulus. So we will need to pass along information about the book type. If a regular book, use mode as normal. If a pre- or post-test, then ignore the mode and identify which field is not null and use that one.

To identify more places that may be effected, in VS Code do a global search for "mode" - CTRL + SHIFT + F to open up the global search on windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions