Quiz Plus

An ultimate solution for Quiz/Exam/Survey


Thank you for purchasing my script. If you have any questions that are beyond the scope of this help file, feel free to email me.

Quiz Plus is a web application / platform for Online Assessments, tests, surveys, quizzes and exams. It’s best suited for the corporate sector, admissions management, online evaluations and skills assessment for the educational institutions, companies, corporations and agencies.

 

  1. "ConnectionStrings": {
  2.  
  3. "ApiConnStringMssql": "data source=Sangib-PC;initial catalog=QuizPlusdb;
  4. persist security info=True;Integrated Security=SSPI;",
  5.  
  6. "ApiConnStringMysql": "server=localhost;port=3306;database=QuizPlusdb;user=root;",
  7.  
  8. "ApiConnStringOracle": "Data Source=(DESCRIPTION=(ADDRESS_LIST=
  9. (ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
  10. (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orclpdb)));User Id=root;Password=root;",
  11.  
  12. "ApiConnStringSqlite": "Data Source=QuizPlusdb.db;",
  13.  
  14. "ApiConnStringPostgreSql": "Server=127.0.0.1;Port=5432;Database=QuizPlusdb;
  15. User Id=postgres;Password=postgres;"
  16.  
  17. }

 

  1. public void ConfigureServices(IServiceCollection services)
  2.  
  3. {
  4. //Sql Server Connection String
  5. /* services.AddDbContextPool<AppDbContext>(opt => opt.UseSqlServer
  6. (Configuration.GetConnectionString("ApiConnStringMssql"))); */
  7.  
  8.  
  9. //Mysql Connection String
  10. services.AddDbContextPool<AppDbContext>(opt=>opt.UseMySql
  11. (Configuration.GetConnectionString("ApiConnStringMysql")));
  12.  
  13. //Sqlite Connection String
  14. /* services.AddDbContextPool<AppDbContext>(opt=>opt.UseSqlite
  15. (Configuration.GetConnectionString("ApiConnStringSqlite"))); */
  16.  
  17.  
  18. //PostgreSql Connection String
  19. /* services.AddDbContextPool<AppDbContext>(opt=>opt.UseNpgsql
  20. (Configuration.GetConnectionString("ApiConnStringPostgreSql"))); */
  21.  
  22.  
  23. //Oracle Connection String
  24. /* services.AddDbContextPool<AppDbContext>(opt=>opt.UseOracle
  25. (Configuration.GetConnectionString("ApiConnStringOracle"))); */

 

               ->dotnet tool install --global dotnet-ef

               ->dotnet ef migrations add MigrationName

               ->dotnet ef database update

Assuming that you run both api and client projects by following previous steps. Now you just need to open config.js (/QuizPlusclient/public/config.js) from Client project and set hostname as http://localhost:5002 because our api is running here and you need to link with api from client.

  1. export default{
  2.     hostname:'http://localhost:5002'
  3. }

 

You should use a vps(virtual private server) to host this product. Minimum requirements for vps are

For Windows Server with IIS

 

For Ubuntu Server with Nginx

Here is some resourses so that you can find more detail about above installations-

 

Windows Server

  1. export default{
  2. hostname:'https://quizplusapi.sangibproject.com'
  3. }

Now execute ( npm build ) on terminal and you need to copy the contents of dist folder to a physical path on server and open another site with Host name as QuizPlus.com. 

 

Linux(Ubuntu) Server

                 -> sudo mkdir /var/www/QuizPlus.Api

             Now it's time to configure nginx, open a config file,

                -> sudo nano /etc/nginx/sites-available/QuizPlusApi

             Place the below contents and save that file.

  1. server {
  2.  
  3. listen 80;
  4. server_name quizplusapi.sangibproject.com;
  5. location / {
  6. proxy_pass http://localhost:5002;
  7. proxy_http_version 1.1;
  8. proxy_set_header Upgrade $http_upgrade;
  9. proxy_set_header Connection keep-alive;
  10. proxy_set_header Host $host;
  11. proxy_cache_bypass $http_upgrade;
  12. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  13. proxy_set_header X-Forwarded-Proto $scheme;
  14. }
  15. }
 

               -> sudo ln -s /etc/nginx/sites-available/QuizPlusApi  /etc/nginx/sites-enabled/QuizPlusApi

Let's create a service now to run your Api,
 
               -> sudo nano /etc/systemd/system/QuizPlus.Api.service
 
Place below contents and save that service
 
  1. [Unit]
  2. Description=Api for QuizPlus client App
  3.  
  4. [Service]
  5. WorkingDirectory=/var/www/QuizPlus.Api/publish
  6. ExecStart=/usr/bin/dotnet /var/www/QuizPlus.Api/publish/QuizplusApi.dll
  7. Restart=always
  8. # Restart service after 10 seconds if the dotnet service crashes:
  9. RestartSec=10
  10. KillSignal=SIGINT
  11. SyslogIdentifier=QuizPlus.Api
  12. User=ubuntu-user
  13. Environment=ASPNETCORE_ENVIRONMENT=Production
  14. Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
  15. Environment=ASPNETCORE_URLS=http://localhost:5002
  16.  
  17. [Install]
  18. WantedBy=multi-user.target
 
 
Notice, the User is set to 'ubuntu-user' , Chnaged that by your linux user which has full permission on the app directory.
 
  • Now, Open Client project and set that 'https://quizplusapi.sangibproject.com' on hostname to config.js file and execute ( npm build ) on terminal, you will get a dist folder

  1. export default{
  2. hostname:'https://quizplusapi.sangibproject.com'
  3. } 

Now you will need to create a directory named QuizPlus.Client on your Linux server. Execute below command on your linux terminal to create that directory then copy the contents of dist folder to this (/var/www/QuizPlus.Client) path.

                 -> sudo mkdir /var/www/QuizPlus.Client

Next, open a config file,

                -> sudo nano /etc/nginx/sites-available/QuizPlusClient

Place the below contents and save that file.

  1. server {
  2. listen 80;
  3. server_name QuizPlus.com;
  4. charset utf-8;
  5. root /var/www/QuizPlus.Client/dist;
  6. index index.html;
  7. #Always serve index.html for any request
  8. location / {
  9. root /var/www/QuizPlus.Client/dist;
  10. try_files $uri /index.html;
  11. }
  12. error_log /var/log/nginx/vue-app-error.log;
  13. access_log /var/log/nginx/vue-app-access.log;
  14. }
 

                -> sudo ln -s /etc/nginx/sites-available/QuizPlusClient  /etc/nginx/sites-enabled/QuizPlusClient

  • Now it's time to import the database file to your Mysql database. You will find a database on DB folder.

 

Now let's end by executing below commands on linux terminal
              -> sudo apt-get install -y libgdiplus
              -> sudo systemctl enable QuizPlus.Api
              -> sudo service QuizPlus.Api start
              -> sudo service mysql restart
              -> sudo service nginx restart 
 
That's all for linux server.

For Admin, Username: admin@quizplus.com Password: abcd1234

To find more detail you can browse this link (https://stripe.com/docs/testing)

Once again, thank you so much for purchasing this script. As I said at the beginning, I'd be glad to help you if you have any questions relating to this script. I'll do my best to assist. If you have a more general question relating to this script you may also comment directly on product comment section.

Sangib Kumar Saha