当前位置: 首页>>代码示例>>C#>>正文


C# Course.GetDirectoryByUnitName方法代码示例

本文整理汇总了C#中Course.GetDirectoryByUnitName方法的典型用法代码示例。如果您正苦于以下问题:C# Course.GetDirectoryByUnitName方法的具体用法?C# Course.GetDirectoryByUnitName怎么用?C# Course.GetDirectoryByUnitName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Course的用法示例。


在下文中一共展示了Course.GetDirectoryByUnitName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UnitToSequentials

		private static Sequential[] UnitToSequentials(Course course, Config config, List<string> units, int unitIndex, string exerciseUrl, string solutionsUrl, Dictionary<string, string> videoGuids)
		{
			var result = new List<Sequential>
			{
				new Sequential(string.Format("{0}-{1}-{2}", course.Id, unitIndex, 0), units[unitIndex],
					course.Slides
						.Where(s => !config.IgnoredUlearnSlides.Contains(s.Id))
						.Where(y => y.Info.UnitName == units[unitIndex])
						.SelectMany(y => y.ToVerticals(course.Id, exerciseUrl, solutionsUrl, videoGuids, config.LtiId))
						.ToArray())
			};
			var note = course.FindInstructorNote(units[unitIndex]);
			var displayName = "Заметки преподавателю";
			var sequentialId = string.Format("{0}-{1}-{2}", course.Id, unitIndex, "note-seq");
			var verticalId = string.Format("{0}-{1}-{2}", course.Id, unitIndex, "note-vert");
			var mdBlockId = string.Format("{0}-{1}-{2}", course.Id, unitIndex, "note-md");
			if (note != null)
				result.Add(new Sequential(sequentialId, displayName,
					new[]
					{
						new Vertical(verticalId, displayName, new[] { new MdBlock(course.FindInstructorNote(units[unitIndex]).Markdown).ToEdxComponent(mdBlockId, displayName, course.GetDirectoryByUnitName(units[unitIndex])) })
					}) { VisibleToStaffOnly = "true" }
				);
			return result.ToArray();
		}
开发者ID:fakefeik,项目名称:uLearn,代码行数:25,代码来源:Converter.cs

示例2: PatchInstructorsNotes

		private void PatchInstructorsNotes(EdxCourse edxCourse, Course ulearnCourse, string olxPath)
		{
			var ulearnUnits = ulearnCourse.GetUnits().ToList();
			foreach (var chapter in edxCourse.CourseWithChapters.Chapters)
			{
				var chapterNote = ulearnCourse.InstructorNotes.FirstOrDefault(x => x.UnitName == chapter.DisplayName);
				if (chapterNote == null)
					continue;
				var unitIndex = ulearnUnits.IndexOf(chapterNote.UnitName);
				var displayName = "Заметки преподавателю";
				var sequentialId = string.Format("{0}-{1}-{2}", ulearnCourse.Id, unitIndex, "note-seq");
				var verticalId = string.Format("{0}-{1}-{2}", ulearnCourse.Id, unitIndex, "note-vert");
				var mdBlockId = string.Format("{0}-{1}-{2}", ulearnCourse.Id, unitIndex, "note-md");
				var sequentialNote = new Sequential(sequentialId, displayName,
					new[]
					{
						new Vertical(verticalId, displayName, new[] { new MdBlock(chapterNote.Markdown).ToEdxComponent(mdBlockId, displayName, ulearnCourse.GetDirectoryByUnitName(chapterNote.UnitName)) })
					}) { VisibleToStaffOnly = true };
				if (!File.Exists(string.Format("{0}/sequential/{1}.xml", olxPath, sequentialNote.UrlName)))
				{
					var sequentials = chapter.Sequentials.ToList();
					sequentials.Add(sequentialNote);
					new Chapter(chapter.UrlName, chapter.DisplayName, chapter.Start, sequentials.ToArray()).Save(olxPath);
				}
				sequentialNote.Save(olxPath);
			}
		}
开发者ID:kontur-edu,项目名称:uLearn,代码行数:27,代码来源:ULearnPatchOptions.cs


注:本文中的Course.GetDirectoryByUnitName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。