Coder Social home page Coder Social logo

zerretech / survey Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blazingapple/survey

0.0 0.0 0.0 2.35 MB

Survey Components and Service for Blazor WASM Application Consumption

Home Page: https://blazorsimplesurvey.azurewebsites.net/displaysurvey

License: MIT License

C# 72.73% CSS 3.09% HTML 23.48% SCSS 0.69%

survey's Introduction

BlazingApple.Survey ๐ŸŽ

๐Ÿ”ฅ A totally copacetic, easy-to-use front-end Blazor Survey package. This front-end Razor Class Library is intended to be used by Blazor WASM projects, and targets .NET 5.

About BlazingApples

BlazingApples is an open-source set of packages that aims to speed application development for Blazor WebAssembly organizations.

โšก Check out the demo site here, or this blog post on how the components work!

๐Ÿ‘ Special thanks to ADefWebServer for creating the BlazorSimpleSurvey demo application which this is based off of.

Demo ๐Ÿ“น

Demo of BlazingApple.Survey

Installation ๐Ÿ”ง

1. Get the required dependencies.

  1. On Client Project, right click and get to the NuGet Package Manager ("Manage NuGetPackages").
  2. Install BlazingApple.Survey

Survey Administration

  1. Add the following to Program.cs's Main:
			builder.Services.AddScoped<DialogService>();
			builder.Services.AddScoped<TooltipService>();
			builder.Services.AddScoped<NotificationService>();
			builder.Services.AddScoped<BlazingApple.SurveyService>();
  1. In your index.html file, add the required Radzen style and script:
    <link rel="stylesheet" href="_content/Radzen.Blazor/css/default-base.css"> <!-- this adds a lot of styles we don't want -->
    <script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>

2. Set up your server's API controller to receive the requests.

It is recommended to do this with EntityFrameworkCore to create the tables in my database and receive and process the request. This portion of the setup shows how to do this.

  1. In your Server project, open ApplicationDbContext, add the following tables:
		using BlazingApples.Shared;
		...
    public DbSet<Survey> Surveys { get; set; }
		public DbSet<SurveyAnswer> SurveyAnswers { get; set; }
		public DbSet<SurveyItem> SurveyItems { get; set; }
		public DbSet<SurveyItemOption> SurveyItemOptions { get; set; }
  1. Create a SurveysController.cs in the Controllers directory, use this controller as the controller.

  2. In the Package Manager Console, enter the following commands:

Survey Administration

``` Add-Migration AddSurveyData Update-Database ``` Now you should be all set to use the components.

Usage ๐Ÿ’ช

Once the (admittedly rather involved) setup is complete, using the components is straightforward:

  1. In a component, add the <DisplaySurvey></DisplaySurvey> component to show surveys to a user. If no survey is provided, this component will download all the active surveys from the server and give the user options to take them.
  2. Use the <SurveyAdmin></SurveyAdmin> component in a page in which you'd like to enable users to create or modify surveys.
  3. Step 3

Credits ๐Ÿ’ฎ

Authors ๐Ÿ“

  1. Taylor White

License ๐Ÿ“œ

License: GPL v2

Home Page ๐Ÿ“ท

Survey Administration

Taking Surveys ๐Ÿ“ท

Taking a Survey

Monitoring Responses ๐Ÿ“ท

Survey Responses

survey's People

Contributors

taylorchasewhite avatar

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.