コード例 #1
0
ファイル: SlideRateRepo.cs プロジェクト: epeshk/uLearn
        public Rates GetRates(Guid slideId, string courseId)
        {
            var rates    = new Rates();
            var allRates = db.SlideRates.Where(x => x.SlideId == slideId).ToList();

            foreach (var rate in allRates)
            {
                if (rate.Rate == SlideRates.Good)
                {
                    rates.AddGood();
                }
                if (rate.Rate == SlideRates.NotUnderstand)
                {
                    rates.AddNotUnderstand();
                }
                if (rate.Rate == SlideRates.NotWatched)
                {
                    rates.AddNotWatched();
                }
                if (rate.Rate == SlideRates.Trivial)
                {
                    rates.AddTrivial();
                }
            }
            return(rates);
        }
コード例 #2
0
ファイル: SlideRateRepo.cs プロジェクト: kontur-edu/uLearn
		public Rates GetRates(Guid slideId, string courseId)
		{
			var rates = new Rates();
			var allRates = db.SlideRates.Where(x => x.SlideId == slideId).ToList();
			foreach (var rate in allRates)
			{
				if (rate.Rate == SlideRates.Good)
					rates.AddGood();
				if (rate.Rate == SlideRates.NotUnderstand)
					rates.AddNotUnderstand();
				if (rate.Rate == SlideRates.NotWatched)
					rates.AddNotWatched();
				if (rate.Rate == SlideRates.Trivial)
					rates.AddTrivial();
			}
			return rates;
		}