Online teaching System: C # realizes network Whiteboard, courseware function

Source: Internet
Author: User

The function of electronic whiteboard and courseware is a necessary function in the online teaching system, this article introduces how to realize the basic function of electronic whiteboard based on OMCS, and the function of courseware: Uploading courseware, playing class, courseware paging, courseware synchronization, deleting courseware and other advanced functions.

The application scenario for this article is this: a teacher and n students go into the same classroom, so they will see the same electronic whiteboard. The difference between teacher role and student role is that teachers have special Whiteboard permissions, which include: uploading courseware, playing classes, deleting courseware, drawing on the whiteboard, labeling, paging, and so on.

I. Service-side

The service side will be OMCS directly. Boost provides the Omcs.server project source code to move over, without making any changes.

Two. Client 1. Realize the conversion of courseware to picture

The most common types of whiteboard courseware are:Word, PDF, PPT document. So, first, we need to implement the Iimageconverter interface to convert PDFs, PPT, Word documents into pictures. In response, we have designed three classes: Word2imageconverter, Pdf2imageconverter, Ppt2imageconverter. The specific implementation code for them can be viewed in the demo source.

Then we want to implement the Iimageconverterfactory factory interface:

 Public class imageconverterfactory : iimageconverterfactory { Public IimageconverterCreateimageconverter (stringextendname) {            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 BOOLSupport (stringextendname) {            returnExtendname = =". 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 =imageconverterfact Ory    = new   Imageconverterfactory  (); //  Picture Converter factory, used in the process of converting courseware into pictures inside Omcs. 
2. Distinguish roles during login: teachers, students

The client login interface is designed as follows:

Depending on the selected role, when you enter the whiteboard, you have different permissions, mainly in the Whiteboard connector's two property settings:

     PublicWhiteboardform (stringClassrid,BOOListeacher)                               {InitializeComponent ();  This. Classroomid =Classrid;  This. WhiteBoardConnector1.Ismanager=Isteacher;  This. WhiteBoardConnector1.watchingonly= !Isteacher;  This. Text =string. Format ("accessing the electronic whiteboard for {0}", This. Classroomid);  This. whiteboardconnector1.connectended + =NewCbgeneric<connectresult>(whiteboardconnector1_connectended);  This. Whiteboardconnector1.beginconnect ( This. Classroomid); }

The Ismanager attribute is used to control whether there is permission to upload courseware, to play classes, to delete courseware, etc.

The Watchingonly property is used to control whether a user can draw an image on a whiteboard.

In this demo, we set the effect is that the teacher can operate courseware, and can draw on the whiteboard, writing, etc., but students can only watch the Whiteboard, can not do anything.

Three. Download

Source: OMCS.Demos.WhiteBoardTest.rar

When running the system for testing, please note that:

(1) Start the OMCS server.

(2) Start the first client, select the "Teacher" role, 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, play classes, delete courseware, courseware page, mark on courseware, write, and so on.

The teacher-side interface is as follows:



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Online teaching System: C # realizes network Whiteboard, courseware function

Related Article

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.