def _create_block(self, content_block_value): """ Creates and returns a minimal BlockData object with the give values. """ block = BlockData(self.location) block.display_name = self.display_name block.weight = content_block_value.weight block_grades_transformer_data = block.transformer_data.get_or_create(GradesTransformer) block_grades_transformer_data.max_score = content_block_value.raw_possible setattr( block_grades_transformer_data, GradesTransformer.EXPLICIT_GRADED_FIELD_NAME, content_block_value.explicit_graded, ) return block
def _create_block(self, content_block_value): """ Creates and returns a minimal BlockData object with the give values. """ block = BlockData(self.location) block.display_name = self.display_name block.weight = content_block_value.weight block_grades_transformer_data = block.transformer_data.get_or_create(GradesTransformer) block_grades_transformer_data.max_score = content_block_value.raw_possible setattr( block_grades_transformer_data, GradesTransformer.EXPLICIT_GRADED_FIELD_NAME, content_block_value.explicit_graded, ) return block
def _create_block(self, raw_possible): """ Creates and returns a minimal BlockData object with the give value for raw_possible. """ block = BlockData('any_key') block.transformer_data.get_or_create(GradesTransformer).max_score = raw_possible return block
def _create_block(self, explicit_graded_value): """ Creates and returns a minimal BlockData object with the give value for explicit_graded. """ block = BlockData('any_key') setattr( block.transformer_data.get_or_create(GradesTransformer), GradesTransformer.EXPLICIT_GRADED_FIELD_NAME, explicit_graded_value, ) return block