Nowadays, with the rapid development of Internet technology, online teaching is also very popular, and electronic whiteboard and courseware functions are essential functions in online teaching systems. This article introduces how to quickly implement them based on OMCS Basic functions of the electronic whiteboard, as well as courseware functions: advanced functions such as uploading courseware, opening courseware, turning pages of courseware, synchronizing courseware, deleting courseware, etc.
The application scenario of this article is as follows: A teacher and N students enter the same classroom, so they will see the same electronic whiteboard. The difference between the teacher role and the student role is that the teacher has special whiteboard permissions. These permissions include: uploading courseware, opening courseware, deleting courseware, drawing on the whiteboard, annotating, turning pages, etc.
The server directly moves the OMCS.Server project source code provided by OMCS.Boost without any modification.
The most common types of whiteboard courseware are: word, pdf, and ppt documents. Therefore, First of all, we need to implement the IImageConverter interface to convert pdf, ppt, and word documents into images. Correspondingly, we designed three classes: Word2ImageConverter, Pdf2ImageConverter, and Ppt2ImageConverter. Their specific implementation codes can be viewed in the source code of the Demo.
Then, we have to implement the IImageConverterFactory factory interface:
##
public class ImageConverterFactory : IImageConverterFactory { public IImageConverter CreateImageConverter(string extendName) { if (extendName == ".doc" || extendName == ".docx") { return new Word2ImageConverter(); } if (extendName == ".pdf") { return new Pdf2ImageConverter(); } if (extendName == ".ppt" || extendName == ".pptx") { return new Ppt2ImageConverter(); } return null; } public bool Support(string extendName) { return extendName == ".doc" || extendName == ".docx" || extendName == ".pdf" || extendName == ".ppt" || extendName == ".pptx"; } }
Then, when the program starts, inject the factory into the multimedia manager (IMultimediaManager) of OMCS:
IMultimediaManager multimediaManager = MultimediaManagerFactory.GetSingleton(); multimediaManager.ImageConverterFactory = new ImageConverterFactory(); // 图片转换器工厂,供OMCS内部将课件转换成图片的过程中使用。
public WhiteBoardForm(string classRid, bool isTeacher ) { InitializeComponent(); this.classRoomID = classRid; this.whiteBoardConnector1.IsManager = isTeacher; this.whiteBoardConnector1.WatchingOnly = !isTeacher; this.Text = string.Format("正在访问{0}的电子白板" ,this.classRoomID); this.whiteBoardConnector1.ConnectEnded += new CbGeneric<ConnectResult>(whiteBoardConnector1_ConnectEnded); this.whiteBoardConnector1.BeginConnect(this.classRoomID); }
Source code: OMCS.Demos.WhiteBoardTest.rar
When running the system for testing, please note:
(1) Start the OMCS server.
(2) Start the first client, select the "teacher" role, and log in to the default classroom.
(3) Start multiple clients, select the "student" role, and log in to the default classroom.
(4) Teachers can upload courseware, open courseware, delete courseware, turn pages of courseware, mark and write on courseware, and other operations.
The teacher interface is as follows:
[Recommended course: C# video tutorial]
The above is the detailed content of C# implements network electronic whiteboard and courseware functions (online teaching system). For more information, please follow other related articles on the PHP Chinese website!