Creating Embedded Formative Assessment Dr. Steve Broskoske Misericordia University EDU 533 Computer-based Education
Dec 26, 2015
Creating Embedded Formative Assessment
Dr. Steve BroskoskeMisericordia University
EDU 533 Computer-based Education
Outline
• Review of Variables• Personalizing CBT
– New object: InputBox• Creating embedded assessment with
variables– Providing feedback with MsgBox– Counting variable
• Working with conditional statements– Advanced MsgBox properties – Navigating
What is a Variable?
• variable: Named location in program code for storing data. Analogous to the memory function on a calculator.
A variable in VBA is like saying in Algebra:
x = 5 OR x = “Dr. Steve”
Review
Declare a Variable
• To use a variable, start by declaring it with a dim statement.– Dim variable_name As data_type
Make up a name for a variable. Use underscore (_) for compound names.
Variable types are either text (string)
or a numerical type.
Review
longsingleBooleanstring
Local vs. Public Variables
• Where a variable is declared affects how it functions.– public variable: A variable that is declared as
public is “alive” and available to all subroutines throughout the project. Declare a public variable at the top of the form.
– private variable: A variable that is declared within one subroutine is “alive” only as long as the subroutine is running. Declare a private variable within one subroutine.
Review
Concatenation with Strings
– Add additional strings to a string variable.Dim age As Integer, maxcount As IntegerDim sentence As stringage = 5maxcount = 100sentence = “I am ” & age & “years old.”sentence = sentence & “I can count to ” & maxcount
Review
Do Not Duplicate Names
• As you create names for procedures and variables, be careful not to:– Name 2 procedures by the same name.– Name 2 variables by the same name.– Name a procedure the same as a variable, or
vice versa.
Review
Personalizing CBTwith an InputBox and a Variable• VBA allows teachers to personalize the
application.• Let’s write the following procedures:
– Remember user name (stores name in a variable). In the process, let’s compare local vs. public variables.
– Prompt a user to enter his/her name.• New object: InputBox.
Elements We Need
• Sub Name()scripting goes here
End Sub• Dim userName As String
– Place within procedure to create local.– Place on top of form to create public.
• userName = “Dr. Steve” 'Comments after quote.• MsgBox ("Your user name is " & userName)
– Must concatenate new text and a string variable.
New Object
• InputBox: Prompts user to enter something. Entered material must be stored in a variable.
• Syntax:Variable = InputBox(Prompt:=“text”, Title:=“title bar text”)
TRY IT
1. Have students enter name using a public variable (you already scripted this code; reuse this macro).
2. Create personalized student feedback.
Give PersonalizedPositive Feedback
Enter Name Using Public Variable(Use VBA already created.)
TRY IT• enterUserName() [Reuse this code. Realize that if this
PP was one continuously running application, we would not have to prompt user to enter name again. The variable would already contain in.]
• enterAge()• enterBooksRead()• printNameAgeBooks() [Use a MsgBox to print out personalized
information.]
Enter Name(reuse code)
Enter Age Enter Books Read
Print Name, Age, Booksin a Personalized Way
Importance of Embedded Assessment
• In CBT, we want to have:– Make learners interact vs. just passively read.– Rehearse small chunk of material already
learned.
In a live classroom, teachers don’t simply teach at students. We provide examples, ask questions, review important items, and provide opportunities to rehearse and apply material.
Providing Feedback withStandard PP Tools
Pick the farm animal that gives us milk.
Remember that graphics and even text boxes can have action settings applied. You could use buttons here in place of graphics.
Providing Feedback with VBA
• With VBA, we can provide feedback by using MsgBoxes.
• If we create a standard message, we can simply call the same procedure at different times without having to do extra work.
Providing Feedback with VBA
• enterUserName() [You already created this code. Just use what you already made.]
• doingWell()• doingPoorly()
Enter User Name(reuse code)
Correct Response
Incorrect Response
Providing Feedback with VBA
• You can now call these procedures from another slide. (Start the show from the previous slide so the student’s name will be available.)
b.
c.
a. This is an INCORRECT response to this item.
This is the CORRECT response to this item.
This is an INCORRECT response to this item.
Adding a Counting Variable
• You can add a counting variable to keep track of how many times a student has taken to locate the correct response.
Dim tries As Integer
tries = tries + 1
Adding a Counting Variable• Declare a public variable to keep track of tries.• Simply increment the counter in each procedure.• Later, we can take some action depending on the
number of tries taken. (Requires more code.)– Note: It’s a good practice to initialize variables. We’ll look at this
shortly.
b.
c.
a. INCORRECT response to this item.
CORRECT response to this item.
INCORRECT response to this item.
Show Number of Tries to Teacher
Conditional Statements
• Much of the power that VBA adds to PP is the capacity to make decisions based on student input.
• We can evaluate student input/responses and then make decisions and take actions.
Conditional Statements
• Syntax for a conditional statement:
If condition Then codingElse codingEnd If
Conditional Statements
If tries>2 Then MsgBox(“Statement”) Else MsgBox(“Statement”) End If
If overLimit=false Then code to do somethingElse code to do somethingEnd If
TRY IT• Reapply macros already created to this slide.• displayProgress()
– If tries is less than 3, then give positive feedback in a MsgBox.
– If tries is anything else (meaning greater than 3), give a comment that the student needs improvement.
b.
c.
a. INCORRECT response to this item.
CORRECT response to this item.
INCORRECT response to this item.
Review Progress
If Statement withAdvanced MsgBox
• You can customize the buttons displayed in a message box to help gather user input. (MsgBox now functions like a simple InputBox.)
• If you add an “IF…THEN” statement to evaluate this user input, you can then have more powerful decision-making at your disposal.
Making Decisionwith Message Boxes
• Displayed button options:– MsgBox(“question”, vbYesNo)– MsgBox(“question”, vbRetryCancel)
• Just as with an InputBox, let a variable equal the input.
• The variable will contain “yes” or “no” or “retry” or “cancel”.
Making Decisionwith Message Boxes
• Dim readyOrNot 'Does not need type: constant.
readyOrNot = MsgBox(“Are you ready to try the assessment?”, vbYesNo)
If readyOrNot = yes Then MsgBox(“Good. You are prepared.”)Else MsgBox(“Sorry you do not feel ready.”)End If
TRY IT
• finishedWithHomework()– Create a variable homeworkDone to hold user
input from the constant from vbYesNo in a MsgBox.
– Give feedback with MsgBox using If…Then.
Answer a Question
Navigating
• Action settings allow you to navigate to a specified slide. With VBA and conditional statements (If…Then), you can control where a student navigates next.
• Syntax:ActivePresentation.SlideShowWindow.View.– GotoSlide (num)– Next– Previous
Assignment
1. Using VBA, create a brief assessment in PP with the following parameters:– 3 questions (items)– Each item can have 2 possible responses.
a
b
Possible answer number 1.
Possible answer number 2.
Assignment
• On the first slide, use an input box to enter the learner’s name in a public variable.
• When the user clicks a response:– Navigate to the next slide to view the next
question.– Increment a public variable that keeps track of
how many questions the learner answered correctly.
Assignment
• On the last slide, create a button that provides personalized input:– Use a message box to display information.– List user’s name.– Display number of corrections that the user
got correct.