Skip to content

Conversation

@bradenmacdonald
Copy link
Member

This fixes OC-667 (upstream bug is a comment in SOL-423): The "Message (max # attempts)" component was not working.

Explanation:
get_message() was called before num_attempts was incremented, so the max_attempts_reached message would never be used, since num_attempts was always less than max_attempts at that point.

Notes:
I wanted to just do a simple fix, which involves moving the get_message() method to after where num_attempts is updated, but the implications of that move were not at all clear due to the complexity of the "submit" handler, and uncertainty about when the various messages are even supposed to be display. So I added a bunch of new tests and documentation to clarify the expected behavior of each type of message (I hope I got it right), and I also simplified the "submit" handler (in Python at least) while I was at it, in order to make the code easier to understand.

Details:

  • Fixed by moving get_message()
  • I added seven new tests for the messages, two of which fail without this fix
  • Added explanations to each type of message so that everyone is clear on the expected behaviour
  • Added per-message-type default text to the messages, which improves the authoring experience significantly
  • Cleaned up the submit() handler somewhat
  • Removed attempted which was not used
  • Change to behavior: Previously if a user submitted an answer to a PB block that "required" the user to complete another block first, the user's individual answers would be saved but the submission would not count. To me, that is a confusing in-between state. The code is much simpler if we just make the handler throw an error on any request to submit a block whose dependencies are not satisfied, so that's what I've done. We do still show the submit button though in case the prerequisite block is on the same page - otherwise the user would have to refresh.

Confusion:

  • In assessment mode, "completed" means the student has gone through all the questions at least once. But in normal mode, it means that the student has gotten a perfect score. Those are totally different things, and should not be stored in the same field. For example, I'm wondering: if the student runs out of attempts in normal mode before achieving a perfect score, do we consider that "completed" ?

@bradenmacdonald bradenmacdonald force-pushed the fix-max-attempts-message branch 3 times, most recently from 62d1f8e to 35fa0a3 Compare April 29, 2015 04:08
@bradenmacdonald bradenmacdonald force-pushed the fix-max-attempts-message branch from 21b7eed to b1db769 Compare April 29, 2015 04:53
@bradenmacdonald
Copy link
Member Author

Kelketek: I figured out how to fix the Travis build!! I do not understand why it was suddenly broken, but bumping the Firefox version has fixed it :)

Also, this is ready for your review.

@Kelketek
Copy link
Member

@bradenmacdonald Thank you for the changes on this. The extra documentation makes things a great deal more clear. I remember trying to puzzle through what all the messages were for and getting frustrated, so this will certainly help.

This works for me, and the code seems clean enough, so I'm giving it a 👍

bradenmacdonald added a commit that referenced this pull request Apr 30, 2015
@bradenmacdonald bradenmacdonald merged commit ee1c513 into master Apr 30, 2015
@bradenmacdonald bradenmacdonald deleted the fix-max-attempts-message branch April 30, 2015 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants