h5p-interactive-book icon indicating copy to clipboard operation
h5p-interactive-book copied to clipboard

WIP: add options hideScoreBeforeSubmit, showSolutionsAfterSubmit

Open kwibus opened this issue 2 years ago • 2 comments

My goal is that you only can view you score after you have submitted your answers. see also #133

I have made a options hideScoreBeforeSubmit that enables this.

Also add option showSolutionsAfterSubmit that will make interactive book will show Solutions of all question after submit answers.

TODO

  • [ ] clean up
  • [ ] I don't like how score in written now after submit. now is: - chapter is redrawn. - then .h5p-interactive-book-summary-buttons is found and styled/focused
  • [ ] save and restore that you have submitted you answers

kwibus avatar Aug 28 '23 09:08 kwibus

@kwibus You will at least need to:

  • update the translation files to reflect the new structure of semantics.json, otherwise the editor may break in other languages than English.
  • adhere to the H5P coding style: for instance there should not be a space between a negating ! and the following expression, one should not use != but !==, use singe quotes for strings (not double quotes and not ` unless you're using a template literal, etc.
  • remove TODOs or implement them.
  • use const instead of let when a variable is not going to change (wrapper).
  • proof-read your translatable strings in semantics.json
  • add the new translatable strings to the sanitizeConfig function.

maybe you'd also want to ...

  • not use query selectors, but use variables instead - in particular if the wrapper variable is available (and automatically remove potentially confusing re-use of the same variable name in nested variable scopes) - yes, that may require rewriting something else, but you have a "TODO" attached to that part anyway.
  • ensure that the "don't show score" state is reset as well when the user resets the exercise.
  • wait for someone of the H5P core team to confirm that this feature is desired, otherwise you may waste your time (except for having some coding exercise).

otacke avatar Aug 28 '23 10:08 otacke

Thanks for you fast feedback,

I think wont be hard to fix those issues. Als I think you right in that it might be better to wait until someone of the H5P Core team confirms this is a desired feature. So I will wait on that.

kwibus avatar Sep 08 '23 09:09 kwibus