Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

How-To Tutorials - Server-Side Web Development

404 Articles
article-image-android-application-testing-getting-started
Packt
24 Jun 2011
9 min read
Save for later

Android Application Testing: Getting Started

Packt
24 Jun 2011
9 min read
We will avoid introductions to Android and the Open Handset Alliance (http://www.openhandsetalliance.com) as they are covered in many books already and I am inclined to believe that if you are reading this article covering this more advanced topic you have started with Android development before. However, we will be reviewing the main concepts behind testing and the techniques, frameworks, and tools available to deploy your testing strategy on Android. Brief history Initially, when Android was introduced by the end of 2007, there was very little support for testing in the platform, and for some of us very accustomed to using testing as a component intimately coupled with the development process, it was the time to start developing some frameworks and tools to permit this approach. By that time Android had some rudimentary support for unit testing using JUnit (https://junit.org/junit5/), but it was not fully supported and even less documented. In the process of writing my own library and tools, I discovered Phil Smith's Positron , an Open Source library and a very suitable alternative to support testing on Android, so I decided to extend his excellent work and bring some new and missing pieces to the table. Some aspects of test automation were not included and I started a complementary project to fill that gap, it was consequently named Electron. And although positron is the anti-particle of the electron, and they annihilate if collide, take for granted that that was not the idea, but more the conservation of energy and the generation of some visible light and waves. Later on, Electron entered the first Android Development Challenge (ADC1) in early 2008 and though it obtained a rather good score in some categories, frameworks had no place in that competition. Should you be interested in the origin of testing on Android, please find some articles and videos that were published in my personal blog (http://dtmilano.blogspot.co.uk/search/label/electron). By that time Unit Tests could be run on Eclipse. However, testing was not done on the real target but on a JVM on the local development computer. Google also provided application instrumentation code through the Instrumentation class. When running an application with instrumentation turned on, this class is instantiated for you before any of the application code, allowing you to monitor all of the interaction the system has with the application. An Instrumentation implementation is described to the system through an AndroidManifest.xml file. Software bugs It doesn't matter how hard you try and how much time you invest in design and even how careful you are when programming, mistakes are inevitable and bugs will appear. Bugs and software development are intimately related. However, the term bugs to describe flaws, mistakes, or errors has been used in hardware engineering many decades before even computers were invented. Notwithstanding the story about the term bug coined by Mark II operators at Harvard University, Thomas Edison wrote this in 1878 in a letter to Puskás Tivadar showing the early adoption of the term: "It has been just so in all of my inventions. The first step is an intuition, and comes with a burst, then difficulties arise — this thing gives out and [it is] then that 'Bugs' — as such little faults and difficulties are called — show themselves and months of intense watching, study and labor are requisite before commercial success or failure is certainly reached." How bugs severely affect your projects Bugs affect many aspects of your software development project and it is clearly understood that the sooner in the process you find and squash them, the better. It doesn't matter if you are developing a simple application to publish on the Android Market, you are re-branding the Android experience for an operator, or creating a customized version of Android for a device manufacturer, bugs will delay your shipment and will cost you money. From all of the software development methodologies and techniques, Test Driven Development, an agile component of the software development process, is likely the one that forces you to face your bugs earlier in the development process and thus it is also likely that you will solve more problems up front. Furthermore, the increase in productivity can be clearly appreciated in a project where a software development team uses this technique versus one that is, in the best of the cases, writing tests at the end of the development cycle. If you have been involved in software development for the mobile industry, you will have reasons to believe that with all the rush this stage never occurs. It's funny because usually, this rush is to solve problems that could have been avoided. In a study conducted by the National Institute of Standards and Technology (USA) in 2002, it was reported that software bugs cost the country economy $59.5 billion annually. More than a third of this cost can be avoided if better software testing is performed. But please, don't misunderstand this message. There are no silver bullets in software development and what will lead you to an increase in productivity and manageability of your project is the discipline applying these methodologies and techniques to stay in control. Why, what, how, and when to test You should understand that early bug detection saves huge amount of project resources and reduces software maintenance costs. This is the best known reason to write software tests for your development project. Increased productivity will soon be evident. Additionally, writing the tests will give you a deeper understanding of the requirements and the problem to be solved. You will not be able to write tests for a piece of software you don't understand. This is also the reason behind the approach of writing tests to clearly understand legacy or third party code and having the infrastructure to confidently change or update it. The more the code is covered by your tests, the higher could be your expectations of discovering the hidden bugs. If during this coverage analysis you find that some areas of your code are not exercised, additional tests should be added to cover this code as well. This technique requires a special instrumented Android build to collect probe data and must be disabled for any release code because the impact on performance could severely affect application behavior. To fill in this gap, enter EMMA (http://emma.sourceforge.net/), an open-source toolkit for measuring and reporting Java code coverage, that can offline instrument classes for coverage. It supports various coverage types: class method line basic block Coverage reports can also be obtained in different output formats. EMMA is supported up to some degree by the Android framework and it is possible to build an EMMA instrumented version of Android. This screenshot shows how an EMMA code coverage report is displayed in the Eclipse editor, showing green lines when the code has been tested, provided the corresponding plugin is installed. (Move the mouse over the image to enlarge it.) Unfortunately, the plugin doesn't support Android tests yet, so right now you can use it for your JUnit tests only. Android coverage analysis report is only available through HTML. Tests should be automated and you should run some or all tests every time you introduce a change or addition to your code in order to ensure that all the conditions that were met before are still met and that the new code satisfies the tests as expected. This leads us to the introduction of Continuous Integration. It relies on the automation of tests and building processes. If you don't use automated testing, it is practically impossible to adopt Continuous Integration as part of the development process and it is very difficult to ensure that changes would not break existing code. What to test Strictly speaking you should test every statement in your code but this also depends on different criteria and can be reduced to test the path of execution or just some methods. Usually there's no need to test something that can't be broken, for example it usually makes no sense to test getters and setters as you probably won't be testing the Java compiler on your own code and the compiler would have already performed its tests. In addition to the functional areas you should test, there are some specific areas of Android applications that you should consider. We will be looking at these in the following sections. Activity lifecycle events You should test that your activities handle lifecycle events correctly. If your activity should save its state during onPause() or onDestroy() events and later be able to restore it in onCreate(Bundle savedInstanceState), you should be able to reproduce and test all these conditions and verify that the state was correctly saved and restored. Configuration-changed events should also be tested as some of these events cause the current Activity to be recreated, and you should test correct handling of the event and the newly created Activity preserves the previous state. Configuration changes are triggered even by rotation events, so you should test you application's ability to handle these situations. Database and filesystem operations Database and filesystem operations should be tested to ensure that they are handled correctly. These operations should be tested in isolation at the lower system level, at a higher level through ContentProviders, or from the application itself. To test these components in isolation, Android provides some mock objects in the android.test.mock package. Physical characteristics of the device Much before delivering your application you should be sure that all of the different devices it can be run on are supported or at less you should detect the situation and take pertinent measures. Among other characteristics of the devices, you may find that you should test: Network capabilities Screen densities Screen resolutions Screen sizes Availability of sensors Keyboard and other input devices GPS External storage In this respect Android Virtual Devices play an important role because it is practically impossible to have access to all of the devices with all of the possible combinations of features but you can configure AVD for almost every situation. However, as it was mentioned before, leave your final tests for actual devices where the real users will run the application to understand its behavior.
Read more
  • 0
  • 0
  • 1773

article-image-how-create-lesson-moodle-2
Packt
24 Jun 2011
7 min read
Save for later

How to Create a Lesson in Moodle 2

Packt
24 Jun 2011
7 min read
  History Teaching with Moodle 2 Create a History course in Moodle packed with lessons and activities to make learning and teaching History interactive and fun  Approaching the lesson We plan to introduce our Year 7 History class to the idea of the Doomsday Book as a means by which William reinforced his control over the country. William was naturally curious about the country he had just conquered. He was particularly keen to find out how much it was worth. He despatched officials to every village with detailed questions to ask about the land that they worked on and the animals that they farmed with. He also sent soldiers who threatened to kill people who lied. All of the records from these village surveys were collated into the Doomsday Book. Many Saxons detested the process and the name of the book is derived from this attitude of loathing towards something they regarded as intrusive and unfair. William died before the process could be completed. Clear lesson objectives can be stated at the start of the lesson. Students would be expected to work through each page and answer questions identical to those found in the Quiz module. The lesson gives students the opportunity to return to a page if the required level of understanding has not been achieved. The lesson questions help students to reach an understanding at their own pace. The short video clips we intend to use will come from the excellent National Archive website. It has links to short sequences of approximately ninety seconds in which actors take on the role of villagers and commissioners and offer a variety of opinions about the nature and purpose of the survey that they are taking part in. At the end of the lesson, we want the students to have an understanding of: The purpose of the Domesday Book How the information was compiled A variety of attitudes towards the whole process Our starting point is to create a flow diagram that captures the routes a student might take through the lesson: The students will see the set of objectives, a short introduction to the Doomsday Book, and a table of contents. They can select the videos in any order. When they have watched each video and answered the questions associated with the content they will be asked to write longer answers to a series of summative questions. These answers are marked individually by the teacher who thus gets a good overall idea of how well the students have absorbed the information. The assessment of these questions could easily include our essay outcomes marking scale. The lesson ends when the student has completed all of the answers. The lesson requires: A branch table (the table of contents). Four question pages based upon a common template. One end of branch page. A question page for the longer answers. An end of lesson page. The lesson awards marks for the correct answers to questions on each page in much the same way as if they were part of a quiz. Since we are only adding one question per page the scores for these questions are of less significance than a student's answers to the essay questions at the end of the lesson. It is after all, these summative questions that allow the students to demonstrate their understanding of the content they have been working with. Moodle allows this work to be marked in exactly the same way as if it was an essay. This time it will be in the form of an online essay and will take up its place in the Gradebook. We are, therefore, not interested in a standard mark for the students' participation in the lesson and when we set the lesson up, this will become apparent through the choices we make.   Setting up a lesson It is important to have a clear idea of the lesson structure before starting the creation of the lesson. We have used paper and pen to create a flow diagram. We know which images, videos, and text are needed on each page and have a clear idea of the formative and summative questions that will enable us to challenge our students and assess how well they have understood the significance of the Doomsday Book. We are now in a position to create the lesson: Enter the Year 7 History course and turn on editing. In Topic 1, select Add an Activity and click Lesson. In the Name section, enter an unambiguous name for the lesson as this is the text that students will click on to enter the lesson. Enter the values as shown in the following screenshot: In the General section, we do not want to impose a time limit on the lesson. We do need to state how many options there are likely to be on each question page. For multiple choice questions, there are usually four options. In the Grade section, we want the essay that they compose at the end of the lesson to be marked in the same way that other essays have been marked. In the Grade options, our preference is to avoid using the lesson questions as an assessment activity. We want it to be a practice lesson where students can work through the activities without needing to earn a score. We have turned off scoring. The students' final essay submission will be marked in line with our marking policy. Students can retake it as many times as they want to. In the Flow control section, we have clicked the Show advanced button to see all of the options available. We want students to be able to navigate the pages to check answers and go back to review answers if necessary. They can take the lesson as often as they want as we intend it to be used for revision purposes for a timed essay or in the summer examination. We have ignored the opportunity to add features such as menus and progress bars as we will be creating our own navigation system. This section also concerns the look and feel of the pages if set to a slide show, an option we are not planning to use. We are planning to create a web link on each page rather than have students download files so we will not be using the Popup to file or web page option. If you are concerned about the stability of your Internet connection for the weblinks to videos you plan to show, there is an alternative option. This would involve downloading the files to your computer and converting them to .flv files. They can then be uploaded to the file picker in the usual way and a link can be created to each one using the Choose a file button shown here. Moodle's video player would play the videos and you would not be reliant on an unstable Internet connection to see the results. The Dependent on section allows further restrictions to be imposed that are not appropriate for this lesson. We do however, want to mark the essay that will be submitted in accordance with the custom marking scheme developed earlier in the course. The box in the Outcomes section must be checked. Clicking the Save and return to course button ensures that the newly created lesson, The Domesday Book, awaits in Topic 1.  
Read more
  • 0
  • 0
  • 2391

article-image-ejb-31-controlling-security-programmatically-using-jaas
Packt
17 Jun 2011
5 min read
Save for later

EJB 3.1: Controlling Security Programmatically Using JAAS

Packt
17 Jun 2011
5 min read
  EJB 3.1 Cookbook Build real world EJB solutions with a collection of simple but incredibly effective recipes The reader is advised to refer the initial two recipies from the previous article on the process of handling security using annotations. Getting ready Programmatic security is affected by adding code within methods to determine who the caller is and then allowing certain actions to be performed based on their capabilities. There are two EJBContext interface methods available to support this type of security: getCallerPrincipal and isCallerInRole. The SessionContext object implements the EJBContext interface. The SessionContext's getCallerPrincipal method returns a Principal object which can be used to get the name or other attributes of the user. The isCallerInRole method takes a string representing a role and returns a Boolean value indicating whether the caller of the method is a member of the role or not. The steps for controlling security programmatically involve: Injecting a SessionContext instance Using either of the above two methods to effect security How to do it... To demonstrate these two methods we will modify the SecurityServlet to use the VoucherManager's approve method and then augment the approve method with code using these methods. First modify the SecurityServlet try block to use the following code. We create a voucher as usual and then follow with a call to the submit and approve methods. out.println("<html>"); out.println("<head>"); out.println("<title>Servlet SecurityServlet</title>"); out.println("</head>"); out.println("<body>"); voucherManager.createVoucher("Susan Billings", "SanFrancisco", BigDecimal.valueOf(2150.75)); voucherManager.submit(); boolean voucherApproved = voucherManager.approve(); if(voucherApproved) { out.println("<h3>Voucher was approved</h3>"); } else { out.println("<h3>Voucher was not approved</h3>"); } out.println("<h3>Voucher name: " + voucherManager.getName() + "</h3>"); out.println("</body>"); out.println("</html>"); Next, modify the VoucherManager EJB by injecting a SessionContext object using the @Resource annotation. public class VoucherManager { ... @Resource private SessionContext sessionContext; Let's look at the getCallerPrincipal method first. This method returns a Principal object (java.security.Principal) which has only one method of immediate interest: getName. This method returns the name of the principal. Modify the approve method so it uses the SessionContext object to get the Principal and then determines if the name of the principal is "mary" or not. If it is, then approve the voucher. public boolean approve() { Principal principal = sessionContext.getCallerPrincipal(); System.out.println("Principal: " + principal.getName()); if("mary".equals(principal.getName())) { voucher.setApproved(true); System.out.println("approve method returned true"); return true; } else { System.out.println("approve method returned false"); return false; } } Execute the SecurityApplication using "mary" as the user. The application should approve the voucher with the output as shown in the following screenshot: Execute the application again with a user of "sally". This execution will result in an exception. INFO: Access exception The getCallerPrincipal method simply returns the principal. This frequently results in the need to explicitly include the name of a user in code. The hard coding of user names is not recommended. Checking against each individual user can be time consuming. It is more efficient to check to see if a user is in a role. The isCallerInRole method allows us to determine whether the user is in a particular role or not. It returns a Boolean value indicating whether the user is in the role specified by the method's string argument. Rewrite the approve method to call the isCallerInRole method and pass the string "manager" to it. If the return value returns true, approve the voucher. public boolean approve() { if(sessionContext.isCallerInRole("manager")) { voucher.setApproved(true); System.out.println("approve method returned true"); return true; } else { System.out.println("approve method returned false"); return false; } } Execute the application using both "mary" and "sally". The results of the application should be the same as the previous example where the getCallerPrincipal method was used. How it works... The SessionContext class was used to obtain either a Principal object or to determine whether a user was in a particular role or not. This required the injection of a SessionContext instance and adding code to determine if the user was permitted to perform certain actions. This approach resulted in more code than the declarative approach. However, it provided more flexibility in controlling access to the application. These techniques provided the developer with choices as to how to best meet the needs of the application. There's more... It is possible to take different actions depending on the user's role using the isCallerInRole method. Let's assume we are using programmatic security with multiple roles. @DeclareRoles ({"employee", "manager","auditor"}) We can use a validateAllowance method to accept a travel allowance amount and determine whether it is appropriate based on the role of the user. public boolean validateAllowance(BigDecimal allowance) { if(sessionContext.isCallerInRole("manager")) { if(allowance.compareTo(BigDecimal.valueOf(2500)) <= 0) { return true; } else { return false; } } else if(sessionContext.isCallerInRole("employee")) { if(allowance.compareTo(BigDecimal.valueOf(1500)) <= 0) { return true; } else { return false; } } else if(sessionContext.isCallerInRole("auditor")) { if(allowance.compareTo(BigDecimal.valueOf(1000)) <= 0) { return true; } else { return false; } } else { return false; } } The compareTo method compares two BigDecimal values and returns one of three values: -1 – If the first number is less than the second number 0 – If the first and second numbers are equal 1 – If the first number is greater than the second number The valueOf static method converts a number to a BigDecimal value. The value is then compared to allowance. Summary This article covered programmatic EJB security based upon the Java Authentication and Authorization Service (JAAS) API. Further resources on this subject: EJB 3.1: Introduction to Interceptors [Article] EJB 3.1: Working with Interceptors [Article] Hands-on Tutorial on EJB 3.1 Security [Article] EJB 3 Entities [Article] Developing an EJB 3.0 entity in WebLogic Server [Article] Building an EJB 3.0 Persistence Model with Oracle JDeveloper [Article] NetBeans IDE 7: Building an EJB Application [Article]
Read more
  • 0
  • 0
  • 1478
Banner background image

article-image-hands-tutorial-ejb-31-security
Packt
15 Jun 2011
9 min read
Save for later

Hands-on Tutorial on EJB 3.1 Security

Packt
15 Jun 2011
9 min read
EJB 3.1 Cookbook Security is an important aspect of many applications. Central to EJB security is the control of access to classes and methods. There are two approaches to controlling access to EJBs. The first, and the simplest, is through the use of declarative annotations to specify the types of access permitted. The second approach is to use code to control access to the business methods of an EJB. This second approach should not be used unless the declarative approach does not meet the needs of the application. For example, access to a method may be denied during certain times of the day or during certain maintenance periods. Declarative security is not able to handle these types of situations. In order to incorporate security into an application, it is necessary to understand the Java EE environment and its terminology. The administration of security for the underlying operating system is different from that provided by the EE server. The EE server is concerned with realms, users and groups. The application is largely concerned with roles. The roles need to be mapped to users and groups of a realm for the application to function properly. A realm is a domain for a server that incorporates security policies. It possesses a set of users and groups which are considered valid users of an application. A user typically corresponds to an individual while a group is a collection of individuals. Group members frequently share a common set of responsibilities. A Java EE server may manage multiple realms. An application is concerned with roles. Access to EJBs and their methods is determined by the role of a user. Roles are defined in such a manner as to provide a logical way of deciding which users/groups can access which methods. For example, a management type role may have the capability to approve a travel voucher whereas an employee role should not have that capability. By assigning certain users to a role and then specifying which roles can access which methods, we are able to control access to EJBs. The use of groups makes the process of assigning roles easier. Instead of having to map each individual to a role, the user is assigned to a group and the group is mapped to a role. The business code does not have to check every individual. The Java EE server manages the assignment of users to groups. The application needs only be concerned with controlling a group's access. A group is a server level concept. Roles are application level. One group can be associated with multiple applications. For example, a student group may use a student club and student registration application while a faculty group might also use the registration application but with more capability. A role is simply a name for a set of capabilities. For example, an auditor role may be to review and certify a set of accounts. This role would require read access to many, if not all, of the accounts. However, modification privileges may be restricted. Each application has its own set of roles which have been defined to meet the security needs of the application. The EE server manages realms consisting of users, groups, and resources. The server will authenticate users using Java's underlying security features. The user is then referred to as a principal and has a credential containing the user's security attributes. During the deployment of an application, users and groups are mapped to roles of the application using a deployment descriptor. The configuration of the deployment descriptor is normally the responsibility of the application deployer. During the execution of the application, the Java Authentication and Authorization Service (JAAS) API authenticates a user and creates a principal representing the user. The principal is then passed to an EJB. Security in a Java EE environment can be viewed from different perspectives. When information is passed between clients and servers, transport level security comes into play. Security at this level can include Secure HTTP (HTTPS) and Secure Sockets Layer (SSL). Messages can be sent across a network in the form of Simple Object Access Protocol (SOAP) messages. These messages can be encrypted. The EE container for EJBs provides application level security which is the focus of the chapter. Most servers provide unified security support between the web container and the EJB container. For example, calls from a servlet in a web container to an EJB are handled automatically resulting in a flexible security mechanism. Most of the recipes presented in this article are interrelated. If your intention is to try out the code examples, then make sure you cover the first two recipes as they provide the framework for the execution of the other recipes. In the first recipe, Creating the SecurityApplication, we create the foundation application for the remaining recipes. In the second recipe, Configuring the server to handle security, the basic steps needed to configure security for an application are presented. The use of declarative security is covered in the Controlling security using declarations recipe while programmatic security is discussed in the next article on Controlling security programmatically. The Understanding and declaring roles recipe examines roles in more detail and the Propagating identity recipe talks about how the identity of a user is managed in an application. Creating the SecurityApplication In this article, we will create a SecurityApplication built around a simple Voucher entity to persist travel information. This is a simplified version of an application that allows a user to submit a voucher and for a manager to approve or disapprove it. The voucher entity itself will hold only minimal information. Getting ready The illustration of security will be based on a series of classes: Voucher – An entity holding travel-related information VoucherFacade – A facade class for the entity AbstractFacade – The base class of the VoucherFacade VoucherManager – A class used to manage vouchers and where most of the security techniques will be demonstrated SecurityServlet – A servlet used to drive the demonstrations All of these classes will be members of the packt package in the EJB module except for the servlet which will be placed in the servlet package of the WAR module. How to do it... Create a Java EE application called SecurityApplication with an EJB and a WAR module. Add a packt package to the EJB module and an entity called Voucher to the package. Add five private instance variables to hold a minimal amount of travel information: name, destination, amount, approved, and an id. Also, add a default and a three argument constructor to the class to initialize the name, destination, and amount fields. The approved field is also set to false. The intent of this field is to indicate whether the voucher has been approved or not. Though not shown below, also add getter and setter methods for these fields. You may want to add other methods such as a toString method if desired. @Entity public class Voucher implements Serializable { private String name; private String destination; private BigDecimal amount; private boolean approved; @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; public Voucher() { } public Voucher(String name, String destination, BigDecimal amount) { this.name = name; this.destination = destination; this.amount = amount; this.approved = false; } ... } Next, add an AbstractFacade class and a VoucherFacade class derived from it. The VoucherFacade class is shown below. As with other facade classes found in previous chapters, the class provides a way of accessing an entity manager and the base class methods of the AbstractFacade class. @Stateless public class VoucherFacade extends AbstractFacade<Voucher> { @PersistenceContext(unitName = "SecurityApplication-ejbPU") private EntityManager em; protected EntityManager getEntityManager() { return em; } public VoucherFacade() { super(Voucher.class); } } Next, add a stateful EJB called VoucherManager. Inject an instance of the VoucherFacade class using the @EJB annotation. Also add an instance variable for a Voucher. We need a createVoucher method that accepts a name, destination, and amount arguments, and then creates and subsequently persists the Voucher. Also, add get methods to return the name, destination, and amount of the voucher. @Stateful public class VoucherManager { @EJB VoucherFacade voucherFacade; Voucher voucher; public void createVoucher(String name, String destination, BigDecimal amount) { voucher = new Voucher(name, destination, amount); voucherFacade.create(voucher); } public String getName() { return voucher.getName(); } public String getDestination() { return voucher.getDestination(); } public BigDecimal getAmount() { return voucher.getAmount(); } ... } Next add three methods: submit – This method is intended to be used by an employee to submit a voucher for approval by a manager. To help explain the example, display a message showing when the method has been submitted. approve – This method is used by a manager to approve a voucher. It should set the approved field to true and return true. reject – This method is used by a manager to reject a voucher. It should set the approved field to false and return false. @Stateful public class VoucherManager { ... public void submit() { System.out.println("Voucher submitted"); } public boolean approve() { voucher.setApproved(true); return true; } public boolean reject() { voucher.setApproved(false); return false; } } To complete the application framework, add a package called servlet to the WAR module and a servlet called SecurityServlet to the package. Use the @EJB annotation to inject a VoucherManager instance field into the servlet. In the try block of the processRequest method, add code to create a new voucher and then use the submit method to submit it. Next, display a message indicating the submission of the voucher. public class SecurityServlet extends HttpServlet { @EJB VoucherManager voucherManager; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { voucherManager.createVoucher("Susan Billings", "SanFrancisco", BigDecimal.valueOf(2150.75)); voucherManager.submit(); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet SecurityServlet</title>"); out.println("</head>"); out.println("<body>"); out.println("<h3>Voucher was submitted</h3>"); out.println("</body>"); out.println("</html>"); } finally { out.close(); } } ... } Execute the SecurityServlet. Its output should appear as shown in the following screenshot: How it works... In the Voucher entity, notice the use of BigDecimal for the amount field. This java.math package class is a better choice for currency data than float or double. Its use avoids problems which can occur with rounding. The @GeneratedValue annotation, used with the id field, is for creating an entity facade. In the VoucherManager class, notice the injection of the stateless VoucherFacade session EJB into a stateful VoucherManager EJB. Each invocation of a VoucherFacade method may result in the method being executed against a different instance of VoucherManager. This is the correct use of a stateless session EJB. The injection of a stateful EJB into a stateless EJB is not recommended.  
Read more
  • 0
  • 0
  • 1697

article-image-moodle-20-multimedia-working-2d-and-3d-maps
Packt
08 Jun 2011
12 min read
Save for later

Moodle 2.0 Multimedia: Working with 2D and 3D Maps

Packt
08 Jun 2011
12 min read
  Moodle 2.0 Multimedia Cookbook Add images, videos, music, and much more to make your Moodle course interactive and fun         Read more about this book       (For more resources on Moodle 2.0, see here.) Introduction Whenever you think of a map, you may either think of the traditional planisphere or the terrestrial globe. There are several types of maps apart from those previously mentioned. We can work with maps of the moon, Mars, constellations, and even the universe! Thus, we are not only going to focus on our planet, but we are going to travel even further! The topic of this article is going to deal with Traveling Around the World and Watching the Universe. After reading this article, you can focus on your next holiday! We explain how to work with different types of maps. We are going to be as creative as possible. We should try to work with maps in an unconventional way. That is to say, the idea is to use a map for a Geography class, but we can use maps as a resource for any type of activity. Thus, we can work with the Geography teacher and he/she could work on another geographical feature of the place that we are working with. Therefore, in that way, we are adding more information to the place we are exploring. Maps are very attractive and they may become quite appealing to our students as long as we find a way to develop a rich activity using them. We should encourage the use of maps and the available resources that we have on the Web so that they can insert them in their homework by themselves as well. Thus, we can develop the activities in such a way that we can either provide the map or ask them to design a map. We can also work with maps in the case of Literature. We can ask students to draw a map of a place that has never existed in the real world, though it did in a story. Thus, another bit of homework that could prove helpful would be for students to design and carry out the map of such a place using the tools that we are going to explore in the following recipes. An example of this could be to draw the map of the country Ruritania and locate the cities of Zenda and Strealsau. These places do not exist in the real world, but they exist in the book The Prisoner of Zenda by Anthony Hope. So, many things can be done with maps. Creating maps with sceneries In this activity, we are going to create a map with sceneries. Therefore, we could either browse our files for pictures from our trips or holidays, or we can search for sceneries on the Web. After selecting the pictures, we create a new folder in Windows Explorer, for example C:Images_Traveling. In this folder, we save all the pictures so as to organize our work. We will use the following well-known website: http://earth.google.com/ to design a map using the pictures we have saved in the folder that we have just created. Let's get ready! Getting ready In this activity, we will work with the previously mentioned website. Therefore, we need to open the web browser and enter it. Click on Download Google Earth 6. Read the Google Maps/Earth Terms of Service and if you agree, click on Agree and Download. The icon of Google Earth will appear on your desktop, as shown in the following screenshot: How to do it... We have already carried out the first steps for this activity. Now, we have to design the maps with the pictures that we want to add. There are also some pictures that are available in the maps; you can also work with them, though the aim of this activity is to upload images in the map. Follow these steps in order to create a folder and find images for the activity: Click on the icon on your desktop and open Google Earth. Bring the Earth closer with the icons on the right. Locate a remote city in the southern hemisphere, as shown in the following screenshot: In the Fly to block, write "Mar del Plata", or any other remote city. Then press Enter or click on the magnifying glass next to the block. You will travel virtually to the desired city. Bring the map forward and locate the place where the picture to be uploaded was taken. Click on Add | Photo. Complete the Name block. Click on Browse. Search for the picture that you want to upload and click on it. Complete the other blocks: Description | View | Photo. Click on OK. The picture will appear, as shown in the following screenshot: You can repeat the same process as many times as the number of pictures you want to upload. After uploading all the pictures, click on File | Save | Save Image, as shown in the following screenshot: Complete the File name block and click on Save. How it works... After uploading the desired pictures to the map, we can create an activity. We could start this course with a little social interaction. We ask our students to think about what element they shouldn't forget if they happen to go to this place. They may not know this city, for sure, unless they live nearby. This is the most interesting part of inserting a remote city that they may want to know more about it! Therefore, a Chat is a good idea to have where all the students will be invited in order to discuss the city. We upload the map that we have created with the images to our activity within the Moodle course. Choose the weekly outline section where you want to insert this activity and follow these steps: Click on Add an activity | Chat. Complete the Name of this chat room and Introduction text blocks. Click on the Insert/edit image icon | Find or upload an image | Browse and look for the image that we have just saved. Click on Upload this file. Complete the Image description block and click on Insert. Click on Save and return to course. The activity looks as shown in the following screenshot: Drawing regions within a map In this activity, we are going to use an interactive website in which we choose a map to work with. It is a very simple one, but we could enhance it by adding interesting ingredients to the recipe. We will use a software for drawing a region on the map, and highlight a region for our students to work with. As it was pointed out before, we are not going to focus on geographical features, though you can add this ingredient yourself when designing the activity. Getting ready We open our default web browser and work with the following website: http://www.fusioncharts.com/maps/Default.asp. We click on Map Gallery and choose a map to work with. In this case, we choose a map of the world and highlight five regions, one for each continent. You can modify it and work with different regions within a continent or a country too. How to do it... We look for the desired map. We can find different types of maps to work with. Everything depends on what type of activity we have in mind. In this case, as the topic of this article has to do with traveling, we circle five regions and ask our students to choose where they would like to go. First of all, we have to find the map and save it as an image so that we can draw the regions and upload it to our Moodle course. Therefore, follow these steps: Click on click here | World Map with countries on the aforementioned site. Another pop-up window appears, displaying a map of the world with the countries. There appears a Map Configuration block where you can customize some features, as shown in the next screenshot. Click on Save Map as Image, as shown in the following screenshot: Another pop-up window will appear. Click on Save. Complete the File name block. Click on Save. Click on Open. A pop-up window displaying the map will appear. Click on File | Copy. Paste the map in Paint or Inkscape. Click on Edit | Paste from and browse for the name of the file. Select the file and click on Open. Use the resources available to draw the regions that you want students to work with, as shown in the following screenshot: Click on File | Save as and write a name for the file. Click on Save. How it works... We have already drawn the regions that we want our students to work with. We have chosen one country from every continent; you can choose another or design it in a different way. We can add a writing activity in which students choose where they would like to travel using the previous map. Select the weekly outline section where you want to add the activity and follow these steps: Click on Add an activity | Upload a single file within Assignments. Complete the Assignment name and Description blocks. Click on the Insert/edit image icon | Find or upload an image | Browse. When you find the image that you want to upload, click on Open | Upload this file. Complete the Image description block. Click on Insert. Click on Save and return to course. The activity is ready! When students click on the activity, it looks as shown in the following screenshot: Labeling a map with pins In this recipe, we will learn how to insert a map in our Moodle course labeled with pins, because we pin all the cities that we are going to work with. Therefore, we insert the map as a resource. After that, we design activities for our students to use the interactive map that we have just added. It is another way to use a resource, making our Moodle course more appealing to the eyes of our students. Getting ready We are going to work with Google Earth, as we did in the first recipe, so we have already installed it. We should think of the cities to insert in our course because we need to pin them all! How to do it... Click on the Google Earth icon that you have on your desktop. This is a way to enrich our traveling course by enhancing its appearance. So, these are the steps that you have to follow: Complete the Fly to block with the place that you want to pin. Click on the yellow pin, as shown in the following screenshot: A pop-up window will appear. Complete the Name block by writing the name of the city. Check the Latitude and Longitude, so that you place the pin correctly. You may complete the Description block. You can change the appearance of the pin by clicking on the pin itself. Another pop-up window will appear showing different sorts of icons, as shown in the following screenshot: You can choose the desired icon by clicking on it | OK. The icon that you have selected will appear in the map. Pin as many cities as you are going to work with and repeat steps 1-7. After pinning all the cities, save the file. Click on File | Save | Save Place as. Complete the File name block (remember to save the file in the folder which was created for this course) | Save. You have already saved the pinned map. How it works... We have to insert the map in our Moodle course. In this case, we are going to Add a resource, because we are introducing all the activities that are to come. So, choose the weekly outline section where you want to save the resource. These are the steps that you have to follow: Click on Add a resource | File. Complete the Name and Description blocks. Click on Add | Browse. Click on the file that you are going to upload | Open | Upload this file | Save and return to course. Although we have added a file, students can work with the map interactively! There's more We can embed the map in an HTML block in our Moodle course. Click on the downwards arrow next to Add... in Add a block, as shown in the following screenshot: Choose HTML and a new block will appear in our Moodle course. Embedding a map in an HTML block Open Google Earth and follow these steps in order to embed the map in the block that we have already added: Click on the View in Google Maps icon, as shown in the following screenshot: Another window appears. Click on Link | Customize and preview embedded map, as shown in the following screenshot: Click on Custom and adjust the Width and Height. In the Preview section, click on the minus sign and adjust the map to fit the window. Copy the HTML code to embed in our Moodle course. Go back to the Moodle course and click on the configuration icon to embed the map. Complete the Block title. In the Content block, click on the HTML icon, paste the HTML code which was copied, and click on Update. Click on Save changes. The map will look as shown in the following screenshot:
Read more
  • 0
  • 0
  • 2048

article-image-moodle-20-multimedia-creating-and-integrating-screencasts-and-videos
Packt
23 May 2011
8 min read
Save for later

Moodle 2.0 Multimedia: Creating and Integrating Screencasts and Videos

Packt
23 May 2011
8 min read
  Moodle 2.0 Multimedia Cookbook Add images, videos, music, and much more to make your Moodle course interactive and fun         Read more about this book       (For more resources on Moodle 2.0, see here.) Introduction Moodle 2.0 offers new features, which make it easier to insert videos, especially from the http://www.youtube.com website. You can find them easily from the file picker, provided you have administrative access to the course. You have to bear in mind that you need to be an administrator in order to enable this option. This article covers different ways to create and interact using either screencasts or videos. We will work with several multimedia assets, which will concern the baseline topic of Wildlife. This topic has many resources, which can be integrated with screencasts and videos available on the Web. Creating screencasts using several free and open source software available on the Web is one of the main goals of this chapter. There is plenty of commercial software, which can be used to create screencasts. We will not focus on them though. We add some special features to the screencasts in order to enhance them. Videos can be recorded in several ways. You may use your cell phone, camera, or the webcam of your computer. We are to focus on the way of creating them and uploading into our Moodle course. We can also use a recorded video from YouTube and upload it directly from the file picker in Moodle 2.0. You can also design a playlist in order to combine several videos and let your students watch them in a row. We do it by creating an account in YouTube. The channel in YouTube can be either public or private; it depends on how we want to carry it out. You can create some screencasts in order to present information to your students instead of showing presentations made using Open Office, PowerPoint, or Microsoft Word. Changing any of these into a screencast is more appealing to the students and not such a difficult task to carry out either. We can create an explanation by recording our voice, for which we will create a virtual board that we can choose to be visible to the audience; in the second case, our explanations can only be heard with no visualization. This is quite an important aspect to be taken into account, especially in teaching because students need a dynamic explanation by their teacher. There are several software available that can be used to create screencasts. One of them is Cam Studio. This software captures AVI files and it is open source. It captures onscreen video and audio. Its disadvantage is that only Windows users can use it. You can download it from http://camstudio.com/. It is time for Mac users. There is also a free program for Mac users that focuses on making quick films by saving the recorded video to get a quick access. It does not record audio. This is Copernicus and you can download it from http://danicsoft.com/software/copernicus/. We need a tool for both Mac and Windows, which is free and open source as well. So, JingProject.com is the software. It does not only record video, but also allows you to take a picture, draw, or add a message on it, and upload the media to a free hosting account. A URL is provided in order to watch the video or the image. You can download it from the following website: http://www.techsmith.com/download/jing/. Screencast-o-matic is another tool that is based on Java that does not need to be downloaded at all. It allows you to upload in an automatic way. It works well with both Mac and Windows machines. You can use this at http://www.screencast-o-matic.com/. This is the tool that we are to work with in the creation of a screencast. We may also modify the videos to make them suitable for learning. We can add annotations in different ways so as to interact through the video with our students. That is to say, we add our comments instead of adding our voice so that students read what we need to tell them. Creating a screencast In this recipe, we create a screencast and upload it to our Moodle course. The baseline topic is Wildlife. Therefore, in this recipe, we will explain to our students where wild animals are located. We can paste in a world map of the different animals, while we add extra data through the audio files. Thus, we can also add more information using different types of images that are inserted in the map. Getting ready Before creating the screencast, plan the whole sequence of the explanation that we want to show to our students, therefore, we will use a very useful Java applet available at http://www.screencast-o-matic.com/. Screencast-o-matic requires the free Java Run-time Environment (also known as JRE) for both the teacher and the students' computers. You can download and install its latest version from http://java.sun.com. How to do it... First of all, design the background scene of the screencast to work with. Afterwards, enter the website http://www.screencast-o-matic.com/. Follow these to create the screencast: Click on Start recording. Another pop-up window appears that looks as shown in the following screenshot: Resize the frame to surround the recording area that you want to record. Click on the recording button (red button). If you want to make a pause, click on the pause button or Alt + P, as shown in the following screenshot: If you want to integrate the webcam or a bluetooth video, click on the upwards arrow in this icon, as shown in the following screenshot: When the screencast is finished, click on Done. You can preview the screencast after you finish designing it. If you need to edit it, click on Go back to add more. If you are satisfied with the preview, click on Done with this screencast, as shown in the following screenshot: When the screencast is finished, our next task is to export it because we need to upload it to our Moodle course. Click on Export Movie. Click on the downwards arrow in Type and choose Flash (FLV), as shown in the following screenshot: Customize the Size and Options blocks, as shown in the previous screenshot or as you wish. When you finish, click on Export, as shown in the previous screenshot. Write a name for this file and click on Save. When the file is exported, click on Go back and do more with this screencast if you want to edit it. Click on Done with this screencast if you are satisfied with the result. A pop-up window appears, click on OK. How it works... We have just created the screencast teaching about wild animals, which students have to watch to learn about the places where wild animals live around the world. We need to upload it to our Moodle course. It is a passive resource; therefore, we can add a resource or design an activity out of it. In this case, we design an activity. Choose the weekly outline section where you want to insert it, and follow these steps: Click on Add an activity | Online text within Assignments. Complete the Assignment name and Description blocks. Click on the Moodle Media icon | Find or upload a sound, video or applet ... | Upload a file | Browse | look for the file that you want to upload and click on it. Click on Open | Upload this file | Insert. Click on Save and return to course. Click on the activity. It looks as shown in the following screenshot: There's more... In the case that we create a screencast, which lasts for around 30 minutes or longer, it will take a long time to upload it to our Moodle course. Therefore, it will be advisable to watch the screencast using a free and open source media player, that is to say VLC Media Player. VLC Media Player You can download the VLC Media Player from the following website: http://www.videolan.org/vlc/. It works with most popular video files formats such as AVI, MP4, and Flash, among others. Follow these steps in order to watch the screencast: Click on Media | Open File | browse for the file that you want to open and click on it. Click on Open. The screencast is displayed, as shown in the following screenshot: See also Enhancing a screencast with annotations  
Read more
  • 0
  • 0
  • 3284
Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at €14.99/month. Cancel anytime
article-image-integrating-yahoo-user-interface-library-yui-moodle
Packt
13 May 2011
6 min read
Save for later

Integrating Yahoo! User Interface Library (YUI) with Moodle

Packt
13 May 2011
6 min read
  Moodle JavaScript Cookbook Over 50 recipes for making your Moodle system more dynamic and responsive with JavaScript In this article, we will cover: Initializing the YUI 3 library Loading YUI 3 modules Loading YUI 2 modules from YUI 3 Attaching basic event handlers Attaching advanced DOM event handlers Implementing Event Delegation Debugging with the YUI console Introduction There are a lot of common tasks that need to be performed when writing JavaScript. A large proportion of this simply involves dealing with differences between web browsers. The need for a way to hide or abstract the specifics of each browser into a standard interface gave rise to sets of tools known as JavaScript libraries. One of the leading libraries in use on the web today is the Yahoo! User Interface Library (YUI). Moodle includes a copy of the YUI as its preferred JavaScript library. YUI provides developers with access to a wide range of tools for enhancing their web applications: The YUI Library is a set of utilities and controls, written with JavaScript and CSS, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. YUI is available under a BSD license and is free for all uses. YUI is proven, scalable, fast, and robust. Built by frontend engineers at Yahoo! and contributors from around the world, it's an industrial-strength JavaScript library for professionals who love JavaScript. Yahoo! Developer Network http://developer.yahoo.com/yui/ In this article, we will learn the basics of working with YUI. We will learn how to initialize the YUI and make it ready for use within our code and load additional modules from versions 2 and 3 of the YUI. We will also learn how to manage the execution of code by attaching events to our controls, and finally how to debug our code with YUI logging tools. Initializing the YUI 3 library In this recipe, we will learn how to initialize the YUI 3 environment within Moodle, which will get us ready to start using YUI 3 features. Moodle takes care of most of the initial setup, namely loading the required CSS and JavaScript files, so all we need to be concerned with is activating the YUI environment. This example will show how to execute JavaScript code from within the YUI environment. We will set up a small YUI script which will simply display a message including the version number of the active YUI environment in a JavaScript alert box. This provides a simple view of what is required to get YUI up and running that we will build on further in the subsequent recipes. Getting ready We begin by setting up a new PHP file yui_init.php in the cook directory with the following content: <?php require_once(dirname(__FILE__) . '/../config.php'); $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM)); $PAGE->set_url('/cook/yui_init.php'); $PAGE->requires->js('/cook/yui_init.js'); echo $OUTPUT->header(); echo $OUTPUT->footer(); ?> Notice that the preceding code references a JavaScript file yui_init.js, which has the following content: YUI().use ( function(Y) { alert('Hello from YUI ' + Y.version); } ); How to do it... We have created a PHP file that sets up a Moodle programming environment and includes a JavaScript file, in a way now familiar to us from previous recipes. What is new here is the content of the JavaScript file, which is where we will make ready the YUI 3 environment. Moodle has already included all the JavaScript files required for YUI (this happened when we output the value returned from $OUTPUT->header();). This means we now have a global object named YUI available within our JavaScript code. We create a new instance of the YUI object with the statement YUI() and then immediately call the use method. The only parameter we will pass to the use method is an anonymous function. This is just like a regular JavaScript function, except that it has no name specified; hence it is "anonymous". A name is not required, as it is not referred to again, but it is simply passed directly to the use method. This function itself accepts a single input parameter Y, which will be a reference to the new instance of the YUI object. (Note that the use method is also used to load additional YUI modules; this is the subject of the next recipe.) The anonymous function just created is the most important part of the code to take note of as this is where we will be putting our entire code that will be making use of the YUI features. In this example, you can see that we are just creating a JavaScript alert with a short message including the value of Y.version, which is simply a string containing the version number of YUI that has been loaded as seen in the following screenshot: Here, we can see that our code has successfully initialized the YUI 3.2.0 environment and is ready for us to start using the features available within the YUI and its additional modules. How it works... We have created a new instance of the global object YUI, and called the use method, passing in an anonymous function that contains the code we wish to run. When the new instance of the YUI object is fully loaded, it makes a call to our anonymous function, and our code is executed. In this example, our code displays a short message containing the version number of the YUI instance we created, confirming that we have a fully functional YUI 3 environment as a basis to implement further YUI features. Loading additional YUI modules YUI has a whole host of additional modules providing a very wide range of functionalities. Some examples of commonly used functionalities provided by additional modules include: Animation Drag and drop Manipulating DOM elements Handling DOM events (that is an input button's "click" event) Handling data (JSON/XML) For a current list of all the modules available, please refer to the Yahoo! Developer Network website for YUI 3 at the URL: http://developer.yahoo.com/yui/3/ How to do it... The loading of additional modules is achieved via the use method of the YUI object. In the previous recipe we learned how to run code via the use method with the following syntax: YUI().use ( function(Y) { /* <code to execute> */ } ); Note that the use method takes an arbitrarily long number of arguments (one or more) and only the last argument must be the anonymous function described in the previous recipe. The preceding arguments are a list of one or more modules you wish to load. So for example, to load the Animation module (anim) and the DOM Event Utility module (event), we would use the following syntax in place of the preceding one: YUI().use ( "anim", "event", function(Y) { /* <code to execute> */ } ); Now all of the features of these two additional modules (anim and event) will be available within the anonymous function that contains the code we want to execute. This technique will be used to load the modules we require in the examples contained in the subsequent recipes.
Read more
  • 0
  • 0
  • 1773

article-image-enhancing-page-elements-moodle-and-javascript
Packt
04 May 2011
7 min read
Save for later

Enhancing Page Elements with Moodle and JavaScript

Packt
04 May 2011
7 min read
  Moodle JavaScript Cookbook Over 50 recipes for making your Moodle system more dynamic and responsive with JavaScript Introduction The Yahoo! UI Library (YUI) offers a range of widgets and utilities to bring modern enhancements to your traditional page elements. In this chapter, we will look at a selection of these enhancements, including features often seen on modern interactive interfaces, such as: Auto-complete: This feature suggests possible values to the user by searching against a list of suggestions as they start typing. We will look at two different ways of using this. First, by providing suggestions as the user types into a text box, and second, by providing a list of possible values for them to select from a combo list box. Auto-update: This technique will allow us to update an area of the page based on a timed interval, which has many uses as we'll see. In this example, we will look at how to create a clock by updating the time on the page at one second intervals. This technique could also be used, for example, to update a news feed every minute, or update stock information every hour. Resizable elements: A simple enhancement which allows users to dynamically resize elements to suit their needs. This could be applied to elements containing a significant amount of text which would allow the user to control the width of the text to suit their personal preference for ideal readability. Custom tooltips: Tooltips appear when an element is hovered, displaying the associated title or alternative text (that is, a description of an image or the title of a hyperlink). This enhancement allows us to have more control over the look of the tooltips making them more visually appealing and more consistent with the overall look and feel of our page. Custom buttons: This enhancement allows us to completely restyle button elements, modifying their look and feel to be consistent with the rest of our page. This also allows us to have a consistent button style across different platforms and web browsers. We will once again be using mostly YUI Version 2 widgets and utilities within the YUI Version 3 framework. At the time of writing, few YUI2 widgets have been ported to YUI3. This method allows us the convenience of the improvements afforded by the YUI3 environment combined with the features of the widgets from YUI2. Adding a text box with auto-complete A common feature of many web forms is the ability to provide suggestions as the user types, based on a list of possible values. In this example, we enhance a standard HTML input text element with this feature. This technique is useful in situations where we simply wish to offer suggestions to the user that they may or may not choose to select, that is, suggesting existing tags to be applied to a new blog post. They can either select a suggested value that matches one they have started typing, or simply continue typing a new, unused tag. How to do it... First, set up a basic Moodle page in the usual way. In this example, we create autocomplete.php with the following content: <?php require_once(dirname(__FILE__) . '/../config.php'); $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM)); $PAGE->set_url('/cook/autocomplete.php'); $PAGE->requires->js('/cook/autocomplete.js', true); ?> <?php echo $OUTPUT->header(); ?> <div style="width:15em;height:10em;"> <input id="txtInput" type="text"> <div id="txtInput_container"></div> </div> <?php echo $OUTPUT->footer(); ?> Secondly, we need to create our associated JavaScript file, autocomplete.js, with the following code: YUI().use("yui2-autocomplete", "yui2-datasource", function(Y) { var YAHOO = Y.YUI2; var dataSource = new YAHOO.util.LocalDataSource ( ["Alpha","Bravo","Beta","Gamma","Golf"] ); var autoCompleteText = new YAHOO.widget.AutoComplete("txtInput", "txtInput_container", dataSource); }); How it works... Our HTML consists of three elements, a parent div element, and the other two elements contained within it: an input text box, and a placeholder div element to use to display the auto-complete suggestions. Our JavaScript file then defines a DataSource to be used to provide suggestions, and then creates a new AutoComplete widget based on the HTML elements we have already defined. In this example, we used a LocalDataSource for simplicity, but this may be substituted for any valid DataSource object. Once we have a DataSource object available, we instantiate a new YUI2 AutoComplete widget, passing the following arguments: The name of the HTML input text element for which to provide auto-complete suggestions The name of the container element to use to display suggestions A valid data source object to use to find suggestions Now when the user starts typing into the text box, any matching auto-complete suggestions are displayed and can be selected, as shown in the following screenshot: Adding a combo box with auto-complete In this example, we will use auto-complete in conjunction with a combo box (drop-down list). This differs from the previous example in one significant way—it includes a drop-down arrow button that allows the user to see the complete list of values without typing first. This is useful in situations where the user may be unsure of a suitable value. In this case, they can click the drop-down button to see suggestions without having to start guessing as they type. Additionally, this method also supports the same match-as-you-type style auto-complete as that of the previous recipe. How to do it... Open the autocomplete.php file from the previous recipe for editing, and add the following HTML below the text box based auto-complete control: <div style="width:15em;height:10em;"> <input id="txtCombo" type="text" style="vertical-align:top; position:static;width:11em;"><span id="toggle"></span> <div id="txtCombo_container"></div> </div> Next, open the JavaScript file autocomplete.js, and modify it to match the following code: YUI().use("yui2-autocomplete", "yui2-datasource", "yui2-element", "yui2-button", "yui2-yahoo-dom-event", function(Y) { var YAHOO = Y.YUI2; var dataSource = new YAHOO.util.LocalDataSource ( ["Alpha","Bravo","Beta","Gamma","Golf"] ); var autoCompleteText = new YAHOO.widget.AutoComplete("txtInput", "txtInput_container", dataSource); var autoCompleteCombo = new YAHOO.widget.AutoComplete("txtCombo", "txtCombo_container", dataSource, {minQueryLength: 0, queryDelay: 0}); var toggler = YAHOO.util.Dom.get("toggle"); var tButton = new YAHOO.widget.Button({container:toggler, label:"↓"}); var toggle = function(e) { if(autoCompleteCombo.isContainerOpen()) { autoCompleteCombo.collapseContainer(); } else { autoCompleteCombo.getInputEl().focus(); setTimeout(function() { autoCompleteCombo.sendQuery(""); },0); } } tButton.on("click", toggle); }); You will notice that the HTML we added in this recipe is very similar to the last, with the exception that we included a span element just after the text box. This is used as a placeholder to insert a YUI2 button control. This recipe is somewhat more complicated than the previous one, so we included some extra YUI2 modules: element, button, and yahoo-dom-event. We define the AutoComplete widget in the same way as before, except we need to add two configuration options in an object passed as the fourth argument. Next, we retrieve a reference to the button placeholder, and instantiate a new Button widget to use as the combo box 'drop-down' button. Finally, we define a click handler for the button, and register it. We now see the list of suggestions, which can be displayed by clicking on the drop-down button, as shown in the following screenshot: How it works... The user can type into the box to receive auto-complete suggestions as before, but may now use the combo box style drop-down button instead to see a list of suggestions. When the user clicks the drop-down button, the click event is fired. This click event does the following: Hides the drop-down menu if it is displayed, which allows the user to toggle this list display on/off. If it is not displayed, it sets the focus to the text box (to allow the user to continue typing), and execute a blank query on the auto-complete widget, which will display the list of suggestions. Note that we explicitly enabled this blank query earlier when we defined the AutoComplete widget with the "minQueryLength: 0" option, which allowed queries of length 0 and above.  
Read more
  • 0
  • 0
  • 2776

article-image-integrating-moodle-20-mahara-and-googledocs-business
Packt
29 Apr 2011
9 min read
Save for later

Integrating Moodle 2.0 with Mahara and GoogleDocs for Business

Packt
29 Apr 2011
9 min read
Moodle 2.0 for Business Beginner's Guide Implement Moodle in your business to streamline your interview, training, and internal communication processes         The Repository integration allows admins to set up external content management systems and use them to complement Moodle's own file management system. Using this integration you can now manage content outside of Moodle and publish it to the system once the document or other content is ready. The Portfolio integration enables users to store their Moodle content in an external e-portfolio system to share with evaluators, peers, and others. Using Google Docs as a repository for Moodle A growing number of organizations are using Google Docs as their primary office suite. Moodle allows you to add Google Docs as a repository so your course authors can link to word processing, spreadsheet, and presentation and form documents on Google Docs. Time for action - configuring the Google Docs plugin To use Google Docs as a repository for Moodle, we first need to configure the plugin like we did with Alfresco. Login to Moodle as a site administrator. From the Site Administration menu, select Plugins and then Repositories. Select Manage Repositories from the Repositories menu. Next to the Google Docs plugin, select Enabled and Visible from the Active menu. On the Configure Google Docs plugin page, give the plugin a different name if you refer to Google Docs as something different in your organization. Click on Save. What just happened You have now set up the Google Docs repository plugin. Each user will have access to their Google Docs account when they add content to Moodle. Time for action - adding a Google Doc to your Moodle course After you have configured the Google Docs plugin, you can add Google Docs to your course. Login to Moodle as a user with course editing privileges. Turn on the editing mode and select File from the Add a resource.. menu in the course section where you want the link to appear. Give the file a name. Remember the name will be the link the user selects to get the file, so be descriptive. Add a description of the file. In the Content section, click the Add.. button to bring up the file browser. Click the Google Docs plugin in the File Picker pop-up window. The first time you access Google Docs from Moodle, you will see a login button on the screen. Click the button and Moodle will take you to the Google Docs login page. Login to Google Docs. Docs will now display a security warning, letting you know an external application (Moodle) is trying to access your file repository. Click on the Grant Access button at the bottom of the screen. Now you will be taken back to the File Picker. Select the file you want to link to your course. If you want to rename the document when it is linked to Moodle, rename it in the Save As text box. Then edit the Author field if necessary and choose a copyright license. Click on Select this file. Select the other options for the file as described in Getting Started with Moodle 2.0 for Business. Click on Save and return to course. What just happened You have now added a Google Doc to your Moodle course. You can add any of the Google Doc types to your course and share them with Moodle users. Google Docs File Formats The Moodle Google Docs plugin makes a copy of the document in a standard office format (rtf, xls, or ppt). When you save the file, any edits to the document after you save it to Moodle will not be displayed. Have a go hero Try importing the other Google Docs file formats into your Moodle course and test the download. Time for reflection Using Google Docs effectively requires clear goals, planning, integration with organizational workflows, and training. If you want to link Moodle with an external content repository, how will you ensure the implementation is successful? What business processes could you automate by using one of these content services? Exporting content to e-portfolios Now that we've integrated Moodle with external content repositories it's time to turn our attention to exporting content from Moodle. The Moodle 2 portfolio system allows users to export Moodle content in standard formats, so they can share their work with other people outside of Moodle, or organize their work into portfolios aimed at a variety of audiences. In a corporate environment, portfolios can be used to demonstrate competency for promotion or performance measurement. They can also be used as a directory of expertise within a company, so others can find people they need for special projects. One of the more popular open source portfolio systems is called Mahara. Mahara is a dedicated e-portfolio system for creating collections of work and then creating multiple views on those collections for specific audiences. It also includes a blogging platform, resume builder, and social networking tools. In recent versions, Mahara has begun to incorporate social networking features to enable users to find others with similar interests or specific skill sets. To start, we'll briefly look at installing Mahara, then work through the integration of Moodle with Mahara. Once we've got the two systems talking to each other, we can look at how to export content from Moodle to Mahara and then display it in an e-portfolio. Time for action - installing Mahara Mahara is a PHP and MySQL application like Moodle. Mahara and Moodle share a very similar architecture, and are designed to be complementary in many respects. You can use the same server setup we've already created for Moodle in Getting Started with Moodle 2.0 for Business. However, we need to create a new database to house the Mahara data as well as ensure Mahara has its own space to operate. Go to http://mahara.org. There is a Download link on the right side of the screen. Download the latest stable version (version 1.3 as of this writing). You will need version 1.3 or later to fully integrate with Moodle 2. For the best results, follow the instructions on the Installing Mahara wiki page, http://wiki.mahara.org/System_Administrator%27s_Guide/Installing_Mahara. If you are installing Mahara on the same personal machine as Moodle, be sure to put the Mahara folder at your web server's root level and keep it separate from Moodle. Your URL for Mahara should be similar to your URL for Moodle. What just happened You have now installed Mahara on your test system. Once you have Mahara up and running on your test server, you can begin to integrate Mahara with Moodle. Time for action - configuring the networking and SSO To begin the process of configuring Moodle and Mahara to work together, we need to enable Moodle Networking. You will need to make sure you have xmlrpc, curl, and openssl installed and configured in your PHP build. Networking allows Moodle to share users and authentication with another system. In this case, we are configuring Moodle to allow Moodle users to automatically login to Mahara when they login to Moodle. This will create a more seamless experience for the users and enable them to move back and forth between the systems. The steps to configure the Mahara portfolio plugin are as follows: From the Site administration menu, select Advanced features. Find the Networking option and set it to On. Select Save changes. The Networking option will then appear in the site admin menu. Select Networking, then Manage Peers. In the Add a new host form, copy the URL of your Mahara site into the hostname field and then select Mahara as the server type. Open a new window and login to your Mahara site as the site admin. Select the Site Admin tab. On your Mahara site, select Configure Site. Then select Networking. Copy the public key from the BEGIN tag to the END CERTIFICATE and paste it into the Public Key field in the Moodle networking form. On the resulting page, select the Services tab to set up the services necessary to integrate the portfolio. You will now need to configure the SSO services. Moodle and Mahara can make the following services available for the other system to consume. Moodle/Mahara Services Descriptions Remote enrollment service: Publish: If you Publish the Remote Enrollment Service, Mahara admins will be able to enroll students in Moodle courses. To enable this, you must also publish to the Single Sign On Service Provider service. Subscribe: Subscribe allows you to remotely enroll students in courses on the remote server. It doesn't apply in the context of Mahara. Portfolio Services: You must enable both Publish and Subscribe to allow users to send content to Mahara. SSO: (Identity Provider) If you Publish the SSO service, users can go from Moodle to Mahara without having to login again. If you Subscribe to this service, users can go from Mahara to Moodle without having to login again. SSO: (Service Provider) This is the converse of Identity Provider service. If you enabled Publish previously, you must enable Subscribe here. If you enabled Subscribe previously, you must enable Publish here. Click on Save changes. What just happened You have just enabled Single Sign-On between Moodle and Mahara. We are now halfway through the setup and now we can configure the Mahara to listen for Moodle users. Have a go hero Moodle Networking is also used to enable Moodle servers to communicate with each other. The Moodle Hub system is designed on top of Moodle networking to enable teachers to share courses with each other, and enable multiple Moodle servers to share users. How could you use this feature to spread Moodle within your organization? Could you create an internal and an external facing Moodle and have them talk to each other? Could different departments each use a Moodle and share access to courses using Moodle networking? For your "have a go hero" activity, design a plan to use Moodle networking within your organization.
Read more
  • 0
  • 0
  • 2740

article-image-alice-3-making-simple-animations-actors
Packt
29 Apr 2011
9 min read
Save for later

Alice 3: Making Simple Animations with Actors

Packt
29 Apr 2011
9 min read
Alice 3 provides an extensive gallery with hundreds of customizable 3D models that you can easily incorporate as actors. This article provides many tasks that will allow us to start making simple animations with many actors in the 3D environment provided by Alice. We will search for models of specific animals in the diverse galleries. We will locate and orient the actors in the 3D space. We will give some simple orders to the actors to create simple animations. Browsing galleries to search for a specific class In this recipe, we will create a new project and set a simple scene. Then we will browse the different packages included in Alice to search for a specific class. We will visualize the thumbnail icons that represent each package and class. Getting ready We have to be working on a project in order to be able to browse the galleries. Therefore, we will create a new project and set a simple scene. Follow these steps: Select File New...| in the main menu to start a new project. A dialog box will display the six predefined templates with their thumbnail previews in the Templates tab. Select GrassyProject.a3p as the desired template for the new project and click on OK. Alice will display a grassy ground with a light blue sky. Click on Edit Scene, at the lower-right corner of the scene preview. Alice will show a bigger preview of the scene and will display the Model Gallery at the bottom. Go to the Model Gallery and select Generic Alice Models Environments | Skies|. Use the horizontal scroll bar to find the ForestSky class. Click on the ForestSky thumbnail. Leave the default name, forestSky, for the new instance and click OK to add it to the existing scene. The scene preview will replace the light blue sky with a violet one. Many trees will appear at the horizon, as shown in the next screenshot: (Move the mouse over the image to enlarge it.) How to do it... Follow these steps to browse the different packages included in Alice to search for a specific class: Make sure that Alice is displaying the scene editor. If you see the Edit Code label at the lower-right corner of the big preview of the scene, it means that Alice is displaying the scene editor. If you see the Edit Scene label at the lower-right corner of a small scene preview, you should click on this label to switch to the scene editor. You will see the Model Gallery displayed at the bottom of the window. The initial view of the Model Gallery shows the following three packages located in the gallery root folder, as shown in the following screenshot: Looking Glass Characters: This package includes many characters that perform realistic animations for the characters. For example, you can make a person walk with a simple call to a procedure. Looking Glass Scenery: This package includes different kinds of scenery elements. Generic Alice Models: This package includes models that provide the basic and generic procedures. For example, you can move a person with a simple procedure call, but there isn't a procedure to make the person walk. If you don't see the previously shown screenshot with the three packages, it means that you are browsing a subfolder of gallery and you need to go back to the gallery root folder. Click on the gallery button and Alice will display the thumbnails for the three packages. If you don't see the three packages, you should check your Alice installation. Click on the search entire gallery textbox, located at the right-hand side of the gallery button. Enter rab in the search entire gallery textbox. Alice will query for the classes and packages that contain the rab string and will display the thumbnails for the following classes, as shown in the next screenshot: Rabbit Scarab WhiteRabbit Parabola Now you know that you have two different rabbits, Rabbit and WhiteRabbit. You can select your favorite rabbit and then add it as an actor in the scene. Select File Save as...| and give a name to the project, for example, MyForest. Then, you can use this new scene as a template for your next Alice project. How it works... Alice organizes its gallery in packages with hierarchical folders. The previously mentioned three packages are located in the gallery root folder. We can browse each package by clicking on its thumbnail. Each time we click on a thumbnail, the related sub-folder will open and Alice will display the thumbnails for the new sub-folders and the classes. The thumbnail that represents a folder, known as a package, displays a folder icon at the upper-left corner and includes the preview of some of the classes that it includes. The next screenshot shows the thumbnails for three packages, amusementpark, animals, and beach. These packages are sub-folders of the Generic Alice Models package: The thumbnails for classes don't include the previously mentioned folder icon and they show a different background color. The next screenshot shows the thumbnails for three classes, Bird1, BirdBaby, and BlueBird: The names for packages included within one of the three main packages use lowercase names, such as, aquarium, bedroom, and circus. The names for classes always start with an uppercase letter, such as, Monitor and Room. When a class name needs more than one word, it doesn't use spaces to separate them but it mixes lowercase with uppercase to mark the difference between words, such as, CatClock and OldBed. The main packages contain hundreds of classes organized in dozens of folders. Therefore, we might spend hours browsing the galleries to find an appropriate rabbit for our scene. We took advantage of Alice query features to search the entire gallery for all the classes that contain a string. This way, we could find a simple rabbit, Rabbit, and a dressed rabbit, WhiteRabbit. There's more... While you type characters in the search entire gallery textbox, Alice will query all the packages and will display the results in real-time. You will notice that Alice changes the results displayed as you are editing the textbox. The results for your search will include both packages and classes that contain the entered string. For example, follow these steps: Click on the search entire gallery textbox, located at the right-hand side of the gallery button. Enter bug in the search entire gallery text box. Alice will query for the classes and packages that contain the bug string and will display two thumbnails. One thumbnail is the bugs package and the other thumbnail is the Ladybug class, as shown in the following screenshot: If you think that Ladybug isn't the appropriate bug you want as an actor, you can click on the thumbnail for the bugs package and you will find many other bugs. When you click on the thumbnail, the text you entered in the search entire gallery textbox will disappear because there is no filter being applied to the gallery and you are browsing the contents of the gallery Generic Alice Models | animals | bugs| package. You can add a Beetle or a Catepillar, as shown in the following screenshot: Creating a new instance from a class in a gallery In this task, we will add a new actor to an existing scene. We will drag and drop a thumbnail of a class from the gallery and then we will learn how Alice adds a new instance to the scene. Getting ready We want to add a new actor to an existing scene. Therefore, we will use an existing project that has a simple scene. Open an existing project based on one of the six predefined Alice templates. You can open the MyForest project saved in the Browsing galleries to search for a specific class recipe in this article. Select Starting Camera View in the drop-down list located at the top of the big scene preview. How to do it... Follow these steps to add a new instance of the WhiteRabbit class: Search for the WhiteRabbit class in the gallery. You can browse gallery Generic Alice Models | animals| or enter rab in the search entire gallery textbox to visualize the WhiteRabbit thumbnail. Drag the WhiteRabbit thumbnail from the gallery to the big scene preview. A bounding box that represents the 3D model in the 3D space will appear, as shown in the next screenshot: Keep the mouse button down and move the mouse to locate the bounding box in the desired initial position for the new element. Once you have located the element in the desired position, release the mouse button and the Declare Property dialog box will appear. Leave the default name, whiteRabbit, for the new instance and click on OK to add it to the existing scene. The scene preview will perform an animation when Alice adds the new instance and then it will go back to the starting camera view to show how the new element appears on the scene. The next screenshot shows the new dressed white rabbit added to the scene, as seen by the starting camera: Select File Save as...| from Alice's main menu and give a new name to the project. Then, you can make changes to the project according to your needs. How it works... When we dropped the thumbnail for the WhiteRabbit class, the Declare Property dialog box provided information about what Alice was going to do, as shown in the following screenshot: Alice defines a new class, MyWhiteRabbit, that extends WhiteRabbit. MyWhiteRabbit is a new value type for the project, a subclass of WhiteRabbit. The name for the new property that represents the new instance of MyWhiteRabbit is whiteRabbit. This means that you can access this new actor with the whiteRabbit name and that this property is available for scene. Because the starting camera view is looking at the horizon, we see the rabbit looking at the camera in the scene preview. If you select TOP in the in the drop-down list located at the top of the big scene preview, you will see the rabbit on the grassy ground and how the camera is looking at the rabbit. The next screenshot shows the scene seen from the top and you can see the camera with a circle around it: There's more... When you run the project, Alice shows a new window with the rendered scene, as seen by the previously shown camera, the starting camera. The default window size is very small. You can resize the Run window and Alice will use the new size to render the scene with a higher resolution. The next time you run the project, Alice will use the new size, as shown in the next screenshot that displays the dressed white rabbit with a forest in the background:
Read more
  • 0
  • 0
  • 4545
article-image-integrating-moodle-20-alfresco-manage-content-business
Packt
29 Apr 2011
8 min read
Save for later

Integrating Moodle 2.0 with Alfresco to Manage Content for Business

Packt
29 Apr 2011
8 min read
  Moodle 2.0 for Business Beginner's Guide Implement Moodle in your business to streamline your interview, training, and internal communication processes. The Repository integration allows admins to set up external content management systems and use them to complement Moodle's own file management system. Using this integration you can now manage content outside of Moodle and publish it to the system once the document or other content is ready. The Portfolio integration enables users to store their Moodle content in an external e-portfolio system to share with evaluators, peers, and others. Managing content in repositories The repository system of Moodle 2 allows you to store and manipulate content outside of Moodle and easily add it to courses. By managing content outside of Moodle, you can provide users with a more robust editing experience. Many organizations utilize workflows and approval processes to ensure the accuracy of the content used in the LMS. A content repository can help you manage that process, and then make the content available on Moodle when it is ready for final publication. Using Alfresco to manage content Alfresco is an open source, enterprise content management system, similar in many ways to Microsoft Sharepoint or EMC's Documentum. Alfresco has seen widespread adoption over the last few years as more people begin to recognize the advantages of open source software. We will start by installing Alfresco, then look at how to link it to Moodle and add content to a Moodle site. At the end of this section, we'll take a look at Alfresco's content conversion services as a tool to ensure content is reliably converted to web friendly formats. Time for action - installing Alfresco on your test site To get us started, we'll install Alfresco on our test system to experiment with the integration. Alfresco runs on a different architecture than Moodle. Alfresco requires a Java application server instead of PHP. Fortunately, there are installers available on the Alfresco site that include everything we will need to develop a test system on your local computer. To install Alfresco, run through the following steps: Open your browser and go to http:www.alfresco.com. Go to the Downloads tab and select the Download Now button for Alfresco Document Management in the Community Edition column. Select the installer for your operating system and download it to your computer. Double-click on the installer (it may take a moment to get started). Select your language for the installer. Choose the database option you want to use. Use the included database, unless you have a good reason not to. When prompted, enter a database password. Be sure to write it down somewhere. The next screen will prompt you for an Alfresco admin password. Definitely write this down. The final screen will prompt you to choose the packages you want to install. Choose the defaults and click on Next. For the examples below, you will need to make sure that you have the OpenOffice component installed. The installer will begin to run. This will probably take a while, so it may be time to go and get a cup of tea. Once the installer is complete, select Launch. This will take a while as well, so a second cup of tea might be in order. Once Alfresco has launched, you can configure the interface with Moodle. What just happened You now have a full-functioning open source enterprise content management system installed on your personal computer. Alfresco has a lot of power for manipulating and sharing documents, but we will only focus on a few features for now. There are a lot of books available to help you learn how to use the more advanced features in Alfresco (a few of them from this publisher as well). Time for action - add a repository plugin to Moodle To allow users to access your new Alfresco repository, you will need to configure Moodle to allow access to the repository. The new repository architecture of Moodle 2 enables developers to create plugins to connect Moodle with other systems. Each system will have its own type of plugin to allow a direct connection between Moodle and the system. To enable Moodle to talk to an external repository, we need to enable the plugin and any associated options. To enable the Alfresco repository plug-in, go through the following steps: Login to Moodle as a Moodle admin. From the Site administration menu, select Plugins and then Repositories. The Manage repositories screen allows you to select from all of the available plugin repositories. For now, we will focus on the Alfresco repository. From the menu in the Active column, select Enabled and visible.The Alfresco plugin allows users in Moodle to add multiple instances of the repository. Most of the time, you will not want to allow users to add additional instances of the repository. As the admin, you can create a single site-wide instance of the repository plugin to allow users to link to Alfresco files. However, if you have more than one Alfresco instance, you can allow multiple users to create additional repositories at either the course level or the user level. Click the Save button to save the initial settings. This will return you to the Manage repositories page. Click on Settings under the Settings column to the right of the Alfresco repository row. This will take you back to the Alfresco settings page, but will provide an additional ability to add a repository instance at the site level. Click the Create a repository instance button at the bottom of the page. Give the name of your Alfresco instance. If this is an institutional repository, give it the same name as you commonly use. For example, if you commonly refer to your Alfresco instance as the "ECM" (for Enterprise Content Management), name the Alfresco instance ECM. Add the URL of your Alfresco site. Be sure to point to the Alfresco Explorer, not the Share application. You will also need to add the API pointer at the end of the string. For example, if you are pointing to the locally installed Alfresco which we described in the preceding case, the URL should be http://127.0.0.1:8080/alfresco/api. Click on Save. You will now have an instance of Alfresco available for users to add content to their courses. If you get the following error: Notice SOAP extension must be enabled for Alfresco plugin, then make sure that the SOAP library is enabled in your php.ini file. The location of the file will vary depending on the system you are using. Find the php.ini file and un-comment the extension=php_soap.dll line. Then restart Moodle and this should solve the error. What just happened You have just configured the Alfresco repository plugin to enable Moodle to talk to Alfresco. When you bring up the file picker in a course or at the site level, you should now see the Alfresco repository as an option. Have a go hero In the next article, we will configure the Google Docs plugin for Moodle, but there are a number of other plugins. Picasa and Flickr are two photo repositories on the web where many people share their photos. Wikimedia and YouTube are two very popular sources of media as well. Enable one or two of these additional plugins to practice configuring Moodle on your own. Time for action - adding content to Alfresco In Moodle 2, repository integrations are read-only. The Moodle design team decided the repository integration should only read from repositories, and the portfolio integration should save content to portfolio repositories. So you can't add content directly to Alfresco with the default plugin. To add content to the repository, we need to use the repository's own interface, then we can add it to Moodle. With Alfresco, that interface is either the Alfresco Explorer or Alfresco Share. To add content to the repository using Share, run through the following steps: Go to your Alfresco share interface, found at http://<your Alfresco server>/share. If your Alfresco is on your local machine with the default install, go to http://127.0.0.1:8080/share. Login with your username and password. Select the Repository link from the top of the page. This will display the folder structure for the default Alfresco repository. Select User Homes and then select your user space. From the menu above the file browser, select Upload. Click on the Select file(s) to upload button at the top of the Upload Files screen. Browse to find your file and then click on the Upload File(s) button. The file you selected should now appear in the file browser. What just happened You have now added a file to your Alfresco repository. We've explored a very simple example of adding a single file with no workflow or approval needed. You can use Share to create content, share it with colleagues, and use versioning and other features to manage the content creation process. Have a go hero Now that you've added a simple file to Alfresco Share, try some of the other features. Check out a file for editing, change it and check it back in for others to use, or create some content directly in Share.
Read more
  • 0
  • 0
  • 2801

article-image-moodle-20-managing-compliance-training
Packt
26 Apr 2011
13 min read
Save for later

Moodle 2.0 for Managing Compliance Training

Packt
26 Apr 2011
13 min read
Moodle 2.0 for Business Beginner's Guide Implement Moodle in your business to streamline your interview, training, and internal communication processes         Using Moodle to manage compliance training Compliance training is a very important part of an organization's risk management strategy. Moodle has a number of tools that you can use to deliver and manage required training for your employees. In this article we will explore the lesson module as well as some useful user management tools to ensure your employees receive the training they need. Using the lesson module as a training tool Every human resources manager must understand and comply with a multitude of regulations and establish policies and procedures to ensure their company is in compliance. Additionally, there are several internal risks to consider including work-life discrimination, protection of confidential information, workplace privacy risks, and so on. Many companies develop training programs as a way to mitigate and avoid certain risks by making employees aware of the company policies and procedures. Moodle's lesson module is a useful tool for this type of training. Using Moodle's inbuilt lesson module is also a time and cost-effective alternative to relying on third-party authoring tools that publish Scorm. The lesson module uses two different page types, which can be implemented in several different ways to create an interactive learning experience for the user. First, the question page asks the user a question and then provides the user with feedback based on their response. The question pages are graded and contribute to a user's grade. The second page type, the content page, presents content and navigation options without grading the user's response. Creating a lesson module Let's take a business case study example. You are developing a lesson module on basic office safety. To train employees on basic fire safety, you decide to use a common active training method—the case study. Before we dive into the lesson module, let's take a moment to decide how we're going to implement this. First, we are going to use a content page to present a realistic building fire scenario and have the learner choose their first action. Second, we will create a question page to present the learner with a scored choice regarding fire safety. Third, we need to then come up with feedback based on their responses. In reality, the fire safety plan would probably be part of a larger emergency action plan. However, for the purposes of this article we are going to keep things simple and address a scenario that may be used when training employees on fire safety. Lesson modules can get quite complicated if you let them, depending on how many choices the reader has for a given scenario and how long the chain of reasoning is. Many experts suggest developing a flowchart to plan out your lesson module before creating it in Moodle. For our purposes, we will just take it through the first choice to show you how to use the content page and then a question page. Once you have that down, it will be easy to keep repeating the process to make your lesson module as simple or complicated as you'd like. Time for action - creating a lesson module Log in to your Moodle site as an administrator. Create a course for your compliance training by following the instructions in Getting Started with Moodle 2.0 for Business. Click the Turn editing on button in the top-right corner. Go to the section you want to add the lesson to and from the Add an activity... drop-down menu, select Lesson. You should now be on the Adding a new Lesson page. The first section of the page is the General section. In the Name field, enter the title of your lesson, for example "Fire Safety". If you want to enter a time limit for the lesson, click the checkbox to the left of Enable at the Time limit (minutes) field and enter the time limit you want implemented, in minutes, for the lesson. For the purposes of this example, assume that if I do not give you a specific value to enter for a field, leave it set at the default. If you want to restrict the availability of the lesson to certain dates, then click the checkboxes next to Enable and enter the Available from date and Deadline date. Under Maximum number of answers, select the maximum number of answers that may be used in the lesson. For example, if it only consists of True/False questions, this would be 2. There are a lot of settings in the lesson module. You are not expected to remember them all. I don't! Next to most of the settings is a ? icon. Select this icon for a description of the setting anytime you can't remember what its purpose is. Grade is the next section on the Adding a new Lesson page. For Grade, select the maximum score that can be given for the lesson from the drop-down menu. If there is no grade, then select no grade from the drop-down menu. We are not going to use question pages for our case study example, so for here select no grade. The Grade category refers to the category in the grade book. We have not set the grade book up yet, so leave this as the default Uncategorised. There will be nothing else available yet in this drop-down menu if you have not set up categories in the grade book. Next go to the Grade options section and select your settings. In the Practice lesson setting, select No from the drop-down menu if you want the grades for this lesson to be recorded. The Custom scoring setting allows you to give a score (positive or negative) for each answer. For our example, select No. This could be a useful tool if there are different levels of right and wrong answers and you wish to capture this in the grade book. If you want to allow re-takes, select Yes from the drop-down menu at the Re-takes allowed setting. If you selected Yes in the previous setting and are allowing re-takes, then you need to select the method for grading in the next setting—Handing of re-takes. Your two choices from the drop-down menu are Use mean or Use maximum. The Display ongoing score setting, if Yes is selected from the drop-down menu, will allow the user to see their current score out of total possible thus far in the lesson. The following screenshot shows the General, Grade, and Grade options sections of the Create a lesson page. Now go to the Flow control section and select your settings. Allow student review, if Yes is selected, gives the user the option of going through the lesson again from the start after they have completed the lesson. Provide option to try a question again, select Yes from the drop-down menu to give the user the option to take the question again for no credit or continue with the lesson if they answer a question incorrectly. If you selected Yes for the previous setting, then in the next setting, Maximum number of attempts, you must select the number of attempts allowed from the drop-down menu. If the user answers the question incorrectly repeatedly, once the maximum number of attempts is reached the user will proceed to the next page in the lesson. If you want the default feedback for correct and incorrect answers to be shown when no feedback has been specified for the question, then at the Display default feedback section, select Yes from the drop-down menu. Default feedback for a correct answer is "That's the correct answer" and for an incorrect answer is "That's the wrong answer". If Yes is selected for the Progress bar setting, then a progress bar is displayed at the bottom of each page. When set to Yes the Display left menu setting provides a list of all the pages in the lesson on the left side of each lesson page. The Pop-up to file or web page section allows you to choose a file to display in a pop-up window at the beginning of a lesson. It also displays a link to reopen the pop-up window in every subsequent page in the lesson. The Dependent on section allows you to restrict access to the lesson based on performance in another lesson in the same course. Restrictions can be based on any combination of completion, time spent, or minimum grade required. Under Dependent on, select the lesson required before access to this lesson from the drop-down menu. Time spent (minutes): If time spent is one of the requirements, then enter the minimum number of minutes required. Completed, if completion is a requirement, then check the box. If a minimum grade is required, then for the Grade better than (%) setting, enter the minimum grade required. The following screenshot shows the Flow control, Pop-up to file or web page, and Dependent on sections of the create a lesson page. Once you have entered all your settings on the lesson page, click on the Save and display button at the bottom of the page. You are now on the editing page for the lesson you just created. See the following example: What just happened? We have just created the shell of a lesson activity for our learners. In the next steps we will add content to the lesson and learn how to ask the learner questions. Time for action - creating a content page Now that we have the shell of the lesson, we can begin to add content. We'll start with adding a simple content page. From the editing page for the lesson you just created, select Add a content page. Enter a descriptive title in the box next to Page title. For our example, we will enter Building is on fire. Enter the content for this page in the Page contents text area. If you want the user's choices for the lesson page to be displayed horizontally, then check the box to the left of Arrange content buttons horizontally? You have now filled in the Add a content page section; see the following screenshot for our example: In the Add a content page section you will find sections for Content 1, Content 2, and so on. This is where we will create the choices for the user. For our example, we will enter "Grab the fire extinguisher and look for smoke" in the Description text area for Content 1. Leave the drop-down menu below the text area on the default Moodle auto-format. For now leave the Jump drop-down menu as is; we will come back to this later. In the Content 2 section, enter your second choice in the Description text area. For our example, we will enter "Walk calmly to the exit and exit the building." Now scroll down to the bottom of the page and select Add a question page. This will save the content page you just created. You will now be on the editing page for the lesson you are creating and you should be able to see the content you just added. See the following screenshot for our example: What just happened? We have now added a content page to our lesson. Content pages can include a wide variety of media, including text, audio, video, and Flash. Next we will look at how to add a scored Question page to test the learner's understanding. Time for action - creating a question page Now we are going to create a question page in our lesson. Question pages are scored and provide the user with feedback on their choices. From the edit page, click the Expanded View option at the top of the page. Then select the Add a question page here link below the content page you just created. From the Select a question type drop-down menu select the question type you want to use. For our example, we are going to select Multichoice. Next click on the Add a question page button. For Page title, enter a title for your question page. For our example, we will enter "Why is this a bad idea?". In the Page contents text area, enter the question you want to ask the learner. For our example, we will enter "Why is grabbing the fire extinguisher and heading for smoke a bad idea?". Below the Page contents text area you will see an Options field; check the box next to Multiple-answer if you are creating a question with more than one correct answer. Our example is going to be single response; therefore we will not select this box. Below the Add a question page section, you will see the Answer 1, Answer 2, and so on, sections where you will enter the possible list of answers the learner will have to choose from. In the Answer 1 section, enter one of the possible answers to the question in the Answer text area. For our example, we will enter "It's dangerous. You should leave it to the professionals". Next in the Response text area, enter the response you want the learner to receive if they select this choice. For our example, we will enter "Firefighters are trained to put out the fire and have the necessary protective gear". Then move to the Answer 2 section and put your second choice and response. For this example, we will have "You can't put out an office fire with a fire extinguisher" for the Answer and "You might be able to put out the fire, but without a respirator you might be overcome by smoke" for the Response. For the correct answer, enter a "1" in the Score field located at the bottom of the corresponding Answer section. Once you have entered all your answers, scroll down to the bottom of the page and select Add a question page to save. Now you are back on the Lesson edit screen and will see the Content page and the Question page you just created. See the following screenshot. What just happened? We have now created a question page to test the learner's understanding of the lesson material. We now need to go back and begin to link our pages together with page jumps. Time for action - creating page jumps You have now added a content page and a question page, but you're not done yet. Now we need to link the question page to the content page using a page jump. The page jump is simply the link between pages. We need to go back to the Jump field we skipped previously: Go back to the content page you created by selecting the edit icon to the right of the Building is on fire page. The edit icon looks like a hand holding a pencil. Scroll down to Content 1 and from the Jump drop-down menu, select the question page you created. For our example, it was Why is this a bad idea?. Set the jump for Content 2 to the End of the Lesson. If the user selects this option, they will end the lesson. Scroll down to the bottom of the page and click on the Save page button. You will now be back at the edit lesson page and the Jump 1: field will now read Why is this a bad idea?. What just happened? We have now linked our pages together using page jumps. In a lesson module, page jumps are used for both navigation and to provide feedback pages for questions. Now we need to go through and test our lesson to make sure everything works.
Read more
  • 0
  • 0
  • 1917

article-image-getting-started-moodle-20-business
Packt
25 Apr 2011
12 min read
Save for later

Getting Started with Moodle 2.0 for Business

Packt
25 Apr 2011
12 min read
  Moodle 2.0 for Business Beginner's Guide Implement Moodle in your business to streamline your interview, training, and internal communication processes         Read more about this book       (For more resources on Moodle, see here.) So let's get on with it... Why Moodle? Moodle is an open source Learning Management System (LMS) used by universities, K-12 schools, and both small and large businesses to deliver training over the Web. The Moodle project was created by Martin Dougiamas, a computer scientist and educator, who started as an LMS administrator at a university in Perth, Australia. He grew frustrated with the system's limitations as well as the closed nature of the software which made it difficult to extend. Martin started Moodle with the idea of building the LMS based on learning theory, not software design. Moodle is based on five learning ideas: All of us are potential teachers as well as learners—in a true collaborative environment we are both We learn particularly well from the act of creating or expressing something for others to see We learn a lot by just observing the activity of our peers By understanding the contexts of others, we can teach in a more transformational way A learning environment needs to be flexible and adaptable, so that it can quickly respond to the needs of the participants within it With these five points as reference, the Moodle developer community has developed an LMS with the flexibility to address a wider range of business issues than most closed source systems. Throughout this article we will explore new ways to use the social features of Moodle to create a learning platform to deliver real business value. Moodle has seen explosive growth over the past five years. In 2005, as Moodle began to gain traction in higher education, there were under 3,000 Moodle sites around the world. As of this writing in July, 2010, there were 51,000 Moodle sites registered with Moodle.org. These sites hosted 36 million users in 214 countries. The latest statistics on Moodle use are always available at the Moodle.org site (http://moodle.org/stats). As Moodle has matured as a learning platform, many corporations have found they can save money and provide critical training services with Moodle. According to the eLearning Guild 2008 Learning Management System survey, Moodle's initial cost to acquire, install, and customize was $16.77 per learner. The initial cost per learner for SAP was $274.36, while Saba was $79.20, and Blackboard $39.06. Moodle's open source licensing provides a considerable cost advantage against traditional closed source learning management systems. For the learning function, these savings can be translated into increased course development, more training opportunities, or other innovation. Or it can be passed back to the organization's bottom line. As Jim Whitehurst, CEO of RedHat, states: "What's sold to customers better than saying 'We can save you money' is to show them how we can give you more functionality within your budget." With training budgets among the first to be cut during a downturn, using Moodle can enable your organization to move costs from software licensing to training development, support, and performance management; activities that impact the bottom line. Moodle's open source licensing also makes customization and integration easier and cheaper than proprietary systems. Moodle has built-in tools for integrating with backend authentication tools, such as Active Directory or OpenLDAP, enrollment plugins to take a data feed from your HR system to enroll people in courses, and a web services library to integrate with your organization's other systems. Some organizations choose to go further, customizing individual modules to meet their unique needs. Others have added components for unique tracking and reporting, including development of a full data warehouse. Moodle's low cost and flexibility have encouraged widespread adoption in the corporate sectors. According to the eLearning Guild LMS survey, Moodle went from a 6.8 % corporate LMS market share in 2007 to a 19.8 % market share in 2008. While many of these adopters are smaller companies, a number of very large organizations, including AA Ireland, OpenText, and other Fortune 500 companies use Moodle in a variety of ways. According to the survey, the industries with the greatest adoption of Moodle include aerospace and defense companies, consulting companies, E-learning tool and service providers, and the hospitality industry. Why open source? Moodle is freely available under the General Public License (GPL). Anyone can go to Moodle.org and download Moodle, run it on any server for as many users as they want, and never pay a penny in licensing costs. The GPL also ensures that you will be able to get the source code for Moodle with every download, and have the right to share that code with others. This is the heart of the open source value proposition. When you adopt a GPL product, you have the right to use that product in any way you see fit, and have the right to redistribute that product as long as you let others do the same. Moodle's open source license has other benefits beyond simply cost. Forrester recently conducted a survey of 132 senior business and IT executives from large companies using open source software. Of the respondents, 92 % said open source software met or exceeded their quality expectations, while meeting or exceeding their expectations for lower costs. Many organizations go through a period of adjustment when making a conscious decision to adopt an open source product. Most organizations start using open source solutions for simple applications, or deep in their network infrastructure. Common open source applications in the data center include file serving, e-mail, and web servers. Once the organization develops a level of comfort with open source, they begin to move open source into mission critical and customer-facing applications. Many organizations use an open source content management system like Drupal or Alfresco to manage their web presence. Open source databases and middleware, like MySQL and JBoss, are common in application development and have proven themselves reliable and robust solutions. Companies adopt open source software for many reasons. The Forrester survey suggests open standards, no usage restrictions, lack of vendor lock-in and the ability to use the software without a license fee as the most important reason many organizations adopt open source software. On the other side of the coin, many CTO's worry about commercial support for their software. Fortunately, there is an emerging ecosystem of vendors who support a wide variety of open source products and provide critical services. There seem to be as many models of open source business as there are open source projects. A number of different support models have sprung up in the last few years. Moodle is supported by the Moodle Partners, a group of 50 companies around the world who provide a range of Moodle services. Services offered range from hosting and support to training, instructional design, and custom code development. Each of the partners provides a portion of its Moodle revenue back to the Moodle project to ensure the continued development of the shared platform. In the same way, Linux is developed by a range of commercial companies, including RedHat and IBM who both share some development and compete with each other for business. While many of the larger packages, like Linux and JBoss have large companies behind them, there are a range of products without clear avenues for support. However, the lack of licensing fees makes them easy to pilot. As we will explore in a moment, you can have a full Moodle server up and running on your laptop in under 20 minutes. You can use this to pilot your solutions, develop your content, and even host a small number of users. Once you are done with the pilot, you can move the same Moodle setup to its own server and roll it out to the whole organization. If you decide to find a vendor to support your Moodle implementation, there are a few key questions to ask: How long have they been in business? How experienced is the staff with the products they are supporting? Are they an official Moodle partner? What is the organization's track record? How good are their references? What is their business model for generating revenue? What are their long-term prospects? Do they provide a wide range of services, including application development, integration, consulting, and software life-cycle management? Installing Moodle for experimentation As Kenneth Grahame's character the Water Rat said in The Wind in the Willows, "Believe me, my young friend, there is nothing—absolutely nothing—half so much worth doing as simply messing about in boats." One of the best tools to have to learn about Moodle is an installation where you can "mess about" without worrying about the impact on other people. Learning theory tells us we need to spend many hours practicing in a safe environment to become proficient. The authors of this book have collectively spent more than 5,000 hours experimenting, building, and messing about with Moodle. There is much to be said for having the ability to play around with Moodle without worrying about other people seeing what you are doing, even after you go live with your Moodle solution. When dealing with some of the more advanced features, like permissions and conditional activities, you will need to be able to log in with multiple roles to ensure you have the options configured properly. If you make a mistake on a production server, you could create a support headache. Having your own sandbox provides that safe place. So we are going to start your Moodle exploration by installing Moodle on your personal computer. If your corporate policy prohibits you from installing software on your machine, discuss getting a small area on a server set up for Moodle. The installation instructions below will work on either your laptop, personal computer, or a server. Time for action — download and run the Moodle installer If you have Windows or a Mac, you can download a full Moodle installer, including the web server, database, and PHP. All of these components are needed to run Moodle and installing them individually on your computer can be tedious. Fortunately, the Moodle community has created full installers based on the XAMPP package. A single double-click on the install package will install everything you need. To install Moodle on Windows: Point your browser to http://download.moodle.org/windows and download the package to your desktop. Make sure you download the latest stable version of Moodle 2, to take advantage of the features we discuss in this article. Unpack the archive by double clicking on the ZIP file. It may take a few minutes to finish unpacking the archive. Double click the Start Moodle.exe file to start up the server manager. Open your web browser and go to http://localhost. You will then need to configure Moodle on your system. Follow the prompts for the next three steps. After successfully configuring Moodle, you will have a fully functioning Moodle site on your machine. Use the stop and start applications to control when Moodle runs on your site. To install Moodle on Mac: Point your browser to http://download.moodle.org/macosx and find the packages for the latest version of Moodle 2. You have two choices of installers. XAMPP is a smaller download, but the control interface is not as refined as MAMP. Download either package to your computer (the directions here are for the MAMP package). Open the .dmg file and drag the Moodle application to your Applications folder. Open the MAMP application folder in your Applications folder. Double click the MAMP application to start the web server and database server. Once MAMP is up and running, double click the Link To Moodle icon in the MAMP folder. You now have a fully functioning Moodle site on your machine. To shut down the site, quit the MAMP application. To run your Moodle site in the future, open the MAMP application and point your browser to http://localhost:8888/moodle: Once you have downloaded and installed Moodle, for both systems, follow these steps: Once you have the base system configured, you will need to set up your administrator account. The Moodle admin account has permissions to do anything on the site, and you will need this account to get started. Enter a username, password, and fill in the other required information to create an account: A XAMMP installation on Mac or Windows also requires you to set up the site's front page. Give your site a name and hit Save changes. You can come back later and finish configuring the site. What just happened? You now have a functioning Moodle site on your laptop for experimentation. To start your Moodle server, double click on the StartMoodle.exe and point your browser at http://localhost. Now we can look at a Moodle course and begin to look at Moodle functionality. Don't worry about how we will use this functionality now, just spend some time getting to know the system. Reflection You have just installed Moodle on a server or a personal computer, for free. You can use Moodle with as many people as you want for whatever purpose you choose without licensing fees. Some points for reflection: What collaboration / learning challenges do you have in your organization? How can you use the money you save on licensing fees to innovate to meet those challenges? Are there other ways you can use Moodle to help your organization meet its goals which would not have been cost effective if you had to pay a license fee for the software?  
Read more
  • 0
  • 0
  • 1632
article-image-moodle-20-science-monitoring-your-students-progress
Packt
01 Apr 2011
7 min read
Save for later

Moodle 2.0 Science: Monitoring Your Students' Progress

Packt
01 Apr 2011
7 min read
Moodle is a really useful tool for helping teachers to monitor the progress of their students. As any teacher knows, this can be a challenge, so having everything in one place is very useful. We'll look at how you can monitor progress with an example. Checking usage and completion of tasks For you to be able to help your users learn, it goes without saying that they have to complete the tasks you set! Quite a common question is "how do I know if my users are looking at the content I make for them?" There are a variety of ways to monitor this, which vary depending on whether you are looking at a resource or an activity. Tracking usage of course materials Quite often you might set your students a task to go on to your Moodle course and read a resource that you have uploaded or follow a link to another website. While you can't know for sure that they have read the material, it is possible to check that they have displayed it on their screen. To check if users had viewed a resource, we have completion tracking. To use this feature, your administrator must enable it for your whole site and you need to turn it on in the student progress section of the course settings. This means that now you can easily see a list of users who have looked at the resource. On the pupil view, there are boxes next to items that require completion. If a teacher has specified certain conditions that need to be met, the box will automatically fill with a tick once they have been met. Users can also use this to manually track their progress towards completion if there are no criteria set for a particular task by ticking a shaded box themselves. This is shown in the following screenshot: Preparation for course completion reports The course completion report will show you which activities or resources your learners have used. To demonstrate this first you need to change some of the settings on your resources and activities, and ask your administrator to enable it in the site settings. Completion settings for resources Let's go back to a resource we uploaded in the first topic "Manufacture of magnesium sulfate" and edit it. Click on Turn editing on, which has the icon of the hand holding the pen. When the updating file dialog comes up, scroll right down to the bottom where it says Activity completion. Here you have a number of settings, as shown in the next screenshot: We're going to use the setting Show activity as complete when conditions are met. If you're happy letting your users decide to declare when they have completed an activity, you can use the setting Students can manually mark the activity as completed. This would be useful for a self review, towards pupils building a portfolio, or just to get them to take more responsibility over their learning. Once you've done this choose the conditions that need to be met. As this is a resource check the box next to Require view. These conditions vary depending on the nature of the activity. If you want to you can set a date when you expect the activity to be completed. This is just to help organize your completion report and is not shared with the users. Completion settings for activities Different activities have their own settings that you can set to decide when an activity is completed by your users. We'll go through each of these below. Forum activity completion settings You can set up activity completion for forums. In the introduction to this forum, our learners were asked to answer the most recent unanswered question and then post a question of their own. Let's use activity completion to make sure that they do this. In the same way, go to update the forum and scroll down to the activity completion settings at the bottom. You'll notice that there are a lot more options than for a resource. The activity completion settings that we'll choose are Required discussions and Require replies. Both of these will be set to one. This means that your students will need to start at least one discussion and provide at least one reply. Don't forget to set the completion tracking setting in the top drop-down box. This is what the settings will look like: Quiz activity completion For quizzes (assignments and lessons), there are two options for activity completion. You can either require your users to view the quiz or require a grade. Let's go back to the motion quiz we set up and let that require students to receive a grade to complete this activity. Here are the settings: Chat activity completion For a chat activity, the only completion option is for users to manually check the boxes completed. Once you've gone through and set the activity completion settings you will be able to see which of your activities your users have completed. Completion tracking for your whole course Now that you have set up your activities and resources to be tracked, you need to define at a course level, which activities need to be finished for course completion. From the settings block on the left-hand side, click on the link Completion tracking. This is where you decide on the criteria for course completion. We want our users to complete all of the activities chosen, so in the first box choose All for the aggregation method. If there are prerequisites for your course, you can set them here. In the activities completed box, check all of the activities you want your users to complete and specify the completion dates, if any, and passing grades. All the settings can be changed to a later date, if you wish. Course completion reports You can now set up the course completion reports. The link can be found in the navigation block on the left-hand side: Once you click on the course completion reports link, you should see something like the following: The grayed out boxes with ticks are for activities that users can manually choose completion for. So as you can see, it would be quite easy to identify which users haven't completed particular tasks. From here, you can click a user's name and send them a reminder via a message. You can also export this data if you wish. Course reports There are three different types of course reports—activity report, view course logs, and participation report. You can use them to monitor your users in slightly different ways. Activity report For the activity report, you can see a simple overview of the number of views for each activity. This could be useful if you want to see if one activity is more popular than another or if an activity is not being viewed a lot. View course logs This report shows detailed usage across the whole course. Now that we are using completion reports, you would only need to use this type of log if you wanted to check when a particular user accessed a task. Participation report This report gives you a customizable overview for each activity listed by a user. You could use this type of report to see if the users have viewed or posted to an activity or resource and then send messages directly to multiple users.
Read more
  • 0
  • 0
  • 1716

article-image-how-set-basic-workshop-moodle
Packt
31 Mar 2011
9 min read
Save for later

How to Set Up a Basic Workshop in Moodle

Packt
31 Mar 2011
9 min read
  Moodle 1.9 Testing and Assessment Develop and evaluate quizzes and tests using Moodle modules         Read more about this book       (For more resources on Moodle, see here.) Workshop is an important part of our look at testing and assessing with Moodle. Here we will look at Workshop, which offers a way to interact and assess students through their submitted work as well as offering the option of self-assessment, peer assessment, and teacher assessment. The first thing we need to do is name the Workshop and give it a description. We will call ours Paragraph Writing Workshop. In the description, we will write a brief summary of what is expected. We are going to test our students on their ability to write a paragraph on a topic of their choosing, with the requirements being that they have a main idea, supporting sentences, and a conclusion. Now, we need to choose our settings. For our first Workshop, we're going to leave most of the settings at the default. The first settings we are going to change are the Grade for Submission and Grade for Assessments. We want our Workshop to be worth 100 points, with each aspect, the teacher and peer assessment, of the Workshop making up half the grade, 50 percent and 50 percent respectively. The other setting we're going to change is Number of Comments, Assessment Elements, Grade Bands, which we will move from one to three. We are moving it to three because our paragraph has three elements we are going to evaluate: main idea, support, and conclusion. Once we've made that change in the Workshop, we will save it. The first thing we see after saving the Workshop is Editing Assessment Elements, since we decided to stay with the default Accumulative grading technique. We have three Elements to complete here, and for Element 1 we are going to enter 'Has a main idea.' For Element 2 we are going to enter 'Has supporting sentences.' For Element 3 we are going to enter 'Has a conclusion.' For each Type of Scale menu, we are going to leave it set to the two point Yes or No scale, since we are simply going to be checking whether or not the paragraph has met the requirements set. We are also going to leave the Element Weight set at 1, since we want each Element to be equal. Once we have entered everything and confirmed the spelling, we click on Save changes. Once the page has been saved, we are taken to the Paragraph Writing Workshop page. Workshop page—Teacher's view This page has all the information you need regarding the Workshop. It has three sections, which give us all the details about the Workshop. The top section is shown in the next screenshot: Here, we have the information about the phase the Workshop is in. The phases are Set up Assignment, Allow Submissions, Allow Submissions and Assessments, Allow Assessments, Calculation of Final Grades, and Show Final Grades. The phases let us know where we are in the Workshop. As you can see, we are in the Allow Submissions and Assessments phase. We also see the start and end of submissions and assessments. The final information contained in this section is the Maximum grade. Here, we see that our maximum grade is 100. This is because we changed the settings from default and the Grade for Assessments and Grade for Submission were both set to 50. Next to the Maximum grade, we see the Specimen Assessment Form link. Clicking on this link will bring us to a sample of the Assessment Sheet we created. This is shown in the next screenshot: I have only shown the first Element here, and the others follow the same pattern. At the top we see the date and time. Under that, we see the criterion we are assessing in the submitted work. Following this, we see the Grade. We have chosen to use a simple 2 Point Scale, Yes or No, so we are presented with just that. Under this we see an area for comments regarding Element 1. Underneath all of the Elements of the Assessment sheet, there is a box for general feedback or comments, which is not graded. At the very bottom of the page, you will see a continue button. Clicking on this will bring you back to the Workshop page. The final thing to mention here is that next to the Specimen Assessment Form link, there is an Edit icon. This can come in handy if you missed something or want to change something in one of the Elements. The second section of the Workshop page is shown here: (Move the mouse over the image to enlarge.) In the previous screenshot, we see the Show Workshop Description link. Clicking on this link will show the description entered when the Workshop was created. Once review of the Workshop description is done, click on the continue button to return to the Workshop page. Under this, we see information about submitted assignments. There are five columns, First Name / Surname, Submission Title, Date, Teacher Assessment, and Total Grade. Under this, in the small letters, we see information about how to interpret the grades as well as the total possible points. Each of these columns will display the appropriate information, and we will look at this again once we submit an assignment. The final section we see on the Workshop page is called Grading Grade Analysis and is shown in the next screenshot: We can see the Count, Mean, Standard Deviation, Maximum, and Minimum in the previous screenshot. Again, we have not submitted any work or assessed anything yet, so there is nothing here. However, once scores are entered into the Workshop, these numbers will be automatically calculated and updated. Now, all we need to do is have our students log into Moodle and they will see the Workshop and they will be able to enter and begin using it. Workshop page—Student's view When the students enter the Workshop, they will see a page that looks a bit different than the one we have just looked at. This is shown in the next screenshot: As you can see, at the top of the page, they see the same thing as the instructor. The student can see the Current phase, which has now moved to the third phase, Allow Submissions and Assessments. It moved to the third Phase because we set the opening for Submissions and Assessments at the same time. We would have seen the second Phase if we had set the Submission and Assessment times to be different. Students will also see the Workshop submission's and assessment's open and close dates and the Maximum grade possible for the Workshop. They are also able to preview the Assessment Form that will be used. This preview is identical to the one the instructor sees. Under this, the students will see the description of the Workshop with the instructions on how they should complete it. Under the Workshop description, we see the Assignment Submission Form. Here is where the students enter their work. There are three things that are done with this form. First, the student will need to create a title in the Submission Title box. Submission Titles Since Workshop is mostly about peer assessments, you may want to control the way titles are handled. While we can hide the student's name from the peer assessor, the title will always be visible. You may want to have students to use an anonymous system, numbers or some other form of code, so that there is no bias in grading. The second thing the students will do is enter their work in the Submission rich text editor. If there were any attachments included as part of the assignment, they would be seen directly below the textbox. When the students have finished with their submission, they click on the Submit Assignment button and the work will be uploaded to a new area called Your Submissions. What a student sees after clicking on the Submit Assignment button is shown in the next screenshot: This newly created section has four pieces of information for the student to see. The first is the Submission Title. Clicking on the title link will bring the student to a new page where they can view their work. The second section is the Action link. If the student is not satisfied with their work, they have the option to either edit or delete it. Clicking on the Edit link will bring the student to the submission screen where they can change whatever they would like, including uploading additional files, should this feature be enabled. The Delete link will permanently erase the file, but as a safeguard, Workshop will offer the student one chance to change their mind before completely erasing the file. The third is the column that shows the date the assignment was submitted. If the assignment is edited, the time of the editing will be reflected in the Submitted column. This can cause a problem for instructors if the deadline for submissions is not set properly. For example, say a student submits the work on time and as they are reviewing the work later in the week, they notice a misspelling, which they edit. The submitted time will be changed to reflect the last edit completed. The final column is Assessments. This is where the student can see how many times they have been assessed. We have no assessments yet, but we do now have a newly submitted piece of work, so we will switch back to our Teacher profile and look at the changes that have taken place.  
Read more
  • 0
  • 0
  • 1055