RezinaLMS-BackEnd/internal/demoseed/curriculum.go

97 lines
13 KiB
Go

package demoseed
import (
"fmt"
"strings"
)
type Course struct {
Key, Name, Description, Tier string
Chapters []Chapter
}
type Chapter struct {
Name, Description string
Lessons []Lesson
}
type Lesson struct {
Title, Description, Question, Explanation string
Options []string
CorrectIndex int
}
// Courses is the current makeup-artistry fixture. Keys are namespaced separately
// from the retired general-learning demo so existing learner progress is retained.
var Courses = []Course{
{Key: "makeup-foundations", Name: "Makeup Artistry Foundations", Description: "Build a professional toolkit, prepare a clean workstation, and create a balanced everyday complexion.", Tier: "FREE", Chapters: []Chapter{
{Name: "Your kit and studio", Description: "Get to know core tools and organize a thoughtful makeup practice routine.", Lessons: []Lesson{
{Title: "Build your first makeup kit", Description: "Identify complexion, eye, and lip essentials. Organize products by purpose and create a kit checklist for a simple everyday look.", Question: "Which kit is the best starting point for practicing a complete everyday look?", Options: []string{"Only several shades of glitter", "Complexion products, eye and lip basics, and suitable brushes", "Only one foundation and no tools"}, CorrectIndex: 1, Explanation: "A balanced starter kit covers the main areas of the face and includes tools for controlled application."},
{Title: "Choose and control your brushes", Description: "Compare dense and fluffy brushes. Practice light pressure and use separate tools to place, blend, and refine product.", Question: "Which brush is best suited to softly blending the edges of powder eyeshadow?", Options: []string{"A fluffy blending brush", "A rigid spatula", "A large body brush"}, CorrectIndex: 0, Explanation: "A fluffy blending brush helps diffuse powder edges using light pressure."},
{Title: "Set up a clean workstation", Description: "Separate clean tools from used tools. Practice dispensing products onto a palette and using disposable applicators without returning them to the product.", Question: "After using a disposable lip applicator on a client, what should you do?", Options: []string{"Return it to the shared lip product", "Save it for the next client", "Discard it and use a fresh applicator when more product is needed"}, CorrectIndex: 2, Explanation: "A used disposable applicator should not be returned to a shared product or reused on another person."},
}},
{Name: "Complexion essentials", Description: "Explore shade matching, controlled coverage, and a natural-looking finish.", Lessons: []Lesson{
{Title: "Match foundation and undertone", Description: "Compare foundation swatches near the jawline in even light. Observe how each shade relates to both face and neck before choosing a match.", Question: "What is the most useful way to compare foundation shades for a face-and-neck match?", Options: []string{"Choose the lightest shade in the range", "Compare jawline swatches in even light", "Choose from the color of the bottle alone"}, CorrectIndex: 1, Explanation: "Jawline swatches help compare the foundation with the surrounding face and neck."},
{Title: "Build a thin, even base", Description: "Apply a small amount of foundation first. Blend the edges and add coverage only where the look calls for it.", Question: "How can you build coverage while retaining control of the finish?", Options: []string{"Apply several thick coats at once", "Leave product edges unblended", "Apply thin layers and assess each layer"}, CorrectIndex: 2, Explanation: "Thin layers make it easier to assess coverage, texture, and blending before adding more."},
{Title: "Balance blush and powder", Description: "Practice placing blush with a light hand. Apply powder selectively and review the finished look in consistent lighting.", Question: "How should you approach blush when learning placement and intensity?", Options: []string{"Start lightly and build the color gradually", "Apply the maximum amount immediately", "Avoid checking the result in a mirror"}, CorrectIndex: 0, Explanation: "Gradual application gives you control of intensity and allows you to adjust placement."},
}},
}},
{Key: "makeup-bridal", Name: "Bridal and Occasion Makeup", Description: "Plan a client-focused bridal look with refined eyes, balanced lips, and a repeatable finishing routine.", Tier: "PREMIUM", Chapters: []Chapter{
{Name: "Design the bridal look", Description: "Translate a consultation into a cohesive look and practice polished eye techniques.", Lessons: []Lesson{
{Title: "Run a bridal consultation", Description: "Discuss the client's preferred finish, reference images, event schedule, and styling. Record the agreed look and the products used during the trial.", Question: "What is the purpose of a bridal makeup trial record?", Options: []string{"To replace the client's preferences with a fixed look", "To record agreed choices and help reproduce the look", "To avoid discussing the event"}, CorrectIndex: 1, Explanation: "A trial record helps the artist and client agree on the design and reproduce it consistently."},
{Title: "Create a soft neutral eye", Description: "Place transition, depth, and lid shades deliberately. Blend the borders and compare the balance of both eyes as you work.", Question: "What should you check while developing a balanced eye look?", Options: []string{"Only the brush handle color", "Only one eye until the entire look is finished", "Both eyes in consistent lighting"}, CorrectIndex: 2, Explanation: "Checking both eyes during application makes it easier to notice and refine differences."},
{Title: "Refine brows and liner", Description: "Practice short, controlled strokes for brows and liner. Step back to compare shape and definition with the rest of the look.", Question: "Which approach provides control when refining a brow?", Options: []string{"Use short strokes and review the shape often", "Fill the entire area with one heavy stroke", "Choose the darkest possible product for every client"}, CorrectIndex: 0, Explanation: "Short strokes allow the artist to build definition gradually and reassess the shape."},
}},
{Name: "Finish and document", Description: "Balance the final details and prepare a clear record for an occasion look.", Lessons: []Lesson{
{Title: "Shape a balanced lip", Description: "Outline a lip shape with controlled placement. Add color in thin layers and refine the edges with a clean detail brush.", Question: "Which tool can help refine an uneven lip-color edge?", Options: []string{"A used mascara wand", "A clean detail brush", "A large powder puff"}, CorrectIndex: 1, Explanation: "A clean detail brush gives controlled access to the edge of the lip color."},
{Title: "Check the look on camera", Description: "Photograph the finished look in even light. Compare the image with the mirror view and note any visible color or blending differences.", Question: "Why review both a photograph and the mirror view of an occasion look?", Options: []string{"To guarantee identical results under every light", "To avoid asking the client for feedback", "To evaluate how the look reads in each view"}, CorrectIndex: 2, Explanation: "Comparing views helps identify details that may read differently on camera."},
{Title: "Plan a touch-up kit", Description: "Choose touch-up items that match the products and finish of the agreed look. Label the kit and record concise application notes for the client.", Question: "What makes a useful touch-up kit for a bridal look?", Options: []string{"Items selected for the agreed look with clear application notes", "A random set of unrelated colors", "Unlabeled products without instructions"}, CorrectIndex: 0, Explanation: "A look-specific kit and clear notes make it easier to maintain the agreed finish."},
}},
}},
{Key: "makeup-editorial", Name: "Creative and Editorial Makeup", Description: "Develop a visual concept, explore color and texture, and document a cohesive makeup portfolio.", Tier: "FREE", Chapters: []Chapter{
{Name: "Color and concept", Description: "Build a mood board and use color relationships to plan an intentional design.", Lessons: []Lesson{
{Title: "Build an editorial mood board", Description: "Collect references for color, shape, texture, and styling. Choose a clear focal point and sketch a face chart before application.", Question: "What should a useful makeup mood board communicate?", Options: []string{"Only the price of the products", "A coherent direction for color, shape, and texture", "Unrelated images with no design direction"}, CorrectIndex: 1, Explanation: "A focused mood board gives the team a shared visual direction for the makeup design."},
{Title: "Work with color relationships", Description: "Compare neighboring and complementary colors on a color wheel. Make swatches and choose a limited palette for a creative look.", Question: "Which pair is complementary on a traditional artist's color wheel?", Options: []string{"Blue and orange", "Blue and green", "Red and orange"}, CorrectIndex: 0, Explanation: "Blue and orange sit opposite each other on a traditional artist's color wheel."},
{Title: "Create a statement eye", Description: "Sketch a graphic eye shape on a face chart. Practice placement with controlled strokes and refine the outline before adding more detail.", Question: "What is a useful first step when planning a graphic eye design?", Options: []string{"Add every available color immediately", "Ignore the intended shape", "Sketch the shape and choose a focal point"}, CorrectIndex: 2, Explanation: "Planning the shape and focal point gives the artist a clear structure for application."},
}},
{Name: "Portfolio practice", Description: "Coordinate textures, capture consistent images, and reflect on the finished work.", Lessons: []Lesson{
{Title: "Combine matte and luminous textures", Description: "Swatch matte and luminous finishes side by side. Place them intentionally so the texture supports the chosen focal point.", Question: "Why swatch different finishes before applying an editorial look?", Options: []string{"To make all products look identical", "To compare how their textures support the design", "To replace a design plan with random choices"}, CorrectIndex: 1, Explanation: "Swatching makes differences in finish visible before committing them to the full look."},
{Title: "Photograph your finished look", Description: "Use consistent lighting, framing, and a simple background. Capture front and detail views that accurately show your blending and color choices.", Question: "Which practice makes a makeup portfolio easier to compare across looks?", Options: []string{"Use consistent lighting and framing", "Change the lighting dramatically for every image", "Hide all close-up details"}, CorrectIndex: 0, Explanation: "Consistent presentation makes it easier to compare the makeup work itself."},
{Title: "Review and improve your technique", Description: "Compare the finished look with your face chart and references. Record one successful technique and one specific adjustment for your next practice.", Question: "Which reflection is the most actionable after completing a practice look?", Options: []string{"There is nothing to review", "I should change everything without choosing a goal", "I will refine one specific blending edge in my next practice"}, CorrectIndex: 2, Explanation: "A specific observation creates a practical goal for the next attempt."},
}},
}},
}
// validateCurriculum catches incomplete fixtures before opening a transaction.
func validateCurriculum(courses []Course) error {
if len(courses) == 0 {
return fmt.Errorf("demo curriculum is empty")
}
keys := map[string]bool{}
questions := map[string]bool{}
for _, course := range courses {
if course.Key == "" || keys[course.Key] || strings.TrimSpace(course.Name) == "" || strings.TrimSpace(course.Description) == "" || (course.Tier != "FREE" && course.Tier != "PREMIUM") || len(course.Chapters) == 0 {
return fmt.Errorf("invalid demo course %q", course.Key)
}
keys[course.Key] = true
for _, chapter := range course.Chapters {
if strings.TrimSpace(chapter.Name) == "" || strings.TrimSpace(chapter.Description) == "" || len(chapter.Lessons) == 0 {
return fmt.Errorf("incomplete chapter in %s", course.Key)
}
for _, lesson := range chapter.Lessons {
if strings.TrimSpace(lesson.Title) == "" || strings.TrimSpace(lesson.Description) == "" || strings.TrimSpace(lesson.Question) == "" || strings.TrimSpace(lesson.Explanation) == "" || len(lesson.Options) < 2 || lesson.CorrectIndex < 0 || lesson.CorrectIndex >= len(lesson.Options) || questions[lesson.Question] {
return fmt.Errorf("invalid knowledge check in %s: %s", course.Key, lesson.Title)
}
questions[lesson.Question] = true
options := map[string]bool{}
for _, option := range lesson.Options {
text := strings.ToLower(strings.TrimSpace(option))
if text == "" || options[text] {
return fmt.Errorf("empty or duplicate option for %s", lesson.Title)
}
options[text] = true
}
}
}
}
return nil
}