add modules elearning

This commit is contained in:
XuanHuyen
2025-04-26 11:32:36 +07:00
parent 6d84b73fbd
commit 480b7fdae3
137 changed files with 7542 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import controllers
from . import models
+38
View File
@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
{
'name': 'eLearning Plus',
'version': '18.0.0.2',
'sequence': 10,
'summary': 'Added extra features to enhance learning.',
'website': 'https://www.manprax.com',
'author': 'ManpraX Software LLP',
'category': 'Website/eLearning',
'description': """
Extended feature of elearning.
""",
'depends': [
'website_slides',
],
'data': [
'views/slide_view.xml',
'views/website_slides_templates_course.xml',
],
'assets': {
'web.assets_backend': [
],
'web.assets_frontend': [
'mx_elearning_plus/static/src/js/slides_course.js',
'mx_elearning_plus/static/src/js/slides_course_extend.js',
'mx_elearning_plus/static/src/js/slides_course_rating_fullscreen.js',
'mx_elearning_plus/static/src/js/slide_comment_composer_fullscreen.js',
'mx_elearning_plus/static/src/xml/comment_composer.xml',
'mx_elearning_plus/static/src/xml/comment_button_composer_extend.xml',
],
},
'demo': [],
'qweb': [],
'images': ["static/description/images/app_banner_plus.png"],
'installable': True,
'application': True,
'license': 'AGPL-3',
}
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import main
+73
View File
@@ -0,0 +1,73 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http, tools, _
from odoo.http import request
from odoo.tools import plaintext2html
from odoo.addons.website_slides.controllers.main import WebsiteSlides
class SlideController(http.Controller):
@http.route(['/website/publish/slide'], type='json', auth="user", website=True)
def publish(self, id):
slide_id = request.env['slide.slide'].browse(id)
return bool(slide_id.website_published)
@http.route(['/slides/slide/mx/like'], type='json', auth="public", website=True)
def slide_like_dislike(self, slide_id):
slide = request.env['slide.slide'].browse(slide_id)
return {
'user_vote': slide.user_vote,
'likes': tools.misc.format_decimalized_number(slide.likes),
'dislikes': tools.misc.format_decimalized_number(slide.dislikes),
}
def _portal_post_has_content(self, res_model, res_id, message, attachment_ids=None, **kw):
""" Tells if we can effectively post on the model based on content. """
return bool(message) or bool(attachment_ids)
@http.route(['/mail/slide/comment'], type='json', methods=['POST'], auth='public', website=True)
def portal_chatter_post(self, res_model, res_id, message, attachment_ids=None, attachment_tokens=None, **kw):
"""Create a new `mail.message` with the given `message` and/or `attachment_ids` and return new message values."""
if not self._portal_post_has_content(res_model, res_id, message,
attachment_ids=attachment_ids, attachment_tokens=attachment_tokens,
**kw):
return
res_id = int(res_id)
result = {'default_message': message}
# message is received in plaintext and saved in html
if message:
message = plaintext2html(message)
vals = ({
'email_from': request.env.user.email_formatted,
'author_id': request.env.user.partner_id.id,
'message_type':'comment',
'body':message if message else '',
'subtype_id': 1,
'model':res_model,
'res_id': res_id,
# 'attachment_ids': False,
'record_name': (request.env[str(res_model)].browse(res_id)).name
})
message=request.env['mail.message'].sudo().create(vals)
result.update({'default_message_id': message.id})
if attachment_ids:
# sudo write the attachment to bypass the read access
# verification in mail message
record = request.env[res_model].browse(res_id)
message_values = {'res_id': res_id, 'model': res_model}
attachments = record._message_post_process_attachments([], attachment_ids, message_values)
if attachments.get('attachment_ids'):
message.sudo().write(attachments)
result.update({'default_attachment_ids': message.attachment_ids.sudo().read(['id', 'name', 'mimetype', 'file_size', 'access_token'])})
return result
class WebsiteSlideController(WebsiteSlides):
@http.route('/slides/slide/like', type='json', auth="public", website=True)
def slide_like(self, slide_id, upvote):
res = super(WebsiteSlideController, self).slide_like(slide_id, upvote)
return res
+4
View File
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import slide_slide
+161
View File
@@ -0,0 +1,161 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import re
import requests
from werkzeug import urls
from markupsafe import Markup
from odoo import models, fields, api, _
_logger = logging.getLogger(__name__)
class Slide(models.Model):
_inherit = 'slide.slide'
# is_hide = fields.Boolean(string="Allow Hide")
def action_publish(self):
if not self.id:
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'type': 'warning',
'message': _("Please save the course to publish it.")
}
}
else:
self.is_published = True
def action_unpublish(self):
self.is_published = False
class Channel(models.Model):
_inherit = 'slide.channel'
description_short = fields.Html('Short Description', help="The description that is displayed on the course card")
description = fields.Html('Description', help="The description that is displayed on top of the course page, just below the title")
YOUTUBE_VIDEO_ID_REGEX_PRO = r'^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*'
GOOGLE_DRIVE_DOCUMENT_ID_REGEX_PRO = r'(^https:\/\/docs.google.com|^https:\/\/drive.google.com).*\/d\/([^\/]*)'
VIMEO_VIDEO_ID_REGEX_PRO = r'\/\/(player.)?vimeo.com\/(?:[a-z]*\/)*([0-9]{6,11})\/?([0-9a-z]{6,11})?[?]?.*'
intro_video_type = fields.Selection([
('youtube_video', 'YouTube Video'),
('google_drive_video', 'Google Drive Video'),
('vimeo_video', 'Vimeo Video')],
string="Slide Type", compute='_compute_intro_video_type', store=True, readonly=False,
help="Subtype of the video category, allows more precision on the actual file type / source type.")
intro_url = fields.Char('External URL', help="URL of the Google Drive file or URL of the YouTube video")
intro_video_url = fields.Char('Introduction Video Link', related='intro_url', readonly=False,
help="Link of the video (we support YouTube, Google Drive and Vimeo as sources)")
intro_video_source_type = fields.Selection([
('youtube', 'YouTube'),
('google_drive', 'Google Drive'),
('vimeo', 'Vimeo')],
string='Video Source', compute="_compute_intro_video_source_type")
video_image_1920 = fields.Image(store=True, readonly=False)
intro_youtube_id = fields.Char('Video YouTube ID', compute='_compute_intro_youtube_id')
intro_vimeo_id = fields.Char('Video Vimeo ID', compute='_compute_intro_vimeo_id')
intro_google_drive_id = fields.Char('Google Drive ID of the external URL', compute='_compute_intro_google_drive_id')
video_embed_code = fields.Html('Embed Code', readonly=True, compute='_compute_video_embed_code', sanitize=False)
@api.depends('intro_video_url', 'intro_google_drive_id', 'intro_video_source_type', 'intro_youtube_id')
def _compute_video_embed_code(self):
for course in self:
video_embed_code = False
if course.intro_video_url :
if course.intro_video_source_type == 'youtube':
query_params = urls.url_parse(course.intro_video_url).query
query_params = query_params + '&theme=light' if query_params else 'theme=light'
video_embed_code = Markup('<iframe src="//www.youtube-nocookie.com/embed/%s?%s" allowFullScreen="true" frameborder="0" style="height:-webkit-fill-available; width:-webkit-fill-available;"></iframe>') % (course.intro_youtube_id, query_params)
elif course.intro_video_source_type == 'google_drive':
video_embed_code = Markup('<iframe src="//drive.google.com/file/d/%s/preview" allowFullScreen="true" frameborder="0" style="height:-webkit-fill-available; width:-webkit-fill-available;"></iframe>') % (course.intro_google_drive_id)
elif course.intro_video_source_type == 'vimeo':
if '/' in course.intro_vimeo_id:
# in case of privacy 'with URL only', vimeo adds a token after the video ID
# the embed url needs to receive that token as a "h" parameter
[vimeo_id, vimeo_token] = course.intro_vimeo_id.split('/')
video_embed_code = Markup("""
<iframe src="https://player.vimeo.com/video/%s?h=%s&badge=0&amp;autopause=0&amp;player_id=0"
frameborder="0" style="height:-webkit-fill-available; width:-webkit-fill-available;" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>""") % (
vimeo_id, vimeo_token)
else:
video_embed_code = Markup("""
<iframe src="https://player.vimeo.com/video/%s?badge=0&amp;autopause=0&amp;player_id=0"
frameborder="0" style="height:-webkit-fill-available; width:-webkit-fill-available;" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>""") % (course.intro_vimeo_id)
course.video_embed_code = video_embed_code
@api.depends('intro_video_type', 'intro_video_source_type')
def _compute_intro_video_type(self):
""" For 'local content' or specific slide categories, the slide type is directly derived
from the slide category.
For external content, the slide type is determined from the metadata and the mime_type.
(See #_fetch_google_drive_metadata() for more details)."""
for course in self:
if course.intro_video_url and course.intro_video_source_type == 'youtube':
course.intro_video_type = 'youtube_video'
elif course.intro_video_url and course.intro_video_source_type == 'google_drive':
course.intro_video_type = 'google_drive_video'
elif course.intro_video_url and course.intro_video_source_type == 'vimeo':
course.intro_video_type = 'vimeo_video'
else:
course.intro_video_type = False
@api.depends('intro_video_url')
def _compute_intro_video_source_type(self):
for course in self:
intro_video_source_type = False
youtube_match = re.match(self.YOUTUBE_VIDEO_ID_REGEX_PRO, course.intro_video_url) if course.intro_video_url else False
if youtube_match and len(youtube_match.groups()) == 2 and len(youtube_match.group(2)) == 11:
intro_video_source_type = 'youtube'
if course.intro_video_url and not intro_video_source_type and re.match(self.GOOGLE_DRIVE_DOCUMENT_ID_REGEX_PRO, course.intro_video_url):
intro_video_source_type = 'google_drive'
vimeo_match = re.search(self.VIMEO_VIDEO_ID_REGEX_PRO, course.intro_video_url) if course.intro_video_url else False
if not intro_video_source_type and vimeo_match and len(vimeo_match.groups()) == 3:
intro_video_source_type = 'vimeo'
course.intro_video_source_type = intro_video_source_type
@api.depends('intro_video_url', 'intro_video_source_type')
def _compute_intro_youtube_id(self):
for course in self:
if course.intro_video_url and course.intro_video_source_type == 'youtube':
match = re.match(self.YOUTUBE_VIDEO_ID_REGEX_PRO, course.intro_video_url)
if match and len(match.groups()) == 2 and len(match.group(2)) == 11:
course.intro_youtube_id = match.group(2)
else:
course.intro_youtube_id = False
else:
course.intro_youtube_id = False
@api.depends('intro_video_url', 'intro_video_source_type')
def _compute_intro_vimeo_id(self):
for course in self:
if course.intro_video_url and course.intro_video_source_type == 'vimeo':
match = re.search(self.VIMEO_VIDEO_ID_REGEX_PRO, course.intro_video_url)
if match and len(match.groups()) == 3:
if match.group(3):
# in case of privacy 'with URL only', vimeo adds a token after the video ID
# the share url is then 'vimeo_id/token'
# the token will be captured in the third group of the regex (if any)
course.intro_vimeo_id = '%s/%s' % (match.group(2), match.group(3))
else:
# regular video, we just capture the vimeo_id
course.intro_vimeo_id = match.group(2)
else:
course.intro_vimeo_id = False
@api.depends('intro_video_url')
def _compute_intro_google_drive_id(self):
""" Extracts the Google Drive ID from the url based on the slide category. """
for course in self:
url = course.intro_video_url
intro_google_drive_id = False
if url:
match = re.match(self.GOOGLE_DRIVE_DOCUMENT_ID_REGEX_PRO, url)
if match and len(match.groups()) == 2:
intro_google_drive_id = match.group(2)
course.intro_google_drive_id = intro_google_drive_id
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 KiB

@@ -0,0 +1,211 @@
<div class="row"
style="margin: 0;position: relative;color: #000;background-position: center;background: #ffffff;border-bottom: 1px solid #e4e4e4;text-align: center; margin: auto; display: flex;justify-content: center;">
<a href="https://www.manprax.com/" target="_blank"><img src="images/manprax.png"
style=" width: 293px; padding: 1rem 0rem; margin: auto" alt="manprax-logo"></a>
</div>
<div class="row"
style="margin:75px 0;position: relative;color: #000;background-position: center;background: #ffffff;border-bottom: 1px solid #e4e4e4; padding-bottom: 30px;">
<div class="col-md-7 col-sm-12 col-xs-12" style="padding: 0px">
<div
style=" margin: 0 0 0px;padding: 20px 0 10;font-size: 23px;line-height: 35px;font-weight: 400;color: #000;border-top: 1px solid rgba(255,255,255,0.1);border-bottom: 1px solid rgba(255,255,255,0.11);text-align: left;">
<h1 style="font-size: 39px;font-weight: 600;margin: 0px !important;">Elearning Plus </h1>
</h3>
</div>
<h2 style="font-weight: 600;font-size: 1.8rem;margin-top: 15px;">Key Highlights</h2>
<ul style=" padding: 0 1px; list-style: none; ">
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Collapse/Expand Feature in course content list.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Fix Bug of Publish/Unpublish Button on course Fullscreen.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Publish slides directly from backend.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Add Description with HTML editor.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Short Introduction video for course.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Like/Dislike option for content in fullscreen.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Comment option for content in fullscreen.
</li>
</ul>
</div>
</div>
<div>
<h2 class="text-center">Screenshots</h2>
<section class="oe_container">
<div>
<div>
<div>
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Collapse/Expand Feature in course content list.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px; width: 80%;"
src="images/screen1.png"></div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Fix Bug of Publish/Unpublish Button on course Fullscreen.
<br>
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen2.png"></div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Publish slides directly from backend.
<br>
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen3.png"></div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Add Description for course in HTML Editor.
<br>
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen4.png"></div>
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen5.png"></div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Add Youtube Video URL or Google Drive Video URL.
<br>
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen6.png"></div>
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen7.png"></div>
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen8.png"></div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Like/Dislike option for content in fullscreen.
<br>
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen9.png"></div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Comment option for content in fullscreen.
<br>
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen10.png"></div>
<div style="text-align: center;"><img class="img img-responsive center-block mb-5"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen11.png"></div>
</div>
</div>
</div>
</div>
</section>
</div>
<div>
<div style="max-width:1540px; margin: 0 auto; ">
<div class="col-lg-12 mb-4">
<h4 class="text-center">Need Help?</h4>
<hr style="border-width: 4px; border-color:#875A7B; width: 80px;">
</div>
</div>
<!-- Contact Cards -->
<div class="row d-flex justify-content-center align-items-center" style="max-width:1540px; margin: 0 auto;">
<div class="col-lg-3 shadow mt-2"
style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem; border-top: 7px solid #546E7A; height: 180px;">
<h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';text-align: center;">Visit us</h5>
<a href="https://manprax.com" target="_blank" class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #546E7A; color: #FFF; border-radius: 4px;">ManpraX Software LLP</a>
</div>
<div class="col-lg-3 shadow mt-2"
style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem; border-top: 7px solid #546E7A; height: 180px;">
<h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';text-align: center;">Bite Sized Conversation</h5>
<a href="https://wa.me/+918448440100" target="_blank" class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #546E7A; color: #FFF; border-radius: 4px;">WhatsApp</a>
</div>
</div>
</div>
<div class="mt-5">
<div style="max-width:1540px; margin: 0 auto; ">
<div class="col-lg-12 mb-4">
<h4 class="text-center">Enquires</h4>
<hr style="border-width: 4px; border-color:#875A7B; width: 80px;">
</div>
</div>
<!-- Contact Cards -->
<div class="row d-flex justify-content-center align-items-center" style="max-width:1540px; margin: 0 auto;">
<div class="col-lg-3 shadow mt-2"
style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem; border-top: 7px solid #546E7A; height: 180px;">
<h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';text-align: center;">Business Enquiry</h5>
<a href="mailto:sales@manprax.com" target="_blank" class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #546E7A; color: #FFF; border-radius: 4px;">Click Here</a>
</div>
<div class="col-lg-3 shadow mt-2"
style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem; border-top: 7px solid #546E7A; height: 180px;">
<h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';text-align: center;">General Enquiry</h5>
<a href="mailto:info@manprax.com" target="_blank" class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #546E7A; color: #FFF; border-radius: 4px;">Click Here</a>
</div>
<div class="col-lg-3 shadow mt-2"
style="padding: 5rem 2rem 2rem; border-radius: 10px; margin-right: 3rem; border-top: 7px solid #546E7A; height: 180px;">
<h5 class="font-weight-bold" style="font-family: Roboto, 'sans-serif';text-align: center;">Join the MX Team</h5>
<a href="mailto:apply@manprax.com" target="_blank" class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #546E7A; color: #FFF; border-radius: 4px;">Click Here</a>
</div>
</div>
</div>
@@ -0,0 +1,144 @@
/** @odoo-module **/
import publicWidget from '@web/legacy/js/public/public_widget';
import portalComposer from "@portal/js/portal_composer";
import { renderToElement } from "@web/core/utils/render";
import { session } from "@web/session";
const PortalComposer = portalComposer.PortalComposer;
PortalComposer.include({
/**
* @private
* @param {Event} ev
*/
async _onSubmitButtonClick(ev) {
await this._super(...arguments).then((result) => {
const $modal = this.$el.closest('#commentpopupcomposer');
$modal.on('hidden.bs.modal', () => {
this.trigger_up('reload_comment_popup_composer', result);
});
$modal.modal('hide');
});
},
/**
* Prepare message data for submission.
*
* @private
* @returns {Object} The data object to be sent to the backend.
*/
_prepareMessageData() {
const messageBody = this.$('textarea[name="message"]').val();
const attachmentIds = this.attachments.map((a) => a.id);
const attachmentTokens = this.attachments.map((a) => a.access_token);
if (this.options.is_comment_fullscreen) {
const resId = $('.o_wslides_fs_sidebar_list_item.active').data('id');
return {
thread_model: this.options.res_model,
thread_id: resId,
post_data: {
body: messageBody,
attachment_ids: attachmentIds,
message_type: "comment",
subtype_xmlid: "mail.mt_comment",
},
attachment_tokens: attachmentTokens,
};
} else {
return {
thread_model: this.options.res_model,
thread_id: this.options.res_id,
post_data: {
body: messageBody,
attachment_ids: attachmentIds,
message_type: "comment",
subtype_xmlid: "mail.mt_comment",
},
attachment_tokens: attachmentTokens,
message_id: this.options.default_message_id,
};
}
},
});
/**
* CommentPopupComposer
*
* Open a popup with the portal composer when clicking on it.
**/
const CommentPopupComposer = publicWidget.Widget.extend({
selector: '.o_comment_popup_composer',
custom_events: {
reload_comment_popup_composer: '_onReloadCommentPopupComposer',
},
willStart: function (parent) {
const def = this._super.apply(this, arguments);
const options = this.$el.data();
this.options = Object.assign({
'token': false,
'res_model': false,
'res_id': false,
'pid': 0,
'csrf_token': odoo.csrf_token,
'user_id': session.user_id,
}, options, {});
return def;
},
/**
* @override
*/
start: function () {
return Promise.all([
this._super.apply(this, arguments),
this._reloadCommentPopupComposer(),
]);
},
/**
* Destroy existing commentPopup and insert new commentPopup widget
*
* @private
* @param {Object} data
*/
_reloadCommentPopupComposer: function () {
// Append the modal
const modal = renderToElement(
'mx_elearning_plus.PopupCommentComposer', {
inline_mode: true,
widget: this,
});
this.$('.o_comment_popup_composer_modal').html(modal);
if (this._composer) {
this._composer.destroy();
}
// Instantiate the "Portal Composer" widget and insert it into the modal
this._composer = new PortalComposer(this, this.options);
return this._composer.appendTo(this.$('.o_comment_popup_composer_modal .o_portal_chatter_composer'))
},
//--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------
/**
* @private
* @param {OdooEvent} event
*/
_onReloadCommentPopupComposer: function (event) {
const data = event.data;
this.options = Object.assign(this.options, data);
this._reloadCommentPopupComposer();
}
});
publicWidget.registry.CommentPopupComposer = CommentPopupComposer;
export default CommentPopupComposer;
@@ -0,0 +1,101 @@
/** @odoo-module **/
import Fullscreen from "@website_slides/js/slides_course_fullscreen_player";
import { _t } from "@web/core/l10n/translation";
import { rpc } from "@web/core/network/rpc";
Fullscreen.include({
events: Object.assign({}, Fullscreen.prototype.events, {
'click .o_btn_comment_unable': '_onClickCommentUnable',
'click .o_btn_comment_public': '_onClickCommentPublic',
'click .o_btn_no_comment_karma': '_onClickNoCommentKarma',
'click .o_btn_comment_karma': '_onClickCommentKarma',
}),
_onClickCommentUnable: function () {
var message = ('Commenting is not enabled on this course.');
this.displayNotification({
type: 'warning',
message: message,
sticky: true
});
},
_onClickCommentPublic: function () {
var message = ('There are no comments for now. Join Course to be the first to leave a comment.');
this.displayNotification({
type: 'warning',
message: message,
sticky: true
});
},
_onClickNoCommentKarma: function () {
var message = ('There are no comments for now. Earn more Karma to be the first to leave a comment.');
this.displayNotification({
type: 'warning',
message: message,
sticky: true
});
},
_onClickCommentKarma: function () {
var message = ('Earn more Karma to leave a comment.');
this.displayNotification({
type: 'warning',
message: message,
sticky: true
});
},
_renderSlide: function () {
this._super.apply(this, arguments);
const slide = this._slideValue;
rpc('/slides/slide/mx/like', {
slide_id: slide.id,
}).then(function (data) {
if (! data.error) {
const $likesBtn = self.$('span.o_wslides_js_slide_like_up_mx');
const $likesIcon = $likesBtn.find('i.fa');
const $dislikesBtn = self.$('span.o_wslides_js_slide_like_down_mx');
const $dislikesIcon = $dislikesBtn.find('i.fa');
// update 'thumbs-up' button with latest state
$likesBtn.data('user-vote', data.user_vote);
$likesBtn.find('span').text(data.likes);
$likesIcon.toggleClass("fa-thumbs-up", data.user_vote === 1);
$likesIcon.toggleClass("fa-thumbs-o-up", data.user_vote !== 1);
// update 'thumbs-down' button with latest state
$dislikesBtn.data('user-vote', data.user_vote);
$dislikesBtn.find('span').text(data.dislikes);
$dislikesIcon.toggleClass("fa-thumbs-down", data.user_vote === -1);
$dislikesIcon.toggleClass("fa-thumbs-o-down", data.user_vote !== -1);
$('.o_wslides_js_slide_like_up_mx').data('slide-id', slide.id);
$('.o_wslides_js_slide_like_down_mx').data('slide-id', slide.id);
$('.o_wslides_js_slide_like_up_mx span').text(data.likes);
$('.o_wslides_js_slide_like_down_mx span').text(data.dislikes);
}
});
},
_onChangeSlideRequest: function (ev){
this._super.apply(this, arguments);
var slideData = ev.data;
var $data = this.$el.prevObject.find('.js_publish_btn:visible').parents(".js_publish_management:first");
rpc('/website/publish/slide', {
id: slideData.id,
}).then(function (result) {
if (result){
$data.removeClass("css_unpublished");
$data.addClass("css_published");
$data.find('input').prop("checked", result);
$data.parents("[data-publish]").attr("data-publish", +result ? 'on' : 'off');
}else{
$data.removeClass("css_published");
$data.addClass("css_unpublished");
$data.find('input').prop("checked", result);
$data.parents("[data-publish]").attr("data-publish", +result ? 'on' : 'off');
}
})
}
});
@@ -0,0 +1,26 @@
/** @odoo-module **/
import publicWidget from '@web/legacy/js/public/public_widget';
publicWidget.registry.websiteCourseExtended = publicWidget.Widget.extend({
selector: '.o_course_extended',
/**
* @override
*/
start: function () {
$('.o_course_extended').on('click','#collapse_div',function() {
var id = this.dataset.target.split('-')[1]
if($('#slide-'+id).is(":visible")) {
$('#slide-'+id).hide()
$(this).children().first().children().removeClass('fa-minus');
$(this).children().first().children().addClass('fa-plus');
}else {
$('#slide-'+id).show()
$(this).children().first().children().removeClass('fa-plus');
$(this).children().first().children().addClass('fa-minus');
}
});
}
})
@@ -0,0 +1,118 @@
/** @odoo-module **/
import publicWidget from '@web/legacy/js/public/public_widget';
import { rpc } from "@web/core/network/rpc";
import { sprintf } from '@web/core/utils/strings';
import { _t } from "@web/core/l10n/translation";
import '@website_slides/js/slides';
var FullscreenSlideLikeWidget = publicWidget.Widget.extend({
events: {
'click .o_wslides_js_slide_like_up_mx': '_onClickUpMx',
'click .o_wslides_js_slide_like_down_mx': '_onClickDownMx',
},
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
/**
* @private
* @param {Object} $el
* @param {String} message
*/
_popoverAlert: function ($el, message) {
$el.popover({
trigger: 'focus',
delay: {'hide': 300},
placement: 'bottom',
container: 'body',
html: true,
content: function () {
return message;
}
}).popover('show');
},
//--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------
/**
* @private
*/
_onClickMx: function (slideId, voteType) {
var self = this;
rpc('/slides/slide/like', {
slide_id: slideId,
upvote: voteType === 'like',
}).then(function (data) {
if (! data.error) {
const $likesBtn = self.$('span.o_wslides_js_slide_like_up_mx');
const $likesIcon = $likesBtn.find('i.fa');
const $dislikesBtn = self.$('span.o_wslides_js_slide_like_down_mx');
const $dislikesIcon = $dislikesBtn.find('i.fa');
// update 'thumbs-up' button with latest state
$likesBtn.data('user-vote', data.user_vote);
$likesBtn.find('span').text(data.likes);
$likesIcon.toggleClass("fa-thumbs-up", data.user_vote === 1);
$likesIcon.toggleClass("fa-thumbs-o-up", data.user_vote !== 1);
// update 'thumbs-down' button with latest state
$dislikesBtn.data('user-vote', data.user_vote);
$dislikesBtn.find('span').text(data.dislikes);
$dislikesIcon.toggleClass("fa-thumbs-down", data.user_vote === -1);
$dislikesIcon.toggleClass("fa-thumbs-o-down", data.user_vote !== -1);
} else {
if (data.error === 'public_user') {
const message = data.error_signup_allowed ?
_t('Please <a href="/web/login?redirect=%s">login</a> or <a href="/web/signup?redirect=%s">create an account</a> to vote for this lesson') :
_t('Please <a href="/web/login?redirect=%s">login</a> to vote for this lesson');
self._popoverAlert(self.$el, sprintf(message, document.URL, document.URL));
} else if (data.error === 'slide_access') {
self._popoverAlert(self.$el, _t('You don\'t have access to this lesson'));
} else if (data.error === 'channel_membership_required') {
self._popoverAlert(self.$el, _t('You must be member of this course to vote'));
} else if (data.error === 'channel_comment_disabled') {
self._popoverAlert(self.$el, _t('Votes and comments are disabled for this course'));
} else if (data.error === 'channel_karma_required') {
self._popoverAlert(self.$el, _t('You don\'t have enough karma to vote'));
} else {
self._popoverAlert(self.$el, _t('Unknown error'));
}
}
});
},
_onClickUpMx: function (ev) {
var slideId = $(ev.currentTarget).data('slide-id');
return this._onClickMx(slideId, 'like');
},
_onClickDownMx: function (ev) {
var slideId = $(ev.currentTarget).data('slide-id');
return this._onClickMx(slideId, 'dislike');
},
});
publicWidget.registry.FullscreenWebsiteSlidesSlideLike = publicWidget.Widget.extend({
selector: '#wrapwrap',
/**
* @override
* @param {Object} parent
*/
start: function () {
var self = this;
var defs = [this._super.apply(this, arguments)];
$('.o_wslides_js_slide_like_mx').each(function () {
defs.push(new FullscreenSlideLikeWidget(self).attachTo($(this)));
});
return Promise.all(defs);
},
});
export default {
FullscreenSlideLikeWidget: FullscreenSlideLikeWidget,
FullscreenWebsiteSlidesSlideLike: publicWidget.registry.FullscreenWebsiteSlidesSlideLike
};
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="mx_elearning_plus.portalComposer" t-inherit="portal.Composer" t-inherit-mode="primary">
<xpath expr="//button[hasclass('o_portal_chatter_composer_btn')]" position="replace">
<t t-if="widget.options['is_comment_fullscreen']">
<button t-attf-data-action="/mail/slide/comment" class="o_portal_chatter_composer_btn btn btn-primary" type="submit">Send</button>
</t>
<t t-else="">
<button t-attf-data-action="/mail/message/post" class="o_portal_chatter_composer_btn btn btn-primary" type="submit">Send</button>
</t>
</xpath>
</t>
</templates>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!--
Popup Comment Composer Widget
-->
<t t-name="mx_elearning_plus.PopupCommentComposer">
<div t-if="widget.options['display_composer']" class="modal fade" id="commentpopupcomposer" tabindex="-1" role="dialog" aria-labelledby="commentpopupcomposerlabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title o_comment_popup_composer_label" style="color: black;" id="commentpopupcomposerlabel">
Add your comment
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="o_portal_chatter_composer"/>
</div>
</div>
</div>
</div>
</t>
</templates>
+31
View File
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_slide_slide_form_inherit_publish" model="ir.ui.view">
<field name="name">slide.slide.form</field>
<field name="model">slide.slide</field>
<field name="inherit_id" ref="website_slides.view_slide_slide_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="before">
<header>
<button name="action_publish" type="object" string="Publish" class="oe_highlight" invisible="is_published"/>
<button name="action_unpublish" type="object" string="Unpublish" class="oe_highlight" invisible="not is_published"/>
</header>
</xpath>
<!-- <field name="slide_resource_downloadable" position="after">
<field name="is_hide" />
</field> -->
</field>
</record>
<record id="mx_plus_view_slide_channel_form_inherit" model="ir.ui.view">
<field name="name">slide.channel.form</field>
<field name="model">slide.channel</field>
<field name="inherit_id" ref="website_slides.view_slide_channel_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='user_id']" position="after">
<field name="intro_video_url" placeholder='e.g "www.youtube.com/watch?v=ebBez6bcSEc"' widget="url"/>
</xpath>
</field>
</record>
</data>
</odoo>
@@ -0,0 +1,247 @@
<?xml version="1.0" ?>
<odoo><data>
<template id="course_slides_list_collapse" inherit_id="website_slides.course_slides_list">
<div t-att-data-channel-id="channel.id" position="attributes">
<attribute name="class" separator=" " add="o_course_extended"/>
</div>
<div t-att-class="'d-flex align-items-center me-auto ps-3 %s' % ('o_wslides_slides_list_drag' if channel.can_publish else '')" position="attributes">
<attribute name="data-toggle">collapse</attribute>
<attribute name="t-att-data-target">'%s%s' % ('#slide-', category_id)</attribute>
<attribute name="aria-expanded">false</attribute>
<attribute name="t-att-aria-controls">category_id</attribute>
<attribute name="id">collapse_div</attribute>
</div>
<xpath expr="//div[@t-if='channel.can_publish and category_id']/i" position="replace">
<i class="fa fa-plus"/>
</xpath>
<ul class="list-unstyled pb-1 border-top" position="replace">
<t t-if="category_id">
<div class="collapse" t-att-id="'slide-%s' % (category_id)">
<ul t-att-data-category-id="category_id" class="list-unstyled pb-1 border-top">
<li class="o_wslides_slides_list_slide o_not_editable border-0"/>
<li class="o_wslides_js_slides_list_empty border-0"/>
<t t-foreach="category['slides']" t-as="slide">
<!-- <t t-if="not slide.is_hide"> -->
<t t-call="website_slides.course_slides_list_slide" />
<!-- </t> -->
<t t-set="j" t-value="j+1"/>
</t>
</ul>
</div>
</t>
<t t-if="not category_id">
<ul t-att-data-category-id="category_id" class="list-unstyled pb-1 border-top">
<li class="o_wslides_slides_list_slide o_not_editable border-0"/>
<li class="o_wslides_js_slides_list_empty border-0"/>
<t t-foreach="category['slides']" t-as="slide">
<t t-call="website_slides.course_slides_list_slide" />
<t t-set="j" t-value="j+1"/>
</t>
</ul>
</t>
</ul>
</template>
<!-- introduction video in courses home page template -->
<template id="course_card_inherit" inherit_id="website_slides.course_card">
<div class="o_wslides_background_image h-100" position="replace">
<t t-if="channel.image_1920">
<div t-field="channel.image_1920" t-options="{'widget': 'image'}" class="o_wslides_background_image h-100">
<t t-if="channel.partner_has_new_content" t-call="website_slides.course_card_information"/>
</div>
</t>
<t t-elif="channel.video_embed_code">
<div t-out="channel.video_embed_code" t-options='{"widget": "video_preview", "class": "embed-responsive-item"}' class="o_wslides_background_image h-100">
<t t-if="channel.partner_has_new_content" t-call="website_slides.course_card_information"/>
</div>
</t>
<t t-else="">
<div t-field="channel.image_1920" t-options="{'widget': 'image', 'preview_image': 'image_512'}" class="o_wslides_background_image h-100">
<t t-if="channel.partner_has_new_content" t-call="website_slides.course_card_information"/>
</div>
</t>
</div>
</template>
<!-- introduction video in course main page template -->
<template id="mx_course_slides_course_main" inherit_id="website_slides.course_main">
<div class="d-flex align-items-end justify-content-around h-100" position="replace">
<div class="d-flex align-items-end justify-content-around h-100">
<t t-if="channel.image_1920">
<div t-field="channel.image_1920" t-options='{"widget": "image", "class": "o_wslides_course_pict d-inline-block mb-2 mt-3 my-md-0"}' class="h-100"/>
</t>
<t t-elif="channel.video_embed_code" >
<div t-out="channel.video_embed_code" t-options='{"widget": "video_preview", "class": "o_wslides_course_pict embed-responsive-item d-inline-block mb-2 mt-3 my-md-0"}' class="h-100" style="width:-webkit-fill-available;"/>
</t>
<t t-else="">
<div t-field="channel.image_1920"
t-options="{'widget': 'image', 'class': 'o_wslides_course_pict d-inline-block mb-2 mt-3 my-md-0', 'preview_image': 'image_1024'}"
class="h-100"/>
</t>
</div>
</div>
</template>
<template id="mx_plus_slide_fullscreen_inherit" inherit_id="website_slides.slide_fullscreen">
<a class="o_wslides_fs_share d-flex align-items-center px-3" position="before">
<div t-if="slide.channel_id.allow_comment" class="o_wslides_js_slide_like_mx d-flex align-items-center px-3">
<span t-attf-class="o_wslides_js_slide_like_up_mx #{'disabled' if not slide.channel_id.can_vote else ''}" tabindex="0" data-bs-toggle="popover" t-att-data-slide-id="slide.id" t-att-data-user-vote="slide.user_vote">
<i t-attf-class="fa fa-1x #{'fa-thumbs-up' if slide.user_vote == 1 else 'fa-thumbs-o-up'}" role="img" aria-label="Likes" title="Like" style="cursor:pointer;"/>
<span t-field="slide.likes" t-options="{'format_decimalized_number': True}"/>
</span>
<span t-attf-class="o_wslides_js_slide_like_down_mx ms-3 #{'disabled' if not slide.channel_id.can_vote else ''}" tabindex="0" data-bs-toggle="popover" t-att-data-slide-id="slide.id" t-att-data-user-vote="slide.user_vote">
<i t-attf-class="fa fa-1x #{'fa-thumbs-down' if slide.user_vote == -1 else 'fa-thumbs-o-down'}" role="img" aria-label="Dislikes" title="Dislike" style="cursor:pointer;"/>
<span t-field="slide.dislikes" t-options="{'format_decimalized_number': True}"/>
</span>
</div>
</a>
<a class="o_wslides_fs_review d-flex align-items-center" position="after">
<a class="o_wslides_fs_comment d-flex align-items-center" title="Comments">
<t t-call="mx_elearning_plus.mx_fullscreen_comment">
<t t-set="enable_slide_comments" t-value="0"/>
<t t-set="allow_comment" t-value="slide.channel_id.allow_comment"/>
<t t-set="channel_type" t-value="slide.channel_id.channel_type"/>
<t t-set="can_access_channel" t-value="can_access_channel"/>
<t t-set="comment_count" t-value="slide.comments_count"/>
<t t-set="enroll" t-value="slide.channel_id.enroll"/>
<t t-set="can_comment" t-value="slide.channel_id.can_comment"/>
<t t-set="token" t-value="channel.access_token"/>
<t t-set="hash" t-value="message_post_hash"/>
<t t-set="pid" t-value="message_post_pid"/>
<t t-set="default_message_id" t-value="False"/>
<t t-set="disable_composer" t-value="not (slide.channel_id.can_comment and slide.channel_id.allow_comment)"/>
<t t-set="_link_btn_classes" t-value="'d-inline-block text-white fw-light shadow-none'"/>
<t t-set="icon" t-value="'fa fa-comments'"/>
<t t-set="_text_classes" t-value="'d-none d-md-inline-block'"/>
<t t-set="object" t-value="slide"/>
<t t-set="is_fullscreen" t-value="True"/>
<t t-set="is_comment_fullscreen" t-value="True"/>
</t>
</a>
</a>
</template>
<template id="mx_fullscreen_comment">
<t t-set="display_composer" t-value="not disable_composer and not (request.session.uid and env.user._is_public())"/>
<div class="d-print-none o_comment_popup_composer o_not_editable p-0"
contenteditable="false"
t-att-data-allow_comment="slide.channel_id.allow_comment"
t-att-data-channel_type="slide.channel_id.channel_type"
t-att-data-comments_count="slide.comments_count"
t-att-data-enroll="slide.channel_id.enroll"
t-att-data-can_comment="slide.channel_id.can_comment"
t-att-data-can_access_channel="can_access_channel"
t-att-data-comments="comments"
t-att-data-res_model="object._name"
t-att-data-res_id="object.id"
t-att-data-pid="pid"
t-att-data-hash="hash"
t-att-data-token="token"
t-att-data-partner_id="request.env.user.partner_id.id"
t-att-data-disable_composer="disable_composer"
t-att-data-display_composer="display_composer"
t-att-data-link_btn_classes="_link_btn_classes"
t-att-data-icon="icon"
t-att-data-text_classes="_text_classes"
t-att-data-allow_composer="'0' if disable_composer else '1'"
t-att-data-is_fullscreen="is_fullscreen"
t-att-data-is_comment_fullscreen="is_comment_fullscreen">
<div class="d-flex flex-wrap align-items-center">
<t t-if="not (slide.channel_id.allow_comment and slide.channel_id.channel_type == 'training')">
<button type="button" t-att-class="'o_btn_comment_unable btn ' + _link_btn_classes or 'btn-primary'">
<i t-if="icon" t-att-class="icon"/>
<span t-attf-class="#{_text_classes}">
<t t-if="is_fullscreen">Comments</t>
<!-- <t t-if="slide.comments_count"> (<t t-out="slide.comments_count"/>)</t> -->
</span>
</button>
</t>
<t t-elif="not slide.comments_count">
<t t-if="not can_access_channel and slide.channel_id.enroll != 'public'">
<button type="button" t-att-class="'o_btn_comment_public btn ' + _link_btn_classes or 'btn-primary'">
<i t-if="icon" t-att-class="icon"/>
<span t-attf-class="#{_text_classes}">
<t t-if="is_fullscreen">Comments</t>
<!-- <t t-if="slide.comments_count"> (<t t-out="slide.comments_count"/>)</t> -->
</span>
</button>
</t>
<t t-if="not slide.channel_id.can_comment">
<button type="button" t-att-class="'o_btn_no_comment_karma btn ' + _link_btn_classes or 'btn-primary'">
<i t-if="icon" t-att-class="icon"/>
<span t-attf-class="#{_text_classes}">
<t t-if="is_fullscreen">Comments</t>
<!-- <t t-if="slide.comments_count"> (<t t-out="slide.comments_count"/>)</t> -->
</span>
</button>
</t>
</t>
<t t-else="">
<t t-if="not slide.comments_count and can_access_channel">
<button type="button" t-att-class="'o_btn_comment_karma btn ' + _link_btn_classes or 'btn-primary'">
<i t-if="icon" t-att-class="icon"/>
<span t-attf-class="#{_text_classes}">
<t t-if="is_fullscreen">Comments</t>
<!-- <t t-if="slide.comments_count"> (<t t-out="slide.comments_count"/>)</t> -->
</span>
</button>
</t>
</t>
<button t-if="display_composer" type="button"
t-att-class="'btn ' + _link_btn_classes or 'btn-primary'"
data-bs-toggle="modal" data-bs-target="#commentpopupcomposer">
<i t-if="icon" t-att-class="icon"/>
<span t-attf-class="#{_text_classes}">
<t t-if="is_fullscreen">Comments</t>
<!-- <t t-if="slide.comments_count"> (<t t-out="slide.comments_count"/>)</t> -->
</span>
</button>
<div class="o_comment_popup_composer_modal"/>
</div>
</div>
</template>
<!-- <template id="mx_plus_slide_aside_training_category_inherit" inherit_id="website_slides.slide_aside_training_category">
<div t-att-class="'o_wslides_lesson_aside_list_link d-flex p-1 %s%s' % (('bg-100 active' if aside_slide == slide else ''), 'text-muted' if not can_access else '')" position="attributes">
<attribute name="t-if">not aside_slide.is_hide</attribute>
</div>
<ul class="list-group ps-5 mb-1 list-unstyled" position="attributes">
<attribute name="t-if">(aside_slide._has_additional_resources() or aside_slide.question_ids) and not aside_slide.is_hide</attribute>
</ul>
</template> -->
<template id="mx_plus_slide_fullscreen_sidebar_category_inherit" inherit_id="website_slides.slide_fullscreen_sidebar_category">
<li t-attf-class="o_wslides_fs_sidebar_list_item d-flex py-1 #{'active' if slide.id == current_slide.id else ''}" position="attributes">
<attribute name="t-att-data-allow-comment">slide.channel_id.allow_comment</attribute>
<attribute name="t-att-data-can-vote">slide.channel_id.can_vote</attribute>
<attribute name="t-att-data-user-vote">slide.user_vote if slide.user_vote else 0</attribute>
<attribute name="t-att-data-likes">slide.likes if slide.likes else 0</attribute>
<attribute name="t-att-data-dislikes">slide.dislikes if slide.dislikes else 0</attribute>
<attribute name="t-att-data-channel-type">slide.channel_id.channel_type</attribute>
<attribute name="t-att-data-comments-count">slide.comments_count</attribute>
<attribute name="t-att-data-enroll">slide.channel_id.enroll</attribute>
<attribute name="t-att-data-can-comment">slide.channel_id.can_comment</attribute>
<attribute name="t-att-data-can-access-channel">can_access_channel</attribute>
<attribute name="t-att-data-comments">comments</attribute>
</li>
<!-- <xpath expr="//span[@class='d-block']/div[@class='d-flex']" position="replace">
</xpath>
<a t-if="can_access" class="d-block" href="#" position="replace">
<t t-if="not slide.is_hide">
<a t-if="can_access" class="d-block" href="#">
<div class="d-flex">
<t t-set="icon_class" t-value="'me-2'"/>
<t t-call="website_slides.slide_icon"/>
<div class="o_wslides_fs_slide_name" t-esc="slide.name"/>
</div>
</a>
<span t-else="" class="d-block" href="#">
<div class="d-flex">
<t t-set="icon_class" t-value="'me-2 text-600'"/>
<t t-call="website_slides.slide_icon"/>
<div class="o_wslides_fs_slide_name text-600" t-esc="slide.name"/>
</div>
</span>
</t>
</a>
<ul class="list-unstyled w-100 pt-2 small ps-4" position="attributes">
<attribute name="t-if">(slide._has_additional_resources() and not slide.is_hide) or (slide.question_ids and not slide.slide_category =='quiz' and not slide.is_hide)</attribute>
</ul> -->
</template>
</data></odoo>
+859
View File
@@ -0,0 +1,859 @@
For copyright information, please see the COPYRIGHT file.
Odoo is published under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3
(LGPLv3), as included below. Since the LGPL is a set of additional
permissions on top of the GPL, the text of the GPL is included at the
bottom as well.
Some external libraries and contributions bundled with Odoo may be published
under other GPL-compatible licenses. For these, please refer to the relevant
source files and/or license files, in the source code tree.
**************************************************************************
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
**************************************************************************
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
**************************************************************************
+5
View File
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from .import models
from .import controllers
+31
View File
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
{
'name': 'LMS eLearning with ORA',
'description': 'Open Response Assessment',
'category': 'Website/eLearning',
'summary': 'Manage and publish an eLearning platform',
'sequence': 10,
'version': '2.2',
'website': 'https://www.manprax.com',
'author': 'ManpraX Software LLP',
'depends': ['website_slides'],
'data': [
'data/ir_cron_data.xml',
'security/ir.model.access.csv',
'views/slide_assessment_view.xml',
'views/templates.xml',
'views/slide_fullscreen_view.xml'
],
'assets': {
'web.assets_frontend': [
'website_ora_elearning/static/src/scss/website_slides.scss',
'website_ora_elearning/static/src/js/ora_fullscreen.js',
'website_ora_elearning/static/src/js/website_ora.js',
'website_ora_elearning/static/src/xml/slide_ora.xml',
],
},
'qweb': [],
'images': ["static/description/images/banner.png"],
'application': True,
'license': 'AGPL-3',
}
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from .import main
+297
View File
@@ -0,0 +1,297 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, http
from odoo.http import request, Response
from datetime import datetime
from markupsafe import Markup
from odoo.addons.website_slides.controllers.main import WebsiteSlides
class WebsiteSlidesORA(WebsiteSlides):
@http.route('/ora/response/save/', type='http', auth="user", website=True)
def save_response(self, **kwargs):
user_response = self._get_access_data(kwargs)
slide = request.env['slide.slide'].sudo().browse(int(kwargs.get('slide_id')))
if kwargs.get('submit') == 'save':
self.add_answers(kwargs, user_response)
if kwargs.get('submit') == 'resubmit_fresh':
self._get_access_data(kwargs, resubmit=True)
user_response.state = 'inactive'
if kwargs.get('submit') == 'resubmit_copy':
resubmit_copy_response = self._get_access_data(kwargs, resubmit=True)
self.add_answers(kwargs, resubmit_copy_response)
user_response.state = 'inactive'
if kwargs.get('submit') == 'submit':
if len(user_response) > 1:
user_response = user_response[-1]
user_response.state = 'submitted'
user_response.submitted_date = datetime.now()
self.add_answers(kwargs, user_response)
if slide.peer_assessment:
peer_limit = slide.peer_limit
enrolled_users = slide.channel_id.partner_ids.filtered(lambda l: l.id != request.env.user.partner_id.id)
if peer_limit <= len(enrolled_users):
peer_limit = peer_limit
else:
peer_limit = len(enrolled_users)
for _ in range(peer_limit):
peer_user = slide._get_peer_user(user_response)
if peer_user:
request.env['open.response.rubric.staff'].create({
'assess_type': 'peer',
'user_id': peer_user.id,
'state': 'in_progress',
'response_id': user_response.id
})
user_response.message_post(
body='This response has been submitted!', message_type='notification',
subtype_xmlid='mail.mt_comment', author_id=request.env.user.partner_id.id,
partner_ids=[user_response.staff_id.partner_id.id])
return request.redirect('/slides/slide/%s' % request.env['ir.http']._slug(slide))
def _get_access_data(self, post, resubmit=False):
user = request.env.user
slide_id = request.env['slide.slide'].sudo().browse(int(post.get('slide_id')))
if slide_id.response_ids and not resubmit:
response = slide_id.response_ids.filtered(lambda x: x.state in ['active', 'submitted'] and x.user_id == user)
if response:
return response
response = slide_id._create_answer(request.env.user.id)
return response
def add_answers(self, kwargs, response):
if kwargs.get('response_id'):
old_user_response = request.env['ora.response'].browse(int(kwargs.get('response_id')))
for line in response.user_response_line:
for oline in old_user_response.user_response_line:
if line.prompt_id == oline.prompt_id:
if line.response_type == 'text':
line.value_text_box = oline.value_text_box
elif line.response_type == 'rich_text':
line.value_richtext_box = Markup(oline.value_richtext_box)
# query = ("update open_response_user_line set value_richtext_box='%s' where id=%s") % (oline.value_richtext_box, oline.id)
# request.cr.execute(query)
else:
for line in response.user_response_line:
if line.response_type == 'text':
line.value_text_box = kwargs[str(line.prompt_id.id)]
elif line.response_type == 'rich_text':
line.value_richtext_box = Markup(kwargs[str(line.prompt_id.id)])
# query = ("update open_response_user_line set value_richtext_box='%s' where id='%s'") % (Markup(kwargs[str(line.prompt_id.id)]), line.id)
# request.cr.execute(query)
def _prepare_additional_channel_values(self, values, **kwargs):
values = super(WebsiteSlidesORA, self)._prepare_additional_channel_values(values, **kwargs)
slide = values.get('slide')
submitted = False
if slide and slide.prompt_ids:
values.update({
'slide_prompts': [{
'id': prompt.id,
'sequence': prompt.sequence,
'question': Markup(prompt.question_name),
'response_type': prompt.response_type,
'submitted': submitted,
'name': prompt.name,
} for prompt in slide.prompt_ids.sorted(key=lambda x: x.id)]
})
if slide and slide.response_ids:
total_responses = slide.response_ids.filtered(lambda l: l.user_id == request.env.user)
submitted_response = total_responses.filtered(lambda l: l.state == 'submitted')
active_response = total_responses.filtered(lambda l: l.state == 'active')
inactive_response = total_responses.filtered(lambda l: l.state == 'inactive')
assessed_response = total_responses.filtered(lambda l: l.state == 'assessed')
values['submitted_response'] = submitted_response
values['active_response'] = active_response
values['inactive_response'] = inactive_response
values['total_responses'] = total_responses
values['assessed_response'] = assessed_response
values['rubric_ids'] = slide.rubric_ids
# if assessed_response:
# values['channel_progress'][slide.id]['quiz_karma_gain'] += assessed_response.xp_points
# values['channel_progress'][slide.id]['quiz_karma_won'] += assessed_response.xp_points
for response in total_responses:
if response.feedback == '<p><br></p>':
response.feedback = False
values['peer_responses'] = request.env['open.response.rubric.staff'].search([
('user_id', '=', request.env.user.id),
('assess_type', '=', 'peer'),
('response_id.state', 'in', ['submitted', 'assessed']),
('response_id.slide_id', '=', slide.id)
]).mapped('response_id')
return values
@http.route('/slides/slide/get_values', website=True, type="json", auth="user")
def slide_get_value(self, slide_id):
csrf_token = request.csrf_token()
slide = request.env['slide.slide'].browse(slide_id)
if slide:
values = {'slide': self._get_slide_values(slide), 'csrf_token': csrf_token}
if slide.prompt_ids:
values.update({
'slide_prompts': [{
'id': prompt.id,
'sequence': prompt.sequence,
'question': Markup(prompt.question_name),
'response_type': prompt.response_type,
'name': prompt.name,
} for prompt in slide.prompt_ids.sorted(key=lambda x: x.id)]
})
if slide.response_ids:
total_responses = slide.response_ids.filtered(lambda l: l.user_id == request.env.user)
values['total_responses'] = []
for ora_response in total_responses:
if ora_response.feedback == '<p><br></p>' or ora_response.feedback == False:
ora_response.feedback = ''
values['total_responses'].append(self._get_total_responses(ora_response, slide))
peer_response_ids = request.env['open.response.rubric.staff'].search([
('user_id', '=', request.env.user.id),
('assess_type', '=', 'peer'),
('response_id.state', 'in', ['submitted', 'assessed']),
('response_id.slide_id', '=', slide.id)
])
values['peer_responses'] = []
for staff_response in peer_response_ids:
submitted_date = False
if staff_response.submitted_date:
submitted_date = staff_response.submitted_date.strftime('%d %B %Y')
values['peer_responses'].append(({
'id': staff_response.response_id.id,
'state': staff_response.state,
'assess_type': staff_response.assess_type,
'user_id': staff_response.user_id.id,
'submitted_date': submitted_date,
'option_ids': [{
'id': rubric_id.criteria_id.id,
'criterian_name': rubric_id.criteria_id.criterian_name,
'criteria_desc': rubric_id.criteria_desc,
'name': rubric_id.option_id.name,
'criteria_option_point': rubric_id.criteria_option_point,
'criteria_option_desc': rubric_id.criteria_option_desc,
'assess_explanation': rubric_id.assess_explanation,
} for rubric_id in staff_response.option_ids],
'user_response_line': [self._get_user_response(user_response_line) for user_response_line in staff_response.response_id.user_response_line]
}))
return values
def _get_slide_values(self, slide):
next_slide = slide.channel_id.slide_content_ids[((slide.channel_id.slide_content_ids.ids).index(slide.id))+1] if ((slide.channel_id.slide_content_ids.ids).index(slide.id)) < len(slide.channel_id.slide_content_ids.ids) - 1 else None
return {
'id': slide.id,
'is_member': slide.channel_id.is_member,
'is_preview': slide.is_preview,
'peer_assessment': slide.peer_assessment,
'completed': (request.env['slide.slide.partner'].sudo().search([('slide_id', '=', slide.id),('partner_id', '=', request.env.user.partner_id.id)])).completed,
'hasNext' : next_slide if next_slide else None,
'ispro' : 1 if 'is_sequential' in request.env['slide.channel']._fields else None,
'next_slide_url': '/slides/slide/%s?fullscreen=1' % request.env['ir.http']._slug(next_slide) if next_slide else None,
'user': request.env.user.id,
'rubric_ids': [{
'criterian_name': rubric.criterian_name,
'name': rubric.name,
'id': rubric.id,
'criterian_ids': [{
'id': option.id,
'name': option.name,
} for option in rubric.criterian_ids],
}for rubric in slide.rubric_ids],
}
def _get_user_response(self, user_response_line):
return {
'id': user_response_line.id,
'prompt_id': user_response_line.prompt_id.id,
'value_text_box': user_response_line.value_text_box,
'value_richtext_box': Markup(user_response_line.value_richtext_box),
}
def _get_total_responses(self, ora_response, slide):
submitted_date = False
if ora_response.submitted_date:
submitted_date = ora_response.submitted_date.strftime('%d %B %Y')
return {
'id': ora_response.id,
'user': request.env.user.id,
'state': ora_response.state,
'feedback': Markup(ora_response.feedback),
'staff_id': ora_response.sudo().staff_id.id,
'staff_name': ora_response.sudo().staff_id.name,
'user_name': ora_response.sudo().user_id.name,
'submitted_date': submitted_date,
'can_resubmit': ora_response.can_resubmit,
'feedback_user_image_url': request.website.image_url(ora_response.sudo().staff_id, 'image_1920', size=256),
'ora_res_user_image_url': request.website.image_url(ora_response.sudo().user_id, 'image_1920', size=256),
'user_response_line': [self._get_user_response(user_response_line) for user_response_line in ora_response.user_response_line],
'slide_rubric_staff_line': [{
'state': staff_line.state,
'assess_type': staff_line.assess_type,
'user_id': staff_line.sudo().user_id.id,
'option_ids': [{
'id': rubric_id.criteria_id.id,
'criterian_name': rubric_id.criteria_id.criterian_name,
'criteria_desc': rubric_id.criteria_desc,
'name': rubric_id.option_id.name,
'criteria_option_point': rubric_id.criteria_option_point,
'criteria_option_desc': rubric_id.criteria_option_desc,
'assess_explanation': rubric_id.assess_explanation,
} for rubric_id in staff_line.option_ids],
}for staff_line in ora_response.slide_rubric_staff_line],
'rubric_ids': [{
'criterian_name': rubric.criterian_name,
'name': rubric.name,
'id': rubric.id,
'criterian_ids': [{
'id': option.id,
'name': option.name,
} for option in rubric.criterian_ids],
}for rubric in slide.rubric_ids],
}
@http.route('/submit/peer/response', type='http', auth="user", website=True)
def submit_peer_response(self, **kwargs):
slide = request.env['slide.slide'].sudo().browse(int(kwargs.get('slide_id')))
if kwargs.get('response_id'):
response_id = request.env['ora.response'].browse(int(kwargs.get('response_id')))
for line in response_id.slide_rubric_staff_line:
if line.user_id == request.env.user and line.assess_type == 'peer':
values = []
for criteria in response_id.slide_id.rubric_ids:
opt_key = ''
exp_key = ''
for option_id in criteria.criterian_ids:
opt_key = 'options_%s_%s' % (response_id.id, criteria.id)
exp_key = 'exp_%s_%s' % (response_id.id, criteria.id)
if opt_key in kwargs and exp_key in kwargs:
break
option_id = kwargs.get(opt_key)
values.append((0, 0, {
'criteria_id': criteria.id,
'option_id': int(option_id) if option_id else False,
'assess_explanation': kwargs.get(exp_key)
}))
line.option_ids = values
line.state = 'completed'
line.submitted_date = datetime.now()
return request.redirect('/slides/slide/%s' % request.env['ir.http']._slug(slide))
def _get_channel_progress(self, channel, include_quiz=False):
result = super(WebsiteSlidesORA, self)._get_channel_progress(channel, include_quiz=include_quiz)
slides = request.env['slide.slide'].sudo().search([('channel_id', '=', channel.id)])
ora_response_ids = request.env['ora.response'].sudo().search([
('slide_id', 'in', slides.ids),
('state', '=', 'assessed'),
('user_id', '=', request.env.user.id)
])
for ora_response in ora_response_ids:
result[ora_response.slide_id.id]['quiz_karma_gain'] += ora_response.xp_points
result[ora_response.slide_id.id]['quiz_karma_won'] += ora_response.xp_points
return result
@http.route(['/slides/channel/leave'], type='json', auth='user', website=True)
def slide_channel_leave(self, channel_id):
slide_ids = request.env['slide.slide'].sudo().search([('channel_id','=',int(channel_id))])
for slide_id in slide_ids:
request.env['ora.response'].sudo().search([('user_id','=',int(request.env.uid)),('slide_id','=', int(slide_id))]).unlink()
res = super(WebsiteSlidesORA, self).slide_channel_leave(channel_id)
return res
@@ -0,0 +1,11 @@
<?xml version='1.0' encoding='UTF-8' ?>
<odoo>
<record id="website_ora_elearning_cron_peer" model="ir.cron">
<field name="name">Assign Response to Users</field>
<field name="model_id" ref="model_slide_slide"/>
<field name="state">code</field>
<field name="code">model._assign_peer_response()</field>
<field name="interval_number">2</field>
<field name="interval_type">hours</field>
</record>
</odoo>
+851
View File
@@ -0,0 +1,851 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_ora_elearning
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-19 05:10+0000\n"
"PO-Revision-Date: 2021-04-19 05:10+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_aside_training_category_inherited
msgid "<i class=\"fa fa-flag text-warning\"/> Assessment"
msgstr "<i class=\"fa fa-flag text-warning\"/> मूल्यांकन"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_fullscreen_sidebar_category_ora_inherit
msgid ""
"<i class=\"fa fa-flag-checkered text-warning mr-2\"/>\n"
" Assessment"
msgstr ""
"<i class=\"fa fa-flag-checkered text-warning mr-2\"/>\n"
" मूल्यांकन"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
msgid "<i class=\"fa fa-users\"/> Peer Assessment"
msgstr "<i class=\"fa fa-users\"/> सहकर्मी मूल्यांकन"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_content_quiz_prompt
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_content_quiz_prompt_active
msgid "<span class=\"input-group-text\">Your Response</span>"
msgstr "<span class=\"input-group-text\">तुम्हारा जवाब</span>"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
msgid "<span class=\"ml-2\">Your response has been assessed.</span>"
msgstr "<span class=\"ml-2\">आपकी प्रतिक्रिया का आकलन किया गया है।</span>"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_content_peer_responses
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
msgid "<span id=\"response_button_text\">View Response</span>"
msgstr "<span id=\"response_button_text\">प्रतिक्रिया देखें</span>"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_assessed_response_prompts
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_peer_responses_cards
msgid "<span style=\"font-weight: bold;\">Assessment</span>"
msgstr "<span style=\"font-weight: bold;\">मूल्यांकन</span>"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
msgid "<span>Resubmit Copy</span>"
msgstr "<span>पुन: सबमिट करें</span>"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
msgid "<span>Resubmit Fresh</span>"
msgstr "<span>फिर से ताज़ा करें</span>"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
msgid "<span>Save Your Progress</span>"
msgstr "<span>अपनी प्रगति को बचाओ</span>"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_peer_responses_cards
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
msgid "<span>Submit</span>"
msgstr "<span>प्रस्तुत</span>"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
msgid "<span>XP</span>"
msgstr ""
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_response_view_form
msgid "<strong>Response</strong>"
msgstr "<strong>प्रतिक्रिया</strong>"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_needaction
msgid "Action Needed"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields.selection,name:website_ora_elearning.selection__ora_response__state__active
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_user_input_view_search
msgid "Active"
msgstr "सक्रिय"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__activity_ids
msgid "Activities"
msgstr "गतिविधियों"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__activity_exception_decoration
msgid "Activity Exception Decoration"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__activity_state
msgid "Activity State"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__activity_type_icon
msgid "Activity Type Icon"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__can_resubmit
msgid "Allow Resubmit"
msgstr "अनुमति दें पुन: सबमिट करें"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__assess_explanation
msgid "Assess Explanation"
msgstr "स्पष्टीकरण का आकलन करें"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__assess_type
msgid "Assess Type"
msgstr "प्रकार का आकलन करें"
#. module: website_ora_elearning
#: model:ir.model.fields.selection,name:website_ora_elearning.selection__ora_response__state__assessed
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_user_input_view_search
msgid "Assessed"
msgstr "आकलन किया"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#, python-format
msgid "Assessment"
msgstr "मूल्यांकन"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_peer_responses_cards
#, python-format
msgid "Assessment Explanation"
msgstr "आकलन स्पष्टीकरण"
#. module: website_ora_elearning
#: model:ir.actions.server,name:website_ora_elearning.website_ora_elearning_cron_peer_ir_actions_server
#: model:ir.cron,cron_name:website_ora_elearning.website_ora_elearning_cron_peer
#: model:ir.cron,name:website_ora_elearning.website_ora_elearning_cron_peer
msgid "Assign Response to Users"
msgstr "उपयोगकर्ताओं को प्रतिक्रिया दें"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_attachment_count
msgid "Attachment Count"
msgstr "अटैचमेंट काउंट"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
#, python-format
msgid "Avatar"
msgstr "अवतार"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_peer_responses_cards
#, python-format
msgid "Complete the rubric and submit the assessment."
msgstr "रूब्रिक को पूरा करें और मूल्यांकन जमा करें।"
#. module: website_ora_elearning
#: model:ir.model.fields.selection,name:website_ora_elearning.selection__open_response_rubric_staff__state__completed
msgid "Completed"
msgstr "पूरा हुआ"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__slide_id
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__slide_id
msgid "Content"
msgstr "सामग्री"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__create_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric__create_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__create_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__create_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__create_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__create_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian__create_uid
msgid "Created by"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__create_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric__create_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__create_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__create_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__create_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__create_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian__create_date
msgid "Created on"
msgstr "पर बनाया"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__criteria_id
msgid "Criteria"
msgstr "मानदंड"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric__criterian_name
msgid "Criterian Name"
msgstr "मानदंड नाम"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__name
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric__name
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__criteria_desc
msgid "Description"
msgstr "विवरण"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__display_name
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric__display_name
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__display_name
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__display_name
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__display_name
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__display_name
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian__display_name
#: model:ir.model.fields,field_description:website_ora_elearning.field_slide_slide__display_name
msgid "Display Name"
msgstr "प्रदर्शित होने वाला नाम"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__feedback
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_response_view_form
msgid "Feedback"
msgstr "प्रतिपुष्टि"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_follower_ids
msgid "Followers"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_channel_ids
msgid "Followers (Channels)"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_partner_ids
msgid "Followers (Partners)"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__activity_type_icon
msgid "Font awesome icon e.g. fa-tasks"
msgstr ""
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_user_input_view_search
msgid "Group By"
msgstr ""
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/js/ora_fullscreen.js:0
#: code:addons/website_ora_elearning/static/src/js/website_ora.js:0
#, python-format
msgid "Hide Response"
msgstr "रिस्पांस छिपाएं"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__id
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric__id
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__id
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__id
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__id
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__id
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian__id
#: model:ir.model.fields,field_description:website_ora_elearning.field_slide_slide__id
msgid "ID"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__activity_exception_icon
msgid "Icon"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__activity_exception_icon
msgid "Icon to indicate an exception activity."
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__message_needaction
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__message_unread
msgid "If checked, new messages require your attention."
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__message_has_error
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__message_has_sms_error
msgid "If checked, some messages have a delivery error."
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields.selection,name:website_ora_elearning.selection__open_response_rubric_staff__state__in_progress
msgid "In Progress"
msgstr "चालू"
#. module: website_ora_elearning
#: model:ir.model.fields.selection,name:website_ora_elearning.selection__ora_response__state__inactive
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_user_input_view_search
msgid "Inactive"
msgstr "निष्क्रिय"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_is_follower
msgid "Is Follower"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt____last_update
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric____last_update
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess____last_update
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff____last_update
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line____last_update
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response____last_update
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian____last_update
#: model:ir.model.fields,field_description:website_ora_elearning.field_slide_slide____last_update
msgid "Last Modified on"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__write_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric__write_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__write_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__write_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__write_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__write_uid
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian__write_uid
msgid "Last Updated by"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__write_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric__write_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__write_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__write_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__write_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__write_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian__write_date
msgid "Last Updated on"
msgstr ""
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_content_peer_responses
#, python-format
msgid "Learner Response"
msgstr "लर्नर रिस्पांस"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_main_attachment_id
msgid "Main Attachment"
msgstr ""
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_response_view_form
msgid "Mark Assessed"
msgstr "निशान लगाया"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_has_error
msgid "Message Delivery error"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_ids
msgid "Messages"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__activity_date_deadline
msgid "Next Activity Deadline"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__activity_summary
msgid "Next Activity Summary"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__activity_type_id
msgid "Next Activity Type"
msgstr ""
#. module: website_ora_elearning
#: model_terms:ir.actions.act_window,help:website_ora_elearning.action_ora_response
msgid "Nobody has replied to your prompts yet"
msgstr "अभी तक किसी ने आपके संकेतों का जवाब नहीं दिया है"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_needaction_counter
msgid "Number of Actions"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_has_error_counter
msgid "Number of errors"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__message_needaction_counter
msgid "Number of messages which requires an action"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__message_has_error_counter
msgid "Number of messages with delivery error"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__message_unread_counter
msgid "Number of unread messages"
msgstr ""
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.view_slide_slide_form_inherit_ora
msgid "ORA"
msgstr "ओ आर ए"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_response_view_form
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_response_view_tree
msgid "ORA Response"
msgstr "ओ आर ए रिस्पांस"
#. module: website_ora_elearning
#: model:ir.actions.act_window,name:website_ora_elearning.action_ora_response
#: model:ir.actions.act_window,name:website_ora_elearning.action_ora_response_reporting
#: model:ir.ui.menu,name:website_ora_elearning.menu_ora_responses
#: model:ir.ui.menu,name:website_ora_elearning.menu_ora_responses_reporting
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_user_input_view_search
msgid "ORA Responses"
msgstr "ओ आर ए प्रतिक्रियाएँ"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.view_slide_slide_form_inherit_ora
msgid "Open Response Assessment"
msgstr "ओपन रिस्पांस असेसमेंट"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__option_ids
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian__name
msgid "Option"
msgstr "विकल्प"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__criteria_option_desc
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian__option_desc
msgid "Option Description"
msgstr "विकल्प का विवरण"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric__criterian_ids
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__option_id
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_response_view_form
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.view_slide_slide_form_inherit_ora
msgid "Options"
msgstr "विकल्प"
#. module: website_ora_elearning
#: model:ir.model.fields.selection,name:website_ora_elearning.selection__open_response_rubric_staff__assess_type__peer
msgid "Peer"
msgstr "पीयर"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: model:ir.model.fields,field_description:website_ora_elearning.field_slide_slide__peer_assessment
#, python-format
msgid "Peer Assessment"
msgstr "सहकर्मी मूल्यांकन"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_slide_slide__peer_limit
msgid "Peer Limit"
msgstr "पीयर लिमिट"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__criteria_option_point
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian__option_points
msgid "Points"
msgstr "अंक"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__prompt_id
#: model:ir.model.fields,field_description:website_ora_elearning.field_slide_slide__prompt_ids
msgid "Prompt"
msgstr "प्रेरित करना"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__user_response_line
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_response_view_form
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.view_slide_slide_form_inherit_ora
msgid "Prompts"
msgstr "संकेतों"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__question_name
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__question_name
msgid "Question"
msgstr "सवाल"
#. module: website_ora_elearning
#: model:ir.model,name:website_ora_elearning.model_ora_response
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__response_id
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__response_id
msgid "Response"
msgstr "प्रतिक्रिया"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_assess__response_assess_id
msgid "Response Assess"
msgstr "प्रतिक्रिया का आकलन"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__response_type
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__response_type
msgid "Response Type"
msgstr "प्रतिक्रिया प्रकार"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_slide_slide__response_count
#: model:ir.model.fields,field_description:website_ora_elearning.field_slide_slide__response_ids
msgid "Responses"
msgstr "जवाब"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__activity_user_id
msgid "Responsible User"
msgstr "जिम्मेदार उपयोगकर्ता"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#, python-format
msgid "Resubmit Copy"
msgstr "पुन: सबमिट करें"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#, python-format
msgid "Resubmit Fresh"
msgstr "फिर से ताज़ा करें"
#. module: website_ora_elearning
#: model:ir.model.fields.selection,name:website_ora_elearning.selection__open_response_prompt__response_type__rich_text
msgid "Rich Text"
msgstr "रिचटेक्स्ट"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__value_richtext_box
msgid "Richtext answer"
msgstr "रिचटेक्स्ट जवाब"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__slide_rubric_ids
#: model:ir.model.fields,field_description:website_ora_elearning.field_rubric_criterian__rubric_id
#: model:ir.model.fields,field_description:website_ora_elearning.field_slide_slide__rubric_ids
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_response_view_form
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.view_slide_slide_form_inherit_ora
msgid "Rubric"
msgstr "सरनामा"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_has_sms_error
msgid "SMS Delivery error"
msgstr ""
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#, python-format
msgid "Save Your Progress"
msgstr "अपनी प्रगति को बचाओ"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__sequence
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__question_sequence
msgid "Sequence"
msgstr "अनुक्रम"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.view_slide_slide_form_inherit_ora
msgid "Settings"
msgstr "समायोजन"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_prompt__slide_id
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric__slide_id
msgid "Slide"
msgstr "स्लाइड"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__slide_rubric_staff_line
msgid "Slide Rubric Staff Line"
msgstr "स्लाइड रुब्रिक स्टाफ लाइन"
#. module: website_ora_elearning
#: model:ir.model,name:website_ora_elearning.model_slide_slide
msgid "Slides"
msgstr "स्लाइड्स"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__staff_id
#: model:ir.model.fields.selection,name:website_ora_elearning.selection__open_response_rubric_staff__assess_type__staff
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_user_input_view_search
msgid "Staff"
msgstr "कर्मचारी"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__state
msgid "State"
msgstr "स्थिति"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__state
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_user_input_view_search
msgid "Status"
msgstr "स्थिति"
#. module: website_ora_elearning
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__activity_state
msgid ""
"Status based on activities\n"
"Overdue: Due date is already passed\n"
"Today: Activity date is today\n"
"Planned: Future activities."
msgstr ""
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#, python-format
msgid "Submit"
msgstr "प्रस्तुत"
#. module: website_ora_elearning
#: model:ir.model.fields.selection,name:website_ora_elearning.selection__ora_response__state__submitted
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_user_input_view_search
msgid "Submitted"
msgstr "प्रस्तुत"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__submitted_date
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__submitted_date
msgid "Submitted Date"
msgstr "सबमिट करने की तिथि"
#. module: website_ora_elearning
#: model:ir.model.fields.selection,name:website_ora_elearning.selection__open_response_prompt__response_type__text
msgid "Text"
msgstr "टेक्स्ट"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_user_line__value_text_box
msgid "Text answer"
msgstr "पाठ का जवाब"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
#, python-format
msgid "There is no peer responses to assess."
msgstr "आकलन करने के लिए कोई सहकर्मी प्रतिक्रिया नहीं है।"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__total_score
msgid "Total Score"
msgstr "कुल स्कोर"
#. module: website_ora_elearning
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__activity_exception_decoration
msgid "Type of the exception activity on record."
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_unread
msgid "Unread Messages"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__message_unread_counter
msgid "Unread Messages Counter"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_open_response_rubric_staff__user_id
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__user_id
msgid "User"
msgstr "उपयोगकर्ता"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.ora_user_input_view_search
msgid "Users"
msgstr "उपयोगकर्ताओं"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#, python-format
msgid "View Response"
msgstr "प्रतिक्रिया देखें"
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__website_message_ids
msgid "Website Messages"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,help:website_ora_elearning.field_ora_response__website_message_ids
msgid "Website communication history"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model.fields,field_description:website_ora_elearning.field_ora_response__xp_points
msgid "XP Points"
msgstr "XP अंक"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#, python-format
msgid "Your Response"
msgstr "तुम्हारा जवाब"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#, python-format
msgid "Your response has been assessed."
msgstr "आपकी प्रतिक्रिया का आकलन किया गया है।"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_content_detailed_inherit_ora
#, python-format
msgid "Your response has been submitted successfully on"
msgstr "आपकी प्रतिक्रिया को सफलतापूर्वक सबमिट कर दिया गया है"
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_content_peer_responses
#, python-format
msgid "assessed on"
msgstr "पर मूल्यांकन किया"
#. module: website_ora_elearning
#: model:ir.model,name:website_ora_elearning.model_open_response_prompt
msgid "open.response.prompt"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model,name:website_ora_elearning.model_open_response_rubric
msgid "open.response.rubric"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model,name:website_ora_elearning.model_open_response_rubric_assess
msgid "open.response.rubric.assess"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model,name:website_ora_elearning.model_open_response_rubric_staff
msgid "open.response.rubric.staff"
msgstr ""
#. module: website_ora_elearning
#: model:ir.model,name:website_ora_elearning.model_open_response_user_line
msgid "open.response.user.line"
msgstr ""
#. module: website_ora_elearning
#. openerp-web
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#: code:addons/website_ora_elearning/static/src/xml/slide_ora.xml:0
#, python-format
msgid "points)"
msgstr "अंक)"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_peer_responses_cards
msgid ""
"points)\n"
" <br/>"
msgstr ""
"अंक)\n"
" <br/>"
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.lesson_assessed_response_prompts
msgid ""
"points)\n"
" <br/>"
msgstr ""
"अंक)\n"
" <br/>"
#. module: website_ora_elearning
#: model:ir.model,name:website_ora_elearning.model_rubric_criterian
msgid "rubric.criterian"
msgstr ""
#. module: website_ora_elearning
#: model_terms:ir.ui.view,arch_db:website_ora_elearning.slide_aside_training_category_inherited
msgid "xp"
msgstr ""
+5
View File
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import ir_model
from .import slide_assessment
+67
View File
@@ -0,0 +1,67 @@
from odoo import models, api
from odoo.exceptions import AccessError
from collections import defaultdict
class IrModelAccessInherit(models.Model):
_inherit = 'ir.model.access'
@api.model
def check(self, model, mode='read', raise_exception=True):
# Call the original check method
if self.env.user.has_group('base.group_portal'):
return True
res = super(IrModelAccessInherit, self).check(model, mode, raise_exception=False)
return res
class IrAttachmentInherit(models.Model):
_inherit = 'ir.attachment'
@api.model
def check(self, mode, values=None):
""" Restricts the access to an ir.attachment, according to referred mode """
if self.env.is_superuser():
return True
# Always require an internal user (aka, employee) to access to a attachment
if not (self.env.is_admin() or self.env.user._is_internal() or self.env.user._is_portal()):
raise AccessError(_("Sorry, you are not allowed to access this document."))
# collect the records to check (by model)
model_ids = defaultdict(set) # {model_name: set(ids)}
if self:
# DLE P173: `test_01_portal_attachment`
self.env['ir.attachment'].flush_model(['res_model', 'res_id', 'create_uid', 'public', 'res_field'])
self._cr.execute('SELECT res_model, res_id, create_uid, public, res_field FROM ir_attachment WHERE id IN %s', [tuple(self.ids)])
for res_model, res_id, create_uid, public, res_field in self._cr.fetchall():
if public and mode == 'read':
continue
if not self.env.is_system():
if not res_id and create_uid != self.env.uid:
raise AccessError(_("Sorry, you are not allowed to access this document."))
if res_field:
field = self.env[res_model]._fields[res_field]
if field.groups:
if not self.env.user.user_has_groups(field.groups):
raise AccessError(_("Sorry, you are not allowed to access this document."))
if not (res_model and res_id):
continue
model_ids[res_model].add(res_id)
if values and values.get('res_model') and values.get('res_id'):
model_ids[values['res_model']].add(values['res_id'])
# check access rights on the records
for res_model, res_ids in model_ids.items():
# ignore attachments that are not attached to a resource anymore
# when checking access rights (resource was deleted but attachment
# was not)
if res_model not in self.env:
continue
if res_model == 'res.users' and len(res_ids) == 1 and self.env.uid == list(res_ids)[0]:
# by default a user cannot write on itself, despite the list of writeable fields
# e.g. in the case of a user inserting an image into his image signature
# we need to bypass this check which would needlessly throw us away
continue
records = self.env[res_model].browse(res_ids).exists()
# For related models, check if we can write to the model, as unlinking
# and creating attachments can be seen as an update to the model
access_mode = 'write' if mode in ('create', 'unlink') else mode
records.check_access_rights(access_mode)
records.check_access_rule(access_mode)
@@ -0,0 +1,248 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, tools
from odoo.exceptions import UserError
class Slide(models.Model):
_inherit = 'slide.slide'
prompt_ids = fields.One2many('open.response.prompt', 'slide_id')
rubric_ids = fields.One2many('open.response.rubric', 'slide_id')
peer_assessment = fields.Boolean("Peer Assessment")
peer_limit = fields.Integer("Peer Limit")
response_ids = fields.Many2many('ora.response', string="Responses", compute="_get_user_responses")
response_count = fields.Integer("Responses", compute="_get_user_responses")
def _get_user_responses(self):
for rec in self:
rec.response_ids = False
rec.response_count = 0
total_response = []
if rec.prompt_ids:
user_response_ids = self.env['ora.response'].search([
('slide_id', '=', rec.id)
])
if user_response_ids:
rec.response_ids = [(6, 0, user_response_ids.ids)]
for response in user_response_ids:
if not response.user_id in total_response:
total_response.append(response.user_id)
rec.response_count = len(total_response)
def action_open_responses(self):
action = self.env['ir.actions.act_window']._for_xml_id('website_ora_elearning.action_ora_response')
action['domain'] = [('id', 'in', self.response_ids.ids)]
return action
def _create_answer(self, user=False):
existing_response = self.env['ora.response'].search([
('user_id', '=', user),
('slide_id', '=', self.id),
('state', '=', 'active')
], limit=1)
vals = {
'user_id': user,
'slide_id': self.id,
'state': 'active',
'user_response_line': [(0, 0, {'prompt_id': prompt_id.id}) for prompt_id in self.prompt_ids],
'slide_rubric_ids': [(6, 0, self.rubric_ids.ids)]
}
if existing_response:
existing_response.write(vals)
return existing_response
return self.env['ora.response'].create(vals)
@api.model
def _assign_peer_response(self):
""" Cron Job for responses which has not been assigned to peers. """
ora_response_ids = self.env['ora.response'].search([('state', '=', 'submitted')])
for ora_response in ora_response_ids:
slide_id = ora_response.slide_id
if slide_id.peer_assessment:
peer_limit = slide_id.peer_limit
enrolled_users = slide_id.channel_id.partner_ids.ids
if peer_limit <= len(enrolled_users):
peer_limit = peer_limit
else:
peer_limit = len(enrolled_users)
assigned_ids = ora_response.slide_rubric_staff_line.filtered(lambda l: l.assess_type == 'peer')
if len(assigned_ids) < peer_limit:
for _ in range(peer_limit):
peer_user = slide_id._get_peer_user(ora_response)
if peer_user:
self.env['open.response.rubric.staff'].create({
'assess_type': 'peer',
'user_id': peer_user.id,
'state': 'in_progress',
'response_id': ora_response.id
})
def _get_peer_user(self, ora_response):
''' Iterate over response and course users and check whether course user is assigned to the response or not.
:param response: Current response on which we are checking the peers.
:return: A res.users record or None.
'''
enrolled_users = list(set(self.channel_id.partner_ids.ids) - set(ora_response.user_id.partner_id.ids))
peer_limit = self.peer_limit
to_allocate_user = {}
for partner_id in enrolled_users:
rubric_line_ids = self.env['open.response.rubric.staff'].search([
('assess_type', '=', 'peer'),
('user_id.partner_id', '=', partner_id),
('response_id', '!=', False),
('response_id.state', 'in', ['submitted'])
])
to_allocate_user.setdefault(partner_id, {})
to_allocate_user[partner_id]['peer_count'] = len(rubric_line_ids)
to_allocate_user[partner_id]['responses'] = rubric_line_ids.mapped('response_id').ids
# Remove ids whose peer limit has reached.
to_allocate_user = dict((key, val) for key, val in to_allocate_user.items() if val['peer_count'] < peer_limit)
# Sorting dict w.r.t peer_count.
sorted_allocate_user_dic = dict(sorted(to_allocate_user.items(), key=lambda x: x[1]['peer_count']))
# Appending those users in list whose responses does not have current response.
user_ids = list(key for key, val in sorted_allocate_user_dic.items() if ora_response.id not in val['responses'])
if user_ids:
return self.env['res.users'].search([('partner_id', '=', user_ids[0])], limit=1)
class ORA_Prompt(models.Model):
_name = 'open.response.prompt'
_order = "sequence"
sequence = fields.Integer("Sequence")
name = fields.Text("Description", translate=True)
slide_id = fields.Many2one('slide.slide')
question_name = fields.Html("Question", required=True, translate=True)
response_type = fields.Selection([
('text', 'Text'),
('rich_text', 'Rich Text')
], default='text', string="Response Type", required=True)
class ORA_Rubric(models.Model):
_name = 'open.response.rubric'
_rec_name = 'criterian_name'
name = fields.Text("Description", required=True, translate=True)
slide_id = fields.Many2one('slide.slide')
criterian_name = fields.Char("Criterian Name", required=True, translate=True)
criterian_ids = fields.One2many('rubric.criterian', "rubric_id", "Options")
class RubricCriterian(models.Model):
_name = 'rubric.criterian'
rubric_id = fields.Many2one('open.response.rubric')
name = fields.Char("Option", required=True, translate=True)
option_desc = fields.Text("Option Description", required=True, translate=True)
option_points = fields.Integer("Points", required=True)
class ORAResponse(models.Model):
_name = 'ora.response'
_inherit = ['mail.thread', 'mail.activity.mixin']
_rec_name = 'slide_id'
_description = "Response"
slide_id = fields.Many2one('slide.slide', "Content")
user_id = fields.Many2one('res.users', "User")
staff_id = fields.Many2one(related="slide_id.channel_id.user_id", string="Staff", store=True)
feedback = fields.Html("Feedback", translate=True, sanitize_attributes=False, sanitize_form=False)
can_resubmit = fields.Boolean("Allow Resubmit")
xp_points = fields.Integer("XP Points", compute="calculate_total_xp", store=True)
user_response_line = fields.One2many('open.response.user.line', 'response_id' , string="Prompts")
slide_rubric_ids = fields.Many2many('open.response.rubric', string="Rubric")
slide_rubric_staff_line = fields.One2many('open.response.rubric.staff', 'response_id')
submitted_date = fields.Datetime("Submitted Date", readonly=False)
state = fields.Selection([
('active', 'Active'),
('submitted', 'Submitted'),
('inactive', 'Inactive'),
('assessed', 'Assessed')
], default="active", tracking=True)
@api.depends('slide_rubric_staff_line.total_score')
def calculate_total_xp(self):
for rec in self:
total_xp = 0
for line in rec.slide_rubric_staff_line:
if line.assess_type == 'staff':
total_xp += line.total_score
rec.xp_points = total_xp
def action_mark_assessed(self):
if self.state == 'submitted':
only_peer = True
for line in self.slide_rubric_staff_line:
if line.assess_type == 'staff':
self.state = 'assessed'
line.state = 'completed'
user_karma = self.user_id.karma
user_karma += self.xp_points
self.sudo().user_id.karma = user_karma
only_peer = False
if only_peer:
raise UserError("Please fill the rubric first.")
class OpenResponseUserLine(models.Model):
_name = 'open.response.user.line'
response_id = fields.Many2one('ora.response', ondelete="cascade")
value_text_box = fields.Text("Text answer", translate=True)
value_richtext_box = fields.Html("Richtext answer", translate=True, sanitize_attributes=False, sanitize_form=False)
slide_id = fields.Many2one(related="response_id.slide_id")
prompt_id = fields.Many2one('open.response.prompt', ondelete='cascade', string="Prompt")
question_name = fields.Html("Question", related='prompt_id.question_name', store=True, translate=tools.html_translate, sanitize_attributes=False, sanitize_form=False)
question_sequence = fields.Integer('Sequence', related='prompt_id.sequence', store=True)
response_type = fields.Selection(string="Response Type", related="prompt_id.response_type")
class OpenResponseRubricStaff(models.Model):
_name = 'open.response.rubric.staff'
response_id = fields.Many2one('ora.response', ondelete="cascade")
assess_type = fields.Selection([
('peer', 'Peer'),
('staff', 'Staff')
], default='staff', required=True)
user_id = fields.Many2one('res.users', string="User", required=True)
total_score = fields.Integer('Total Score', compute="calculate_total_score", store=True)
state = fields.Selection([
('in_progress', 'In Progress'),
('completed', 'Completed')
], default="in_progress", readonly=True, string="Status")
submitted_date = fields.Datetime("Submitted Date")
option_ids = fields.One2many('open.response.rubric.assess', 'response_assess_id')
@api.depends('option_ids.criteria_option_point')
def calculate_total_score(self):
for rec in self:
total_score = 0
for line in rec.option_ids:
total_score += line.criteria_option_point
rec.total_score = total_score
class OpenResponseRubricAssess(models.Model):
_name = 'open.response.rubric.assess'
criteria_id = fields.Many2one('open.response.rubric', 'Criteria', required=True)
criteria_desc = fields.Text(related='criteria_id.name')
option_id = fields.Many2one('rubric.criterian', 'Options', required=True)
criteria_option_desc = fields.Text(related='option_id.option_desc')
criteria_option_point = fields.Integer(related='option_id.option_points')
assess_explanation = fields.Text("Assess Explanation", required=True, translate=True)
response_assess_id = fields.Many2one('open.response.rubric.staff', ondelete="cascade")
@api.onchange('criteria_id')
def onchange_criteria_id(self):
for rec in self:
rubric_ids = rec.response_assess_id.response_id.slide_id.rubric_ids.ids
return {
'domain': {
'criteria_id': [('id', 'in', rubric_ids)]
}
}
@@ -0,0 +1,22 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_open_response_prompt_user,open.response.prompt,model_open_response_prompt,base.group_user,1,1,1,1
access_open_response_rubric_user,open.response.rubric,model_open_response_rubric,base.group_user,1,1,1,1
access_rubric_criterian_user,rubric.criterian,model_rubric_criterian,base.group_user,1,1,1,1
access_ora_response,ora.response,model_ora_response,base.group_user,1,1,1,1
access_open_response_user_line,open.response.user.line,model_open_response_user_line,base.group_user,1,1,1,1
access_open_response_rubric_staff,open.response.rubric.staff,model_open_response_rubric_staff,base.group_user,1,1,1,1
access_open_response_rubric_assess,open.response.rubric.assess,model_open_response_rubric_assess,base.group_user,1,1,1,1
access_open_response_prompt_public,open.response.prompt,model_open_response_prompt,base.group_public,1,1,1,0
access_open_response_rubric_public,open.response.rubric,model_open_response_rubric,base.group_public,1,1,1,0
access_open_response_prompt_portal,open.response.prompt,model_open_response_prompt,base.group_portal,1,1,1,0
access_open_response_rubric_portal,open.response.rubric,model_open_response_rubric,base.group_portal,1,1,1,0
access_ora_response_portal,ora.response,model_ora_response,base.group_portal,1,1,1,0
access_open_response_rubric_staff_portal,open.response.rubric.staff,model_open_response_rubric_staff,base.group_portal,1,1,1,0
access_open_response_rubric_assess_portal,open.response.rubric.assess,model_open_response_rubric_assess,base.group_portal,1,1,1,0
access_open_response_user_line_portal,open.response.user.line,model_open_response_user_line,base.group_portal,1,1,1,0
access_rubric_criterian_portal,rubric.criterian,model_rubric_criterian,base.group_portal,1,1,1,0
access_ora_response_public,ora.response,model_ora_response,base.group_public,1,1,1,0
access_open_response_rubric_staff_public,open.response.rubric.staff,model_open_response_rubric_staff,base.group_public,1,1,1,0
access_open_response_rubric_assess_public,open.response.rubric.assess,model_open_response_rubric_assess,base.group_public,1,1,1,0
access_open_response_user_line_public,open.response.user.line,model_open_response_user_line,base.group_public,1,1,1,0
access_rubric_criterian_public,rubric.criterian,model_rubric_criterian,base.group_public,1,1,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_open_response_prompt_user open.response.prompt model_open_response_prompt base.group_user 1 1 1 1
3 access_open_response_rubric_user open.response.rubric model_open_response_rubric base.group_user 1 1 1 1
4 access_rubric_criterian_user rubric.criterian model_rubric_criterian base.group_user 1 1 1 1
5 access_ora_response ora.response model_ora_response base.group_user 1 1 1 1
6 access_open_response_user_line open.response.user.line model_open_response_user_line base.group_user 1 1 1 1
7 access_open_response_rubric_staff open.response.rubric.staff model_open_response_rubric_staff base.group_user 1 1 1 1
8 access_open_response_rubric_assess open.response.rubric.assess model_open_response_rubric_assess base.group_user 1 1 1 1
9 access_open_response_prompt_public open.response.prompt model_open_response_prompt base.group_public 1 1 1 0
10 access_open_response_rubric_public open.response.rubric model_open_response_rubric base.group_public 1 1 1 0
11 access_open_response_prompt_portal open.response.prompt model_open_response_prompt base.group_portal 1 1 1 0
12 access_open_response_rubric_portal open.response.rubric model_open_response_rubric base.group_portal 1 1 1 0
13 access_ora_response_portal ora.response model_ora_response base.group_portal 1 1 1 0
14 access_open_response_rubric_staff_portal open.response.rubric.staff model_open_response_rubric_staff base.group_portal 1 1 1 0
15 access_open_response_rubric_assess_portal open.response.rubric.assess model_open_response_rubric_assess base.group_portal 1 1 1 0
16 access_open_response_user_line_portal open.response.user.line model_open_response_user_line base.group_portal 1 1 1 0
17 access_rubric_criterian_portal rubric.criterian model_rubric_criterian base.group_portal 1 1 1 0
18 access_ora_response_public ora.response model_ora_response base.group_public 1 1 1 0
19 access_open_response_rubric_staff_public open.response.rubric.staff model_open_response_rubric_staff base.group_public 1 1 1 0
20 access_open_response_rubric_assess_public open.response.rubric.assess model_open_response_rubric_assess base.group_public 1 1 1 0
21 access_open_response_user_line_public open.response.user.line model_open_response_user_line base.group_public 1 1 1 0
22 access_rubric_criterian_public rubric.criterian model_rubric_criterian base.group_public 1 1 1 0
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

@@ -0,0 +1,237 @@
<div class="row"
style="margin: 0;position: relative;color: #000;background-position: center;background: #ffffff;border-bottom: 1px solid #e4e4e4;text-align: center; margin: auto; display: flex;justify-content: center;">
<a href="https://www.manprax.com/" target="_blank"><img src="images/manprax.png"
style=" width: 293px; padding: 1rem 0rem; margin: auto" alt="manprax-logo"></a>
</div>
<div class="row"
style="margin:75px 0;position: relative;color: #000;background-position: center;background: #ffffff;border-bottom: 1px solid #e4e4e4; padding-bottom: 30px;">
<div class="col-md-7 col-sm-12 col-xs-12" style="padding: 0px">
<div
style=" margin: 0 0 0px;padding: 20px 0 10;font-size: 23px;line-height: 35px;font-weight: 400;color: #000;border-top: 1px solid rgba(255,255,255,0.1);border-bottom: 1px solid rgba(255,255,255,0.11);text-align: left;">
<h1 style="font-size: 39px;font-weight: 600;margin: 0px !important;">Elearning with Open Response
Assessment(ORA) </h1>
<h3 style="font-size: 21px;margin-top: 8px;position: relative;">Most advanced open source elearning software
</h3>
</div>
<h2 style="font-weight: 600;font-size: 1.8rem;margin-top: 15px;">Key Highlights</h2>
<ul style=" padding: 0 1px; list-style: none; ">
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Provides Open Response Assessment(ORA) with feedback on top of Odoo Elearning.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Provide functionality to create prompts(Subjective Questions) and rubric(Scoring criterion) for the content.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Maintain history of responses submitted by learner with staff feedback.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Allow course creators to give feedback and option to resubmit the assigment.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Supports rich text and normal text as response.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Rich text provide options to insert images and documents as odoo do.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Assessment can be done from both screen view(Fullscreen & Normal).
</li>
<h2 style="font-weight: 600;font-size: 1.8rem;margin-top: 15px;">Peer Assessment</h2>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Allow user to enable/disable peer assessment.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Allow learner to assess the responses of the other learner(Peer).
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Responses of learner will be automatically allocated to peers.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Multilingual support (English, Hindi).
</li>
</ul>
</div>
</div>
<div>
<h2 class="text-center">Screenshots</h2>
<section class="oe_container">
<div>
<div>
<div>
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Create prompts that you want to ask from users.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px; width: 80%;"
src="images/screen1.png"></div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Creator can define the criteria on which response will be assessed.
<br>
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen2.png"></div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Learner answers the assessment directly from the course.
<br>
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen3.png"></div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Once user submit the response it will be visible in cards.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen4.png">
</div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Once user submit the response creator can assess it or give feedback to it.
</h3>
<div id="myCarousel" class="carousel slide" data-ride="carousel"
style="width: 80%;margin-left: 102px;">
<div class="carousel-inner">
<div class="carousel-item active"><img class="img img-responsive d-block w-100"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;height: 80%;"
src="images/screen5.png">
</div>
<div class="carousel-item"><img class="img img-responsive d-block w-100"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;height: 80%;"
src="images/screen6.png">
</div>
<div class="carousel-item"><img class="img img-responsive d-block w-100"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;height: 80%;"
src="images/screen7.png">
</div>
</div>
<a class="carousel-control-prev" href="#myCarousel" data-slide="prev"
style="left:-25px;width: 35px;color: #000;">
<span class="carousel-control-prev-icon"><i class="fa fa-chevron-left"
style="font-size:24px"></i></span></a>
<a class="carousel-control-next" href="#myCarousel" data-slide="next"
style="right:-25px;width: 35px;color: #000;">
<span class="carousel-control-next-icon"><i class="fa fa-chevron-right"
style="font-size:24px"></i></span></a>
</div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Creator can assess the response from the response itself.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen8.png">
</div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Once creator assesses the response learner can see what assessment he got and the xp points for it.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen9.png">
</div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Enable/Disable peer assessment setting from the course.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen10.png">
</div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Responses of learner will be automatically allocated to peers.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen13.png">
</div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Learner can see the peer assessment once other learner response allocated to them.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen11.png">
</div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Once learner submit the assessment. He/She can see the assessment in a table view.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen12.png">
</div>
</div>
</div>
</div>
</div>
</section>
</div>
@@ -0,0 +1,403 @@
/** @odoo-module **/
import { _t } from "@web/core/l10n/translation";
import { renderToFragment } from "@web/core/utils/render";
import publicWidget from '@web/legacy/js/public/public_widget';
import Fullscreen from "@website_slides/js/slides_course_fullscreen_player";
import { markup } from "@odoo/owl";
import { loadWysiwygFromTextarea } from "@web_editor/js/frontend/loadWysiwygFromTextarea";
import { rpc } from "@web/core/network/rpc";
var findSlide = function (slideList, matcher) {
return slideList.find((slide) => {
return Object.keys(matcher).every((key) => matcher[key] === slide[key]);
});
};
Fullscreen.include({
events: Object.assign({}, Fullscreen.prototype.events, {
"click .o_wslides_js_lesson_ora_submit": '_submitOra',
"click .o_submit_peer_response": '_submitPeer',
"click .o_wslides_fs_toggle_sidebar": '_onClickToggleSidebar',
"click .o_wslides_ora_continue": '_onClickOraNext'
}),
/**
* @override
* @param {Object} el
* @param {Object} slides Contains the list of all slides of the course
* @param {integer} defaultSlideId Contains the ID of the slide requested by the user
*/
init: function (parent, slides, defaultSlideId, channelData) {
var result = this._super.apply(this,arguments);
this.initialSlideID = defaultSlideId;
// this.slides = this._preprocessSlideData(slides);
this.channel = channelData;
var slide;
const urlParams = new URL(window.location).searchParams;
if (defaultSlideId) {
slide = findSlide(this.slides, {id: defaultSlideId, isQuiz: String(urlParams.get("quiz")) === "1" });
} else {
slide = this.slides[0];
}
this._slideValue = slide;
this.sidebar = new NewSidebar(this, this.slides, slide);
return result;
},
_preprocessSlideData: function (slidesDataList) {
var res = this._super.apply(this, arguments);
res.forEach(function (slideData, index) {
slideData.isOra = !!slideData.isOra;
slideData.hasQuestion = !!slideData.hasQuestion;
try {
if (!(slideData.isOra) && !(slideData.hasQuestion) && slideData.category != 'certification') {
slideData._autoSetDone = true;
}
}
catch {
if (!(slideData.hasQuestion) && slideData.category != 'certification') {
slideData._autoSetDone = true;
}
}
});
return res;
},
_onChangeSlideRequest: function (ev) {
var slideData = ev.data;
var newSlide = findSlide(this.slides, {
id: slideData.id,
isQuiz: slideData.isQuiz || false,
isOra: slideData.isOra || false,
});
this._updateSlideValue(newSlide);
},
/**
* Triggering a event to switch to next slide
*
* @private
* @param OdooEvent ev
*/
_onClickOraNext: function (ev) {
var self = this;
if (this._slideValue.isOra === true) {
rpc('/slides/slide/get_values', {
slide_id: (this._slideValue.id),
}).then(function (data) {
if (data.slide.hasNext && data.slide.next_slide_url && !data.slide.ispro) {
var url = data.slide.next_slide_url;
window.location.replace(url);
}
if (data.slide.hasNext && data.slide.next_slide_url && data.slide.ispro) {
var slide = $('.o_wslides_fs_sidebar_list_item.active');
var $slides = this.$('.o_wslides_fs_sidebar_list_item');
var slideListdata = [];
var slideList = []
$slides.each(function () {
var slideData = $(this).data();
if (slideData.category == 'video' && slideData.videoSourceType !== 'vimeo' && !slideData.hasQuestion && !slideData.embedCode.includes('iframe')) {
slideData.embedCode = '<iframe src=\"' + slideData.embedCode + '\" allowFullScreen=\"true\" frameborder=\"0\"></iframe>'
}
slideListdata.push(slideData);
slideList.push($(this));
});
var slide_list_data = self._preprocessSlideData(slideListdata);
var index = 0;
if (slide.data().category == 'quiz') {
for (let [i, v] of slideList.entries()) {
if (v[0].classList.contains('active')) {
index = i;
}
}
}
else if ((slide.data().category != 'quiz' && slide.data().hasQuestion) || slide.data().hasOra) {
for (let [i, v] of slideList.entries()) {
if (v[0].classList.contains('active')) {
index = i + 1;
}
}
}
if (index == slideList.length) {
index = index - 1
}
var next_slide = slide_list_data[index + 1];
if (next_slide === self.get('slide')) {
next_slide = slide_list_data[index + 2];
}
next_slide['canAccess'] = 'True';
var next_slide_list = slideList[index + 1]
if (next_slide_list === self.get('slide')) {
next_slide_list = slide_list_data[index + 2];
}
var next_div = next_slide_list.find('.o_wslides_fs_slide_name');
self.slides.push(next_slide);
slide.removeClass('active');
$('.o_sidebar_link').attr("href", '#');
$('.o_btn_set_done').addClass('d-none');
$('.o_btn_next_slide').addClass('d-none');
next_slide_list.addClass('active');
next_slide_list.removeClass('disabled')
next_slide_list.removeClass('text-600')
next_div.removeClass('text-600');
if (slide.data()['hasQuestion'] || slide.data()['isQuiz'] || slide.data()['hasOra']) {
var next_quiz = slide.find('.o_wslides_fs_sidebar_list_item a');
next_quiz.attr("href", '#');
next_quiz.removeClass('text-600');
var next_mini = slide.find('.o_wslides_fs_sidebar_list_item span');
next_mini.attr("href", '#');
next_mini.removeClass('text-600');
}
self.sidebar.set('slideEntry', {
id: next_slide.id,
isQuiz: next_slide.isQuiz || false
});
// }
}
});
}
},
_renderSlide: function () {
var def = this._super.apply(this, arguments);
var $content = this.$('.o_wslides_fs_content');
var self = this;
if (this._slideValue.isOra === true) {
rpc('/slides/slide/get_values', {
slide_id: (this._slideValue.id),
}).then(function (data) {
if (data.slide_prompts) {
for (let i = 0; i < data.slide_prompts.length; i++) {
data.slide_prompts[i].question = markup(data.slide_prompts[i].question)
}
}
if (data.total_responses) {
for (let i = 0; i < data.total_responses.length; i++) {
for (let j = 0; j < (data.total_responses[i].user_response_line).length; j++) {
data.total_responses[i].user_response_line[j].value_richtext_box = markup(data.total_responses[i].user_response_line[j].value_richtext_box)
}
}
}
if (data.peer_responses) {
for (let i = 0; i < data.peer_responses.length; i++) {
for (let j = 0; j < (data.peer_responses[i].user_response_line).length; j++) {
data.peer_responses[i].user_response_line[j].value_richtext_box = markup(data.peer_responses[i].user_response_line[j].value_richtext_box)
}
}
}
$content.empty().append(renderToFragment('slide.ora.assessment', {widget: data}));
$('textarea.o_wysiwyg_loader').toArray().forEach((textarea) => {
var $textarea = $(textarea);
var options = {
resizable: true,
userGeneratedContent: true,
height: 100,
};
loadWysiwygFromTextarea(self, $textarea[0], options)
});
$('.custom_response').click(function () {
var id = this.id.split('-')[this.id.split('-').length - 1];
var button = $(this);
$('#collapse_div_' + id).on('shown.bs.collapse', function () {
button.children().text(_t('Hide Response'));
});
$('#collapse_div_' + id).on('hidden.bs.collapse', function () {
button.children().text(_t('View Response'));
});
});
});
}
return Promise.all([def]);
},
_submitPeer: function (ev) {
var id = ev.currentTarget.id.split('_')[ev.currentTarget.id.split('_').length - 1]
var data = $('#ora_peer_submit_' + id).serializeArray();
var self = this;
ev.preventDefault();
$.ajax({
type: "POST",
url: "/submit/peer/response",
data: data,
success: function (data) {
self._renderSlide();
}
});
},
_submitOra: function (ev) {
var responseData = []
$('.o_wslides_ora_answer_info').each(function () {
var response_div_id = `response_div_${this.id}`;
var $response_div = $(`.${response_div_id}`);
if ($response_div.length && !$response_div.val()) {
var richTextValue = $response_div.find('.note-editable').html();
responseData.push({ name: this.id, value: richTextValue });
}
});
responseData;
var data = $('#ora_form').serializeArray();
responseData.forEach(function (item) {
var existingField = data.find(function (field) {
return field.name === item.name;
});
if (existingField) {
existingField.value = item.value;
} else {
data.push({ name: item.name, value: item.value });
}
});
data.push({ name: ev.currentTarget.name, value: ev.currentTarget.value });
ev.preventDefault();
var self = this;
$.ajax({
type: "POST",
url: "/ora/response/save/",
data: data,
success: function (data) {
self._renderSlide();
}
});
},
});
/**
* This widget is responsible of navigation for one slide to another:
* - by clicking on any slide list entry
* - by mouse click (next / prev)
* - by recieving the order to go to prev/next slide (`goPrevious` and `goNext` public methods)
*
* The widget will trigger an event `change_slide` with
* the `slideId` and `isMiniQuiz` as data.
*/
var NewSidebar = publicWidget.Widget.extend({
events: {
'click .o_wslides_fs_sidebar_list_item .o_wslides_fs_slide_name': '_onClickTab',
},
init: function (parent, slideList, defaultSlide) {
var result = this._super.apply(this, arguments);
this.slideEntries = slideList;
this._slideEntry = defaultSlide;
return result;
},
start: function () {
var self = this;
return this._super.apply(this, arguments).then(function () {
$(document).keydown(self._onKeyDown.bind(self));
});
},
destroy: function () {
$(document).unbind('keydown', this._onKeyDown.bind(this));
return this._super.apply(this, arguments);
},
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
/**
* Change the current slide with the next one (if there is one).
*
* @public
*/
goNext: function () {
var currentIndex = this._getCurrentIndex();
if (currentIndex < this.slideEntries.length - 1) {
this._updateSlideEntry(this.slideEntries[currentIndex + 1]);
}
},
/**
* Change the current slide with the previous one (if there is one).
*
* @public
*/
goPrevious: function () {
var currentIndex = this._getCurrentIndex();
if (currentIndex >= 1) {
this._updateSlideEntry(this.slideEntries[currentIndex - 1]);
}
},
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
/**
* Get the index of the current slide entry (slide and/or quiz)
*/
_getCurrentIndex: function () {
const slide = this._slideEntry;
var currentIndex = this.slideEntries.findIndex(entry => {
return entry.id === slide.id && entry.isQuiz === slide.isQuiz;
});
return currentIndex;
},
//--------------------------------------------------------------------------
// Handler
//--------------------------------------------------------------------------
/**
* Handler called whenever the user clicks on a sub-quiz which is linked to a slide.
* This does NOT handle the case of a slide of category "quiz".
* By going through this handler, the widget will be able to determine that it has to render
* the associated quiz and not the main content.
*
* @private
* @param {*} ev
*/
_onClickMiniQuiz: function (ev) {
var slideID = parseInt($(ev.currentTarget).data().slide_id);
this._updateSlideEntry({
slideID: slideID,
isMiniQuiz: true
});
this.trigger_up('change_slide', this._slideEntry);
},
/**
* Handler called when the user clicks on a normal slide tab
*
* @private
* @param {*} ev
*/
_onClickTab: function (ev) {
ev.stopPropagation();
const $elem = $(ev.currentTarget).closest('.o_wslides_fs_sidebar_list_item');
if ($elem.data('canAccess') === 'True') {
var isQuiz = $elem.data('isQuiz');
var isOra = $elem.data('isOra');
var slideID = parseInt($elem.data('id'));
var slide = findSlide(this.slideEntries, { id: slideID, isQuiz: isQuiz, isOra: isOra });
this._updateSlideEntry(slide);
}
},
/**
* Actively changes the active tab in the sidebar so that it corresponds
* the slide currently displayed
*
* @private
* @param {Object} slide
*/
_updateSlideEntry: function (slide) {
if (this._slideEntry === slide) {
return;
}
this._slideEntry = slide;
this.$('.o_wslides_fs_sidebar_list_item.active').removeClass('active');
var selector = '.o_wslides_fs_sidebar_list_item[data-id='+slide.id+'][data-is-quiz!="1"]';
this.$(selector).addClass('active');
this.trigger_up('change_slide', this._slideEntry);
},
/**
* Binds left and right arrow to allow the user to navigate between slides
*
* @param {*} ev
* @private
*/
_onKeyDown: function (ev) {
switch (ev.key) {
case "ArrowLeft":
this.goPrevious();
break;
case "ArrowRight":
this.goNext();
break;
}
},
});
@@ -0,0 +1,41 @@
/** @odoo-module **/
import publicWidget from '@web/legacy/js/public/public_widget';
import { loadWysiwygFromTextarea } from "@web_editor/js/frontend/loadWysiwygFromTextarea";
import { _t } from "@web/core/l10n/translation";
publicWidget.registry.websiteORA = publicWidget.Widget.extend({
selector: '.o_user_response',
/**
* @override
*/
start: function () {
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return def;
}
var self = this;
$('textarea.o_wysiwyg_loader').toArray().forEach((textarea) => {
var $textarea = $(textarea);
var options = {
resizable: true,
userGeneratedContent: true,
height: 100,
};
loadWysiwygFromTextarea(self, $textarea[0], options)
});
$('.custom_response').click(function () {
var id = this.id.split('-')[this.id.split('-').length - 1];
var button = $(this);
$('#collapse_div_' + id).on('shown.bs.collapse', function () {
button.children().text(_t('Hide Response'));
});
$('#collapse_div_' + id).on('hidden.bs.collapse', function () {
button.children().text(_t('View Response'));
});
});
return Promise.all([def]);
},
});
@@ -0,0 +1,42 @@
.o_wslides_js_lesson_ora odoo-wysiwyg-container {
width: 100%;
display: block;
}
.o_wslides_js_lesson_ora .o_wslides_js_lesson_quiz_question p {
margin-bottom: 0;
}
.o_wslides_js_lesson_ora .o_wysiwyg_wrapper {
width: 100%;
}
#wrapwrap table.table.table-bordered td, .o_editable table.table.table-bordered td {
min-width: 120px;
}
@media (max-width: 575px) {
.tableBox {
width: 300px;
}
}
.icon-circle {
margin-left: 15px;
margin-top: 12px;
font-size: 17px;
}
.save1 {
margin-left: 7px;
}
.margin-sizing {
margin-top: 15px;
margin-left: 20px;
font-size: larger;
}
.question_answer_spacing {
margin-left: 8px;
}
@@ -0,0 +1,437 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="slide.ora.assessment">
<style>
.question_text p {
display: inline;
}
</style>
<div class="o_wslides_fs_quiz_container o_wslides_wrap h-100 w-100 overflow-auto pb-5 o_user_response" style="background-color: rgb(236 236 236)">
<ul class="nav nav-tabs o_wslides_lesson_nav" role="tablist">
<li class="nav-item">
<a href="#ora_assessment" aria-controls="ora_assessment" data-oe-model="slide.slide" class="nav-link active" role="tab" data-bs-toggle="tab">
<i class="fa fa-edit"></i> Assessment
</a>
</li>
<t t-if="widget.slide.peer_assessment">
<li class="nav-item">
<a href="#peer_assessment" aria-controls="peer_assessment" data-oe-model="slide.slide" class="nav-link" role="tab" data-bs-toggle="tab">
<i class="fa fa-users"></i> Peer Assessment
</a>
</li>
</t>
</ul>
<div class="tab-content">
<div id="ora_assessment" role="tabpanel" class="o_wslides_js_ora_container tab-pane fade show active" t-att-data-slide-id="widget.slide.id" name="slide" t-att-value="widget.slide.id">
<t t-if="widget.total_responses">
<t t-foreach="widget.total_responses" t-as="response" t-key="response">
<t t-if="response.state == 'inactive' || response.state == 'submitted' || response.state == 'assessed'">
<div class="card-body">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-light">
<t t-set="bio_popover_data">
<div class="d-flex o_wforum_bio_popov &amp;&amp;er_wrap">
<img class="o_forum_avatar_big flex-shrink-0 mr-3" t-att-src="response.ora_res_user_image_url" alt="Avatar"
style="height:70px;width:70px;"/>
<div>
<h5 class="o_wforum_bio_popover_name mb-0" t-esc="response.user_name"/>
<span class="o_wforum_bio_popover_info" t-esc="response.user_name"/>
</div>
</div>
</t>
<div class="row" style="line-height: 2.3em;">
<div class="d-flex align-items-start">
<div t-attf-class="o_wforum_author_box d-inline-flex o_show_info o_compact align-items-center o_wforum_bio_popover"
t-att-data-content="bio_popover_data">
<div class="o_wforum_author_pic position-relative rounded-circle me-2">
<img t-attf-class="rounded-circle o_forum_avatar shadow" t-att-src="response.ora_res_user_image_url" alt="Avatar"
style="height:40px;width:40px;"/>
</div>
</div>
<t t-if="response.state != 'assessed'">
<span class="ml-2">Your response has been submitted successfully on
<t t-esc="response.submitted_date"/>
</span>
</t>
<t t-if="response.state == 'assessed'">
<span class="ml-2">Your response has been assessed.</span>
</t>
</div>
<div class="ml-auto">
<button t-if="widget.slide.completed &amp;&amp; widget.slide.hasNext" class="btn btn-primary o_wslides_ora_continue" style="float:right;position:relative;">
Continue <i class="fa fa-chevron-right ms-1"/>
</button>
<button t-attf-id="show_response-{{response.id}}"
t-attf-class="btn btn-primary custom_response"
t-attf-data-bs-target="#collapse_div_{{response.id}}"
t-attf-aria-controls="collapse_div"
data-bs-toggle="collapse"
t-attf-style="float:right;position:relative;margin-right:10px;"
type="button">
<span id='response_button_text'>View Response</span>
</button>
</div>
</div>
</div>
<t t-if="response.state != 'assessed'">
<div t-attf-id="collapse_div_{{response.id}}"
class="collapse custom_collapse list-group-item">
<t t-if="widget.slide_prompts">
<t t-call="lesson_submitted_response_prompts"/>
</t>
</div>
</t>
<t t-if="response.state == 'assessed'">
<div t-attf-id="collapse_div_{{response.id}}"
class="collapse custom_collapse list-group-item">
<t t-call="lesson_assessed_response_prompts"/>
</div>
</t>
<t t-if="response.feedback">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-light">
<t t-set="bio_popover_data">
<div class="d-flex o_wforum_bio_popover_wrap">
<img class="o_forum_avatar_big flex-shrink-0 mr-3" t-att-src="feedback_user_image_url" alt="Avatar"
style="height:75px;width75px;"/>
<div>
<h5 class="o_wforum_bio_popover_name mb-0" t-esc="response.staff_name"/>
<span class="o_wforum_bio_popover_info" t-esc="response.staff_name"/>
</div>
</div>
</t>
<div class="row">
<div t-attf-class="o_wforum_author_box d-inline-flex #{display_info and 'o_show_info'} #{compact and 'o_compact align-items-center'} #{bio_popover_data and 'o_wforum_bio_popover'}"
t-att-data-content="bio_popover_data">
<div class="o_wforum_author_pic position-relative rounded-circle me-2">
<img t-attf-class="rounded-circle o_forum_avatar shadow"
t-att-src="feedback_user_image_url" alt="Avatar" style="height:40px;width:40px;"/>
</div>
</div>
<div class="col">
<t t-out="response.feedback"/>
</div>
</div>
<t t-if="response.can_resubmit and response.state == 'submitted'">
<form id="ora_form" t-attf-action="/ora/response/save" method="post" role="form" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" t-att-value="widget.csrf_token"/>
<input type="hidden" name="slide_id" t-att-value="widget.slide.id"/>
<input type="hidden" name="response_id" t-att-value="response.id"/>
<div>
<button class="o_wslides_js_lesson_ora_submit btn btn-primary o_slide_submit_btn" id="submit_response_fresh" type="submit"
style="margin-top: 10px;" name="submit" value="resubmit_fresh">
<span>Resubmit Fresh</span>
</button>
<button class="o_wslides_js_lesson_ora_submit btn btn-primary o_slide_submit_btn" id="submit_response_copy" type="submit"
style="margin-right:10px;margin-top: 10px;" name="submit" value="resubmit_copy">
<span>Resubmit Copy</span>
</button>
<button t-if="widget.slide.completed &amp;&amp; widget.slide.hasNext" class="btn btn-primary o_wslides_ora_continue" style="margin-right:10px;margin-top: 10px;">
Continue <i class="fa fa-chevron-right ms-1"/>
</button>
</div>
</form>
</t>
</div>
</t>
</div>
</t>
<t t-if="response.state == 'active'">
<form id="ora_form" role="form" enctype="multipart/form-data" action="#">
<input type="hidden" id="response_id" t-att-value="response.id"/>
<input type="hidden" name="csrf_token" t-att-value="widget.csrf_token"/>
<div>
<t t-if="widget.slide_prompts">
<t t-call="lesson_active_response_prompts"/>
</t>
</div>
<div class="mt-3 card-body">
<button t-attf-class="o_wslides_js_lesson_ora_submit btn btn-primary#{(widget.slide.is_member or widget.slide.is_preview) and ' ' or ' d-none'}" name="submit" value="save" type="button">
<span>Save Your Progress</span>
</button>
<button t-attf-class="o_wslides_js_lesson_ora_submit btn btn-primary#{(widget.slide.is_member or widget.slide.is_preview) and ' ' or ' d-none'}" style="float:right;" name="submit" value="submit" type="button">
<span>Submit</span>
</button>
</div>
</form>
</t>
</t>
</t>
<t t-if="(! widget.hasOwnProperty('total_responses') || widget.total_responses.length == 0) &amp;&amp; widget.slide_prompts">
<form id="ora_form" role="form" enctype="multipart/form-data" action="#">
<input type="hidden" name="csrf_token" t-att-value="widget.csrf_token"/>
<div>
<t t-if="widget.slide_prompts">
<t t-call="lesson_active_response_prompts"/>
</t>
</div>
<div t-attf-class="mt-3 card-body#{(widget.slide.is_member) and ' ' or ' d-none'}">
<button t-attf-class="o_wslides_js_lesson_ora_submit btn btn-primary" name="submit" value="save" type="button">
<span>Save Your Progress</span>
</button>
<button t-attf-class="o_wslides_js_lesson_ora_submit btn btn-primary" style="float:right;" name="submit" value="submit" type="button">
<span>Submit</span>
</button>
</div>
</form>
</t>
</div>
<div id="peer_assessment" role="tabpanel" class="tab-pane fade">
<t t-if="widget.peer_responses">
<div>
<t t-call="lesson_content_peer_responses"/>
</div>
</t>
<t t-if="! widget.peer_responses || (widget.peer_responses &amp;&amp; widget.peer_responses.length == 0)">
<h2>There is no peer responses to assess.</h2>
</t>
</div>
</div>
</div>
</t>
<t t-name="lesson_content_peer_responses">
<div class="o_wslides_js_lesson_ora" id="peer" style="padding-left: 15px;padding-right: 12px;">
<t t-set="count" t-value="0"/>
<t t-foreach="widget.peer_responses" t-as="response" t-key="response">
<t t-set="count" t-value="count + 1"/>
<div class="mt-3 list-group-item list-group-item-light" style="line-height: 2.5em;">
<span>Learner Response <t t-esc="count"/>
<t t-if="response.submitted_date">assessed on <t t-esc="response.submitted_date"/></t>
</span>
<button t-if="widget.slide.completed &amp;&amp; widget.slide.hasNext" class="btn btn-primary o_wslides_ora_continue" style="float:right;position:relative;">
Continue <i class="fa fa-chevron-right ms-1"/>
</button>
<button t-attf-id="show_response-{{response.id}}"
t-attf-class="btn btn-primary custom_response me-3"
t-attf-data-bs-target="#collapse_div_{{response.id}}"
t-attf-aria-controls="collapse_div"
data-bs-toggle="collapse"
t-attf-style="float:right;position:relative;"
type="button">
<span id='response_button_text'>View Response</span>
</button>
</div>
<div t-attf-id="collapse_div_{{response.id}}"
class="collapse custom_collapse list-group-item">
<form action="/submit/peer/response" t-attf-id="ora_peer_submit_{{response.id}}" role="form" enctype="multipart/form-data">
<input type="hidden" name="response_id" t-att-value="response.id"/>
<input type="hidden" name="csrf_token" t-att-value="widget.csrf_token"/>
<input type="hidden" name="slide_id" t-att-value="widget.slide.id"/>
<t t-call="lesson_submitted_response_prompts"/>
</form>
</div>
</t>
<input type="hidden" name="slide_id" t-att-value="widget.slide.id" />
</div>
</t>
<t t-name="lesson_submitted_response_prompts">
<div class="o_wslides_js_lesson_ora" id="lessonORA">
<t t-foreach="widget.slide_prompts" t-as="prompt" t-key="prompt">
<t t-call="lesson_content_quiz_prompt_submitted"/>
</t>
<t t-if="response.state == 'in_progress' and response.user_id == widget.slide.user">
<h3>Complete the rubric and submit the assessment.</h3>
<t t-foreach="widget.slide.rubric_ids" t-as="rubric" t-key="rubric">
<ul class="list-group">
<li class="list-group-item mb-3">
<div class="mb-3">
<h4><t t-esc="rubric.criterian_name"/></h4>
<span t-esc="rubric.name"/>
</div>
<div class="o_select_option mb-3 row" style="margin: auto;">
<select class="form-select" t-attf-name="options_{{response.id}}_{{rubric.id}}"
t-attf-id="'options_{{response.id}}_{{rubric.id}}" required="required"
style="width:auto;margin-right: 20px;margin-bottom: 20px;">
<t t-foreach="rubric.criterian_ids" t-as="option" t-key="option">
<option t-att-value="option.id">
<t t-esc="option.name"/>
</option>
</t>
</select>
<textarea class="form-control s_website_form_input" t-attf-name="exp_{{response.id}}_{{rubric.id}}"
required="required" placeholder="Assessment Explanation"/>
</div>
</li>
</ul>
</t>
<button class="btn btn-primary o_submit_peer_response" t-attf-id="submit_peer_response_{{response.id}}" type="submit"
style="margin-top: 10px;margin-bottom:10px;margin-left: auto;display: table;" name="submit" value="peer_response">
<span>Submit</span>
</button>
</t>
<t t-if="response.state == 'completed'">
<h3 style="text-align: center;">
<span style="font-weight: bold;">Assessment</span>
</h3>
<hr style="height:1px;border-width:0;color:gray;background-color:gray"/>
<div class="tableBox" style="overflow: auto;">
<table class="table-bordered table" style="table-layout: auto;">
<t t-foreach="response.option_ids" t-as="res_rubric" t-key="res_rubric">
<tr>
<td style="text-align: center;vertical-align: middle;">
<strong><span t-esc="res_rubric.criterian_name"/></strong>
</td>
<t t-foreach="widget.slide.rubric_ids" t-as="rubric" t-key="rubric">
<t t-foreach="rubric.criterian_ids" t-as="option" t-key="option">
<t t-if="res_rubric.id == rubric.id">
<td t-attf-style="background-color:#{res_rubric.name == option.name and '#d9edf7'};
overflow-wrap: anywhere;text-align: center;vertical-align: middle;">
<span t-esc="option.name"/>
<t t-if="res_rubric.name == option.name">
<t t-set="points" t-value="'('+res_rubric.criteria_option_point+'points)'"/>
<span t-esc="points"></span>
<br/>
<span t-esc="res_rubric.assess_explanation" style="font-size:12px;"/>
</t>
</td>
</t>
</t>
</t>
</tr>
</t>
</table>
</div>
</t>
</div>
</t>
<t t-name="lesson_assessed_response_prompts">
<div class="o_wslides_js_lesson_ora" id="lessonORA">
<t t-foreach="widget.slide_prompts" t-as="prompt" t-key="prompt">
<t t-call="lesson_content_quiz_prompt_submitted"/>
</t>
<t t-foreach="response.slide_rubric_staff_line" t-as="staff_line" t-key="staff_line">
<t t-if="staff_line.assess_type == 'staff'">
<h3 class="text-center mt-3">
<span style="font-weight: bold;">Assessment</span>
</h3>
<hr style="height:1px;border-width:0;color:gray;background-color:gray"/>
<div class="tableBox" style="overflow-x: auto">
<table class="table-bordered table" style="table-layout: auto;">
<t t-foreach="staff_line.option_ids" t-as="res_rubric" t-key="res_rubric">
<tr>
<td style="text-align: center;vertical-align: middle;">
<strong><span t-esc="res_rubric.criterian_name"/></strong>
</td>
<t t-foreach="widget.slide.rubric_ids" t-as="rubric" t-key="rubric">
<t t-foreach="rubric.criterian_ids" t-as="option" t-key="option">
<t t-if="res_rubric.id == rubric.id">
<td t-attf-style="background-color:#{res_rubric.name == option.name and '#d9edf7'};
overflow-wrap: anywhere;text-align: center;vertical-align: middle;">
<span t-esc="option.name"/>
<t t-if="res_rubric.name == option.name">
(<span style="margin-right:2px;" t-esc="res_rubric.criteria_option_point"></span>points)
<br/>
<span t-esc="res_rubric.assess_explanation" style="font-size:12px;"/>
</t>
</td>
</t>
</t>
</t>
</tr>
</t>
</table>
</div>
</t>
</t>
</div>
</t>
<t t-name="lesson_active_response_prompts">
<div class="o_wslides_js_lesson_ora" id="lessonORA">
<t t-foreach="widget.slide_prompts" t-as="prompt" t-key="prompt">
<t t-call="lesson_content_quiz_prompt_active"/>
</t>
<input type="hidden" name="slide_id" t-att-value="widget.slide.id" />
</div>
</t>
<t t-name="lesson_content_quiz_prompt_active">
<div t-attf-class="o_wslides_js_lesson_quiz_question card-body #{(widget.slide.is_member) and ' ' or ' disabled'}"
t-attf-data-question-id="#{prompt.id}" t-att-data-title="prompt.question" style="margin-top: 15px;margin-left: 7px;">
<div class="row mb-2">
<div style="display:inline-flex;">
<small class="text-muted">
<i class="fa fa-quora me-1"></i>
</small>
<div class="question_text ml-2" style="line-height:1.2;flex-direction:column;display:inline-flex;" t-out="prompt['question']"/>
</div>
</div>
<div class="list-group o_wslides_ora_answer_info" t-att-id="prompt.id">
<t t-if="response">
<t t-foreach="response.user_response_line" t-as="user_input" t-key="user_imput">
<t t-if="user_input.prompt_id == prompt.id">
<t t-if="prompt.response_type == 'text'">
<span class="input-group-text">Your Response</span>
<div class="input-group" style="text-align: justify;">
<textarea t-attf-class="form-control response_div_#{prompt.id}" t-att-name="prompt.id" required="required"><t t-esc="user_input.value_text_box"/></textarea>
</div>
</t>
<t t-if="prompt.response_type == 'rich_text'">
<span class="input-group-text">Your Response</span>
<div t-attf-class="position-relative o_wysiwyg_textarea_wrapper response_div_#{prompt.id}">
<textarea class="form-control o_wysiwyg_loader"
t-att-name="prompt.id" required="required">
<t t-esc="user_input.value_richtext_box"/>
</textarea>
</div>
</t>
</t>
</t>
</t>
<t t-if="! response">
<t t-if="prompt.response_type == 'text'">
<span class="input-group-text">Your Response</span>
<div class="input-group" style="text-align: justify;">
<textarea t-attf-class="form-control response_div_#{prompt.id}" t-att-name="prompt.id" required="required"></textarea>
</div>
</t>
<t t-if="prompt.response_type == 'rich_text'">
<span class="input-group-text">Your Response</span>
<div t-attf-class="position-relative o_wysiwyg_textarea_wrapper response_div_#{prompt.id}">
<textarea class="form-control s_website_form_input o_wysiwyg_loader" t-att-name="prompt.id" required="required"></textarea>
</div>
</t>
</t>
<t t-if="prompt.name">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-info">
<i class="fa fa-info-circle me-2"/>
<span class="o_wslides_quiz_answer_comment" t-esc="prompt.name"/>
</div>
</t>
</div>
</div>
</t>
<t t-name="lesson_content_quiz_prompt_submitted">
<div t-attf-class="o_wslides_js_lesson_quiz_question card-body #{(widget.slide.is_member) and ' ' or ' disabled'}"
t-attf-data-question-id="#{prompt.id}" t-att-data-title="prompt.question">
<div class="row mb-2">
<div style="display:inline-flex;">
<small class="text-muted">
<i class="fa fa-quora me-1"></i>
</small>
<div class="question_text ml-2" style="line-height:1.2;flex-direction:column;display:inline-flex;" t-out="prompt['question']"/>
</div>
</div>
<div class="row mb-2">
<div style="display:inline-flex;line-height:1">
<t t-foreach="response.user_response_line" t-as="user_input" t-key="user_imput">
<t t-if="user_input.prompt_id == prompt.id">
<t t-if="prompt.response_type == 'text'">
<small class="text-muted">
<i class="fa fa-font me-1"></i>
</small>
<span class="ml-1" style="line-height: 1">
<span style="white-space: break-spaces;" t-esc="user_input.value_text_box"/>
</span>
</t>
<t t-if="prompt.response_type == 'rich_text'">
<small class="text-muted">
<i class="fa fa-font me-1"></i>
</small>
<span class="ml-1" style="line-height: 1">
<span t-out="user_input.value_richtext_box"/>
</span>
</t>
</t>
</t>
</div>
</div>
</div>
</t>
</templates>
@@ -0,0 +1,249 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_slide_slide_form_inherit_ora" model="ir.ui.view">
<field name="name">slide.slide.form</field>
<field name="model">slide.slide</field>
<field name="inherit_id" ref="website_slides.view_slide_slide_form"/>
<field name="arch" type="xml">
<div class="oe_button_box" position="inside">
<button name="action_open_responses" type="object" class="oe_stat_button" icon="fa-pencil-square-o">
<field name="response_count" widget="statinfo"/>
</button>
</div>
<page name="quiz" position="after">
<page name="ora" string="ORA">
<separator string="Open Response Assessment"/>
<notebook>
<page name="prompt" string="Prompts">
<field name="prompt_ids">
<list string="Prompts">
<field name='sequence' widget='handle'/>
<field name="name"/>
<field name="question_name"/>
<field name="response_type"/>
</list>
<form>
<label for="question_name"/>
<field name="question_name"/>
<label for="name"/>
<field name="name"/>
<label for="response_type"/>
<field name="response_type"/>
</form>
</field>
<field name="response_ids" invisible="1"/>
</page>
<page name="rubric" string="Rubric">
<field name="rubric_ids">
<list string="Rubric">
<field name="criterian_name"/>
<field name="name"/>
</list>
<form>
<group>
<field name="criterian_name"/>
<field name="name"/>
</group>
<label for="criterian_ids"/>
<field name="criterian_ids">
<list string="Options" editable="top">
<field name="name"/>
<field name="option_desc"/>
<field name="option_points"/>
</list>
</field>
</form>
</field>
</page>
<page name="settings" string="Settings">
<group>
<field name="peer_assessment"/>
<field name="peer_limit"
required="peer_assessment == True"
invisible="peer_assessment == False"/>
</group>
</page>
</notebook>
</page>
</page>
</field>
</record>
<record id="ora_response_view_form" model="ir.ui.view">
<field name="name">ora.response.view.form</field>
<field name="model">ora.response</field>
<field name="arch" type="xml">
<form string="ORA Response" create="false">
<header>
<button name="action_mark_assessed" type="object" string="Mark Assessed" class="oe_highlight" invisible="state != 'submitted'"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group col="2">
<group>
<field name="slide_id" readonly="1"/>
<field name="create_date" readonly="1"/>
<field name="user_id" readonly="1"/>
<field name="submitted_date" readonly="0"/>
</group>
<group>
<field name="staff_id" readonly="state in ('assessed', 'inactive')"/>
<field name="xp_points"/>
</group>
</group>
<notebook>
<page name="prompts" string="Prompts">
<field name="user_response_line" mode="kanban" readonly="1">
<kanban default_order="question_sequence DESC">
<field name="question_sequence"/>
<field name="prompt_id"/>
<field name="create_date"/>
<field name="question_name"/>
<field name="response_type"/>
<field name="value_text_box"/>
<field name="value_richtext_box"/>
<templates>
<t t-name="card">
<div class="oe_module_vignette" style="width: 900px;">
<div class="oe_module_desc">
<div class="float-right"><field name="create_date"/></div>
<div>
<p>
<field name="question_name" widget="html"/>
</p>
<div><p><strong>Response</strong></p></div>
<t t-if="record.response_type.raw_value == 'text'">
<p style="overflow-wrap: break-word;">
<field name="value_text_box" style="white-space:break-spaces;" />
</p>
</t>
<t t-if="record.response_type.raw_value == 'rich_text'">
<p style="overflow-wrap: break-word;">
<field name="value_richtext_box" widget="html"/>
</p>
</t>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</page>
<page name="rubric" string="Rubric">
<field name="slide_rubric_staff_line" readonly="state in ('assessed', 'inactive')">
<list string="Rubric">
<field name="assess_type"/>
<field name="user_id"/>
<field name="create_date"/>
<field name="total_score"/>
<field name="state"/>
</list>
<form>
<div class="oe_title">
<h1>
<field name="assess_type"/>
</h1>
</div>
<group>
<group>
<field name='create_date'/>
<field name="total_score"/>
</group>
<group>
<field name="user_id"/>
<field name="state"/>
</group>
</group>
<separator string="Options"/>
<field name="option_ids">
<list editable="bottom">
<field name="criteria_id"/>
<field name="criteria_desc"/>
<field name="option_id" domain="[('rubric_id', '=', criteria_id)]"/>
<field name="criteria_option_desc"/>
<field name="criteria_option_point"/>
<field name="assess_explanation"/>
</list>
</field>
</form>
</field>
</page>
<page name="feedback" string="Feedback">
<group>
<field name="can_resubmit" readonly="state in ('assessed', 'inactive')"/>
</group>
<field name="feedback" readonly="state in ('assessed', 'inactive')" widget="html"/>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<record id="ora_response_view_list" model="ir.ui.view">
<field name="name">ora.response.view.list</field>
<field name="model">ora.response</field>
<field name="arch" type="xml">
<list string="ORA Response" decoration-muted="state == 'inactive'" create="0">
<field name="slide_id"/>
<field name="create_date"/>
<field name="xp_points"/>
<field name="user_id"/>
<field name="staff_id"/>
<field name="state"/>
</list>
</field>
</record>
<record id="ora_user_input_view_search" model="ir.ui.view">
<field name="name">ora.response.search</field>
<field name="model">ora.response</field>
<field name="arch" type="xml">
<search string="ORA Responses">
<field name="slide_id"/>
<field name="user_id"/>
<field name="staff_id"/>
<filter name="completed" string="Assessed" domain="[('state', '=', 'assessed')]"/>
<filter string="Submitted" name="submitted" domain="[('state', '=', 'submitted')]"/>
<filter string="Active" name="active" domain="[('state', '=', 'active')]"/>
<filter string="Inactive" name="inactive" domain="[('state', '=', 'inactive')]"/>
<group expand="0" string="Group By">
<filter name="state" string="Status" domain="[]" context="{'group_by': 'state'}"/>
<filter string="Staff" name="group_by_staff" domain="[]" context="{'group_by': 'staff_id'}"/>
<filter string="Users" name="group_by_user" domain="[]" context="{'group_by': 'user_id'}"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_ora_response">
<field name="name">ORA Responses</field>
<field name="res_model">ora.response</field>
<field name="view_mode">list,form</field>
<field name="view_id" ref="ora_response_view_list"></field>
<field name="search_view_id" ref="ora_user_input_view_search"/>
<field name="context">{'search_default_group_by_user': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
Nobody has replied to your prompts yet
</p>
</field>
</record>
<record model="ir.actions.act_window" id="action_ora_response_reporting">
<field name="name">ORA Responses</field>
<field name="res_model">ora.response</field>
<field name="view_mode">list</field>
<field name="view_id" ref="ora_response_view_list"></field>
<field name="search_view_id" ref="ora_user_input_view_search"/>
</record>
<menuitem name="ORA Responses"
id="menu_ora_responses"
action="action_ora_response"
parent="website_slides.website_slides_menu_courses"
sequence="10"/>
<menuitem name="ORA Responses"
id="menu_ora_responses_reporting"
action="action_ora_response_reporting"
parent="website_slides.website_slides_menu_report"
sequence="100"/>
</data>
</odoo>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="slide_fullscreen_sidebar_category_ora_inherit" inherit_id="website_slides.slide_fullscreen_sidebar_category">
<ul class="list-unstyled w-100 small fw-light" position="attributes">
<t t-if="'is_sequential' not in slide.fields_get()">
<attribute name="t-if">slide.prompt_ids or slide.sudo().slide_resource_ids or (slide.question_ids and not slide.slide_category =='quiz')</attribute>
</t>
</ul>
<xpath expr='//li[@class="o_wslides_fs_sidebar_list_item ps-0 mb-1"]' position="after">
<t t-if="'is_sequential' not in slide.fields_get()">
<li class="o_wslides_fs_sidebar_list_item ps-0 mb-1 ora_tab" t-if="slide.prompt_ids"
t-att-data-id="slide.id"
t-att-data-can-access="is_member"
t-att-data-name="slide.name"
t-att-data-type="slide.slide_type"
t-att-data-slug="slug(slide)"
t-att-data-is-ora="1"
t-att-data-is-member="is_member" style="box-shadow: none;">
<a t-if="can_access" class="o_wslides_fs_slide_quiz o_wslides_fs_slide_name" href="#" t-att-index="i">
<i class="fa fa-flag-checkered text-warning mr-2"/>
Assessment
</a>
<span t-else="" class="text-600">
<i class="fa fa-flag-checkered text-warning mr-2"/>
Assessment
</span>
</li>
</t>
</xpath>
</template>
</data>
</odoo>
+711
View File
@@ -0,0 +1,711 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="slide_content_detailed_inherit_ora" inherit_id="website_slides.slide_content_detailed">
<span t-attf-class="mx-2 my-1 badge #{'text-bg-success' if slide_completed else 'text-bg-info'}" position="attributes">
<attribute name="t-if">"slide.question_ids and (slide_completed or quiz_karma_gain) or slide.prompt_ids"</attribute>
</span>
<div id="about" position="attributes">
<attribute name="t-att-class">'tab-pane fade in show active'</attribute>
</div>
<div id="discuss" position="replace">
<div role="tabpanel" t-att-class="'tab-pane fade'" id="discuss">
<t t-call="portal.message_thread">
<t t-set="object" t-value="slide"/>
<t t-set="disable_composer" t-value="not (slide.channel_id.can_comment and slide.channel_id.allow_comment and slide.channel_id.channel_type == 'training')"/>
<t t-set="display_rating" t-value="False"/>
</t>
</div>
</div>
<div id="about" position="inside">
<style>
.question_text p {
display: inline;
}
</style>
<div class="o_wslides_js_ora_container o_user_response" id="lessonAssessment" t-att-data-slide-id="slide.id" name="slide" value="slide.id">
<t t-if="total_responses">
<t t-if="inactive_response">
<t t-foreach="inactive_response" t-as="response">
<div class="mt-3">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-light">
<t t-set="bio_popover_data">
<div class="d-flex o_wforum_bio_popover_wrap">
<img class="o_forum_avatar_big flex-shrink-0 mr-3" t-att-src="website.image_url(response.create_uid, 'image_128', '75x75')" alt="Avatar"/>
<div>
<h5 class="o_wforum_bio_popover_name mb-0" t-field="response.create_uid" t-options='{"widget": "contact", "country_image": True, "fields": ["name", "country_id"]}'/>
<span class="o_wforum_bio_popover_info" t-field="response.create_uid" t-options='{"widget": "contact", "UserBio": True, "badges": True, "fields": ["karma"]}'/>
</div>
</div>
</t>
<div class="row" style="line-height: 2.3em;">
<div class="d-flex align-items-start">
<div t-attf-class="o_wforum_author_box d-inline-flex #{display_info and 'o_show_info'} #{compact and 'o_compact align-items-center'} #{bio_popover_data and 'o_wforum_bio_popover'}"
t-att-data-content="bio_popover_data">
<div class="o_wforum_author_pic position-relative rounded-circle me-2">
<img t-attf-class="rounded-circle o_forum_avatar #{not display_info and 'shadow'}"
t-att-src="website.image_url(response.user_id, 'image_1920', '40x40')" alt="Avatar"/>
</div>
</div>
<span class="ml-2">Your response has been submitted successfully on
<t t-esc="response.submitted_date" t-options="{'widget': 'date','format': 'd MMM Y'}"/>
</span>
</div>
<div class="ml-auto">
<button t-attf-id="show_response-{{response.id}}"
t-attf-class="btn btn-primary custom_response"
t-attf-data-bs-target="#collapse_div_{{response.id}}"
t-attf-aria-controls="collapse_div"
data-bs-toggle="collapse"
t-attf-style="float:right;position:relative;"
type="button">
<span id='response_button_text'>View Response</span>
</button>
</div>
</div>
</div>
</div>
<div t-att-id="'collapse_div_%s' % response.id" style="padding-top:0;padding-bottom:0;"
class="collapse custom_collapse list-group-item" t-if="slide.slide_type != 'certification'">
<t t-if="slide.prompt_ids">
<t t-call="website_ora_elearning.lesson_inactive_response_prompts"/>
</t>
</div>
<t t-if="response.feedback">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-light">
<t t-set="bio_popover_data">
<div class="d-flex o_wforum_bio_popover_wrap">
<img class="o_forum_avatar_big flex-shrink-0 mr-3" t-att-src="website.image_url(response.staff_id, 'image_128', '75x75')" alt="Avatar"/>
<div>
<h5 class="o_wforum_bio_popover_name mb-0" t-field="response.staff_id" t-options='{"widget": "contact", "country_image": True, "fields": ["name", "country_id"]}'/>
<span class="o_wforum_bio_popover_info" t-field="response.staff_id" t-options='{"widget": "contact", "UserBio": True, "badges": True, "fields": ["karma"]}'/>
</div>
</div>
</t>
<div class="row">
<div t-attf-class="o_wforum_author_box d-inline-flex #{display_info and 'o_show_info'} #{compact and 'o_compact align-items-center'} #{bio_popover_data and 'o_wforum_bio_popover'}"
t-att-data-content="bio_popover_data">
<div class="o_wforum_author_pic position-relative rounded-circle me-2">
<img t-attf-class="rounded-circle o_forum_avatar #{not display_info and 'shadow'}"
t-att-src="website.image_url(response.staff_id, 'image_1920', '40x40')" alt="Avatar"/>
</div>
</div>
<div class="col">
<t t-out="response.feedback"/>
</div>
</div>
</div>
</t>
</t>
</t>
<t t-if="assessed_response">
<t t-foreach="assessed_response" t-as="response">
<div class="mt-3">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-light">
<t t-set="bio_popover_data">
<div class="d-flex o_wforum_bio_popover_wrap">
<img class="o_forum_avatar_big flex-shrink-0 mr-3" t-att-src="website.image_url(response.create_uid, 'image_128', '75x75')" alt="Avatar"/>
<div>
<h5 class="o_wforum_bio_popover_name mb-0" t-field="response.create_uid" t-options='{"widget": "contact", "country_image": True, "fields": ["name", "country_id"]}'/>
<span class="o_wforum_bio_popover_info" t-field="response.create_uid" t-options='{"widget": "contact", "UserBio": True, "badges": True, "fields": ["karma"]}'/>
</div>
</div>
</t>
<div class="row" style="line-height: 2.3em;">
<div class="d-flex align-items-center">
<div t-attf-class="o_wforum_author_box d-inline-flex #{display_info and 'o_show_info'} #{compact and 'o_compact align-items-center'} #{bio_popover_data and 'o_wforum_bio_popover'}"
t-att-data-content="bio_popover_data">
<div class="o_wforum_author_pic position-relative rounded-circle me-2">
<img t-attf-class="rounded-circle o_forum_avatar #{not display_info and 'shadow'}"
t-att-src="website.image_url(response.user_id, 'image_1920', '40x40')" alt="Avatar"/>
</div>
</div>
<span class="ml-2">Your response has been assessed.</span>
</div>
<div class="ml-auto">
<button t-attf-id="show_response-{{response.id}}"
t-attf-class="btn btn-primary custom_response"
t-attf-data-bs-target="#collapse_div_{{response.id}}"
t-attf-aria-controls="collapse_div"
data-bs-toggle="collapse"
t-attf-style="float:right;position:relative;"
type="button">
<span id='response_button_text'>View Response</span>
</button>
</div>
</div>
</div>
</div>
<div t-att-id="'collapse_div_%s' % response.id" style="padding-top:0;padding-bottom:0;"
class="collapse custom_collapse list-group-item" t-if="slide.slide_type != 'certification'">
<t t-if="slide.prompt_ids">
<t t-call="website_ora_elearning.lesson_assessed_response_prompts"/>
</t>
</div>
<t t-if="response.feedback">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-light">
<t t-set="bio_popover_data">
<div class="d-flex o_wforum_bio_popover_wrap">
<img class="o_forum_avatar_big flex-shrink-0 mr-3" t-att-src="website.image_url(response.staff_id, 'image_128', '75x75')" alt="Avatar"/>
<div>
<h5 class="o_wforum_bio_popover_name mb-0" t-field="response.staff_id" t-options='{"widget": "contact", "country_image": True, "fields": ["name", "country_id"]}'/>
<span class="o_wforum_bio_popover_info" t-field="response.staff_id" t-options='{"widget": "contact", "UserBio": True, "badges": True, "fields": ["karma"]}'/>
</div>
</div>
</t>
<div class="row">
<div t-attf-class="o_wforum_author_box d-inline-flex #{display_info and 'o_show_info'} #{compact and 'o_compact align-items-center'} #{bio_popover_data and 'o_wforum_bio_popover'}"
t-att-data-content="bio_popover_data">
<div class="o_wforum_author_pic position-relative rounded-circle me-2">
<img t-attf-class="rounded-circle o_forum_avatar #{not display_info and 'shadow'}"
t-att-src="website.image_url(response.staff_id, 'image_1920', '40x40')" alt="Avatar"/>
</div>
</div>
<div class="col">
<t t-out="response.feedback"/>
</div>
</div>
</div>
</t>
</t>
</t>
<t t-if="submitted_response">
<t t-foreach="submitted_response" t-as="response">
<div class="mt-3">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-light">
<t t-set="bio_popover_data">
<div class="d-flex o_wforum_bio_popover_wrap">
<img class="o_forum_avatar_big flex-shrink-0 mr-3" t-att-src="website.image_url(response.create_uid, 'image_128', '75x75')" alt="Avatar"/>
<div>
<h5 class="o_wforum_bio_popover_name mb-0" t-field="response.create_uid" t-options='{"widget": "contact", "country_image": True, "fields": ["name", "country_id"]}'/>
<span class="o_wforum_bio_popover_info" t-field="response.create_uid" t-options='{"widget": "contact", "UserBio": True, "badges": True, "fields": ["karma"]}'/>
</div>
</div>
</t>
<div class="row" style="line-height: 2.3em;">
<div class="d-flex align-itmes-start">
<div t-attf-class="o_wforum_author_box d-inline-flex #{display_info and 'o_show_info'} #{compact and 'o_compact align-items-center'} #{bio_popover_data and 'o_wforum_bio_popover'}"
t-att-data-content="bio_popover_data">
<div class="o_wforum_author_pic position-relative rounded-circle me-2">
<img t-attf-class="rounded-circle o_forum_avatar #{not display_info and 'shadow'}"
t-att-src="website.image_url(response.user_id, 'image_1920', '40x40')" alt="Avatar"/>
</div>
</div>
<span class="ml-2">Your response has been submitted successfully on
<t t-esc="response.submitted_date" t-options="{'widget': 'date','format': 'd MMM Y'}"/>
</span>
</div>
<div class="ml-auto">
<button t-attf-id="show_response-{{response.id}}"
t-attf-class="btn btn-primary custom_response"
t-attf-data-bs-target="#collapse_div_{{response.id}}"
t-attf-aria-controls="collapse_div"
data-bs-toggle="collapse"
t-attf-style="float:right;position:relative;"
type="button">
<span id='response_button_text'>View Response</span>
</button>
</div>
</div>
</div>
</div>
<div t-att-id="'collapse_div_%s' % response.id" style="padding-top:0;padding-bottom:0;"
class="collapse custom_collapse list-group-item" t-if="slide.slide_type != 'certification'">
<t t-if="slide.prompt_ids">
<t t-call="website_ora_elearning.lesson_submitted_response_prompts"/>
</t>
</div>
<t t-if="response.feedback">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-light">
<t t-set="bio_popover_data">
<div class="d-flex o_wforum_bio_popover_wrap">
<img class="o_forum_avatar_big flex-shrink-0 mr-3" t-att-src="website.image_url(response.staff_id, 'image_128', '75x75')" alt="Avatar"/>
<div>
<h5 class="o_wforum_bio_popover_name mb-0" t-field="response.staff_id" t-options='{"widget": "contact", "country_image": True, "fields": ["name", "country_id"]}'/>
<span class="o_wforum_bio_popover_info" t-field="response.staff_id" t-options='{"widget": "contact", "UserBio": True, "badges": True, "fields": ["karma"]}'/>
</div>
</div>
</t>
<div class="row">
<div t-attf-class="o_wforum_author_box d-inline-flex #{display_info and 'o_show_info'} #{compact and 'o_compact align-items-center'} #{bio_popover_data and 'o_wforum_bio_popover'}"
t-att-data-content="bio_popover_data">
<div class="o_wforum_author_pic position-relative rounded-circle me-2">
<img t-attf-class="rounded-circle o_forum_avatar #{not display_info and 'shadow'}"
t-att-src="website.image_url(response.staff_id, 'image_1920', '40x40')" alt="Avatar"/>
</div>
</div>
<div class="col">
<t t-out="response.feedback"/>
</div>
</div>
<t t-if="response.can_resubmit">
<form t-attf-action="/ora/response/save" method="post" role="form" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<input type="hidden" name="slide_id" t-att-value="slide.id"/>
<div>
<input type="hidden" name="response_id" t-att-value="response.id"/>
<button class="btn btn-primary o_slide_submit_btn" id="submit_response_fresh" type="submit"
style="margin-top: 10px;" name="submit" value="resubmit_fresh">
<span>Resubmit Fresh</span>
</button>
<button class="btn btn-primary o_slide_submit_btn" id="submit_response_fresh" type="submit"
style="margin-right:10px;margin-top: 10px;" name="submit" value="resubmit_copy">
<span>Resubmit Copy</span>
</button>
</div>
</form>
</t>
</div>
</t>
</t>
</t>
<form t-attf-action="/ora/response/save" id="ora_form" role="form" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<t t-if="active_response">
<t t-foreach="active_response" t-as="response">
<div t-if="slide.slide_type != 'certification'">
<t t-if="slide.prompt_ids">
<t t-call="website_ora_elearning.lesson_active_response_prompts"/>
</t>
</div>
<div class="mt-3" style="margin-left:13px;">
<button t-att-class="'o_wslides_js_lesson_ora_submit btn btn-primary %s' % ('d-none' if not (slide.channel_id.is_member) else '')" type="submit" name="submit" value="save">
<span>Save Your Progress</span>
</button>
<button t-att-class="'o_wslides_js_lesson_ora_submit btn btn-primary o_slide_submit_btn %s' % ('d-none' if not (slide.channel_id.is_member) else '')" style="float:right;" type="submit" name="submit" value="submit">
<span>Submit</span>
</button>
</div>
</t>
</t>
</form>
</t>
<t t-if="not total_responses and slide.prompt_ids">
<form t-attf-action="/ora/response/save" method="post" role="form" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div t-if="slide.slide_type != 'certification'">
<t t-if="slide.prompt_ids">
<t t-call="website_ora_elearning.lesson_content_prompts"/>
</t>
</div>
<div class="mt-3" style="margin-left:13px;">
<button t-att-class="'o_wslides_js_lesson_ora_submit btn btn-primary o_slide_submit_btn %s' % ('d-none' if not (slide.channel_id.is_member) else '')" type="submit" name="submit" value="save">
<span>Save Your Progress</span>
</button>
<button t-att-class="'o_wslides_js_lesson_ora_submit btn btn-primary o_slide_submit_btn %s' % ('d-none' if not (slide.channel_id.is_member) else '')" style="float:right;" type="submit" name="submit" value="submit">
<span>Submit</span>
</button>
</div>
</form>
</t>
</div>
</div>
<ul role="tablist" position="inside">
<t t-if="slide.peer_assessment">
<li class="nav-item">
<a href="#peer_assessment" aria-controls="peer_assessment" class="nav-link" role="tab" data-bs-toggle="tab">
<i class="fa fa-users"></i> Peer Assessment
</a>
</li>
</t>
</ul>
<div id="statistic" position="after">
<div role="tabpanel" class="tab-pane fade" id="peer_assessment">
<t t-if="peer_responses">
<div>
<t t-call="website_ora_elearning.lesson_content_peer_responses"/>
</div>
</t>
<t t-if="not peer_responses">
<h2>There is no peer responses to assess.</h2>
</t>
</div>
</div>
</template>
<template id="lesson_inactive_response_prompts">
<div class="o_wslides_js_lesson_ora" id="lessonORA" style="margin-left:13px;">
<t t-foreach="slide_prompts" t-as="prompt">
<t t-call="website_ora_elearning.lesson_content_quiz_prompt_inactive"/>
</t>
<input type="hidden" name="slide_id" t-att-value="slide.id" />
</div>
</template>
<template id="lesson_assessed_response_prompts">
<div class="o_wslides_js_lesson_ora" id="lessonORA" style="margin-left:13px;">
<t t-foreach="slide_prompts" t-as="prompt">
<t t-call="website_ora_elearning.lesson_content_quiz_prompt_assessed"/>
</t>
<input type="hidden" name="slide_id" t-att-value="slide.id" />
<h4 style="text-align: center;">
<span style="font-weight: bold;">Assessment</span>
</h4>
<hr style="height:1px;border-width:0;color:gray;background-color:gray"/>
<div style="overflow: auto;">
<t t-foreach="response.slide_rubric_staff_line" t-as="line">
<t t-if="line.assess_type == 'staff'">
<table class="table-bordered table" style="table-layout: auto;">
<t t-foreach="line.option_ids" t-as="res_rubric">
<tr>
<td style="text-align: center;vertical-align: middle;min-width:120px;">
<strong><span t-esc="res_rubric.criteria_id.criterian_name"/></strong>
</td>
<t t-foreach="slide.rubric_ids" t-as="rubric">
<t t-if="res_rubric.criteria_id.id == rubric.id">
<t t-foreach="rubric.criterian_ids" t-as="option">
<td t-att-style="'background-color:%s; overflow-wrap: anywhere;
text-align: center;vertical-align: middle;min-width:120px;' %
('#d9edf7' if res_rubric.option_id.name == option.name else '')">
<span t-esc="option.name"/>
<t t-if="res_rubric.option_id.name == option.name">
(<span style="margin-right:2px;" t-esc="res_rubric.criteria_option_point"></span>points)
<br/>
<span t-esc="res_rubric.assess_explanation" style="font-size:12px;"/>
</t>
</td>
</t>
</t>
</t>
</tr>
</t>
</table>
</t>
</t>
</div>
<hr style="height:1px;border-width:0;color:gray;background-color:gray"/>
</div>
</template>
<template id="lesson_submitted_response_prompts">
<div class="o_wslides_js_lesson_ora" id="lessonORA" style="margin-left:13px;">
<t t-foreach="slide_prompts" t-as="prompt">
<t t-call="website_ora_elearning.lesson_content_quiz_prompt_submitted"/>
</t>
<input type="hidden" name="slide_id" t-att-value="slide.id" />
</div>
</template>
<template id="lesson_active_response_prompts">
<div class="o_wslides_js_lesson_ora" id="lessonORA" style="margin-left:13px;">
<t t-foreach="slide_prompts" t-as="prompt">
<t t-call="website_ora_elearning.lesson_content_quiz_prompt_active"/>
</t>
<input type="hidden" name="slide_id" t-att-value="slide.id" />
</div>
</template>
<template id="lesson_content_prompts" name="Lesson: ORA specific content">
<div class="o_wslides_js_lesson_ora" id="lessonORA" style="margin-left:13px;">
<t t-foreach="slide_prompts" t-as="prompt">
<t t-call="website_ora_elearning.lesson_content_quiz_prompt"/>
</t>
<input type="hidden" name="slide_id" t-att-value="slide.id" />
</div>
</template>
<template id="lesson_content_quiz_prompt" name="Lesson: ORA prompt template">
<div t-att-class="'o_wslides_js_lesson_quiz_question mt-3 %s' % ('disabled' if not (slide.channel_id.is_member) else '')"
t-att-data-question-id="prompt['id']" t-att-data-title="prompt['question']">
<div class="row d-flex mb-2">
<div class="d-flex align-content-start">
<small class="text-muted">
<i class="fa fa-quora me-2"></i>
</small>
<span class="question_text ml-1" style="line-height:1;" t-out="prompt['question']"/>
</div>
</div>
<div class="list-group">
<t t-if="prompt['response_type'] == 'text'">
<span class="input-group-text">Your Response</span>
<div class="input-group" style="text-align: justify;">
<textarea class="form-control" t-att-name="prompt['id']"></textarea>
</div>
</t>
<t t-if="prompt['response_type'] == 'rich_text'">
<span class="input-group-text">Your Response</span>
<div>
<textarea class="form-control o_wysiwyg_loader" t-att-name="prompt['id']"></textarea>
</div>
</t>
<t t-if="prompt['name']">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-info">
<i class="fa fa-info-circle"/>
<span class="o_wslides_quiz_answer_comment" t-esc="prompt['name']"/>
</div>
</t>
</div>
</div>
</template>
<template id="lesson_content_quiz_prompt_active" name="Lesson: ORA prompt template">
<div t-att-class="'o_wslides_js_lesson_quiz_question mt-3 %s' % ('disabled' if not (slide.channel_id.is_member) else '')"
t-att-data-question-id="prompt['id']" t-att-data-title="prompt['question']">
<div class="row d-flex mb-2">
<div class="d-flex align-content-start" style="display:inline-flex;">
<small class="text-muted">
<i class="fa fa-quora me-2"></i>
</small>
<span class="question_text ml-2" style="line-height:1.2;flex-direction:column;display:inline-flex;" t-out="prompt['question']"/>
</div>
</div>
<div class="list-group">
<t t-foreach="response.user_response_line" t-as="user_input">
<t t-if="user_input.prompt_id.id == prompt['id']">
<t t-if="prompt['response_type'] == 'text'">
<span class="input-group-text">Your Response</span>
<div class="input-group" style="text-align: justify;">
<textarea t-attf-class="form-control response_div_#{prompt['id']}" t-att-name="prompt['id']" required="required"><t t-esc="user_input.value_text_box"/></textarea>
</div>
</t>
<t t-if="prompt['response_type'] == 'rich_text'">
<span class="input-group-text">Your Response</span>
<div t-attf-class="response_div_#{prompt['id']}">
<textarea class="form-control o_wysiwyg_loader" t-att-name="prompt['id']" required="required"><t t-esc="user_input.value_richtext_box"/></textarea>
</div>
</t>
</t>
</t>
<t t-if="prompt['name']">
<div class="o_wslides_quiz_answer_info list-group-item list-group-item-info">
<i class="fa fa-info-circle"/>
<span class="o_wslides_quiz_answer_comment" t-esc="prompt['name']"/>
</div>
</t>
</div>
</div>
</template>
<template id="lesson_content_quiz_prompt_submitted">
<div t-att-class="'o_wslides_js_lesson_quiz_question mt-3 %s' % ('disabled' if not (slide.channel_id.is_member) else '')"
t-att-data-question-id="prompt['id']" t-att-data-title="prompt['question']">
<div class="row d-flex mb-2">
<div class="d-flex align-content-start" style="display:inline-flex;">
<small class="text-muted">
<i class="fa fa-quora me-2"></i>
</small>
<span class="question_text ml-2" style="line-height:1.2;flex-direction:column;display:inline-flex;" t-out="prompt['question']"/>
</div>
</div>
<div class="list-group flex-row">
<t t-foreach="response.user_response_line" t-as="user_input">
<t t-if="user_input.prompt_id.id == prompt['id']">
<t t-if="prompt['response_type'] == 'text'">
<small class="text-muted">
<i class="fa fa-font me-2"></i>
</small>
<div class="input-group ml-1" style="line-height:1">
<t t-esc="user_input.value_text_box"/>
</div>
</t>
<t t-if="prompt['response_type'] == 'rich_text'">
<small class="text-muted">
<i class="fa fa-font me-2"></i>
</small>
<div class="ml-1" style="line-height:1">
<span t-field="user_input.value_richtext_box"/>
</div>
</t>
</t>
</t>
</div>
<hr style="height:1px;border-width:0;color:gray;background-color:gray"/>
</div>
</template>
<template id="lesson_content_quiz_prompt_inactive" name="Lesson: ORA prompt template">
<div t-att-class="'o_wslides_js_lesson_quiz_question mt-3 %s' % ('disabled' if not (slide.channel_id.is_member) else '')"
t-att-data-question-id="prompt['id']" t-att-data-title="prompt['question']">
<div class="row d-flex mb-2">
<div class="d-flex align-content-start" style="display:inline-flex;">
<small class="text-muted">
<i class="fa fa-quora me-2"></i>
</small>
<span class="question_text ml-2" style="line-height:1.2;flex-direction:column;display:inline-flex;" t-out="prompt['question']"/>
</div>
</div>
<div class="list-group flex-row">
<t t-foreach="response.user_response_line" t-as="user_input">
<t t-if="user_input.prompt_id.id == prompt['id']">
<t t-if="prompt['response_type'] == 'text'">
<small class="text-muted">
<i class="fa fa-font me-2"></i>
</small>
<div class="input-group ml-1" style="line-height:1">
<t t-esc="user_input.value_text_box"/>
</div>
</t>
<t t-if="prompt['response_type'] == 'rich_text'">
<small class="text-muted">
<i class="fa fa-font me-2"></i>
</small>
<div class="ml-1" style="line-height:1">
<span t-field="user_input.value_richtext_box"/>
</div>
</t>
</t>
</t>
</div>
<hr style="height:1px;border-width:0;color:gray;background-color:gray"/>
</div>
</template>
<template id="lesson_content_quiz_prompt_assessed" name="Lesson: ORA prompt template">
<div t-att-class="'o_wslides_js_lesson_quiz_question mt-3 %s' % ('disabled' if not (slide.channel_id.is_member) else '')"
t-att-data-question-id="prompt['id']" t-att-data-title="prompt['question']">
<div class="row d-flex mb-2">
<div class="d-flex align-content-start" style="display:inline-flex;">
<small class="text-muted">
<i class="fa fa-quora me-2"></i>
</small>
<span class="question_text ml-2" style="line-height:1.2;flex-direction:column;display:inline-flex;" t-raw="prompt['question']"/>
</div>
</div>
<div class="list-group flex-row">
<t t-foreach="response.user_response_line" t-as="user_input">
<t t-if="user_input.prompt_id.id == prompt['id']">
<t t-if="prompt['response_type'] == 'text'">
<small class="text-muted">
<i class="fa fa-font me-2"></i>
</small>
<div class="input-group ml-1" style="line-height:1">
<t t-esc="user_input.value_text_box"/>
</div>
</t>
<t t-if="prompt['response_type'] == 'rich_text'">
<small class="text-muted">
<i class="fa fa-font me-2"></i>
</small>
<div class="ml-1" style="line-height:1">
<span t-field="user_input.value_richtext_box"/>
</div>
</t>
</t>
</t>
</div>
<hr style="height:1px;border-width:0;color:gray;background-color:gray"/>
</div>
</template>
<template inherit_id="website_slides.slide_aside_training_category" id="slide_aside_training_category_inherited">
<span class="align-items-end" position="attributes">
<t t-if="'is_sequential' not in aside_slide.fields_get()">
<attribute name="t-if" separator=" or " add="aside_slide.prompt_ids"/>
</t>
</span>
<ul class="o_wslides_lesson_aside_list_links list-group mb-1 list-unstyled fw-light" position="attributes">
<t t-if="'is_sequential' not in aside_slide.fields_get()">
<attribute name="t-if">aside_slide.prompt_ids or aside_slide.sudo().slide_resource_ids or aside_slide.question_ids</attribute>
</t>
</ul>
<ul class="o_wslides_lesson_aside_list_links list-group mb-1 list-unstyled fw-light" position="inside">
<t t-if="'is_sequential' not in aside_slide.fields_get()">
<li class="ps-4">
<a t-if="can_access and aside_slide.prompt_ids" t-att-href="'/slides/slide/%s#lessonAssessment' % (slug(aside_slide))" class="o_wslides_lesson_aside_list_link text-decoration-none small text-600">
<i class="fa fa-flag text-warning"/> Assessment
</a>
<span t-elif="not can_access and aside_slide.prompt_ids"
class="o_wslides_lesson_aside_list_link text-decoration-none small text-600 text-muted">
<i class="fa fa-flag text-warning"/> Assessment
</span>
</li>
</t>
</ul>
</template>
<template id="lesson_content_peer_responses">
<div class="o_wslides_js_lesson_ora" id="peer">
<t t-set="count" t-value="0"/>
<t t-foreach="peer_responses" t-as="response">
<t t-set="count" t-value="count + 1"/>
<t t-set="submitted_date" t-value=""/>
<div class="mt-3 list-group-item list-group-item-light d-flex flex-wrap justify-content-between align-items-center" style="line-height: 2.5em;">
<span>Learner Response <t t-esc="count"/>
<t t-set="submitted_date" t-value="response.slide_rubric_staff_line.filtered(lambda x: x.user_id == user)[-1].submitted_date if response.slide_rubric_staff_line.filtered(lambda x: x.user_id == user) else None"/>
<t t-if="submitted_date"> assessed on <t t-esc="submitted_date" t-options="{'widget': 'date','format': 'd MMM Y'}"/></t>
</span>
<button t-attf-id="show_response-{{response.id}}"
t-attf-class="btn btn-primary custom_response"
t-attf-data-bs-target="#collapse_div_{{response.id}}"
t-attf-aria-controls="collapse_div"
data-bs-toggle="collapse"
t-attf-style="float:right;position:relative;"
type="button">
<span id='response_button_text'>View Response</span>
</button>
</div>
<t t-call="website_ora_elearning.lesson_peer_responses_cards"/>
</t>
<input type="hidden" name="slide_id" t-att-value="slide.id" />
</div>
</template>
<template id="lesson_peer_responses_cards">
<div t-att-id="'collapse_div_%s' % response.id" class="collapse custom_collapse list-group-item"
style="padding-top:0;padding-bottom:0;">
<form t-attf-action="/submit/peer/response" method="post" role="form" enctype="multipart/form-data">
<input type="hidden" name="response_id" t-att-value="response.id"/>
<t t-foreach="response.user_response_line" t-as="user_response">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<t t-set="prompt" t-value="{'id': user_response.prompt_id.id,'question':user_response.question_name,'response_type':user_response.response_type}"/>
<t t-call="website_ora_elearning.lesson_content_quiz_prompt_assessed"/>
<input type="hidden" name="slide_id" t-att-value="slide.id"/>
</t>
<t t-foreach="response.slide_rubric_staff_line" t-as="staff_line">
<t t-if="staff_line.user_id == user and staff_line.state == 'in_progress'">
<h3>Complete the rubric and submit the assessment.</h3>
<div>
<t t-foreach="rubric_ids" t-as="rubric">
<ul class="list-group">
<li class="list-group-item mb-3">
<div class="mb-3">
<h4><t t-esc="rubric.criterian_name"/></h4>
<span t-esc="rubric.name"/>
</div>
<div class="o_select_option mb-3 row" style="margin: auto;">
<select class="form-control" t-att-name="'options_%s_%s'% (response.id, rubric.id)" t-att-id="'options_%s_%s'% (response.id, rubric.id)"
style="width:auto;margin-right: 20px;margin-bottom: 20px;">
<t t-foreach="rubric.criterian_ids" t-as="option">
<option t-att-value="option.id">
<t t-esc="option.name"/>
</option>
</t>
</select>
<textarea class="form-control" t-att-name="'exp_%s_%s'% (response.id, rubric.id)" required="required" placeholder="Assessment Explanation"
style="width: 600px;"/>
</div>
</li>
</ul>
</t>
<button class="btn btn-primary" t-att-id="'submit_peer_response_%s' % (response.id)" type="submit"
style="margin-top: 10px;margin-bottom:10px;margin-left: auto;display: table;" name="submit" value="peer_response">
<span>Submit</span>
</button>
</div>
</t>
<t t-if="staff_line.user_id == user and staff_line.state == 'completed'">
<h3 style="text-align: center;">
<span style="font-weight: bold;">Assessment</span>
</h3>
<hr style="height:1px;border-width:0;color:gray;background-color:gray"/>
<div style="overflow: auto;">
<table class="table-bordered table" style="table-layout: auto;">
<t t-foreach="staff_line.option_ids" t-as="res_rubric">
<tr>
<td style="text-align: center;vertical-align: middle;min-width:120px;">
<strong><span t-esc="res_rubric.criteria_id.criterian_name"/></strong>
</td>
<t t-foreach="slide.rubric_ids" t-as="rubric">
<t t-if="res_rubric.criteria_id.id == rubric.id">
<t t-foreach="rubric.criterian_ids" t-as="option">
<td t-att-style="'background-color:%s; overflow-wrap: anywhere;
text-align: center;vertical-align: middle;min-width:120px;'
% ('#d9edf7' if res_rubric.option_id.name == option.name else '')">
<span t-esc="option.name"/>
<t t-if="res_rubric.option_id.name == option.name">
(<span style="margin-right:2px;" t-esc="res_rubric.criteria_option_point"></span>points)
<br/>
<span t-esc="res_rubric.assess_explanation" style="font-size:12px;"/>
</t>
</td>
</t>
</t>
</t>
</tr>
</t>
</table>
</div>
</t>
</t>
</form>
</div>
</template>
</data>
</odoo>
+5
View File
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
from . import controllers
+37
View File
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
{
'name': 'eLearning with Scorm',
'version': '18.3',
'sequence': 10,
'summary': 'Manage and publish an eLearning platform',
'website': 'https://www.manprax.com',
'author': 'ManpraX Software LLP',
'category': 'Website/eLearning',
'description': """
Create Online Courses Using Scorm
""",
'depends': [
'website_slides',
],
'data': [
'security/ir.model.access.csv',
'views/res_config_settings_views.xml',
'views/slide_slide_views.xml',
'views/templates.xml',
],
'assets': {
'web.assets_frontend': [
'website_scorm_elearning/static/src/js/slides_course.js',
'website_scorm_elearning/static/src/js/slides_course_fullscreen_player.js',
'website_scorm_elearning/static/src/xml/website_slides_fullscreen.xml',
],
'web.assets_backend': [
'website_scorm_elearning/static/src/scss/slide_slide.scss',
]
},
'external_dependencies': {'python': ['boto3']},
'images': ["static/description/images/scorm_banner.png"],
'installable': True,
'application': True,
'license': 'AGPL-3',
}
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import main
@@ -0,0 +1,84 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http
from odoo.http import request
from odoo.addons.website_slides.controllers.main import WebsiteSlides
class WebsiteSlidesScorm(WebsiteSlides):
@http.route('/slides/slide/get_scorm_version', type="json", auth="public", website=True)
def get_scorm_version(self, slide_id):
slide_dict = self._fetch_slide(slide_id)
return {
'scorm_version': slide_dict['slide'].scorm_version
}
@http.route('/slide/slide/set_session_info', type='json', auth="user", website=True)
def _set_session_info(self, slide_id, element, value):
slide_partner_sudo = request.env['slide.slide.partner'].sudo()
slide_id = request.env['slide.slide'].browse(slide_id)
slide_partner_id = slide_partner_sudo.search([
('slide_id', '=', slide_id.id),
('partner_id', '=', request.env.user.partner_id.id)], limit=1)
if not slide_partner_id:
slide_partner_id = slide_partner_sudo.create({
'slide_id': slide_id.id,
'channel_id': slide_id.channel_id.id,
'partner_id': request.env.user.partner_id.id
})
session_element_id = slide_partner_id.lms_session_info_ids.filtered(lambda l: l.name == element)
if session_element_id:
session_element_id.value = value
else:
request.env['lms.session.info'].create({
'name': element,
'value': value,
'slide_partner_id': slide_partner_id.id
})
@http.route('/slide/slide/get_session_info', type='json', auth="user", website=True)
def _get_session_info(self, slide_id):
slide_partner_sudo = request.env['slide.slide.partner'].sudo()
slide_id = request.env['slide.slide'].browse(slide_id)
slide_partner_id = slide_partner_sudo.search([
('slide_id', '=', slide_id.id),
('partner_id', '=', request.env.user.partner_id.id)], limit=1)
session_info_ids = request.env['lms.session.info'].search([
('slide_partner_id', '=', slide_partner_id.id)
])
values = {}
for session_info in session_info_ids:
values[session_info.name] = session_info.value
return values
@http.route('/slides/slide/set_completed_scorm', website=True, type="json", auth="public")
def slide_set_completed_scorm(self, slide_id, completion_type):
if request.website.is_public_user():
return {'error': 'public_user'}
fetch_res = self._fetch_slide(slide_id)
slide = fetch_res['slide']
if fetch_res.get('error'):
return fetch_res
if slide.website_published and slide.channel_id.is_member:
slide.action_mark_completed()
self._set_karma_points(fetch_res['slide'], completion_type)
return {
'channel_completion': fetch_res['slide'].channel_id.completion
}
def _set_karma_points(self, slide_id, completion_type):
slide_partner_sudo = request.env['slide.slide.partner'].sudo()
slide_partner_id = slide_partner_sudo.search([
('slide_id', '=', slide_id.id),
('partner_id', '=', request.env.user.partner_id.id)], limit=1)
if slide_partner_id:
user_sudo = request.env['res.users'].sudo()
user_id = user_sudo.search([('partner_id', '=', slide_partner_id.partner_id.id)], limit=1)
if completion_type == 'passed':
slide_partner_id.lms_scorm_karma = slide_id.scorm_passed_xp
user_id.karma = slide_id.scorm_passed_xp
if completion_type == 'completed':
slide_partner_id.lms_scorm_karma = slide_id.scorm_completed_xp
user_id.karma = slide_id.scorm_passed_xp
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import res_config_settings
from . import slide_slide
@@ -0,0 +1,66 @@
from odoo import models, fields, api, _
import boto3
from botocore.exceptions import NoCredentialsError, PartialCredentialsError, ClientError
from odoo.exceptions import UserError
class ResConfigSettings(models.TransientModel):
"""
Configure the access credentials
"""
_inherit = 'res.config.settings'
amazon_access_key = fields.Char(string='Amazon S3 Access Key', copy=False,
config_parameter='amazon_s3_connector.amazon_access_key',
help='Enter your Amazon S3 Access Key here.')
amazon_secret_key = fields.Char(string='Amazon S3 Secret key',
config_parameter='amazon_s3_connector.amazon_secret_key',
help='Enter your Amazon S3 Secret Key here.')
amazon_bucket_name = fields.Char(string='Folder ID',
config_parameter='amazon_s3_connector.amazon_bucket_name',
help='Enter the name of your Amazon S3 Bucket here.')
is_amazon_connector = fields.Boolean(
config_parameter='amazon_s3_connector.amazon_connector', default=False,
help='Enable or disable the Amazon S3 connector.')
def action_test_amazon_s3_connection(self):
"""
Test the S3 connection using the provided credentials.
"""
self.ensure_one()
amazon_access_key = self.amazon_access_key
amazon_secret_key = self.amazon_secret_key
bucket_name = self.amazon_bucket_name
if not amazon_access_key or not amazon_secret_key or not bucket_name:
raise UserError(_("Amazon S3 credentials or bucket name are missing."))
try:
s3_client = boto3.client(
's3',
aws_access_key_id=amazon_access_key,
aws_secret_access_key=amazon_secret_key
)
s3_client.head_bucket(Bucket=bucket_name)
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'title': _("Success"),
'type': 'success',
'message': _("Connection Successful"),
'sticky': False,
},
}
except Exception as e:
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'title': _("Error Occured"),
'type': 'danger',
# 'message': _("Unexpected error: %s") % str(e),
'message': _("Check Credentials Again"),
'sticky': False,
},
}
@@ -0,0 +1,326 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import os
import json
import base64
import zipfile
import tempfile
import shutil
import urllib.parse
import boto3
from io import BytesIO
import logging
_logger = logging.getLogger(__name__)
from werkzeug import urls
from mimetypes import guess_type
import xml.etree.ElementTree as ET
from odoo.http import request
from markupsafe import Markup
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from urllib.parse import quote
class SlidePartnerRelation(models.Model):
_inherit = 'slide.slide.partner'
lms_session_info_ids = fields.One2many('lms.session.info', 'slide_partner_id', 'LMS Session Info')
lms_scorm_karma = fields.Integer("Scorm Karma")
class LmsSessionInfo(models.Model):
_name = 'lms.session.info'
_description = 'Lms Session Info'
name = fields.Char("Name")
value = fields.Char("Value")
slide_partner_id = fields.Many2one('slide.slide.partner')
class Channel(models.Model):
""" A channel is a container of slides. """
_inherit = 'slide.channel'
nbr_scorm = fields.Integer("Number of Scorms", compute="_compute_slides_statistics", store=True)
@api.depends('slide_ids.slide_category', 'slide_ids.is_published', 'slide_ids.completion_time',
'slide_ids.likes', 'slide_ids.dislikes', 'slide_ids.total_views', 'slide_ids.is_category', 'slide_ids.active')
def _compute_slides_statistics(self):
super(Channel, self)._compute_slides_statistics()
class Slide(models.Model):
_inherit = 'slide.slide'
slide_category = fields.Selection(
selection_add=[('scorm', 'Scorm')], ondelete={'scorm': 'set default'})
slide_type = fields.Selection(
selection_add=[('scorm', 'Scorm')], ondelete={'scorm': 'set null'}, compute="_compute_slide_type", store=True)
is_amazon_s3 = fields.Boolean(
string="Scorm upload on Amazon S3",
help="Indicates whether the slide file is hosted on Amazon S3"
)
scorm_data = fields.Many2many('ir.attachment')
nbr_scorm = fields.Integer("Number of Scorms", compute="_compute_slides_statistics", store=True)
filename = fields.Char()
embed_code = fields.Html('Embed Code', readonly=True, compute='_compute_embed_code')
embed_code_external = fields.Html('External Embed Code', readonly=True, compute='_compute_embed_code')
scorm_version = fields.Selection([
('scorm11', 'Scorm 1.1/1.2'),
('scorm2004', 'Scorm 2004 Edition')
], default="scorm11")
scorm_passed_xp = fields.Integer("Scorm Passed Xp")
scorm_completed_xp = fields.Integer("Scorm Completed Xp")
scorm_completion_on_finish = fields.Boolean("Scorm Completion on Finish")
manifest_file = fields.Char()
@api.onchange('is_amazon_s3')
def _onchange_is_amazon_s3(self):
amazon_access_key = self.env['ir.config_parameter'].sudo().get_param('amazon_s3_connector.amazon_access_key')
amazon_secret_key = self.env['ir.config_parameter'].sudo().get_param('amazon_s3_connector.amazon_secret_key')
bucket_name = self.env['ir.config_parameter'].sudo().get_param('amazon_s3_connector.amazon_bucket_name')
if self.is_amazon_s3:
if not amazon_access_key or not amazon_secret_key or not bucket_name:
self.scorm_data = False
raise UserError("Amazon S3 credentials or bucket name are not configured.")
else:
pass
else:
pass
@api.onchange('scorm_version')
def onchange_scorm_version(self):
if self.manifest_file:
res = {}
scorm_version = self.extract_scorm_version(self.manifest_file)
if scorm_version != self.scorm_version:
res['warning'] = {
'title': _('Warning'),
'message': _('The scorm version is different from actual scorm verison. Results may vary if you select wrong scorm version.')
}
return res
@api.depends('slide_ids.sequence', 'slide_ids.slide_category', 'slide_ids.is_published', 'slide_ids.is_category')
def _compute_slides_statistics(self):
super(Slide, self)._compute_slides_statistics()
@api.depends('slide_category', 'question_ids', 'channel_id.is_member')
@api.depends_context('uid')
def _compute_mark_complete_actions(self):
super(Slide, self)._compute_mark_complete_actions()
@api.depends('slide_category', 'source_type', 'video_source_type')
def _compute_slide_type(self):
res = super(Slide, self)._compute_slide_type()
for slide in self:
if slide.slide_category == 'scorm':
slide.slide_type = 'scorm'
return res
@api.depends('slide_type')
def _compute_slide_icon_class(self):
slide = self.filtered(lambda slide: slide.slide_type == 'scorm')
slide.slide_icon_class = 'fa-file-archive-o'
super(Slide, self - slide)._compute_slide_icon_class()
def _compute_quiz_info(self, target_partner, quiz_done=False):
res = super(Slide, self)._compute_quiz_info(target_partner)
for slide in self:
slide_partner_id = self.env['slide.slide.partner'].sudo().search([
('slide_id', '=', slide.id),
('partner_id', '=', target_partner.id)
], limit=1)
if res[slide.id].get('quiz_karma_won'):
res[slide.id]['quiz_karma_won'] += slide_partner_id.lms_scorm_karma
else:
res[slide.id]['quiz_karma_won'] = slide_partner_id.lms_scorm_karma
return res
@api.onchange('scorm_data')
def _on_change_scorm_data(self):
if self.scorm_data:
if len(self.scorm_data) > 1:
raise ValidationError(_("Only one scorm package allowed per slide."))
tmp = self.scorm_data.name.split('.')
ext = tmp[len(tmp) - 1]
if ext != 'zip':
raise ValidationError(_("The file must be a zip file.!!"))
if self.is_amazon_s3:
# preferred_file = "index_lms.html" if self.is_tincan else "story.html"
self.filename = self._upload_to_s3(self.scorm_data)
else:
self.read_files_from_zip()
else:
if self.filename:
folder_dir = self.filename.split('scorm')[-1].split('/')[-2]
path = os.path.join(os.path.dirname(os.path.abspath(__file__)))
target_dir = os.path.join(os.path.split(path)[-2],"static","media","scorm",str(self.id),folder_dir)
if os.path.isdir(target_dir):
shutil.rmtree(target_dir)
def _upload_to_s3(self, scorm_data):
amazon_access_key = self.env['ir.config_parameter'].sudo().get_param('amazon_s3_connector.amazon_access_key')
amazon_secret_key = self.env['ir.config_parameter'].sudo().get_param('amazon_s3_connector.amazon_secret_key')
bucket_name = self.env['ir.config_parameter'].sudo().get_param('amazon_s3_connector.amazon_bucket_name')
if not amazon_access_key or not amazon_secret_key or not bucket_name:
raise UserError("Amazon S3 credentials or bucket name are not configured in settings.")
try:
# Create an S3 client
s3 = boto3.client(
's3',
aws_access_key_id=amazon_access_key,
aws_secret_access_key=amazon_secret_key
)
try:
bucket_region = s3.get_bucket_location(Bucket=bucket_name).get('LocationConstraint') or 'us-east-1'
except Exception as e:
raise UserError(_("Failed to retrieve bucket region: %s" % str(e)))
# Decode the base64-encoded zip content
try:
zip_content = base64.b64decode(scorm_data.datas)
except Exception as e:
raise UserError(_("Failed to decode the SCORM data: %s" % str(e)))
# Remove the file extension from the zip file name
base_name = os.path.splitext(scorm_data.name)[0]
channel_id = int(str(self.channel_id.id).split("_")[1])
file_prefix = f"{base_name}_Scorm_{channel_id}"
story_url = None
selected_file = None
# Create a temporary directory to extract files
with tempfile.TemporaryDirectory() as temp_dir:
zip_file_path = os.path.join(temp_dir, scorm_data.name)
# Save the zip content to a temporary file
try:
with open(zip_file_path, 'wb') as zip_file:
zip_file.write(zip_content)
except Exception as e:
raise UserError(_("Failed to save SCORM zip content to temporary file: %s" % str(e)))
# Extract the zip file into the temporary directory
extract_dir = os.path.join(temp_dir, f"extracted_files/{file_prefix}")
os.makedirs(extract_dir, exist_ok=True)
try:
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
zip_ref.extractall(extract_dir)
except Exception as e:
raise UserError(_("Failed to extract SCORM zip file: %s" % str(e)))
# Upload each extracted file to S3
try:
s3_file_url_base = f"https://{bucket_name}.s3.{bucket_region}.amazonaws.com/"
for root, _, files in os.walk(extract_dir):
for file_name in files:
file_path = os.path.join(root, file_name)
relative_path = os.path.relpath(file_path, extract_dir)
s3_key = f"{file_prefix}/{relative_path.replace(os.sep, '/')}"
mime_type, _ = guess_type(file_name)
if mime_type is None:
mime_type = 'application/octet-stream'
with open(file_path, 'rb') as file_stream:
s3.upload_fileobj(file_stream, bucket_name, s3_key, ExtraArgs={'ContentType': mime_type, 'ContentDisposition': 'inline'})
encoded_s3_key = quote(s3_key, safe='/()')
if self.is_tincan and file_name == 'index_lms.html':
selected_file = encoded_s3_key
elif file_name == 'index.html':
selected_file = encoded_s3_key
elif file_name == 'story.html' and not selected_file:
selected_file = encoded_s3_key # Set only if nothing else is selected
# If we have a valid selected file, create the final URL
if selected_file:
story_url = s3_file_url_base + selected_file
except Exception as e:
raise ValidationError("Failed to upload files to Amazon S3: %s" % str(e))
return story_url
except Exception as e:
raise ValidationError("An unexpected error occurred while processing the SCORM data: %s" % str(e))
@api.depends('slide_category', 'google_drive_id', 'video_source_type', 'youtube_id')
def _compute_embed_code(self):
for rec in self:
super(Slide, rec)._compute_embed_code()
try:
if rec.slide_category == 'scorm' and rec.scorm_data and not rec.is_tincan:
rec.embed_code = Markup('<iframe src="%s" frameborder="0" aria-label="%s"></iframe>') % (rec.filename, _('Scorm'))
rec.embed_code_external = Markup('<iframe src="%s" frameborder="0" aria-label="%s"></iframe>') % (rec.filename, _('Scorm'))
elif rec.slide_category == 'scorm' and rec.scorm_data and rec.is_tincan:
user_name = self.env.user.id
user_mail = self.env.user.login
base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
end_point = f"{base_url}/slides/slide"
encoded_endpoint = urllib.parse.quote(end_point, safe=":/?&=")
actor_data = {
"name": [user_name],
"mbox": [f"mailto:{user_mail}"]
}
actor_json = json.dumps(actor_data) # Convert to JSON string
encoded_actor = urllib.parse.quote(actor_json) # URL encode the JSON string
iframe_template = (
'<iframe src="{}?endpoint={}&actor={}&activity_id={}" '
'allowFullScreen="true" frameborder="0"></iframe>'
)
rec.embed_code = Markup(iframe_template.format(
rec.filename, encoded_endpoint, encoded_actor, rec.id
))
rec.embed_code_external = Markup(iframe_template.format(
rec.filename, encoded_endpoint, encoded_actor, rec.id
))
except Exception as e:
if rec.slide_category == 'scorm' and rec.scorm_data:
rec.embed_code = Markup('<iframe src="%s" frameborder="0" autoplay="1"></iframe>') % (rec.filename)
rec.embed_code_external = Markup('<iframe src="%s" aria-label="%s"></iframe>') % (rec.filename, _('Scorm'))
def read_files_from_zip(self):
file = base64.decodebytes(self.scorm_data.datas)
fobj = tempfile.NamedTemporaryFile(delete=False)
fname = fobj.name
fobj.write(file)
zipzip = self.scorm_data.datas
f = open(fname, 'r+b')
f.write(base64.b64decode(zipzip))
path = os.path.join(os.path.dirname(os.path.abspath(__file__)))
manifest_file = None
with zipfile.ZipFile(fobj, 'r') as zipObj:
listOfFileNames = zipObj.namelist()
html_file_name = ''
html_file_name = list(filter(lambda x: 'index.html' in x, listOfFileNames))
manifest_file_name = list(filter(lambda x: 'imsmanifest.xml' in x, listOfFileNames))
if not html_file_name:
html_file_name = list(filter(lambda x: 'index_lms.html' in x, listOfFileNames))
if not html_file_name:
html_file_name = list(filter(lambda x: 'story.html' in x, listOfFileNames))
source_dir = os.path.join(os.path.split(path)[-2],"static","media","scorm",str(self.id))
try:
zipObj.extractall(source_dir)
if len(manifest_file_name) > 0:
manifest_file = f"{source_dir}/{manifest_file_name[0]}"
self.filename = '/website_scorm_elearning/static/media/scorm/%s/%s' % (str(self.id), html_file_name[0] if len(html_file_name) > 0 else None)
except OSError as e:
_logger.warning("Filesystem is read-only, cannot create directory: %s", source_dir)
raise UserError("The file is read-only, so it can't be uploaded to SCORM. Please enable Scorm upload on Amazon S3 to continue.")
f.close()
if manifest_file:
self.manifest_file = manifest_file
self.scorm_version = self.extract_scorm_version(manifest_file)
def extract_scorm_version(self, manifest_file):
tree = ET.parse(manifest_file)
root = tree.getroot()
# Find the schemaversion element
schema_version_element = root.find('.//{http://www.imsproject.org/xsd/imscp_rootv1p1p2}metadata/{http://www.imsproject.org/xsd/imscp_rootv1p1p2}schemaversion')
# Check if the version is 1.2
if schema_version_element is not None and schema_version_element.text == '1.2':
return 'scorm11'
else:
return 'scorm2004'
+1
View File
@@ -0,0 +1 @@
boto3
@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_slide_lms_session_info_public,lms.session.info,model_lms_session_info,base.group_public,1,0,0,0
access_slide_lms_session_info_user,lms.session.info,model_lms_session_info,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_slide_lms_session_info_public lms.session.info model_lms_session_info base.group_public 1 0 0 0
3 access_slide_lms_session_info_user lms.session.info model_lms_session_info base.group_user 1 1 1 1
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

@@ -0,0 +1,107 @@
<div class="row"
style="margin: 0;position: relative;color: #000;background-position: center;background: #ffffff;border-bottom: 1px solid #e4e4e4;text-align: center; margin: auto; display: flex;justify-content: center;">
<a href="https://www.manprax.com/" target="_blank"><img src="images/manprax.png"
style=" width: 293px; padding: 1rem 0rem; margin: auto" alt="manprax-logo"></a>
</div>
<div class="row"
style="margin:75px 0;position: relative;color: #000;background-position: center;background: #ffffff;border-bottom: 1px solid #e4e4e4; padding-bottom: 30px;">
<div class="col-md-7 col-sm-12 col-xs-12" style="padding: 0px">
<div style=" margin: 0 0 0px;padding: 20px 0 10;font-size: 23px;line-height: 35px;font-weight: 400;color: #000;border-top: 1px solid rgba(255,255,255,0.1);border-bottom: 1px solid rgba(255,255,255,0.11);text-align: left;">
<h1 style="font-size: 39px;font-weight: 600;margin: 0px !important;">Elearning with Scorm Package </h1>
<h3 style="font-size: 21px;margin-top: 8px;position: relative;">Add SCORM package to make your course more interactable to learners.
</h3>
</div>
<h2 style="font-weight: 600;font-size: 1.8rem;margin-top: 15px;">Instruction to use this module.</h2>
<ul style=" padding: 0 1px; list-style: none; ">
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Change media directory ownership to odoo user or daemon user.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;width: max-content;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Media directory is in "{custom addons path}/website_scorm_elearning/static/media".
</li>
<li style="display: flex; align-items: center; padding: 8px 0; font-size: 18px;"><i class="fa fa-check-circle-o" style="width: 40px; color: #00438b;"></i>
Or you can connect Odoo with Amazon S3 by adding credentials in the configuration.
This will store the SCORM package in an S3 bucket, and you can retrieve the link.
</li>
</ul>
<h2 style="font-weight: 600;font-size: 1.8rem;margin-top: 15px;">Key Highlights</h2>
<ul style=" padding: 0 1px; list-style: none; ">
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Added new type (Scorm) for SCORM attachments.
</li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o"
style="width:40px; color:#00438b"></i>
Added support to upload Scorm Packages to the Elearning courses.
</li>
</ul>
</div>
</div>
<div>
<h2 class="text-center">Screenshots</h2>
<section class="oe_container">
<div>
<div>
<div>
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert" style="font-weight: 400; color: #091E42; background: #fff; text-align: left; border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width: 40px; color: #00438b;"></i>
Add configuration for Amazon S3 bucket by going to General Settings, saving the data, and testing the connection. This will connect Odoo with Amazon S3.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px; width: 80%;"
src="images/configuration.png">
</div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Upload SCORM Package to the course content.
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px; width: 80%;"
src="images/screen1.png">
</div>
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Play SCORM File on eLearning Slide.
<br>
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen2.png">
</div>
</div>
<div style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert"
style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;">
<i class="fa fa-check-circle-o" style="width:40px; color:#00438b"></i>
Intract with SCORM package.
<br>
</h3>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen3.png">
</div>
<br/>
<div style="text-align: center;"><img class="img img-responsive center-block"
style="border-top-left-radius: 10px;border-top-right-radius: 10px;width: 80%;"
src="images/screen4.png">
</div>
</div>
</div>
</div>
</div>
</section>
</div>
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Custom Certificate Template',
'author': 'Bac Ha Software',
'website': 'https://bachasoftware.com',
'maintainer': 'Bac Ha Software',
'version': '1.0',
'category': 'eLearning',
'sequence': 101,
'summary': 'Custom eLearning Certification Template',
'description': "A product of Bac Ha Software provides additional options for certificate templates.",
'images': ['static/description/banner.png'],
'depends': ['survey'],
'data': [
'views/survey_report_templates.xml',
],
'assets': {
'web.report_assets_common': [
'bhs_elearning_certification_template/static/src/scss/survey_reports.scss',
],
},
'demo': [],
"external_dependencies": {},
'installable': True,
'application': True,
'auto_install': False,
'qweb': [],
'license': 'LGPL-3'
}
@@ -0,0 +1,6 @@
from odoo import api, exceptions, fields, models, _
class BHSSurvey(models.Model):
_inherit = 'survey.survey'
certification_report_layout = fields.Selection(selection_add=[('bhs_certificate', 'BHS Certificate')])
@@ -0,0 +1,3 @@
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M79.375 20.4583C75.555 16.5996 71.0049 13.5402 65.9902 11.4585C60.9754 9.37673 55.5963 8.31434 50.1667 8.33326C27.4167 8.33326 8.87499 26.8749 8.87499 49.6249C8.87499 56.9166 10.7917 63.9999 14.375 70.2499L8.54166 91.6666L30.4167 85.9166C36.4583 89.2083 43.25 90.9583 50.1667 90.9583C72.9167 90.9583 91.4583 72.4166 91.4583 49.6666C91.4583 38.6249 87.1667 28.2499 79.375 20.4583ZM50.1667 83.9583C44 83.9583 37.9583 82.2916 32.6667 79.1666L31.4167 78.4166L18.4167 81.8333L21.875 69.1666L21.0417 67.8749C17.6156 62.404 15.7964 56.0801 15.7917 49.6249C15.7917 30.7083 31.2083 15.2916 50.125 15.2916C59.2917 15.2916 67.9167 18.8749 74.375 25.3749C77.5728 28.5581 80.1071 32.3443 81.8308 36.5142C83.5545 40.684 84.4335 45.1545 84.4167 49.6666C84.5 68.5833 69.0833 83.9583 50.1667 83.9583ZM69 58.2916C67.9583 57.7916 62.875 55.2916 61.9583 54.9166C61 54.5833 60.3333 54.4166 59.625 55.4166C58.9167 56.4583 56.9583 58.7916 56.375 59.4583C55.7917 60.1666 55.1667 60.2499 54.125 59.7083C53.0833 59.2083 49.75 58.0833 45.8333 54.5833C42.75 51.8333 40.7083 48.4583 40.0833 47.4166C39.5 46.3749 40 45.8333 40.5417 45.2916C41 44.8333 41.5833 44.0833 42.0833 43.4999C42.5833 42.9166 42.7917 42.4583 43.125 41.7916C43.4583 41.0833 43.2917 40.4999 43.0417 39.9999C42.7917 39.4999 40.7083 34.4166 39.875 32.3333C39.0417 30.3333 38.1667 30.5833 37.5417 30.5416H35.5417C34.8333 30.5416 33.75 30.7916 32.7917 31.8333C31.875 32.8749 29.2083 35.3749 29.2083 40.4583C29.2083 45.5416 32.9167 50.4583 33.4167 51.1249C33.9167 51.8333 40.7083 62.2499 51.0417 66.7083C53.5 67.7916 55.4167 68.4166 56.9167 68.8749C59.375 69.6666 61.625 69.5416 63.4167 69.2916C65.4167 68.9999 69.5417 66.7916 70.375 64.3749C71.25 61.9583 71.25 59.9166 70.9583 59.4583C70.6667 58.9999 70.0417 58.7916 69 58.2916Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

Some files were not shown because too many files have changed in this diff Show More