Online Teaching System: C # functions of online electronic whiteboards and Courseware,

Source: Internet
Author: User
Tags image converter

Online Teaching System: C # functions of online electronic whiteboards and Courseware,

The electronic whiteboard and courseware functions are essential functions in the online teaching system. This article describes how to quickly implement the basic functions of the electronic whiteboard based on OMCS and the courseware functions: advanced functions such as uploading courseware, Opening Courseware, turning courseware pages, synchronizing courseware, and deleting courseware.

The Application Scenario in this article is as follows: a teacher and N students enter the same classroom, so they will see the same whiteboard. The difference between the instructor role and the student role is that the teacher has special whiteboard permissions, including uploading courseware, Opening Courseware, deleting courseware, drawing, tagging, and turning pages on the whiteboard.

I. Server

The Server directly moves the source code of the OMCS. Server project provided by OMCS. Boost without any modifications.

Ii. Client 1. Implement the conversion from courseware to image

The most common types of whiteboard courseware are word, pdf, and ppt documents. Therefore, we need to implement the IImageConverter interface to Convert pdf, ppt, and Word documents into images. Accordingly, we designed three classes: Word2ImageConverter, javas2imageconverter, and Ppt2ImageConverter. The specific implementation code can be viewed in the Demo source code.

Then, we need to implement the IImageConverterFactory 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 OMCS multimedia Manager (IMultimediaManager:

IMultimediaManager multimediaManager = MultimediaManagerFactory. GetSingleton (); multimediaManager. ImageConverterFactory = new ImageConverterFactory (); // The Image Converter factory for OMCS to convert courseware to images.
2. Logon Time Zone roles: teachers and students

The client logon interface is designed as follows:

Different roles have different permissions when entering the whiteboard, mainly reflected in the two attribute settings of the whiteboard connector:

Public WhiteBoardForm (string classRid, bool isTeacher) {InitializeComponent (); this. classRoomID = classRid; this. whiteBoardConnector1.IsManager = isTeacher; this. Authorization =! IsTeacher; this. text = string. format ("accessing the {0} whiteboard", this. classRoomID); this. whiteBoardConnector1.ConnectEnded + = new CbGeneric <ConnectResult> (whiteBoardConnector1_ConnectEnded); this. whiteBoardConnector1.BeginConnect (this. classRoomID );}

The IsManager attribute is used to control whether you have the permission to upload courseware, open courseware, and delete courseware.

The WatchingOnly attribute is used to control whether users can draw images on the whiteboard.

In this Demo, the effect we set is that the teacher can operate the courseware and draw and write on the whiteboard, but the students can only watch the whiteboard and cannot perform any operations.

Iii. Download

Source code: OMCS.Demos.WhiteBoardTest.rar

Note the following before testing the system:

(1) Start the OMCS server.

(2) start the first client, select the "teacher" role, and log on to the default classroom.

(3) Start Multiple clients, select the "student" role, and log on to the default classroom.

(4) instructors can upload courseware, open courseware, delete courseware, flip courseware pages, and Mark and write courseware.

The instructor interface is as follows:



Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.