Commit Graph
4 Commits
Author SHA1 Message Date
Julien Banken 4fb38e2876 [IMP] website_event_track[_live]_quiz: allow multiple tries & improve layouts
When the user submits a quiz, the user will not get much feedback. To
improve the user experience, we will now indicate how many points the
users earned per question. With that information, the users could detect
errors and report them to the administrators. We will also add some
minor layout improvements to make things clearer.

When the administrator creates a quiz, the administrator might not want
to set a limit on the number of attempts that a user can have on a quiz.
To allow that, we added an option in the quiz settings called 'Unlimited
Tries'. When the administrator checks that option, a button will appear
below the quiz and will let the users reset the quiz at will.

Sometimes, the administrator might also want to (1) give points for an
answer that is not wrong or (2) give no point for a correct answer. This
is not currently possible as we considered that the correct answer is the
answer that rewards points. To allow that, we will add a new boolean
field on each answer to mark the correct answer.

task-2504216

COM PR: odoo/odoo#69585
UPG PR: odoo/upgrade#2408
2021-09-02 07:32:24 +00:00
aaj-odoo 0c6ce6cf44 [IMP] website_event_track_quiz: improve ux for quizzes on tracks
Right now, if we want to add a quiz to the event track, we need to
create it from the m2o field available in the form view. But it is
not very intuitive as user will have to select 'Create and Edit'
option from the m2o drop-down. Quick create is not really helpful
here. Also, trying to add question for the quiz will pile up the
modals which looks messy.

With this commit, in the event track's form view, we:

 - Remove the m2o for `quiz_id` (from the track form view, not from model)
 - Introduce "Add Quiz" header button, which redirects user to form view
   of the quiz, with no option to create new quiz directly as only one quiz
   should be linked to quiz. Also, once the quiz is added, this button will
   be hidden.
 - Introduce new stat button "Go to Quiz", which redirects user to the form
   view of quiz (again, does not allow creation from the same reason). This
   button is visible only if the quiz is already added for the track.

Apart from that,  re-arrage the quiz form view  `event_quiz_view_form` by
putting 'Event' and 'Event Track' fields on the same line, and we utilize
the same view while creating / updating quiz from the track.

Note:

Since the creation of quiz is now done in its own form view (with action button
"Add Quiz" from track's form view), we are passing the default `event_track_id`
while creating the quiz. It means that we don't need to compute it anymore.
Instead, now we need to compute the `quiz_id` on the track, based on the
`event_track_id` field alreay set on the quiz.

So, we introduce new One2Many `quiz_ids` field to compute the `quiz_id` on the
track, and we remove `event_track_ids` from the quiz. Basically, the logic of
setting `quiz_id` (on the track) and `event_track_id` (on the quiz) is inverted
with the commit, and the demo data is updated accordinlgy.

TaskID-2486552

closes odoo/odoo#70067

Related: odoo/upgrade#2522
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-24 04:34:39 +00:00
Thibault Delavallée b0845c0f2b [REM] website_event_online: merge into website_event
PURPOSE

Clean organization and models linked to Event Online feature introduced in
semi stable saas-13.3 at odoo/odoo@981f95bbf4 and odoo/enterprise@14722028ae

Also clean website event menu not being available in website event but only
in website event track, which implies some extra-code to manage it.

In short: merge website_event_online in website_event, website_event_track
_(online/session) in website_event_track.

RATIONALE

_online modules have been added to extend content of website_event and
website_event_track without having any impact on those module. First step
of cleaning is to move this content directly in base module.

track_session module is mainly a rewrite of track module. Second step of
cleaning is to move its content directly in website_event_track.

SPECIFICATIONS

Move remaining content of website event online to website event.

Update dependencies accordingly.

LINKS

Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
2020-08-21 17:30:13 +00:00
fe17857e89 [ADD] website_event_track_quiz: add quiz feature on event.track
RATIONALE

Events are sometimes held online, gathering a community. In this merge we
improve Event application to better support full-online events with improved
tracks, wishlists, chat rooms, ...

PURPOSE

Allow to configure a quiz on event tracks, much like eLearning.
The quiz is taken at the end of the live stream / track video.
(Or when the talk is 'live' of 'done').

SPECIFICATIONS

Users can now configure an event.quiz on event.track.

The quiz is a simple collection of event.quiz.questions that in turn contain
a few event.quiz.answers.
Only one of the answer is considered as correct and should be configured with
"awarded_points" greater than 0.

On the event.track frontend page, attendees can take the quiz when the track
is "live" (or "done") and earn the total amount of configured awarded_points.
Each quiz can only be taken once (if you fail, you can't try again).

Attendees are then ranked in a leaderboard that is displayed in the "Community"
section of the event frontend menus.
The leaderboard allows to see your own position as well as basic search for
other attendees.
The points earned during the event are event-specific and will not be shared
with other instances of event.event.

Points as well as quiz completion are stored in the relationship between a
visitor and a track (event.track.visitor).

The models are very much based on a similar feature in website_slides, even
though the implementation in event is not karma based.
We will probably have to merge the features later into a base gamification_quiz
module.

LINKS

Task ID-2252655 (Main Online Event task)
Task ID-2283771 (Quizzes on Talks, Leaderboard)

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Quentin Mourier <qmo@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-08-04 14:28:29 +00:00