Coder Social home page Coder Social logo

forcedotcom / quiz-host-app Goto Github PK

View Code? Open in Web Editor NEW
100.0 9.0 66.0 3.01 MB

Multiplayer quiz app built on Salesforce technology (host app)

License: Creative Commons Zero v1.0 Universal

Shell 2.40% Apex 65.32% CSS 2.45% HTML 9.54% JavaScript 19.06% Batchfile 1.23%
salesforce heroku lwc lwc-oss quiz game lightning-web-components

quiz-host-app's Introduction

All Contributors

Quiz icon

Multiplayer quiz app built on Salesforce technology (host app)

GitHub Workflow GitHub Workflow codecov

  1. About
  2. Installation
    1. Requirements
    2. Host App Installation
    3. Player App Installation
    4. Host App Configuration
    5. Questions Setup
  3. Performance and Scalability
  4. Playing
  5. Troubleshooting
  6. Building / Developing
  7. Contributing
  8. Code of Conduct
  9. License

About

This application is a multiplayer game entirely built on Salesforce technology. A game host presents questions from a Salesforce Org on a shared screen or a video projector. Players compete by answering those questions in real-time using a Lightning Web Component Open Source mobile application hosted on Heroku. The fastest player to give the correct answer scores the most points. As the game progresses, leaderboards are displayed so that players can keep track of scores and ranks.

The quiz app was launched during Developer Game Night at Dreamforce 2019.

Quiz registration at Dreamforce 2019
Quiz host app showing question Quiz player app showing answer buttons Quiz leaderboard at Dreamforce 2019

Installation

Requirements

The quiz requires two applications: a host app and a player app.

The host app is a Lightning Web Component (LWC) app running on a Salesforce org.

The player app is a mobile app built with Lightning Web Component Open Source (LWC OSS). It runs on Node.js deployed on Heroku. You'll need a free Heroku account to set it up. A free account lets you run the game with a small group of players. If you run the game with a larger group, consider upgrading to a Hobby Dyno.

Quiz app architecture

Step 1: Host App Installation

There are two installation options for the host app:

Option 1: Managed Package (recommended)

If installing on a Developer Edition org, you first need to set up My Domain by following these instructions and keeping the default login policy.

  1. Click this link to install the host app package and choose Install for All Users.

    You'll need to approve access to https://chart.googleapis.com. We use this library to draw leaderboards.

  2. Set up permissions:

    1. Navigate to Setup > Users > Permission Sets, click Quiz Host
    2. Click Manage Assignments
    3. Click Add Assignment
    4. Check your user and click Assign.
  3. Navigate to Setup > Integrations > Change Data Capture, enable Change Data Capture for the Quiz Player object and Save.

Option 2: Scratch Org (for development purposes)

We assume that you have a working Salesforce DX environment (Salesforce CLI installed, Dev Hub configured and authorized). See this Trailhead project for guided steps.

  1. Open a Terminal and clone the git repository:

    git clone https://github.com/developerforce/quiz-host-app.git
    cd quiz-host-app
    
  2. Run the installation script. The script deploys the quiz host app on a scratch org with a quiz alias and pre-loads sample questions.

    MacOS or Linux

    ./install-dev.sh quiz sample
    

    Windows

    install-dev.bat quiz sample
    

    Once the script completes, it will open your new scratch org in a browser tab. If you close the tab or get disconnected, run this command to reopen the org sfdx force:org:open -u quiz

Step 2: Player App Installation

  1. Generate a security token for your Salesforce user.

  2. Generate a secure password using this service or any other. This will be the secret Quiz API Key that you'll set later in both applications.

  3. Deploy the Quiz Player App to Heroku by clicking this button: Deploy to Heroku

  4. Set the Config Vars for the Heroku Player app as following:

    Variable Description
    QUIZ_API_KEY The Quiz API key.
    SF_LOGIN_URL The login URL of your Salesforce org:
    https://test.salesforce.com/ for scratch orgs and sandboxes
    https://login.salesforce.com/ for Developer Edition and production
    SF_PASSWORD Your Salesforce user's password.
    SF_TOKEN Your Salesforce user's security token.
    SF_USERNAME Your Salesforce username.
    SF_NAMESPACE The Salesforce package namespace (leave the sfqz default value unless you are developing with a Scratch org).
    COLLECT_PLAYER_EMAILS Whether the app should collect player emails (true/false).

Step 3: Host App Configuration

  1. In your Salesforce org, go to Setup > Remote Site Settings and add a new site named Quiz_Player_App with the player app URL.

  2. Generate a minified URL for the Heroku player app using this service or any other URL shortener (opt for a custom link for greater readability).

  3. Go to Setup > Custom Metadata Types and click Manage Records next to Quiz Settings.

  4. Click New and add a record with these values:

    Field Description
    Player App URL The Heroku player app URL.
    Player App URL Minified The minified URL for the player app.
    Quiz API Key The password that was generated earlier.
    Question Timer The duration of the question timer (default: 12 seconds).
  5. Using the App Switcher, navigate to the Quiz Lightning app. If the installation went well, the quiz page should appear with no errors:

Quiz registration page on host app

At this point you can:

Step 4: Questions Setup

Questions are stored as Quiz Question records.

The Quiz Session record controls the list of selected questions and specifies the questions' order. Use the component on this record page to rearrange questions (don't forget to save your changes).

You org should have one and only one Quiz Session record at any time.

Make sure to edit the Quiz Session record after adding new questions as they aren't automatically added to the quiz.

Option 1: Importing questions using the Data Import Wizard (Recommended)

You can create or import questions by adding records manually or by importing them in a CSV or XLS file with the Data Import Wizard.

Use this table template to save time:

Label Answer A Answer B Answer C Answer D Correct Answer
1 + 1 = ? 1 2 3 4 B

Option 2: Importing questions using the Salesforce CLI

You can import questions with the Salesforce CLI.

  1. Get a zip with custom questions and extract in the data folder. Assuming that your custom question folder is named CUSTOM_QUESTIONS, you should have the following files and folders:

    /data
    /CUSTOM_QUESTIONS
        /plan.json
        /sfqz__Quiz_Question__cs.json
        /sfqz__Quiz_Session__cs.json
        /sfqz__Quiz_Session_Question__cs.json
    
  2. Run this script to remove existing questions:

    sfdx force:apex:execute -f bin/wipe-data.apex
    
  3. Run this script from the project root to import your custom questions:

    sfdx force:data:tree:import -p data/CUSTOM_QUESTIONS/plan.json
    

Performance and Scalability

Performance is critical to the game experience: it must be as close as possible to real-time.

In full transparency, we have no precise benchmark on how well the game scales and which kind of Dyno to use but here are some pointers:

  • A free Heroku Dyno supports a 50 player game just fine.
  • The app has worked flawlessly with 400 players on a Heroku Performance dyno but we never tested with more.

All the pressure lies on the Heroku infrastructure and in particular on the Node.js WebSocket server. We cannot guarantee how the network (sockets and load balancer) behave at large scale.

Note that Heroku datacenters are only available in North America and Europe. If you are running the quiz from another region (i.e.: India, Australia...), there's a chance that players will experience some lag.

Playing

๐ŸŽฅ Watch the playthrough video

Once you have installed the app, test it in private to confirm that it works.

Here is how the game works:

  1. Open the Salesforce org.
  2. Open the Quiz app from App Launcher.
  3. Make sure that the screen is showing the Registration screen. If not, click the Reset button.
  4. Open the mini URL or scan the QR code with your phone. That should open the player app.
  5. Register on the player app. Your player name should automatically appear on the host app.
  6. Click on the top right Start button on the host app. Once the game is started, players are no longer able to register.
  7. Your player app should show a "Waiting for question" message for a few seconds then show the 4 answer buttons. If the player app does not refresh, you likely have a setup issue. See troubleshooting.

Scoring system

Players start with a zero score. The fastest player to answer a question correctly earns 1000 points. Players who also answered correctly but slower will earn a decreasing number of points depending on how late they answered. Wrong answers grant no points. The player that scores the most points at the end of the game wins.

Player app wake-up

Shortly before running the official game, make sure to access the player app a first time to load it.
The default Heroku setup uses a free Heroku dyno. This implies that apps that are inactive for more than 30 minutes are put to sleep. Any connection to the app will wake it up but it takes a bit less than a minute. You may experience some "Request time out" errors during that wake-up time.

If you are running the game with 50+ players, consider upgrading to a Hobby dyno.

Resetting the game

You can reset the game at any time by clicking on the Reset button on top right of the Quiz app. This resets the quiz session to the registration phase, clears players and previous answers.

Troubleshooting

Review these common problems. If you can't find a solution to your problem, open a new issue.

Player app is not starting (Heroku error page is displayed)

  • Check the Heroku app logs for the cause of the error. The app will refuse to start if your Salesforce credentials are incorrect (most likely error).
  • Verify your Salesforce credentials in the configuration variables of your Heroku app.

Player app is not updating when switching game phase (from registration to question for example)

  • Check that you have registered the correct Remote Site in your org.
  • Check that your Quiz API Key is correctly set up in both the Custom Metadata Types and in the configuration variables of your Heroku app.

Player app is slow/lags, questions do not show up on time

See the Performance and Scalability section.

Something is wrong with the quiz data or you'd like to reset it

  • Reset the game using the Reset button on the quiz app. This resets the quiz session to the registration phase, clears players and previous answers.
  • Run the following script wipe ALL quiz data. You'll have to reimport questions.
    sfdx force:apex:execute -f bin/wipe-data.apex
    

You're seeing a "Failed to validate Quiz app settings: Read timed out" error on the host app

Refresh the page to fix the problem. Refer to the Player app wake-up section of this document for more information.

Building / Developing

If you want to build the project from sources and contribute, run npm install to install the project build tools.

Here is the Quiz Player App repository.

Contributing

We love contributions, small or big, from others!

Please see our CONTRIBUTING guidelines. The first thing to do is to discuss the change you wish to make via issue, email, or any other method with the owners of this repository.

Also, review our code of conduct. Please adhere to it in all your interactions with this project.

Thanks goes to these wonderful โœจ people (emoji key) for contributing to the project:


Philippe Ozil

๐Ÿ’ป ๐ŸŽจ ๐Ÿค” ๐Ÿ“– ๐Ÿ‘€

mlezer-bd

๐Ÿ“–

M Hamza Siddiqui

๐Ÿ›ก๏ธ

This project follows the all-contributors specification. Contributions of any kind welcome!

๐Ÿ“„ Code of Conduct

Please review and adhere to our CODE_OF_CONDUCT.md before contributing to this project in any way (e.g. creating an issue, writing code, etc).

๐Ÿ“ License

This project is licensed under the Creative Commons Zero v1.0 License. See the LICENSE file for details.

quiz-host-app's People

Contributors

actions-user avatar allcontributors[bot] avatar annyhe avatar crcastle avatar dependabot[bot] avatar mhamzas avatar mlezer avatar pozil avatar svc-scm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quiz-host-app's Issues

Player app is not showing textbox to register Player

Hi,
I followed the steps given in the installation reference document. I am able to host the quiz but not able to play it.
on entering the URL it just shows Quiz header and rest all is blank. Could you tell me what could be the issue?
Attached is how the player URL is displaying
Player URL

CLI source push error: locale issue

Attempting to install with a brand new Dev Org, and the latest CLI version, 7.36.0, on a Windows machine and I get a few errors. I do get a username, password, scratch org id and url after these errors, but I am pretty sure without a permission set, it's not going to work properly. Here is the terminal output:

PS C:\Users\Melissa> sfdx force:auth:web:login -d -a myhuborg
Successfully authorized ######@gmail.com with org ID 00D##############K
You may now close the browser
PS C:\Users\Melissa> cd quiz-host-app
PS C:\Users\Melissa\quiz-host-app> .\install-dev.bat quiz sample

Installing Quiz org:

  • Org alias: quiz
  • Data: sample

Cleaning previous scratch org...
Successfully marked scratch org quiz for deletion

Creating scratch org...
Successfully created scratch org: 00D##############A, username: test- ########@example.com

Pushing source...
### MissingMessageError: Missing message source_push:commandDescription for locale en_US.
at Messages.getMessageWithMap (C:/Program Files/Salesforce CLI/client/node_modules/@salesforce/core/lib/messages.js:277:19)
at Messages.getMessage (C:/Program Files/Salesforce CLI/client/node_modules/@salesforce/core/lib/messages.js:261:21)
at Object. (C:/Program Files/Salesforce CLI/client/node_modules/salesforce-alm/dist/commands/force/source/push.js:28:45)
at Module._compile (C:/Program Files/Salesforce CLI/client/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at LazyLoader.loadModule (C:/Program Files/Salesforce CLI/client/node_modules/@salesforce/lazy-require/lib/LazyLoader.js:139:21)
at Function._load (C:/Program Files/Salesforce CLI/client/node_modules/@salesforce/lazy-require/lib/LazyLoader.js:115:29)
at require (C:/Program Files/Salesforce CLI/client/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at fetch (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/config/lib/plugin.js:111:21)
at Plugin.findCommand (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/config/lib/plugin.js:125:21)
at Object.load (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/config/lib/plugin.js:58:72)
at Config.runCommand (C:/Program Files/Salesforce CLI/client/node_modules/@oclif/config/lib/config.js:149:27)
### Installation failed.

Assigning permissions...
### === Failures
USERNAME ERROR MESSAGE
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
test-######@example.com ### Permission set "Quiz_Host" not found in target org. Do you need to push source?

Importing data...
### ERROR running force:data:tree:import: The requested resource does not exist
Installation failed.

RE-use of the same question in a quiz session results in a loop

Summary

Given: a quiz session of ten questions.
When: two of the quiz session question records reference the same Question object and are back-to-back ie: indexes 6, 7
Then: The app enters into an infinite loop, presenting the same question over and over again. (Long past the 10 questions included in the quiz session

App Version

Host app version (see bottom of host game page):
1.0.2

Player app version (see bottom of player registration page):
1.1.0

Steps To Reproduce:

  1. Create a new Quiz Session
  2. In the quiz session, create two quiz session questions
  3. ensure that these two new quiz session questions are back-to-back, and reference the same question__c object
  4. Create a third quiz session question record, referencing a different question

Expected result

I expect it to progress to the third question.

Actual result

It keeps looping to the same (first or second) question

Additional information

Quiz Host App: Bug report

Summary

Contact information: David Freeman, Salesforce Technical Architect, [email protected]

Short summary of what is going on or to provide context.

Tested with iPhone 12 (iOS 15.4.1), Android Galaxy S21+ (v12), MacBook Pro 2020 (iOS 12.3.1), and Chromebook (v100.0.4896.133)

-Cannot have an apostrophe ( ' ) in the name when registering for quiz; e.g. cannot have ( David's Chromebook ), but can have ( Davids Chromebook ). (Minor problem)

-Intermittently, some devices show "Wait for question." when the quiz is started.

-Intermittently, all devices show "Wait for question." when the question is shown on the big screen and the timer counts down.

App Version

Host app version (see bottom of host game page):
x.y.z

v2.7.0

Player app version (see bottom of player registration page):
x.y.z

v2.1.1

Steps To Reproduce:

  1. This is step 1.
  2. This is step 2. All steps should start with '1.'

Two issues...

-Once everyone registers and the quiz is started, a device or device(s) will sit at "Waiting for how to start game." while the other devices show the question properly. If the user with the "stalled" device refreshes, the question is shown, but typically too late to answer and they see "You didn't answer in time.". This happens intermittently.

-When proceeding to the next question by clicking ( Next ), all devices show "Wait for question." on their screens while the question is shown on the main screen and the timer winds down. I have the question timer set to 15 seconds. After about 12 seconds, the question is shown on devices, but this only gives about 3 seconds to answer.

Expected result

Describe what should have happened.

Self-explanatory given above scenario in Steps to Reproduce.

Actual result

Describe what actually happened instead.

Self-explanatory given above scenario in Steps to Reproduce.

Additional information

Feel free to attach a screenshot or code snippets.

Heroku Deployment Fails

Summary

Heroku Deployment Fails

Steps To Reproduce:

  1. Try to deploy the app to Heroku.

Expected result

Successful deployment

Actual result

Deployment failed.

Additional information

image

I have doubled checked the parameters I set to the project and it looks ok, maybe I am missing something else.
I also see this warning from Heroku could that be the reason ?
image
Feel free to attach a screenshot or code snippets.

Scratch Org Namespace

Summary

Following the steps on the process to set a scratch org is not possible due to the namespace requirement on Heroku.

App Version

Host app version (see bottom of host game page):
v2.6.0

Player app version (see bottom of the player registration page):
v2.1.0

Steps To Reproduce:

  1. Previously register for a free Dev Hub org
  2. Clone the quiz-host-app
  3. Update the project-scratch-def.json to remove package information, to prevent errors
  4. Generate security token
  5. Fill Heroku config vars with namespace blank

Expected result

No namespace restriction for scratch orgs.

Actual result

An Error is returned because the namespace is a required field.

Additional information

To include a namespace on a scratch org, I would need to first register a namespace on the free dev hub. To register a namespace I would need to set a namespace on a developer org.

Data Import Error during installation

Summary

Permission Issue on data import during Install

Short summary of what is going on or to provide context.
Running the installation script default arguments in Mac OS X

Everything goes well until data import when this error appears

Importing data...
ERROR running force:data:tree:import: We couldn't process your request because you don't have access to Current_Question__c on Quiz_Session__c. To learn more about field-level security, visit Tips and Hints for Page Layouts and Field-Level Security in our Developer Documentation.

App Version

Host app version (see bottom of host game page):
x.y.z

Player app version (see bottom of player registration page):
x.y.z

Steps To Reproduce:

  1. ./install-dev.sh quiz sample
  2. Error appears

Expected result

Succesful installation

Describe what should have happened.

Actual result

ERROR running force:data:tree:import: We couldn't process your request because you don't have access to Current_Question__c on Quiz_Session__c. To learn more about field-level security, visit Tips and Hints for Page Layouts and Field-Level Security in our Developer Documentation.

Additional information

Lag between phone and app

I'm experiencing some severe ag between the app putting the new question on screen and the answer options appearing on the player's smart phone. In some instances the ability to answer the question finally shows on the phone when the time has elapsed to answer.

Incorrect score assigned to players

I ran a few tests with a friend and I saw weird behaviors in player scores on several occasions.

For example, I only got 500 points after answering correctly the first question. According to the spec we discussed, that shouldn't happen. I should have got 1000 (fastest good answer).

Screenshot 2019-11-05 at 22 55 31

Later on in this game, another player gave a correct answer to a different question but only scored 576.

Screenshot 2019-11-05 at 22 56 28

Here's the data of all answers that I had at the end of the game:
answers.csv.txt

Can you run some tests and investigate?

Upgrade to latest package fails

Summary

I attempted to upgrade the package and received a "this package does not share a common ancestor" error.

App Version

Host app version (see bottom of host game page):
2.2.0

Player app version (see bottom of player registration page):
2.0.0

Steps To Reproduce:

  1. Click the link to install v2.5 package into an org with v2.2
  2. Wait and see the error

Expected result

I expected 2.2 to be upgraded to 2.5 If this doesn't upgrade easily, it defeats the purpose of using a package.

Actual result

Received an error.

Additional information

Let me know if I am doing something wrong.

Run several quizz at the same time

What is missing from the application? Please describe.
the possibility to configure several quiz

Describe the solution you'd like
choose the quiz when launching the session.
launch different quiz at the same time for different user group

Describe alternatives you've considered
have a specific heroku app per quiz session

Additional context
user located in different cities
quiz after training

Question: What number of users should I upgrade my Dyno?

I am planning to use the app for a user group meeting soon that I have 60+ registrations.

Is this too many users to host on the Free Dyno?
When should I upgrade to the Hobby Dyno?
100+ Users?

just looking for a suggestion. Thanks

Can create multiple answers for same player same question

Screen Shot 2019-09-23 at 11 35 36 AM

Insert succeeds if the answers are created in rapid succession

Ways to solve it:

  • move checking for duplicates to QuestionAnswer trigger

  • in compute Score, have a Set, and only update scores of answers whose playerId is not in that set.

Installation on Windows not working

Hello I tried to install application as per steps given in https://github.com/fostive/quiz-host-app?ref=hackernoon.com it works well with "Managed Package"
but its not working with Scratch Org (for development purposes)
its giving error

Installing Quiz org:

  • Org alias: quiz
  • Data: sample

Cleaning previous scratch org...
Successfully marked scratch org quiz for deletion

Creating scratch org...
WARNING: Warning: If you're using Contacts to Multiple Accounts, beginning with the Spring โ€™21 release, the feature isn't automatically enabled. You must manually enable the setting for new scratch orgs. Enable the setting in one of these ways: update the Account Settings page in Setup, add the enableRelateContactsToMultipleAccounts setting to your scratch org definition file, or enable it via Metadata API.
Successfully created scratch org: 00D1j000000E4z8EAC, username: [email protected]

Pushing source...
Job ID | 0Af1j00001VJaKbCAL
SOURCE PROGRESS | โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ | 110/110 Components
=== Pushed Source
STATE FULL NAME TYPE PROJECT PATH
โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Add Quiz CustomApplication src\main\default\applications\Quiz.app-meta.xml
Add QuizAbstractDataService ApexClass src\main\default\classes\QuizAbstractDataService.cls
Add QuizAbstractDataService ApexClass src\main\default\classes\QuizAbstractDataService.cls-meta.xml
Add QuizAnswer ApexClass src\main\default\classes\QuizAnswer.cls
Add QuizAnswer ApexClass src\main\default\classes\QuizAnswer.cls-meta.xml
Add QuizAnswerRestResource ApexClass src\main\default\classes\QuizAnswerRestResource.cls

||||||||||||||All apex class in between|||||||||||

Add QuizSettingsTest ApexClass src\test\default\classes\QuizSettingsTest.cls-meta.xml
Add QuizTestUtils ApexClass src\test\default\classes\QuizTestUtils.cls
Add QuizTestUtils ApexClass src\test\default\classes\QuizTestUtils.cls-meta.xml

Assigning permissions...
=== Failures
Username Error Message
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
[email protected] Permission set "Q" not found in target org. Do you need to push source?

Importing data...
ERROR running force:data:tree:import: We couldn't process your request because you don't have access to Label__c on Quiz_Question__c. To learn more about field-level security, visit Tips and Hints for Page Layouts and Field-Level Security in our Developer Documentation.
Installation failed.

Generating user password...
Successfully set the password "xxxxxxxxxxxx" for user [email protected].
You can see the password again by running "sfdx force:user:display -u [email protected]".

Installation completed.

Access org 00D1j000000E4z8EAC as user [email protected] with the following URL: https://customization-force-3605-dev-ed.cs102.my.salesforce.com/secur/frontdoor.jsp?sid=00D1j000000E4z8!ARkAQPjYJbIODmi5WJfPSBRsdWSvOXBLHPylUe98m.86cIK8N2meNMHmNP9HxE8SOgJZDoOvwcKn7jXWwHzzFxJ_hBKN5teQ&retURL=%2Flightning%2Fsetup%2FSecurityremoteProxy%2Fhome

Short summary of what is going on or to provide context.
There is no App available in Apps
image

To solve this problem I tried to add App so I given App permission to system admin from control panel
But still getting this error
image

Could you please help me in resolving this error and to make App run on Dev?

Generate Random Quiz

What is missing from the application? Please describe.
A way to easily generate a 10 question quiz from a stockpile of questions.

Describe the solution you'd like
A button? some ui control that would generate a random 10 question quiz

Describe alternatives you've considered
I've been using this Anonymous Apex snippet, which could form the basis for this feature:

List<Quiz_Question__C> questions = [SELECT Id FROM Quiz_question__c];
List<Quiz_Session_question__c> sessionQuestions = [SELECT Id, question__r.name, Question_Index__c FROM Quiz_Session_Question__c];
Set<Quiz_Question__c> chosenQuestions = new Set<Quiz_Question__c>();

for(Quiz_Session_Question__c question: sessionQuestions) {
	question.question__c = getRandomIdNotAlreadyChosen();    
}

update sessionQuestions;

public id getRandomIdNotAlreadyChosen(){
	Integer i = Integer.valueOf((Math.random() * questions.size()));
    if(!chosenQuestions.contains(questions.get(i))){
        chosenQuestions.add(questions.get(i));
        return questions.get(i).id;
    } else {
        return getRandomIdNotAlreadyChosen();
    }
}

NB: This is a rough and tumble, but functional implementation.

Additional context

Unable to Open App

Hello
I have set up the Heroku app exactly as instructed. Triple verified the variables. However, when i click to open the application, it says tghe page could not be served. I am at a loss. I would appreciate any help to resolve. We had planned to use this tomorrow for our virtual meeting. thanks in advance.
Below is the log
2020-04-01T17:41:01.449231+00:00 app[web.1]: npm ERR! Exit status 255
2020-04-01T17:41:01.449389+00:00 app[web.1]: npm ERR!
2020-04-01T17:41:01.449550+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2020-04-01T17:41:01.449655+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-04-01T17:41:01.459811+00:00 app[web.1]:
2020-04-01T17:41:01.460012+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-04-01T17:41:01.460128+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-04-01T17_41_01_450Z-debug.log
2020-04-01T17:41:01.525148+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-01T18:02:04.779770+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sfnebraskaquizgame.herokuapp.com request_id=078d4b05-2c37-4369-8b0c-f4855b8ead7d fwd="13.110.6.8" dyno= connect= service= status=503 bytes= protocol=https
2020-04-01T18:21:04.721484+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sfnebraskaquizgame.herokuapp.com request_id=e60a0dcd-e32f-46ae-b8a3-58184fe69c15 fwd="24.252.51.52" dyno= connect= service= status=503 bytes= protocol=https

Blacklist for player names?

What is missing from the application? Please describe.
Currently players can use any name they like, which could be abused.

Describe the solution you'd like
I'd love a quick check against a "naughty words" list that prevents the player from creating an inappropriate name.

Additional context
I know this isn't foolproof, as people can get creative using unicode characters and so on, but it might be nice to make it a little more difficult than it is.

Player App - No Access to QuizPlayerStatsRestResource class

Summary

Error when quiz ends, seen by the players when the app tries to show them their stats at the end of the quiz.

App Version

Host app version (see bottom of host game page):
2.2.4

Player app version (see bottom of player registration page):
2.0.0

Steps To Reproduce:

  1. Run a quiz through to the end
  2. On the Player app screen you get an error about access to the QuizPlayerStatsRestResource class.

Expected result

You should see you're personal result (rank etc)

Actual result

You see an error

Additional information

I think the sdfx.QuizPlayerStatsRestResource class needs to be added to the Quiz_Host.permissionset or perhaps have a permission set for the Quiz_Player (to be used by the user that's used by the Heroku app).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.