override fun createTask()

in intellij-plugin/educational-core/src/com/jetbrains/edu/learning/stepik/hyperskill/courseGeneration/HyperskillTaskBuilder.kt [43:83]


  override fun createTask(type: String): Task {
    val task = super.createTask(type)

    task.descriptionText = "<div class=\"step-text\">\n${task.descriptionText}\n</div>"
    task.apply {
      if (stepSource.isCompleted) {
        status = CheckStatus.Solved
      }

      when (this) {
        is CodeTask, is DataTask, is ChoiceTask, is StringTask, is NumberTask, is SortingTask, is MatchingTask, is TableTask -> {
          name = stepSource.title
        }
        is EduTask -> {
          if (task is RemoteEduTask) {
            task.checkProfile = stepSource.checkProfile
          }
          name = stepSource.title
          customPresentableName = null
        }
        is UnsupportedTask -> {
          descriptionText = getUnsupportedTaskDescriptionText(name, stepSource.id)
          name = stepSource.title
        }
      }

      feedbackLink = "${stepLink(stepSource.id)}$HYPERSKILL_COMMENT_ANCHOR"
    }

    if (task is CodeTask) {
      val submissionLanguage = task.submissionLanguage
      if (submissionLanguage != null) {
        val options = stepSource.block?.options as? PyCharmStepOptions
        if (options?.hasHeaderOrFooter(submissionLanguage) == true) {
          doNotHighlightErrorsInTasksWithHeadersOrFooters(task)
        }
      }
    }

    return task
  }