Skip to content

Commit

Permalink
more refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
arslanashraf7 committed Nov 6, 2024
1 parent 449572b commit 76e6482
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lms/djangoapps/instructor_task/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def get_task_completion_info(instructor_task): # lint-amnesty, pylint: disable=
problem_url = None
entrance_exam_url = None
email_id = None
course_id = None
try:
task_input = json.loads(instructor_task.task_input)
except ValueError:
Expand All @@ -151,7 +150,6 @@ def get_task_completion_info(instructor_task): # lint-amnesty, pylint: disable=
problem_url = task_input.get('problem_url')
entrance_exam_url = task_input.get('entrance_exam_url')
email_id = task_input.get('email_id')
course_id = task_input.get('course_key')

if instructor_task.task_state == PROGRESS:
# special message for providing progress updates:
Expand Down Expand Up @@ -195,7 +193,7 @@ def get_task_completion_info(instructor_task): # lint-amnesty, pylint: disable=
else: # num_succeeded < num_attempted
# Translators: {action} is a past-tense verb that is localized separately. {succeeded} and {attempted} are counts. # lint-amnesty, pylint: disable=line-too-long
msg_format = _("Problem {action} for {succeeded} of {attempted} students")
elif course_id is not None:
elif task_input and task_input.get('course_key'):
from ol_openedx_canvas_integration.utils import get_task_output_formatted_message
msg_format = get_task_output_formatted_message(task_output)
succeeded = True
Expand Down

0 comments on commit 76e6482

Please sign in to comment.