Default objects for Velocity Code
To use Velocity scripting in header / footer code, you need to turn on Velocity by adding following custom property in the Site Details->Customizations tab.
ENABLE_VELOCITY=true
API | Description |
---|---|
Methods on UIContext object | |
getCurrentLogoPath | Returns currently set logo's path for the site. The output can be used in an IMG tag to create the Logo in custom header. |
getUrl | Returns the URL of the current page |
getPageDescriptor | Returns the page descriptor if the currently displayed page is a CMS published page |
getCurrentUser | Returns User object corresponding to current user. The User object further provides firstName, lastName and userName properties which can be used to display a customized greeting in the header. |
Methods on User object | |
getFirstName | |
getLastName | |
getNonPrefixedUserName | User name of the current user |
getAttachment | Picture of the current user (if uploaded). The output variable is of type Attachment |
isAdmin | |
isGuest | |
getProperty("Custom User Property Name") | Custom user property value |
TestInstance object | This object contains the data corresponding to the results of a test taken by a user. The object can be accessed as ${testInstance} |
getTest | Test which was taken by the user |
getStudent | User who took test |
getStartedOn | Date on which the test was taken |
getNoOfAttempted | Total number of questions attempted by the user |
getNoOfCorrect | Total number of correctly attempted questions |
getNoOfIncorrect | Total number of incorrectly attempted questions |
getTotalScore | Total score obtained by the user |
getResult | Whether the user passed or failed in the test |
Test object | This object contains the data corresponding to the test that was taken by a user. |
getName | Name of the test |
getDuration | Duration of the test in milliseconds |
getTotalQuestions | Total number of questions in the test |
getTotalMarks | Total points in the test |
getPassingMarks | Passing points in the test if specified |
getNegativeMarksPerQuestion | Negative points in the test if specified |
Rating:
Related Pages
Group Management
Javascript
- Customization On Payment Page
- Validate IP Address while accessing the course
- UI Customization JavaScript Functions
- Verify Custom properties during Test Taking
- Verifying User Properties During Test
- JS Example
- example_custom_scripts
- Test Taking - Customization using callback mechanism
- Cms Calendar Example
Reports
Enrollment Management
- API - Update Event Subscription
- API - Create ExamTestInstance
- Update Program Member - via Program Session Id
- Update Program Member
- API - Self Enroll in Course Session
- Update Course Session Member
- API - Self Enroll in Program Session
- API - Self Enroll in Event
- API - Enroll Users in Course Session
- API - Enroll Users in Program Session
- API - Enroll Users in Event
- API - Enroll Users in Program
Other
Introduction
Report
- Get Sites Metadata
- Get Open Learning Items List
- API - Program Enrollment Summary
- API - Course Enrollment Summary
- Get Catalog Items List
- API - Course Session Members list
- API - Program Members List
- Event participants list
- Api - Test Attempts (Test Instances) List
- Test instance details list
- Api - Non Subscribed Event List
- Api - Subscribed Event List
- API - List All Report Schedules
- API - Get Latest Report Content For A Given Schedule ID
- API - Get Report Content For A Given Report ID
- API - List Reports For A Given Schedule
User Management
- API - User list
- API - Get user details
- Api - User Creation
- API - Create User (With Custom Properties)
- API - Update User
- API - Rename User
- API - Add user to group(s)
- API - Remove user from group(s)
- Merge User Accounts
- API - Activate User
- API - Deactivate User
- API - Change User's Origin Site
- Api - User Login (Creating User Session)
eCommerce
Group Management
Javascript
- Customization On Payment Page
- Validate IP Address while accessing the course
- UI Customization JavaScript Functions
- Verify Custom properties during Test Taking
- Verifying User Properties During Test
- JS Example
- example_custom_scripts
- Test Taking - Customization using callback mechanism
- Cms Calendar Example
Reports
Enrollment Management
- API - Update Event Subscription
- API - Create ExamTestInstance
- Update Program Member - via Program Session Id
- Update Program Member
- API - Self Enroll in Course Session
- Update Course Session Member
- API - Self Enroll in Program Session
- API - Self Enroll in Event
- API - Enroll Users in Course Session
- API - Enroll Users in Program Session
- API - Enroll Users in Event
- API - Enroll Users in Program
Other
Introduction
Report
- Get Sites Metadata
- Get Open Learning Items List
- API - Program Enrollment Summary
- API - Course Enrollment Summary
- Get Catalog Items List
- API - Course Session Members list
- API - Program Members List
- Event participants list
- Api - Test Attempts (Test Instances) List
- Test instance details list
- Api - Non Subscribed Event List
- Api - Subscribed Event List
- API - List All Report Schedules
- API - Get Latest Report Content For A Given Schedule ID
- API - Get Report Content For A Given Report ID
- API - List Reports For A Given Schedule
User Management
- API - User list
- API - Get user details
- Api - User Creation
- API - Create User (With Custom Properties)
- API - Update User
- API - Rename User
- API - Add user to group(s)
- API - Remove user from group(s)
- Merge User Accounts
- API - Activate User
- API - Deactivate User
- API - Change User's Origin Site
- Api - User Login (Creating User Session)