Git Product home page Git Product logo

estimation-survey's Introduction

Estimation Survey

This project contains the source code for a simple web application providing survey capabilities for estimation demo exercises.

Technology

The demo project was created using the DevExpress UI Components for Blazor on a ASP.NET Core 6.0 Blazor Server App using SignalR Razor Pages Web Application

Blazor and DevExpress

Exercise 1: Guess the distance - Histogram

In the first exercise, the participants ought to guess the distance between two cities. Based on the differences to the right answer, a histogram will be calculated and displayed.

The number of columns ($NCol$) in the histogram will be determined automatically by the number of answers given ($NAns$).

$$ NCol = \sqrt{NAns} $$

The value range of each column ($RCol$) will be determined by the difference of the lowest value ($min$) to the greates value ($max$) proportional to the number of columns ($NCol$).

$$ RCol = { max - min \over NCol} $$

This is how the razor code looks like for creating the histogram based on the DevExpress DxChart - Histogram control:

@code
{
    private uebung1MadridDistribution = 
        DistributionCalculator.GenerateNormalDistributionForUebung1Madrid();
}
<DxChart Data="@uebung1MadridDistribution"
         T="DistributionItem">
    <DxChartTitle Text="Auswertung Madrid" />
    <DxChartBarSeries ArgumentField="@((DistributionItem i) => i.Gruppe)"
                      ValueField="@((DistributionItem i) => i.AnzahlSchaetzungen)">
    </DxChartBarSeries>
    <DxChartLegend Visible="false" />
</DxChart>

And this is how the resulting view is rendered:

Screen-Shot 1

Excerise 2: PERT - Range

In the second exercise, the participants ought to estimate the distance between two cities by giving a range guess using the Three-point estimation of the Program evaluation and review technique (PERT), where the Estimate $E$ is calculated using the values:

  • $a$ = the best-case estimate
  • $m$ = the most likely estimate
  • $b$ = the worst-case estimate

$$ E = {a + 4*m + b \over 6} $$

PERT

This is how the razor code looks like for creating the range based on the DevExpress DxChart - Range Bar control:

@code
{
    private IEnumerable<Uebung2OnePertEstimateByUser> uebung2AthenEstimates =
        ResponseStore
            .GetAllUebung2()
            .Select(x => new Uebung2OnePertEstimateByUser(x.UserId, x.ToAthen));
}
<DxChart Data="@uebung2AthenEstimates"
         T="Uebung2OnePertEstimateByUser"
         CustomizeElement="Grid_CustomizeElement">
    <DxChartRangeBarSeries StartValueField="@((Uebung2OnePertEstimateByUser p) => p.Estimate.BestCase)"
                           EndValueField="@((Uebung2OnePertEstimateByUser p) => p.Estimate.WorstCase)"
                           ArgumentField="@((Uebung2OnePertEstimateByUser p) => p.UserId)" />
    <DxChartTooltip Enabled="true">
        @context.GetRangePoint().Render((rangePoint) =>
        @<div style="margin: 0.75rem">
            <div>@rangePoint.StartValue - @rangePoint.EndValue</div>
        </div>)
    </DxChartTooltip>
    <DxChartValueAxis>
        <DxChartAxisTitle Text="Distanz [km]" />
    </DxChartValueAxis>
    <DxChartArgumentAxis>
        <DxChartAxisLabel />
    </DxChartArgumentAxis>
    <DxChartLegend Visible="false" />
</DxChart>

And this is how the resulting view is rendered:

Screen-Shot 2

Excerise 3: T-Shirt size - Vote Distribution

In the third exercise the participants ought to estimate the size of different countries using the T-Shirt size approach, where the size XS represents the smallest countries and the size XL represents the biggest countries.

T-Shirt Sizes

To render the result the html code will be composed by a custom code block in the front end code of the view. For the layout the DevExpress - Grid Layout control is used.

    private IEnumerable<Uebung3EstimatesByUser> allOtherResponses =
        ResponseStore
            .GetAllUebung3()
            .Where(x => x.UserId != this.myUserName);

    private Uebung1Estimates myEstimate = ResponseStore.GetEstimateUebung3(myUserName);
<DxGridLayoutItem Row="1" Column="0">
    <Template>
        <img src="img/austria.png" width="25"  /> Österreich: <b>83’871</b> km^2 (S)
    </Template>
</DxGridLayoutItem>
<DxGridLayoutItem Row="1" Column="1">
    <Template>
    <div class="row w-100 mx-0">
    <p class="col-12 mt-2">
        @{
            if (myEstimate.Oesterreich == TShirtSize.XS)
            {
                <span>@OwnVote</span>
            }
            for (int i = 0; i < allOtherResponses.Count(x => x.Oesterreich == TShirtSize.XS); i++)
            {
                <span>@Vote</span>
            }
        }
    </p>
    </div>
    </Template>
</DxGridLayoutItem>

And this is how the view looks like.

Screen-Shot 3

Credits

Image Sources

DevExpress Controls

estimation-survey's People

Contributors

bbt-mmarkovic avatar

Watchers

 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.