'QS' (Questionnaire Sequencer), is my eLearning and questionnaire system that presents material to the client in a logic driven way. It is structured as an ordered sequence of text and media (questionnaires, quizzes, audio slide shows and video clips).

The system has had many variants in the past using different programming systems. The version presented here is a server-side program, "SmartSequencer", written in B4J. An eLearning project or a questionnaire consists of a project script that is interpreted by SmartSequencer. I designed the scripting language (QSScript) more than 15 years ago, and it has evolved to be easy to read and edit with a good text editor (Notepad++). Each project QSScript specifies which screens the client sees, as well as the logic that determines the specific sequence of the screens.

A QSScript is a simple text file that is automatically converted to a .json file when first referenced. Both the text file and the .json equivalent are stored on the server. The client-side is only a skeleton HTML/Javascript to connect to the server through a websocket. In fact, the motivation behind this exercise was to see if the websockets approach is up to the task (I think it is).

I have uploaded the zipped project folder which contains the app as well as two examples in separate subfolders under smartSeq\objects\www\. Each example project has a QSScript file (.txt and equivalent .json), as well as index.css, index.html, and myLogo.png files. Comparing the browser pages with the blocks in the .txt file will be most insightful. The index.html has a hidden div with the project's name (in case you are wondering how the generic app gets the name of the script).

The examples are extracts from working projects and are intended for review by the B4X community and are incomplete on purpose. Video and audio materials in the examples are copyrighted and should not be used in any other context. The SmartSequencer app itself may be modified or used 'as is' on new project QSScripts created by other members of the B4X community. Please acknowledge authorship in the source file of the app and QSScripts.

This SmartSequencer is not a finished product. Currently I am working on adding a progress indicator (not so straightforward as the logic flow through the sequence is based on the client's response set and can not be predicted beforehand). Moreover, each project still needs a database for login username, password, and logging user answers and data, as well as for allowing re-entry into interrupted sessions and multiple sessions per client. Such a database also requires a QSScript for retrieving data by authorized project administrators.

I have updated the app to include a database, a login procedure, administrative functions and more examples. In the examples with a user login, users, if interrupted, can resume where they left off. The administrative function allows retrieval of data for pasting in Excel (or statistical package).
I have also relocated the script files and media away from the 'www' folder. The original script files are never made available to the browser, and the media files are made available to the browser only when needed.

Because of size limitation for attachments (500K) I needed to break out the example script files into separate zip files. Please follow these steps to reconstitute the folder structure.

Step 1. Download the 6 attached zip files.

Step 2. Create a new folder called 'smartSeq'

Step 3. Unzip smartSeq.zip to this folder (there should be the expected B4J files as well as an 'objects' folder).

Step 4. The objects folder has an empty 'QSScripts' subfolder, unzip the remaining 5 example script files to this folder. The unzipped folder structure should look like this:

To try it out, start SmartSequencer.b4j in release mode (this will create other standard B4J folders and an executable 'SmartSequencer.jar' file in objects). To kill the server when you have finished testing, use the kill button in B4J log panel. If you have closed B4J already, you may need to restart your computer or kill the server manually:

ABMaterial is a phenomenal system, where B4J server apps use the framework to create html, css, and javascript that are served to the user through web sockets. The design paradigm is based on controls nested inside a grid structure. The set of controls is extensive and the flexibilty of themes is vast. The focus is on the aesthetics of visible form.

My app also creates dynamic html (not css or javascript) on the fly and serves it to the client's browser via web sockets. The visual design part is very simple with an emphasis on following the logic of an eTraining course or a questionnaire sequence. I have built in the option to change themes to a small extent, but essentially I want all screens in a given sequence to look similar with only the content changing.

I can see that there might be a way to combine these approaches by having about a dozen or so different screens designed by ABMaterial and then presenting parameterized versions of these to the client's browser according to a QSScript.