Exemplo n.º 1
0
        private static void Show(Lesson lesson, LessonExtension ext, IList <Assignment> lst, int i)
        {
            var obj = lst[i];

            Console.Write("==================================");
            if (obj.IsIgnored)
            {
                Console.WriteLine();
            }
            else if (!obj.IsSubmitted)
            {
                Console.WriteLine("[NOT SUBMITTED]");
            }
            else
            {
                Console.WriteLine("[SUBMITTED]");
            }
            Console.Write(ext.Assignments.Count == lst.Count ? $"[{i,3}]" : "[   ]");
            Console.WriteLine($" {lesson.Term} {lesson.Name}/a/{obj.Title}");
            Console.WriteLine($"Date: {obj.Date:yyyyMMdd}");
            Console.WriteLine($"Due:  {obj.DueDate:yyyyMMdd}");
            Console.WriteLine($"File: {obj.FileSize,20:N0}B {obj.FileName}");
            Console.WriteLine($"{obj.Score,10} {obj.Assess}");
            Console.WriteLine(obj.Content);
            Console.WriteLine();
        }
Exemplo n.º 2
0
        private static void Show(Lesson lesson, LessonExtension ext, IList <Announcement> lst, int i)
        {
            var obj = lst[i];

            Console.WriteLine("==================================");
            Console.Write(ext.Announcements.Count == lst.Count ? $"[{i,3}]" : "[   ]");
            Console.WriteLine($" {lesson.Term} {lesson.Name}/a/{obj.Title}");
            Console.WriteLine($"Date: {obj.Date:yyyyMMdd} From: {obj.From}");
            Console.WriteLine(obj.Content);
            Console.WriteLine();
        }
Exemplo n.º 3
0
        private static void Show(Lesson lesson, LessonExtension ext, IList <Document> lst, int i)
        {
            var obj = lst[i];

            Console.WriteLine("==================================");
            Console.Write(ext.Documents.Count == lst.Count ? $"[{i,3}]" : "[   ]");
            Console.WriteLine($" {lesson.Term} {lesson.Name}/a/{obj.Title}");
            Console.WriteLine($"Date: {obj.Date:yyyyMMdd}");
            Console.WriteLine($"File: {obj.FileSize,20:N0}B {obj.FileName}");
            Console.WriteLine(obj.Abstract);
            Console.WriteLine();
        }
Exemplo n.º 4
0
        protected override int ConcreteRun(Lesson lesson, LessonExtension ext, IEnumerable <Assignment> objs)
        {
            var lst = objs.ToList();

            for (var i = 0; i < lst.Count; i++)
            {
                Show(lesson, ext, lst, i);
                PromptForIgnore(lst[i], false);
            }

            return(0);
        }
Exemplo n.º 5
0
        public static LessonExtension From(Lesson lesson)
        {
            LessonExtension ext;

            if (Dic.TryGetValue(lesson, out ext))
            {
                return(ext);
            }

            ext = new LessonExtension(lesson);
            try
            {
                ext.Load();
            }
            catch (Exception)
            {
                // ignore
            }
            Dic.Add(lesson, ext);
            return(ext);
        }
Exemplo n.º 6
0
 protected sealed override int ConcreteRun(Lesson lesson, LessonExtension ext, IEnumerable <Assignment> objs) =>
 ConcreteRun(lesson, objs);
Exemplo n.º 7
0
 protected abstract int ConcreteRun(Lesson lesson, LessonExtension ext, IEnumerable <Assignment> objs);
Exemplo n.º 8
0
 public static LessonExtension Extension(this Lesson l) => LessonExtension.From(l);