course

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCourseJson

func GetCourseJson(courseID, coursesPath string) (string, error)

func ResetProgress

func ResetProgress(courseID, progressPath string) error

func SaveCourse

func SaveCourse(response, coursesPath string) (string, error)

func SaveProgress

func SaveProgress(courseID, completedLessonID, currentLessonID, progressPath string, totalLessons int) error

Types

type Course

type Course struct {
	ID                  string   `json:"course_id"`
	Title               string   `json:"title"`
	Description         string   `json:"description"`
	ProgrammingLanguage string   `json:"programming_language"`
	Lessons             []Lesson `json:"lessons"`
}

func GetCourseStruct

func GetCourseStruct(courseID, coursesPath string) (Course, error)

func GetCourses

func GetCourses(coursesPath string) ([]Course, error)

type Lesson

type Lesson struct {
	ID              string   `json:"lesson_id"`
	Title           string   `json:"title"`
	Slides          []string `json:"slides"`
	TaskDescription string   `json:"task_description"`
	InitialCode     string   `json:"initial_code"`
	CorrectOutput   string   `json:"correct_output"`
	FileName        string   `json:"file_name"`
}

type Progress

type Progress struct {
	CourseID         string    `json:"course_id"`
	CompletedLessons []string  `json:"completed_lessons"`
	CurrentLesson    string    `json:"current_lesson"`
	LastAccessed     time.Time `json:"last_accessed"`
	TotalLessons     int       `json:"total_lessons"`
}

func LoadProgresses

func LoadProgresses(progressPath string) ([]Progress, error)

type ProgressStatus

type ProgressStatus int
const (
	NotStarted ProgressStatus = iota
	InProgress
	Completed
)

func LoadProgressStatus

func LoadProgressStatus(courseID, progressPath string) (ProgressStatus, string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL