Commit Graph
58 Commits
Author SHA1 Message Date
Aurélien Warnon ffa504887d [IMP] website_slides: slightly improve various e-learning views
PURPOSE

This commit adds some small UI improvements to the e-learning views.
All those small changes are meant to improve the general user experience when
adding content to a course.

DETAILED SPECS

- Change some placeholders / labels
- Inform the end-user that he can edit his 'webpage' slide using the editor
- Inform the end-user that he can add questions to his 'quiz' slide using the
  'Quiz' tab in the backend form view
- Do not update from slide metadata if field value is already set
- Do not allow previews for certifications
- "Allow Download" of slide content is now False by default
  As it was nice to have for "Documentation" courses but does not really make
  sense for "Training" ones.
- Having a duplicate video id is now informative on the frontend and not
  blocking as before (it was allowed in the backend form anyway).
- Show the video title in the frontend preview

Task-2510174

Part-of: odoo/odoo#71477
2021-11-30 15:21:48 +00:00
Aurélien Warnon 7b5427f6d6 [REF] website_slides: refactor external content management in slide.slide
PURPOSE

Globally refactor the way we handle external content (YouTube videos,
Google Drive documents, ...) in the course slides.

This includes both technical changes (new computed fields, rename, ...) as well
as visual changes on the form views that allow introducing new content, both in
the backend (slide.slide form view) and in the frontend (course main website
page).

SPECS

TECHNICAL REFACTOR

1. Rework the "url" field

This field was used without any distinction for videos, regular documents and
images, leading to a big confusion both technically and visually.

The urls are now split in separate fields (video_url, document_google_url and
image_google_url), based on the type of slide.
Those fields are implemented as 'related' to the stored 'url' field to avoid
extra storage.

This change globally increases the readability and usability in the code, and
also allows for clear labels on the various views.

1b. Rework the "binary_content" field

The same way as for the 'url' field, the 'binary_content' field has been split
into 2 related fields ('document_binary_content' and 'image_binary_content').

This allows for more readability and also helps in the form view to limit the
file selection to the supported file types.

2. Remove the "document_id" stored field

This field did not have to be stored since it can "easily" be inferred from the
video/document URL with some regex work.

3. Remove the "mime_type" field

This field's value was only determined by an external call to the Google Drive
API. It was inconsistent because not set for manually uploaded document and was
used for some strange checks that seemed to work but did not make much sense.
(e.g: used to make the difference between a Google Drive video and a YouTube
video??).

It has been replaced by a "document_type" field, which is always 'pdf' for
local files (only type we support) and inferred from the mimeType returned by
Google Drive metadata for external documents.

This allows, for instance, to show pretty icons next to every slide based on
their type, "sheet" files (Excel, Google Sheet, ...) share the same icons, the
same principle is applied to "doc" files (Word, OpenOffice, Google Doc, ...)
and finally "slides" files (PowerPoint, Google Slides, ...).

4. Introduce several computed fields

Such as:
- video_source_type
- youtube_id
- google_drive_id

These fields are mostly inferred from the slide type and the related URL.
They are used to make clear checks in the code and ease readability, for
example when constructing the slide "embed code" to insert it in the frontend
full screen viewer.

5. Remove the "presentation" slide_type

The slide type "presentation" was some kind of very confusing type between
image and pdf. It was mostly relying on the fact that the content had a bigger
width than height ('landscape' display).

This lead to a lot of confusion both in the code base and in the various forms
allowing to introduce new content ("what should I choose? document or
presentation?").

In order to simplify everything, we completely removed the slide type
"presentation" and converted all the data that had this type and the various
code checks to the type "document" instead.

Meaning that we end up with the following slide types:
- Infographic - for images, local files + external links
- Web Page - local input only
- Document local files + external links
- Video - external only, YouTube or Google Drive links
- Quiz

FUNCTIONAL

Following the technical changes here above, we can improve the form view of the
slide.slide model as well as the website form that allows adding new content.

1. Slide form view

To make it clear where the source of the document comes from, we introduced a
"source_type" field that is either "local_file", used when uploading a file
from your computer, or "external", used when linking content from Google Drive.

The source_type selection appears when adding content of type "document" or
"infographic" and conditions the display of the file upload button or the
document_url field.

2. Adding content from the website

When adding content from the website, the user is now invited to select from
ALL the available slide type, meaning we added "Infographic" to the selection.

Before this change, if you wanted to link an image, you had to select the type
"presentation" (that has a PDF file as icon...) and then input an image file.
The JS then processed the file type to determine the slide type.

As this was slightly confusing for the end user, we decided to use the same
approach as the form view, meaning you FIRST select the type of slide you want
and THEN input the content as a local file or external link.

Since we now handle all types of documents when using an external Google Drive
link, the various screen and text helpers have been reworked accordingly.

3. Handle more types of slides with the new "slide_type" field

This commit also introduces a new "slide_type" field.
(Don't get confused, the previous "slide_type" field has been renamed to
"slide_category" in an earlier rename commit).

This slide_type is a refined slide_category:
- Videos are split into 'youtube_video' and 'google_drive_video'
- Documents are refined based on the file mime_type if it's external content
  For example, if you link a Excel file, the slide_type will be 'sheet'.
  If you link a Google Doc, the slide_type will be 'doc'
  etc...
  (Local documents are only PDFs since it's the only type we support for now)

This small change allows to include minor nice details into views, such as a
refined icon for each slide_type on the website.

LINKS

Task-2510174
UPG PR odoo/upgrade#2498

Part-of: odoo/odoo#71477
2021-11-30 15:21:48 +00:00
Aurélien Warnon ab0b36e8a5 [REF] website_slides: rename slide.slide fields
This commit simply applies the following renames in the slide.slide model:

- 'datas' is renamed into 'binary_content'
- 'slide_type' is renamed into 'slide_category'

This changes intend to ease the next bug refactoring of the website_slide
module content management.

There should be no functional changes applied in this commit.

Task-2510174

Part-of: odoo/odoo#71477
2021-11-30 15:21:47 +00:00
Thibault Delavallée d5b688956b [IMP] survey: display a list-kanban when being ungrouped
PURPOSE

When dealing with lot of surveys kanban view is not really optimal and its
state based grouping is not really helpful. Indeed we do not have total of
each coumn and there is not point adding new states, meaning most surveys
hang in the same column. This is not an optimal display.

SPECIFICATIONS

Improve ungrouped display as this is the main usage of surveys. It should
be displayed like a global list view: each card should take the whole
screen (like ``Visitor`` kanban view). Each line contains some "columns"
holding statistics. We notably use a progressbar to display a nice passed
ratio, as well as a many2one avatar widget to make survey enters the era
of amazing wow kanban views.

When grouped, display should be the old one, aka a standard card.

This is done using a small CSS hack: card template actually consists in main
templates related to two displays. Each card style is hidden depending on being
groups or ungrouped. This triggers a class that is used using CSS to hide
irrelevant content.

A ribbon is also added on kanban cards displaying an Archived danger ribbon
when survey is not active anymore. It is therefore coherent with the form
view display that also has a ribbon defined.

An override in website_slides_survey is added to add number of courses using
the survey.

Order is updated so that new surveys are on top. No need to be bloated by
old ongoing surveys when creating new one.

Finally, some labelling is done with answers to be clearer: registered (number
of raw user inputs), completed (finished answers), certified or passed (quiz
with certification activated or not).

Task-2388785

Part-of: odoo/odoo#77227
2021-11-24 14:04:20 +00:00
Thibault Delavallée f13857bf74 [IMP] survey: update views naming
As we are about to refactor survey views, especially kanban, let us rename
some views xml IDs. Especially they have few overrides so quick to do.

Task-2388785

Part-of: odoo/odoo#77227
2021-11-24 14:04:20 +00:00
ijas ahammed d41a32e1d9 [IMP] survey,website_slides_survey: improve certification list view
This commit improves the survey list view in eLearning certifications to make
it simpler. This is done through a new primary view, inheriting from the base
one in order to keep changes localized. The main changes are:

- removed the trophy icon from 'Certification' button as each of them
  here are certificates only
- improved string of `title` field to 'Certification Title'
- added `user_id` field with many2one_avatar_user widget after `title`
  in the base tree view (survey.survey_tree)
- updated strings from 'Success Ratio' and 'Avg Score %' to
  'Success Ratio (%)' and 'Avg Score (%)'.
- moved `answer_done_count` field after `answer_duration_avg`
- removed the field `answer_count`
- added float time widget to the field `answer_duration_avg`
  in the base tree view (survey.survey_tree).

TaskID-2607467

Part-of: odoo/odoo#76930
2021-11-23 09:39:34 +00:00
Nikunj Ladava 69f65136b4 [FIX] website_slides_survey: fix certificate preview
before this commit,
it was raising an error while try to preview the certificate

after this commit,
prevent the preview of certificate, as it is not possible to
set the preview of certificate

task- 2623276

closes odoo/odoo#78911

X-original-commit: 8c51d83855566cb21578f18ebf460cead484aed2
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2021-10-25 14:49:00 +00:00
Thomas Josse 91db19c187 [IMP] mass_mailing_slides / survey / website_forum / website_[sale_]slides_* : enhancing the views in eLearning
Purpose
=======
This commit is enhancing the website_slides module.

Specifications
==============
It changes placeholders for certain fields, it changes helpers in some
of the views.

It updates some of the main views of the menus and corrects wordings
inside of them.

It activates the Graph and Pivot views for the reporting of
Courses, Reviews and Quizzes.

It cleans up some of the measures inside of the Pivot and Graph views
of each menus where it is available.

It also merges 2 models: slide.slide.link and slide.slide.resource into
slide.slide.resource with a type Selection field.
This is done in order to create a single table for the additional
resources of a Content.

It also improves the front-end of the module with minor changes.
It fixes the problem of long names inside of breadcrumbs.
It also adds a message when there is no leaderboard in /profile/users.

task-2597345

See odoo/enterprise#20480
See odoo/upgrade#2784

Part-of: odoo/odoo#75646
2021-10-22 11:09:16 +00:00
dht-odoo 32acd56002 [FIX] website_slides_survey: add context to survey_id
Before this commit when user quick create a certification,
then it will create record in survey but not with certification
equals to True. Due to which it will be excluded from domain and
we will not able to find it in survey_id in elearning.

With this commit we pass certification equals to true and scoring_type
equals to scoring_without_answers in context of survey_id. So now,
it will be not excluded in domain('certificate', '=', True) in elearning.

Task Id: 2621296

closes odoo/odoo#75375

X-original-commit: 47894929591c7f46451242c1d0368094e2b3c295
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-20 10:27:40 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Priyanka Kakadiya c7f4f6d978 [IMP] website_slides_survey: share channel from result page
This commit enables eLearning users to share the channel linked to
certification they cleared directly from the result page.

Notes:

1 - We already have the option to share a certificate from the user info page
    or from the slide page, and the same mechanism has been utilised here.
2 - With a recent commit[1], top padding was added to the modal opened on
    website front-end to prevent modal overlapping the navbar. But it caused
    a side effect on survey result page, where navbar is hidden. So we remove
    this top padding on modal for the survey result page.

[1] - https://github.com/odoo/odoo/commit/6ef622772f7d0172553aca6dbce9eb71855460d7

taskId - 2337696

closes odoo/odoo#58104

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-19 10:58:39 +00:00
std-odoo 406cf8e80d [FIX] website_slides_survey: fix certification share button
Bug
===
In the user profile view, we can see the certifications of the current user.

If we click on the share button, we are redirected to the course instead
of opening the share modal.

Technical
=========
Since 1f52435966 we use an on-lick event to
redirect the user when he click on the card. We use the JS event instead
of an standard anchor because nested anchors are forbidden in HTML.

That cause an issue if we click on a child anchor and if we stay on the
same page (which is the case when we open a bootstrap modal) because the
on-click event will be triggered.

We can not just stop the click propagation otherwise the modal won't be
opened.

Also, as the bootstrap modal element (`website_slides.slide_share_modal`)
is inside the element with the on-click event, so, if we click anywhere
on the modal, we will be redirected...

So, the solution is to open manually the modal, to stop the click
propagation and to move the modal element.

Task-2337693

closes odoo/odoo#59545

X-original-commit: 2a63f98bd359907169d14539feaa99a1d83263f0
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-08 16:14:14 +00:00
Patrick Hoste 4f2a4b175f [REF] website_slides: improve elearning backend usability and onboarding
PURPOSE

Improve elearning backend usability and onboarding

SPECIFICATIONS

Improve layout of email send when invite. Do like a SO, add the join button
in the notification email and not in the composer itself. It required to
create a new notification layout specific to that invite wizard.

Improve channel form view: remove statistics as they are already displayed
in various places, add a stat button for content/visits, better display of
karma (split gain from karma-based access rules).

Automatically publish channel's product to avoid de-synchronization of publish
flags.

Remove unused channel_url field on wizard.

LINKS

Task ID-2241513
PR #55698
2020-08-11 10:31:23 +00:00
Jorge Pinna Puissant 5549fb8202 [FIX] website_slides_survey: start now with a content slide
Before this commit, the Start now button uses the first slide (a content
slide or a category slide). If the first slide was a category slide then
an error was raised.

Now, only content slides are used to start the survey.

opw-2265250

closes odoo/odoo#52309

X-original-commit: bbc84c5d03eae51b6edfe270da51087970db2227
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-06-03 08:38:35 +00:00
Florent LejolyandDavid Beguin 24033e4aaf [IMP] website_slides,_survey: allow certification creation at frontend
Purpose
=======

Before this commit, in the front end, you had to create a certification before
adding it to a course. This commit allows creation of certification in
front-end with pre-filled settings.

Functional Spec
===============

1. On a course, add content, type certification, you can choose an existing one
   (normal flow) or create a new one in the dropdown by typing a new survey
   name (new flow).
3. When submitting (Publish or save as draft), a certification survey, with
   pre-filled settings is created and linked to the slide.
   Pre-filled settings:
        * One page per question
        * Attempts limit : 1
        * Time limit : no limit
        * Scoring without answers
        * Passing score : 70%
        * Is Certification : True
        * Email Template : Certification: Send by email
        * Give Badge : False
4. After submit, the user stays on the Course Content.
5. A toaster is displayed in the top right saying:
    Toaster's Title: Certification created
    Content: Follow this link to add questions to your certification.
    <a>Edit certification</a>

A website editor can select a certification (if available) for the creation of
a slide.

Task id: 1981399
PR #43577

Co-Authored-By: Florent Lejoly <fle@odoo.com>
Co-Authored-By: David Beguin <dbe@odoo.com>
2020-04-16 10:26:32 +00:00
Thibault Delavallée 6c28c82b62 [FIX] website_slides: do not allow to begin certification of archived slides
If you archive a certification while being member of the source you still
have access to the "Begin Certification" button. Indeed you can see the
certification as you have rights to do so (publisher, manager) but trying
the certification will crash as it is not allowed for archived slides.

Instead in archived mode the "Test Certification" button is displayed that
allow to make a test entry even for archived surveys.

closes odoo/odoo#47956

X-original-commit: 10abdf711ac7d0aee7d6eab4e30b08acd38eaa23
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-18 18:41:01 +00:00
David BeguinandAurélien Warnon 4a7c84e696 [REF] survey: use ajax instead of redirection for screen transitions
PURPOSE

To have a better UX, the transition between questions in a survey should not
be done by loading another page, but by loading next questions in AJAX.

This will allow to fade out / fade in the next question and improve the user
experience, as well as prepare the work for the complete survey redesign.

SPECIFICATIONS

General
=======

This commit refactors the way the questions are loaded.
To go to next question(s), instead of redirecting to a new page containing
the next question(s), the submit process is loading the next question(s)
using ajax. The template of the question is prepared at server side and is
given in html string to the client that display the next question in a smooth
transition (fade in / fade out).

This commit includes also the start and the end screen of the survey inside
the survey form in order to perform smooth transition between start screen
and first question(s) and between last question(s) and end screen.

Only one master template (survey form) is now used to display every part of
the survey : start + questions + end screens.

The answer_done error is now handled by the _prepare_survey_data itself.
If the user wants to display an already_done survey, the returned template
is the end screen.

This commit handles page transition for the survey results. When submitting
survey, the survey result widget is initialized and attached to the survey
result section.

A new route has been added : /survey/begin/.
If the user arrives on start screen, the state is 'New'. Once the user clicks
on Start button, an rpc call is made to survey/begin that will call the
survey_prepare_data to render the first question page and set the state to
in_progress and the start_datetime of the answer.

Validation
==========

Add the validation of all types of questions directly in the frontend.
This allows to reduce the latency before the survey is validated and was
necessary to go along with our new fade out / fade in mechanism.
The client does not need to wait the validation answer from the server to
display validation error messages.

The current questions are only faded out if the frontend validation has passed.
The server still makes this validation before submitting answers and loading
next question(s) to avoid direct rpc calls that would mess up the answers.

Error messages are now displayed with a slide down transition, for a wonderful
wow effect !

Timer
=====

As the survey form works with ajax to display start screen, question(s) and
end page, the timer has to be started only after the start screen.

This commit display and start the timer only after start survey button is
clicked.

Breadcrumb
==========

As the survey form now works in ajax to display in same page start screen,
question(s) and end page screen, the breadcrumb has to be controlled not only
on page loading but also manually between transition from a screen to another.

To ease the breadcrumb management, breadcrumb is now a widget that will reload
a js template, mainly depending of the current page id.
The js form initialize or update this widget giving this new page id.
On breadcrumb item click, the widget triggers a onclick caught by the form
that calls the submit with the given target.

This commit handles page transition for the breadcrumb. When going forward or
backward (next or previous page), the breadcrumb activates, deactivates and
links elements are reinitialized depending of the target page.

LINKS

Task ID: 2152223
PR #41453

Co-authored-by: Aurélien Warnon <awa@odoo.com>
2020-01-13 15:50:14 +00:00
Swapnesh Shah 847b05fb19 [FIX] website_slides_survey: create certificates with scoring by default
Follow up on https://github.com/odoo/odoo/commit/6e5b211f4efd2f29b8bf582465284527e38bc763
Certificate field is not sufficient, scoring type should be set by default
to avoid creating non certificates without knowing it.

closes odoo/odoo#42640

X-original-commit: 1edfa69a4c95deca5192f28f162f2f0b8322bb8f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-01-03 08:35:33 +00:00
Tiffany Chang (tic) 12eb45301f [IMP] website_slides_survey: add survey course visibility
Previously there was no way to view when a survey (specifically a
certification survey) was being used by a course from the survey
app. We handle 2 cases for when a survey is currently assigned to
a course:

1. A survey is assigned to 1 course => survey form stat button visible to bring user
   directly to corresponding course form.
2. A survey is assigned to more than 1 course (unlikely, but currently possible) =>
   survey form stat button visible to show user a list of corresponding courses where
   each list entry can be clicked on to view corresponding course form.

Note: we do not cover viewing courses a survey was previously assigned to as this would
   be currently be unreasonable to track.

closes odoo/odoo#42336

Task: 2153743
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-01-02 14:47:04 +00:00
Thibault Delavallée 755ac5f313 [REF] survey: on survey.user_input, rename some fields to ease understanding
PURPOSE

As new features are about to land in survey, notably live interactions [1]
and new survey building [2] performing a pre cleaning is necessary. In this
PR we clean survey models by: removing unnecessary fields, cleaning some code
and finally renaming models.

SPECIFICATIONS: RENAME QUIZ_SCORE ON SURVEY.USER_INPUT

On survey.user_input, quiz_score field to scoring_percentage

``quiz_score`` field name is related to the old "quiz" behavior of surveys
that is replaced by certifications and scoring mechanisms. Let us propagate
the renaming, beginning with a ``scoring_`` prefix.

SPECIFICATIONS: RENAME QUIZZ_PASSED ON SURVEY.USER_INPUT

on survey.user_input, rename quizz_passed field to scoring_success

``quizz_passed`` field name is related to the old "quiz" behavior of surveys
that is replaced by certifications and scoring mechanisms. Let us propagate
the renaming, beginning with a ``scoring_`` prefix.

SPECIFICATIONS: RENAME TOKEN ON SURVEY.USER_INPUT

on survey.user_input, rename token field to access_token

Survey user input model holds two token field. One is used to distinguish
a pool of attempts linked to a given invite: ``invite_token``. The other
one is used to control access to a specific user input. It means that
``invite_token`` indicates a set of user inputs and each of them is accessed
through its own ``token``. To be coherent with other naming in odoo this
latter field is renamed to ``access_token``.

LINKS

[0] Related to Task ID 2061901 (survey models cleaning and preparation)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)

PR #40765
2019-12-05 15:21:28 +00:00
Thibault Delavallée 1e66894042 [REF] survey: on survey.survey, rename some fields to ease understanding
PURPOSE

As new features are about to land in survey, notably live interactions [1]
and new survey building [2] performing a pre cleaning is necessary. In this
PR we clean survey models by: removing unnecessary fields, cleaning some code
and finally renaming models.

SPECIFICATIONS: RENAME THANKS_YOU_MESSAGE ON SURVEY.SURVEY

On survey.survey, rename thanks_you_message to description_done

In this commit we rename thanks_you_message field. Indeed for certifications
or recruitment form, "thank you" is not really the unique content you
would get in a post-survey message. We therefore rename it to description_done
to better indicate its use.

SPECIFICATIONS: RENAME CERTIFICATE ON SURVEY.SURVEY

On survey.survey, rename certificate field to certification

All certification related fields on survey model begin with certification_ .
Only the boolean one telling if a survey is a certification or not is called
certificate. In order to ease grep and ordering it is renamed to certification.

SPECIFICATIONS: RENAME PASSING_SCORE ON SURVEY.SURVEY

on survey.survey, rename passing_score field to scoring_success_min

``passing_score`` field name is not really the best name we could find.
Renaming the field using a ``scoring_`` prefix allow to know this field
is linked to the scoring mechanism.

LINKS

[0] Related to Task ID 2061901 (survey models cleaning and preparation)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)

PR #40765
2019-12-05 15:21:28 +00:00
Hoste Patrick ec9e389f2f [IMP] website_slides: allow to create and update quizzes directly in frontend
Purpose is to ease designing your courses by allowing to create and update
slide quiz directly in frontend, within the slide display.

With this commit you are able to

  * add a quiz to a slide or add a question to an existing quiz;
  * edit an existing question from a quiz:

   * change the title of the Question;
   * add, remove or update answers;
   * change the right answer;
   * delete an existing question;
   * reorder the questions from a quiz;
   * reset the quiz for the current user if he is a website designer, allowing
     to test the quiz and its answers;

New frontend widgets are introduced allowing to manipulate quiz. Slide page
now supports a readonly / taking quiz mode and an edit mode for quizzes
used notably for website designers / course maintainers.

Task ID : 1999636
PR : #35326

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-29 13:36:25 +00:00
Thibault Delavallée ca1c975d78 [REF] survey: split templates into main files and rename templates
PURPOSE

Purpose is to perform some cleaning in survey models: naming, ordering,
dead code [0]. As new features are about to land in survey, notably live
interactions [1] and new survey building [2] performing a pre cleaning
is necessary [3].

SPECIFICATIONS

Remove dead code :

  * split templates into 3 main files

   * survey_templates: holding main templates when taking a survey;
   * survey_templates_statistics: graph and statistics (results) of a survey;
   * survey_templates_management: templates linked to corner cases and
     error management (403, closed survey, ...) as well as tools and utility
     templates;

  * rename template ids to ease code understanding;

No functional changes should occur with this commit. It contains only
code move, not any change at all.

LINKS

[0] Related to Task ID 2144393 (surveys split / cleaning)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)
[3] Task ID 2061901 (survey models cleaning and preparation)

PR #40623
2019-11-25 09:48:23 +00:00
David Beguin 5ac64d6e02 [IMP] website_slides_survey: add certification badges section to ranks badge page
This commit adds a section to distinguish the certification badges from the
other badges users may obtain in eLearning. Certification badges are available
on the ranks page, linked to a running survey. Clicking on them directly
redirects into the linked course.

Task ID : 1961053
PR #32594
2019-11-22 15:30:53 +00:00
David Beguin 1f52435966 [FIX] website_slides_survey: redirect to course on certification click in profile page
Back2basic-like: purpose is to allow people to go from a frontend certification
card on profile to its linked course page.

Task ID : 1961053
PR #32594
2019-11-22 15:13:41 +00:00
mcm-odoo b29d0385ad [IMP] website_slides: add call to actions in user profile
Before this task, when the user arrived on his profile,
some empty sections didn't had any call to actions

task-2080615

closes odoo/odoo#38029

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-18 13:04:08 +00:00
David Beguin a8473341ac [IMP] website_slides_survey : Add share button for certification in user's profile page
This commit adds a button in the certification card in the profile page.
this button opens the share modal and allows to share to social networks
the course linked to that certification.

Task ID : 1950396
PR #31776

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-15 13:02:24 +00:00
Thibault Delavallée 6e5b211f4e [FIX] website_slides_survey: create certificates with scoring by default
Certificate field is not sufficient, scoring type should be set by default
to avoid creating non certificates without knowing it.

Task 2067872 (eLearning internal testing)
Task 2058598 (survey internal testing)
PR #36756
2019-09-13 10:05:43 +00:00
Michaël Mattiello 8c9473fd78 [IMP] website_slides_{*}: improve backend UI, views and user actions
Purpose of this commit is to perform a back2basics on eLearning backend
views. It helps users in their daily use of eLearning and improve UI.

Containing

  * channel kanban view tweaking;
  * channel form view: some spacing and renaming improvements. Also set
    advanced field (new content email, share template) as group no one;

  * slide kanban view tweaking;
  * removed sections from kanban and list view for contents;
  * contents form view: various improvements, with notably

    * removed field website_url;
    * set publishded date is now readonly, tracked and in group_no_one as
      it is automatically set when publishing the lesson, and people should
      not update it manually;
    * removed the sum "Content" and replaced it by a stat button
    * reword quiz constraint error messages;

  * rating views improvements:
    * revamped the kanban view of rating that were a bit broken;
    * added a pivot view in Reporting/Reviews;
    * updated graph view in Reporting/Reviews;

This commit also provides some usability fixes

  * prevent sending email if new content is category;
  * email: Prevent displaying an image if there is no image;

LINKS

Task 2049640 (website slides back2basics and fiximp)
Task 2058595 (eLearning v13 testing)
2019-09-03 15:02:21 +00:00
ryv-odoo 695c65131b [FIX] elearning: fix invisible kanban view label
In the the kanban view of slide.channel, text belong numbers
was invisible (white on white) on the community version.
We change the class to be visible for each version.

TASK-ID : 2049115

closes odoo/odoo#35858

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-20 13:25:37 +00:00
qmo-odoo 340613d068 [REF] website_slides: revamp channel form view
PURPOSE

Like already done for sale order, invoice of survey, purpose of this commit
is to remove category model and replace by a flagged line (slide). It allows
to easily reorder slides in an embedded list view.

SPECIFICATIONS

This commit completely reworks the slide.channel form view

  * improve the content management from the form itself by adding a tree view
    with the possibility of drag and dropping slides from category to category.
    This tree view has buttons to quickly add content or certification. It
    also allow to add a category (slide with flag is_category) without opening
    a modal;
  * reorder tabs and fields, improve some labels;
  * add a custom float field widget to display ratings as stars;
  * add stat button for partners who completed/certified ;the course
  * add stat button that redirects to the forum posts;
  * add stat button that redirects to the channel reviews;

LINKS

Task 1978731
PR #33255
2019-08-08 08:29:34 +00:00
qmo-odoo 5f4c7c5afa [FIX] website_slides_survey: fix certified correctly replacing members in kanban view
SPECIFICATIONS

Before this commit, installing survey would replace the number of done members
by its label. Now the number of members who completed the course will be
displayed correctly.

LINKS

Task 1978731
PR #33255
2019-08-08 08:26:08 +00:00
fja-odoo 5dac8f8f29 [REF] website, *: remove hardcoded image urls
* = website_forum, website_profile, website_sale,
website_sale_comparison, website_slides, website_slides_survey

Some image links were hard coded in the xml views of website, now they
are replaced with website.image_url(model, field).

Part of https://github.com/odoo/odoo/pull/34149
task-2007400

closes odoo/odoo#34149

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-05 13:24:22 +00:00
Jérémy HennecartandThibault Delavallée ee29641b08 [REF] website_slide_survey: improve integration into eLeaning application
PURPOSE

eLearning should have its own application in manager. Indeed this is becoming
a big application and having it embedded inside Website application is not
enough anymore. It should also hold updated and easy-to-use menus,
navigation, actions and views in backend.

SPECIFICATIONS

Add menu entry inside Courses
  * Certifications: kanban view of surveys of type certificate

Add menu entry inside Reporting
  * Certifications: list view on surveys of type certificate
    Columns: Title, Survey Stage, Registered People, Certified People, Attempts
    Success Rate (certified/attempts), Average Results

LINKS

Task 1978729
PR #35061

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Jérémy Hennecart <jeh@odoo.com>
2019-08-05 08:43:21 +00:00
Thibault DelavalléeandJérémy Hennecart 98bdb241de [IMP] website_slides: add an overview (kanban view) on course model
PURPOSE

eLearning should have its own application in manager. Indeed this is becoming
a big application and having it embedded inside Website application is not
enough anymore. It should also hold updated and easy-to-use menus,
navigation, actions and views in backend.

SPECIFICATIONS

Add course (slide.channel) kanban view. Each tile should contain

  * Title of the course (make it big, o_primary)
  * Tags below the title
  * Primary button "New Lesson"
  * Statistics :
    * Attendees
    * Running (progress != 100%)
    * (if one content is certificate) Certified or Finished
  * See
    * v1: https://drive.google.com/a/odoo.com/file/d/13K8FmkbwmBG4JQ5gH3Q5T8OlWPs3blcu/view?usp=drivesdk

With FP remarks https://drive.google.com/a/odoo.com/file/d/1mb7LUT0VUNs5fMcKB9c0Bfaqk2-XFFuu/view?usp=drivesdk
  * remove globe, type and visibility of course, lessen padding between rating
    views and watch time;
  * for rating, instead of 8.00 => 5 reviews (4.5/5);
  * replace "View Lesson" / "Invite" by "View Course" => Send to the front-end
  * In the menu of the card, add:
    * Invite (same behavior than before, when it was a primary btn)
  * click on x Contents:  land on the contents, group by category with sequence
  * re-order of the 3 infos/Stats at the bottom of the card: 1. Content,
    2. Attendee, 3. Certified
    * + number: font-weight: 500 + font-size 1.2em
    * + labels: remove text-uppercase, + text-color: #666666
    * + the "whole box" is clickable

LINKS

Task 1978729
PR #35061

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Jérémy Hennecart <jeh@odoo.com>
2019-08-05 08:40:33 +00:00
Sébastien Theys 58a2ffa26f [IMP] *: rename image fields
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small  => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
	what was previously the big size)

+ add new intermediate format:
image_512

PR: #34925
2019-08-02 16:47:58 +00:00
qmo-odoo 75153e72bc [IMP] website_slides: Improve methods to get user certificates
This commit improves a few methods related to the user profiles:
- Change _prepare_all_users_values so that it
works with a batch of users
- Change the _get_user_certificates and rename it to _get_users_certificates
so that it works with a batch of users to avoid doing a search in a
list comprehension.
This method will also be used to get the number of certificates per users

TaskID: 1952064
PR: #32229

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-30 13:03:35 +00:00
qmo-odoo ef3ccce079 [FIX] website_slides_survey: fix some certifications issues in eLearning frontend
This commit fixes a few issues with courses which have certification

 * fix links to already passed certifications: currently it crashed, now it
   redirects to the certification end screen;
 * "Begin your certification now" green box link now has same behaviour
   as links in the list view. It redirects to either the start certification
   screen or the first slide in fullscreen mode. Moreover once the user has
   started the course (at least one completed slide) this box disappears as
   it is not really useful anymore;

Some dead code is removed.

Commit linked to task ID 1978530 (fixes linked to internal testing).
2019-05-03 12:43:01 +00:00
sri-odoo 3d463640fc [IMP] website_slides_survey: add a specific background for certification channels
This commit introduces a specific icon/design for certifications. It is applied
to channels having at least one slide of certification type.

Linked to task 1958372
Related to PR #32648
2019-04-23 09:40:35 +00:00
David Beguin a13e33ddda [FIX] website_slide{_survey} : apply various fixes on elearning views
- Fix certification card in user's profile page

Since design review, certification card were not displaying well.
This commit applies the course card template on certification card
and modifies the way the certification get downloaded by calling directly the
controller instead of using class catched in javascript that calls afterward the
controller.

- Allow review button only if allow_comment in FS mode + redirect url

'write a review' button in fullscreen mode must not be displayed if the course
is not in allow_comment mode. Also, the url if this button was redirecting
to slide view in non fullscreen mode. As no review can be done from this point,
the url redirect now to the course view.

- Fix fullscreen slide height.

- Fix all slides view per category pager and page rendering

Since the introduction of categorized data dictionnary that is given to the template,
if a category is empty, it's rendered anyway, which is good for publisher,
to quickly see all existing categories.
But other users should not see those empty categories.

Also, if the slides from a course are filtered (with View all button) by category,
all the slides should be reachable, using the pager. This was not the case as
categorized slides dictionnary returned no slides if page <= 2.
(as bound of array was from offset to limit and offset and limit were equals)
The number of slides per category must be overwritten if search category is activated,
to see more than the 4 first slides of the category.

Finally, if search category is activated, only the target category should be displayed,
and not the others, for performance reason.

- Show 'not verified' next to user's name if user karma = 0

Instead of using the email_validation_done flag. As email validation is only used
to offer the user some karma in order to be able to interact in the forum or eLearning.
If the user already has karma, he is already considered as active and 'verified'

- Correct URL of certification in FS mode

Task ID : 1941250
Closes PR #31567

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-19 13:03:51 +00:00
Aurélien Warnon 199ecdd30f [IMP] website_slides_survey: handle certification re-enroll/purchase flow
Task #1945036

Purpose
=======

If the user fails his last attempt at a course certification, we remove him from
the members of the course (and he has to enroll again).
He receives an email in the process notifying him of his failure and suggesting
he enrolls to the course again.

The purpose is to have a 'certification flow' where the user can re-purchase the
certification when they have failed it.

This could lead to some issues if the course containing the certification also has
other slides with content because the user will not have access to them after failing.
This also prevents configuring courses with multiple certifications since the membership
will be removed at the first failure.

These use cases are considered "non standard" by the business and are thus not handled
in the code. We assume that users will configure their courses "correctly".
2019-03-18 14:46:32 +00:00
qmo-odoo add45ee470 [FIX] website_slides_survey: go to survey if only one slide certification
Purpose of this commit:
  In case there is only one slide in the course and that unique slide
  is of type certification, clicking on the link redirects the user
  to the survey page instead of the fullscreen view

Task-1946511

closes odoo/odoo#31843

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-03-15 20:38:58 +00:00
qmo-odoo e8e8d7a956 [FIX] website_slides_survey: certification slide url
Before this commit, in fullscreen mode, clicking on the "pass certification"
button would redirect the user to the "non-fullscreen" view.
After this commit, the button directly redirects the user to the survey page.

To avoid generating user_input of survey (test entry or not) for
certification slides in fullscreen mode (table of content), we decided
to create those user_input lazily: we redirect the user to a route that
create (or reuse) the correct user_input.

Task-1946511
2019-03-15 20:38:58 +00:00
Aurélien Warnon 44ae98d3dd [IMP] survey: add a download button at the end of certification process
Purpose
=======

When the user successfully takes a certification, he can download the certification
document using a new "Download certification" button.
(In addition to receiving an email containing the certification)

Also cleaned a bit the way certifications are downloaded.

Task-1941250
2019-03-15 20:38:58 +00:00
qmo-odoo fd78a40836 [REF] website_slides: revamp fullscreen widget
This commit makes the 'Fullscreen' page a complete odoo
widgets. We decided to split it into some sub widget:
- Fullscreen: will be the master piece, handle communication of
components, displaying slide content, setting slide as completed,
handling server RPC calls, ....
- Sidebar: responsible for slide navigation, based on the table of
content. (prev, next, keyboard naviguation, ...)
- VideoPlayer: display content for Youtube video and handling player
event to auto set as completed, ...

The DOM of this page is still rendered serverside. DOM was cleaned in
order to be less complex and less deep. CSS style was also reviewed
to decrease line of code.

Fullscreen is now completely using Quiz widget with events triggered.

Task-1942852
2019-03-12 15:31:40 +00:00
Thibault Delavallée 57004e22b0 [FIX] website_slides_survey: avoid issue when fetching certification information
Information was already present, let us use it instead of having access issues
on membership.

Commit linked to task ID 1941250 and PR #31708.

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-08 14:51:25 +00:00
Thibault Delavallée 7afd23e56c [FIX] website_slides: various fixes
Display
 * improve color of trophy displayed on top of course main page (success if
   course done, warning while working on it);
 * correctly fetch and display karma/xp points on course lesson list. It is
   either gain of next try, either awarded points depending on slide
   completion;
 * fix control buttons in course main page (prev, next, set done,
   set completed, fullscren), notably correctly set them disabled;

Linting / Code
 * put demo in no update;
 * rename some parameter in website_slides_survey to avoid conflict between
   quiz (on a slide) and certification (a survey);

 Commit linked to task ID 1941250 and PR #31697.

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-08 11:15:07 +00:00
David Beguin f38a81f981 [IMP] website_slide_survey : set slide completed when quizz_passed
This commit sets the completed flag to True for a slide of type certification
when this certification is succeeded (quizz_passed set to True).

Also, the Download certification button has been added to the fullscreen mode
if the certification is passed by the user.

Task ID : 1941250
PR #31697
2019-03-08 11:15:07 +00:00
Thibault Delavallée 20e68b3297 [REF] website_slides: rework standard lesson page view
Purpose of this commit is to perform a cleaning and upgrade of the lesson
view in front-end when not using the fullscreen mode. This page had not
been updated since eLearning addition.

A method is added on slide model to have a protected method computing quiz
related information on a given set of slides, notably potential karma gain,
gained karma and number of attempts. It is mainly a code move from controllers
now working in batch.

Some linting is also done, notably a badly-named file.

See original eLearning task for main specifications [1].

Commit linked to task ID 1941250 and PR #31657.

[1] See task ID 1902304

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-07 19:51:33 +00:00
sri-odoo af41382fa1 [REF] website_profile and dependencies: improve global layout and design
Purpose is to perform a cleaning pass on website_profile templates. It
cleans the DOM, templates and CSS and proposes various improvements on
general design and layouting. This includes notably

 * lessen custom CSS and use bootstrap 4 classes;
 * simplify layout when possible;
 * make is responsive and mobile friendly;

No functional changes should occur with this commit.

Sub modules are impacted as profile is extended in various other
applications: eLearning, forum and certification.

Commit linked to task ID 1941250 and PR #31453
2019-03-04 16:13:52 +00:00