<commit_before># Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.

"""Classes supporting creation and editing of question_groups."""

__author__ = '<NAME> (<EMAIL>)'


from common import schema_fields
from controllers.utils import BaseRESTHandler
from controllers.utils import XsrfTokenManager
from models import transforms
from models.models import QuestionDAO
from models.models import QuestionGroupDAO
from models.models import QuestionGroupDTO
import question_editor
from unit_lesson_editor import CourseOutlineRights


class QuestionGroupManagerAndEditor(question_editor.BaseDatastoreAssetEditor):
    """An editor for editing and managing question_groups."""

    def get_template_values(self, key):
        template_values = {}
        template_values['page_title'] = self.format_title('Edit Question')
        template_values['main_content'] = self.get_form(
            QuestionGroupRESTHandler, key)

        return template_values

    def get_add_question_group(self):
        self.render_page(self.get_template_values(''))

    def get_edit_question_group(self):
        self.render_page(self.get_template_values(self.request.get('key')))


class QuestionGroupRESTHandler(BaseRESTHandler):
    """REST handler for editing question_groups."""

    URI = '/rest/question_group'

    REQUIRED_MODULES = [
        'gcb-rte', 'inputex-hidden', 'inputex-select', 'inputex-string',
        'inputex-list']<commit_msg>Changed the title from  Edit Question to Edit Question Group for question group editing. 	Change on 2013/06/28 by juliaoh <<EMAIL>> ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=48690119<commit_after># Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.

"""Classes supporting creation and editing of question_groups."""

__author__ = '<NAME> (<EMAIL>)'


from common import schema_fields
from controllers.utils import BaseRESTHandler
from controllers.utils import XsrfTokenManager
from models import transforms
from models.models import QuestionDAO
from models.models import QuestionGroupDAO
from models.models import QuestionGroupDTO
import question_editor
from unit_lesson_editor import CourseOutlineRights


class QuestionGroupManagerAndEditor(question_editor.BaseDatastoreAssetEditor):
    """An editor for editing and managing question_groups."""

    def get_template_values(self, key):
        template_values = {}
        template_values['page_title'] = self.format_title('Edit Question Group')
        template_values['main_content'] = self.get_form(
            QuestionGroupRESTHandler, key)

        return template_values

    def get_add_question_group(self):
        self.render_page(self.get_template_values(''))

    def get_edit_question_group(self):
        self.render_page(self.get_template_values(self.request.get('key')))


class QuestionGroupRESTHandler(BaseRESTHandler):
    """REST handler for editing question_groups."""

    URI = '/rest/question_group'

    REQUIRED_MODULES = [
        'gcb-rte', 'inputex-hidden', 'inputex-select', 'inputex-string',
        'inputex-list']
{'fraction_non_alphanumeric': 0.08618199325950891, 'fraction_numerical': 0.0077034183919114105, 'mean_word_length': 4.481530343007916, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3105132', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1091, 'n_words': 368}