def test_disabled_handler_does_not_submit_completion(self): handlers.scorable_block_completion( sender=self, user_id=self.user.id, course_id=six.text_type(self.context_key), usage_id=six.text_type(self.block_key), weighted_earned=0.0, weighted_possible=3.0, modified=datetime.utcnow().replace(tzinfo=utc), score_db_table='submissions', ) with self.assertRaises(BlockCompletion.DoesNotExist): BlockCompletion.objects.get(user=self.user, context_key=self.context_key, block_key=self.block_key)
def test_disabled_handler_does_not_submit_completion(self): handlers.scorable_block_completion( sender=self, user_id=self.user.id, course_id=six.text_type(self.course_key), usage_id=six.text_type(self.block_key), weighted_earned=0.0, weighted_possible=3.0, modified=datetime.utcnow().replace(tzinfo=utc), score_db_table='submissions', ) with self.assertRaises(BlockCompletion.DoesNotExist): BlockCompletion.objects.get( user=self.user, course_key=self.course_key, block_key=self.block_key )
def call_scorable_block_completion_handler(self, block_key, score_deleted=None): """ Call the scorable completion signal handler for the specified block. Optionally takes a value to pass as score_deleted. """ if score_deleted is None: params = {} else: params = {'score_deleted': score_deleted} handlers.scorable_block_completion( sender=self, user_id=self.user.id, course_id=str(self.context_key), usage_id=str(block_key), weighted_earned=0.0, weighted_possible=3.0, modified=datetime.utcnow().replace(tzinfo=utc), score_db_table='submissions', **params )
def call_scorable_block_completion_handler(self, block_key, score_deleted=None): """ Call the scorable completion signal handler for the specified block. Optionally takes a value to pass as score_deleted. """ if score_deleted is None: params = {} else: params = {'score_deleted': score_deleted} handlers.scorable_block_completion( sender=self, user_id=self.user.id, course_id=six.text_type(self.course_key), usage_id=six.text_type(block_key), weighted_earned=0.0, weighted_possible=3.0, modified=datetime.utcnow().replace(tzinfo=utc), score_db_table='submissions', **params )