File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838 "effect" : 2
3939 }
4040 ],
41+ "effectsLabel" : {
42+ "-2" : " aggravating" ,
43+ "-1" : " somewhat aggravating" ,
44+ "0" : " undetermined" ,
45+ "1" : " somewhat mitigating" ,
46+ "2" : " mitigating"
47+ },
4148 "selectedQuestionIndex" : null ,
4249 "cases" : {
4350 "case 1" : {
Original file line number Diff line number Diff line change 4242 background-color : # eee ;
4343 border-top : 1px solid grey;
4444 }
45+ td .score--2 {
46+ background-color : hsl (350 , 60% , 85% );
47+ }
48+ td .score--1 {
49+ background-color : hsl (350 , 60% , 95% );
50+ }
51+ td .score-1 {
52+ background-color : hsl (150 , 60% , 95% );
53+ }
54+ td .score-2 {
55+ background-color : hsl (150 , 60% , 85% );
56+ }
4557 </ style >
4658 </ head >
4759 < body >
@@ -74,9 +86,12 @@ <h2 class="title is-3">Automated review ✨</h2>
7486 < tr v-for ="(question, idx) in reviewRows ">
7587 < td > {{idx+1}}. {{question.text}}</ td >
7688 < td > {{question.answer}}</ td >
77- < td > {{question.score}}</ td >
89+ < td :class ="`score-${question.score}` ">
90+ {{getEffectLabelFromQuestion(question)}}
91+ < template v-if ="areScoresShown "> ({{question.score}})</ template >
92+ </ td >
7893 </ tr >
79- < tr >
94+ < tr v-if =" areScoresShown " >
8095 < td > </ td >
8196 < td > Total:</ td >
8297 < td > {{totalScore}}</ td >
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ createApp({
6363 questionnaire : { } ,
6464 modelsList : [ ] ,
6565 areDetailsShown : false ,
66+ areScoresShown : false ,
6667 }
6768 } ,
6869 async mounted ( ) {
@@ -207,6 +208,9 @@ createApp({
207208 let nameParts = acase . name . split ( / \s / )
208209 return `${ acase . incidentDate } - ${ nameParts [ 1 ] } ${ nameParts [ 0 ] [ 0 ] } .` ;
209210 } ,
211+ getEffectLabelFromQuestion ( question ) {
212+ return this . questionnaire . effectsLabel [ question . score ] || 'undetermined'
213+ } ,
210214 highlightText ( text , highlights ) {
211215 // TODO: deduped this code from nlpui.js
212216 let ret = text ?? ''
You can’t perform that action at this time.
0 commit comments