Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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
# 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
"""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
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
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
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
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
'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
}]
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