This repository has been archived by the owner on Jul 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
solution-comparison.html
157 lines (145 loc) · 5.32 KB
/
solution-comparison.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Solution Comparison</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css">
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.js"></script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</head>
<body>
<nav class="navbar is-light has-text-centered">
<div class="navbar-menu is-active">
<div class="navbar-start">
<a class="navbar-item" href="https://evgeniy-khist.github.io/">
evgeniy-khist.github.io
</a>
<a class="navbar-item" href="pairwise-comparison.html">
Pairwise Comparison
</a>
<a class="navbar-item" href="solution-comparison.html">
Solution Comparison
</a>
<a class="navbar-item" href="image-pairwise-comparison.html">
Image Pairwise Comparison
</a>
</div>
<div class="navbar-end">
<div class="navbar-item">
<a class="github-button" href="https://github.com/evgeniy-khist/pairwise-comparison" data-icon="octicon-star"
data-size="large" data-show-count="true"
aria-label="Star evgeniy-khist/pairwise-comparison on GitHub">Star</a>
</div>
<div class="navbar-item">
<a class="github-button" href="https://github.com/evgeniy-khist/pairwise-comparison/fork"
data-icon="octicon-repo-forked" data-size="large" data-show-count="true"
aria-label="Fork evgeniy-khist/pairwise-comparison on GitHub">Fork</a>
</div>
<div class="navbar-item">
<a class="github-button" href="https://github.com/evgeniy-khist" data-size="large" data-show-count="true"
aria-label="Follow @evgeniy-khist on GitHub">Follow @evgeniy-khist</a>
</div>
</div>
</div>
</nav>
<section id="app" class="section">
<div class="container">
<div class="columns">
<div class="column">
<div class="field has-addons">
<div class="control">
<input class="input" type="text" placeholder="New requirement" v-model="newRequirementValue"
@keyup.enter="addRequirement">
</div>
<div class="control">
<a class="button is-primary" @click="addRequirement">Add</a>
</div>
</div>
<table class="table">
<thead>
<tr>
<th>Requirement</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr v-for="requirement in sortedRequirements">
<th>{{ requirement.value }}</th>
<td>{{ requirement.score }}</td>
</tr>
</tbody>
</table>
</div>
<div class="column">
<div class="field has-addons">
<div class="control">
<input class="input" type="text" placeholder="New solution" v-model="newSolutionValue"
@keyup.enter="addSolution">
</div>
<div class="control">
<a class="button is-primary" @click="addSolution">Add</a>
</div>
</div>
<table class="table">
<thead>
<tr>
<th>Solution</th>
<th>Score</th>
<th></th>
</tr>
</thead>
<tbody>
<tr v-for="solution in sortedSolutions">
<th>{{ solution.value }}</th>
<td>{{ solution.score }}</td>
<td><span class="tag is-success" v-if="winners.includes(solution)">Winner</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="columns">
<div class="column">
<p class="title is-3">Compare requirements</p>
<div class="field is-grouped is-grouped" v-for="pair in requirementPairs">
<p class="control">
<a class="button" :class="{ 'is-primary': pair.isItem1Winner() }" :disabled="pair.voted"
@click="pair.voteForItem1()">
{{ pair.item1.value }}
</a>
</p>
<p class="control">
<a class="button" :class="{ 'is-primary': pair.isItem2Winner() }" :disabled="pair.voted"
@click="pair.voteForItem2()">
{{ pair.item2.value }}
</a>
</p>
</div>
</div>
<div class="column">
<p class="title is-3">Evaluate solutions</p>
<table class="table">
<thead>
<tr>
<th></th>
<th v-for="solution in solutions">{{ solution.value }}</th>
</tr>
</thead>
<tbody>
<tr v-for="requirement in requirements">
<th>{{ requirement.value }}</th>
<td v-for="solution in solutions">
<input type="checkbox" @change="evaluateSolution($event, solution, requirement)">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<script src="pairwise-comparison.js"></script>
<script src="solution-comparison-vue.js"></script>
</body>
</html>