refactor: move xmodule folder to root
- Moving xmodule folder to root as we're dissolving sub-projects of common folder in edx-platform
- More info: https://openedx.atlassian.net/browse/BOM-2579
- -e common/lib/xmodule has been removed from the requirements as xmodule has itself become the part of edx-platform and not being installed through requirements
- The test files common/lib/xmodule/test_files/ have been removed as they are not being used anymore
This commit is contained in:
103
xmodule/modulestore/edit_info.py
Normal file
103
xmodule/modulestore/edit_info.py
Normal file
@@ -0,0 +1,103 @@
|
||||
"""
|
||||
Access methods to get EditInfo for xblocks
|
||||
"""
|
||||
|
||||
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
from xblock.core import XBlockMixin
|
||||
|
||||
|
||||
class EditInfoMixin(XBlockMixin):
|
||||
"""
|
||||
Provides the interfaces for getting the edit info from XBlocks
|
||||
"""
|
||||
@property
|
||||
def edited_by(self):
|
||||
"""
|
||||
The user id of the last user to change this xblock content, children, or settings.
|
||||
"""
|
||||
return self.runtime.get_edited_by(self)
|
||||
|
||||
@property
|
||||
def edited_on(self):
|
||||
"""
|
||||
The datetime of the last change to this xblock content, children, or settings.
|
||||
"""
|
||||
return self.runtime.get_edited_on(self)
|
||||
|
||||
@property
|
||||
def subtree_edited_by(self):
|
||||
"""
|
||||
The user id of the last user to change content, children, or settings in this xblock's subtree
|
||||
"""
|
||||
return self.runtime.get_subtree_edited_by(self)
|
||||
|
||||
@property
|
||||
def subtree_edited_on(self):
|
||||
"""
|
||||
The datetime of the last change content, children, or settings in this xblock's subtree
|
||||
"""
|
||||
return self.runtime.get_subtree_edited_on(self)
|
||||
|
||||
@property
|
||||
def published_by(self):
|
||||
"""
|
||||
The user id of the last user to publish this specific xblock (or a previous version of it).
|
||||
"""
|
||||
return self.runtime.get_published_by(self)
|
||||
|
||||
@property
|
||||
def published_on(self):
|
||||
"""
|
||||
The datetime of the last time this specific xblock was published.
|
||||
"""
|
||||
return self.runtime.get_published_on(self)
|
||||
|
||||
|
||||
class EditInfoRuntimeMixin(metaclass=ABCMeta):
|
||||
"""
|
||||
An abstract mixin class for the functions which the :class: `EditInfoMixin` methods call on the runtime
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def get_edited_by(self, xblock):
|
||||
"""
|
||||
The datetime of the last change to this xblock content, children, or settings.
|
||||
"""
|
||||
pass # lint-amnesty, pylint: disable=unnecessary-pass
|
||||
|
||||
@abstractmethod
|
||||
def get_edited_on(self, xblock):
|
||||
"""
|
||||
The datetime of the last change to this xblock content, children, or settings.
|
||||
"""
|
||||
pass # lint-amnesty, pylint: disable=unnecessary-pass
|
||||
|
||||
@abstractmethod
|
||||
def get_subtree_edited_by(self, xblock):
|
||||
"""
|
||||
The user id of the last user to change content, children, or settings in this xblock's subtree
|
||||
"""
|
||||
pass # lint-amnesty, pylint: disable=unnecessary-pass
|
||||
|
||||
@abstractmethod
|
||||
def get_subtree_edited_on(self, xblock):
|
||||
"""
|
||||
The datetime of the last change content, children, or settings in this xblock's subtree
|
||||
"""
|
||||
pass # lint-amnesty, pylint: disable=unnecessary-pass
|
||||
|
||||
@abstractmethod
|
||||
def get_published_by(self, xblock):
|
||||
"""
|
||||
The user id of the last user to publish this specific xblock (or a previous version of it).
|
||||
"""
|
||||
pass # lint-amnesty, pylint: disable=unnecessary-pass
|
||||
|
||||
@abstractmethod
|
||||
def get_published_on(self, xblock):
|
||||
"""
|
||||
The datetime of the last time this specific xblock was published.
|
||||
"""
|
||||
pass # lint-amnesty, pylint: disable=unnecessary-pass
|
||||
Reference in New Issue
Block a user