Skip to content

Conversation

@itsjeyd
Copy link
Member

@itsjeyd itsjeyd commented Sep 18, 2015

This PR adds step navigation and submission functionality to the new blocks introduced in #62.

  • New mentoring block now displays one step at a time.
  • New step block allows to submit step results. Info about last step submitted is saved at mentoring level so users are taken to the correct step when resuming their work (or reloading the page).
  • New mentoring block allows to navigate to next step after submitting step results.
  • After submitting the last step, new mentoring block displays a "Try again" button that allows to reset the block and start from scratch. (This functionality will be moved to the review step as part of OC-913.)

Screenshots

New mentoring block displaying a single step (with multiple questions):

new-mentoring-block-displaying-single-step

After submitting the current step (all answers correct):

controls-after-submit-all-correct

After submitting the current step (some answers correct):

controls-after-submit-some-correct

After submitting the current step (no correct answers):

controls-after-submit-none-correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itsjeyd Is there any particular benefit of not using Dict field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@e-kolpakov Hm. Maybe for the odd case where a question (with a non-unique name) is used multiple times within the same step? With a List field we'd be able to retain results for all occurrences of the question in that case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itsjeyd this is unlikely to work at all - how do you than distinguish the questions when you need to display their values? By sequential number? I'm not sure it would work (but not sure it wouldn't as well). Let's keep it as is for now, but please keep in mind it might make sense to use Dict.

@e-kolpakov
Copy link
Contributor

@itsjeyd there's one minor issue in studio editing - not sure if it slipped from the previous task or was added as part of this one:
screenshot from 2015-09-18 17 09 13

"Que?" there is a "Question" field of an MCQ - looks like student view is reused for preview view. If it's not clear, the screehnshot is made when editing MCQ answers.

@itsjeyd
Copy link
Member Author

itsjeyd commented Sep 18, 2015

@e-kolpakov Thanks for the comments. I looked into the studio editing issue -- it's present in the existing mentoring block as well and it seems like it's caused by a peculiarity of MCQBlock: Unlike other types of question blocks it adds the value of self.question to its Fragment in get_author_edit_view_fragment:

def get_author_edit_view_fragment(self, context):
    """
    The options for the 1-5 values of the Likert scale aren't child blocks but we want to
    show them in the author edit view, for clarity.
    """
    fragment = Fragment(u"<p>{}</p>".format(self.question))
    self.render_children(context, fragment, can_reorder=True, can_add=False)
    return fragment

This behavior was introduced way back in Feb -- let me know if you think I should still change it as part of this PR.

@e-kolpakov
Copy link
Contributor

@itsjeyd if it's an existing behavior - let's just keep it. I just haven't saw it before for some reason, so I thought it was a regression

@e-kolpakov
Copy link
Contributor

@itsjeyd 👍

itsjeyd added a commit that referenced this pull request Sep 21, 2015
Step navigation and submission for new mentoring block
@itsjeyd itsjeyd merged commit e195051 into master Sep 21, 2015
@xitij2000 xitij2000 deleted the step-navigation branch December 13, 2019 06:42
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