예제 #1
0
def reload_widgets():
    """Reload the default classifiers and widgets."""
    Classifier.delete_all_classifiers()
    Classifier.load_default_classifiers()

    Widget.delete_all_widgets()
    InteractiveWidget.load_default_widgets()
    NonInteractiveWidget.load_default_widgets()
예제 #2
0
파일: admin.py 프로젝트: sunu/oppia-test-2
def reload_demos():
    """Reload default classifiers, widgets, and explorations (in that order)."""
    Classifier.delete_all_classifiers()
    Classifier.load_default_classifiers()

    Widget.delete_all_widgets()
    InteractiveWidget.load_default_widgets()
    NonInteractiveWidget.load_default_widgets()

    Exploration.delete_demo_explorations()
    Exploration.load_demo_explorations()
예제 #3
0
파일: tests.py 프로젝트: sunu/oppia-test-2
    def test_loading_and_deletion_of_classifiers(self):
        """Test loading and deletion of the default classifiers."""
        self.assertEqual(Classifier.query().count(), 0)

        Classifier.load_default_classifiers()
        classifiers = Classifier.query()
        classifier_ids = [classifier.id for classifier in classifiers]
        self.assertIn('Coord2DClassifier', classifier_ids)
        self.assertEqual(classifiers.count(), 7)

        Classifier.delete_all_classifiers()
        self.assertEqual(Classifier.query().count(), 0)
예제 #4
0
파일: models.py 프로젝트: sunu/oppia-test-2
 def rules(self):
     if not self.classifier:
         return []
     return Classifier.get_by_id(self.classifier).rules