fun getIcon()

in intellij-plugin/educational-core/src/com/jetbrains/edu/learning/projectView/CourseViewUtils.kt [120:139]


  fun getIcon(item: StudyItem): Icon {
    val icon: Icon = when (item) {
      is Course -> CourseTree
      is Section -> if (item.isSolved) SectionSolved else Section

      is Lesson -> if (item.isSolved) LessonSolved else Lesson

      is Task -> when (item) {
        is IdeTask -> if (item.isSolved) IdeTaskSolved else CourseView.IdeTask
        is TheoryTask -> if (item.isSolved) TheoryTaskSolved else CourseView.TheoryTask
        else -> if (item.status == CheckStatus.Unchecked) CourseView.Task
        else if (item.isSolved || item.containsCorrectSubmissions()) TaskSolved
        else TaskFailed
      }

      else -> error("Unexpected item type: ${item.javaClass.simpleName}")
    }
    val modifier = getSyncChangesModifier(item) ?: return icon
    return LayeredIcon.create(icon, modifier)
  }