Automattic / sensei

Sensei LMS - Online Courses, Quizzes, & Learning
https://senseilms.com
GNU General Public License v2.0
536 stars 197 forks source link

Add Quiz block #3776

Closed donnapep closed 3 years ago

donnapep commented 3 years ago

Describe the solution you'd like

Add the ability to add a Quiz block to a lesson (and only a lesson for now). The block should support adding one or more Question blocks.

The block should also support configuration of the following settings:

Screen Shot 2021-01-13 at 7 47 33 AM

Although the quiz block is added on the lesson page, it's displayed on a new page once the View Quiz button is clicked.

yscik commented 3 years ago

Since the quiz displayed as a separate page, it might be better to move this into its own CPT, and add Quizzes to lessons via the course outline. Having it inside the lesson content could be difficult to navigate in the editor when that content is lengthy. Adding the various question blocks are also probably easier without having to deal with a container block.

There are also some requests to have standalone quizzes, or quizzes attached to a course.

donnapep commented 3 years ago

@yscik I don't think we'll be able to break the lesson-quiz association as part of this work, as that would likely require a lot of refactoring and put our Q1 goals in jeopardy. We could certainly surface quizzes in the sidebar and use the course outline block to add them to the lesson though. Feel free to play with a design for this one too. I haven't thought it through as much.

If possible (though not a must if it turns out to be too large in scope), questions would display on separate pages instead of all on the same page. This would be the default behaviour and there would be no option to display on the same page.

yscik commented 3 years ago

Right, just found out that we already have a Quiz CPT, and one is created for every lesson. Questions are linked to these quiz posts.

Based on that, we can use that existing quiz post in the editor just to separate the quiz editor. The implementation would actually be the same as with a Quiz block in the lesson post — in both cases we have to do the same as with the course outline, having separate calls on load and save to convert the blocks to and from the backend structure (question posts and quiz-question association meta).

We can add an Edit Quiz link to lessons instead of an UI to add a quiz to the outline, so there is no confusion on only being able to have one for each lesson.

questions would display on separate pages instead of all on the same page

I'm not sure having to submit questions one by one and wait for the next one wouldn't degrade the learner experience — considering the typical page load time of Wordpress sites. We could have Number of questions per page option, so site owners can decide?

donnapep commented 3 years ago

I'm not sure having to submit questions one by one and wait for the next one wouldn't degrade the learner experience — considering the typical page load time of Wordpress sites.

I was thinking we might try to build this in such a way that a page refresh isn't required when navigating between questions. I think Crowdsignal does this already.

We could have Number of questions per page option, so site owners can decide?

We could provide an option, although we'll need to be mindful of scope going forward and trying to keep things really lean. Given this, it's potentially something that wouldn't make it into a first iteration.

It's been suggested to display the quiz on the same page as the lesson, but I would also consider this more of a nice-to-have than a need-to-have.

Building designs for the ideal case sounds fine, so long as it's relatively easy for us to pull out pieces that may not be so important in a first go round.