How to use the extensions.objects.models.objects function in extensions

To help you get started, we’ve selected a few extensions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oppia / oppia / extensions / rules / base.py View on Github external
class CheckedProofRule(rule_domain.Rule):
    subject_type = objects.CheckedProof


class GraphRule(rule_domain.Rule):
    subject_type = objects.Graph


class ImageWithRegionsRule(rule_domain.Rule):
    subject_type = objects.ImageWithRegions


class ClickOnImageRule(rule_domain.Rule):
    subject_type = objects.ClickOnImage
github oppia / oppia / extensions / rules / base.py View on Github external
class NonnegativeIntRule(rule_domain.Rule):
    subject_type = objects.NonnegativeInt


class NormalizedStringRule(rule_domain.Rule):
    subject_type = objects.NormalizedString


class RealRule(rule_domain.Rule):
    subject_type = objects.Real


class SetOfUnicodeStringRule(rule_domain.Rule):
    subject_type = objects.SetOfUnicodeString


class SetOfHtmlStringRule(rule_domain.Rule):
    subject_type = objects.SetOfHtmlString


class UnicodeStringRule(rule_domain.Rule):
    subject_type = objects.UnicodeString


class CheckedProofRule(rule_domain.Rule):
    subject_type = objects.CheckedProof


class GraphRule(rule_domain.Rule):
    subject_type = objects.Graph
github oppia / oppia / extensions / rules / base.py View on Github external
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwar
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Base rules."""

from core.domain import rule_domain
from extensions.objects.models import objects


class CodeEvaluationRule(rule_domain.Rule):
    subject_type = objects.CodeEvaluation


class CoordTwoDimRule(rule_domain.Rule):
    subject_type = objects.CoordTwoDim


class MusicPhraseRule(rule_domain.Rule):
    subject_type = objects.MusicPhrase


class NonnegativeIntRule(rule_domain.Rule):
    subject_type = objects.NonnegativeInt


class NormalizedStringRule(rule_domain.Rule):
    subject_type = objects.NormalizedString
github oppia / oppia / core / domain / rule_domain.py View on Github external
"""Get a parameter list from the rule description."""
    param_list = []
    while description.find('{{') != -1:
        opening_index = description.find('{{')
        description = description[opening_index + 2:]

        bar_index = description.find('|')
        param_name = description[: bar_index]
        description = description[bar_index + 1:]

        closing_index = description.find('}}')
        normalizer_string = description[: closing_index]
        description = description[closing_index + 2:]

        param_list.append(
            (param_name, getattr(objects, normalizer_string))
        )

    return param_list
github oppia / oppia / extensions / rules / base.py View on Github external
class NonnegativeIntRule(rule_domain.Rule):
    subject_type = objects.NonnegativeInt


class NormalizedStringRule(rule_domain.Rule):
    subject_type = objects.NormalizedString


class RealRule(rule_domain.Rule):
    subject_type = objects.Real


class SetOfUnicodeStringRule(rule_domain.Rule):
    subject_type = objects.SetOfUnicodeString


class SetOfHtmlStringRule(rule_domain.Rule):
    subject_type = objects.SetOfHtmlString


class UnicodeStringRule(rule_domain.Rule):
    subject_type = objects.UnicodeString


class CheckedProofRule(rule_domain.Rule):
    subject_type = objects.CheckedProof


class GraphRule(rule_domain.Rule):
    subject_type = objects.Graph
github oppia / oppia / extensions / rules / base.py View on Github external
class SetOfUnicodeStringRule(rule_domain.Rule):
    subject_type = objects.SetOfUnicodeString


class SetOfHtmlStringRule(rule_domain.Rule):
    subject_type = objects.SetOfHtmlString


class UnicodeStringRule(rule_domain.Rule):
    subject_type = objects.UnicodeString


class CheckedProofRule(rule_domain.Rule):
    subject_type = objects.CheckedProof


class GraphRule(rule_domain.Rule):
    subject_type = objects.Graph


class ImageWithRegionsRule(rule_domain.Rule):
    subject_type = objects.ImageWithRegions


class ClickOnImageRule(rule_domain.Rule):
    subject_type = objects.ClickOnImage
github oppia / oppia / extensions / rules / base.py View on Github external
class NormalizedStringRule(rule_domain.Rule):
    subject_type = objects.NormalizedString


class RealRule(rule_domain.Rule):
    subject_type = objects.Real


class SetOfUnicodeStringRule(rule_domain.Rule):
    subject_type = objects.SetOfUnicodeString


class SetOfHtmlStringRule(rule_domain.Rule):
    subject_type = objects.SetOfHtmlString


class UnicodeStringRule(rule_domain.Rule):
    subject_type = objects.UnicodeString


class CheckedProofRule(rule_domain.Rule):
    subject_type = objects.CheckedProof


class GraphRule(rule_domain.Rule):
    subject_type = objects.Graph


class ImageWithRegionsRule(rule_domain.Rule):
    subject_type = objects.ImageWithRegions
github oppia / oppia / extensions / rules / base.py View on Github external
class CodeEvaluationRule(rule_domain.Rule):
    subject_type = objects.CodeEvaluation


class CoordTwoDimRule(rule_domain.Rule):
    subject_type = objects.CoordTwoDim


class MusicPhraseRule(rule_domain.Rule):
    subject_type = objects.MusicPhrase


class NonnegativeIntRule(rule_domain.Rule):
    subject_type = objects.NonnegativeInt


class NormalizedStringRule(rule_domain.Rule):
    subject_type = objects.NormalizedString


class RealRule(rule_domain.Rule):
    subject_type = objects.Real


class SetOfUnicodeStringRule(rule_domain.Rule):
    subject_type = objects.SetOfUnicodeString


class SetOfHtmlStringRule(rule_domain.Rule):
    subject_type = objects.SetOfHtmlString
github oppia / oppia / extensions / widgets / interactive / FileReadInputWithHints / FileReadInputWithHints.py View on Github external
'name': 'high_hint',
        'description': 'The high level hint',
        'generator': generators.Copier,
        'init_args': {},
        'customization_args': {
            'value': ''
        },
        'obj_type': 'UnicodeString',
    }]

    # Actions that the reader can perform on this widget which trigger a
    # feedback interaction, and the associated input types. Interactive widgets
    # must have at least one of these. This attribute name MUST be prefixed by
    # '_'.
    _handlers = [{
        'name': 'submit', 'input_type': objects.UnicodeString
    }]
github oppia / oppia / extensions / rules / base.py View on Github external
class SetOfHtmlStringRule(rule_domain.Rule):
    subject_type = objects.SetOfHtmlString


class UnicodeStringRule(rule_domain.Rule):
    subject_type = objects.UnicodeString


class CheckedProofRule(rule_domain.Rule):
    subject_type = objects.CheckedProof


class GraphRule(rule_domain.Rule):
    subject_type = objects.Graph


class ImageWithRegionsRule(rule_domain.Rule):
    subject_type = objects.ImageWithRegions


class ClickOnImageRule(rule_domain.Rule):
    subject_type = objects.ClickOnImage