Skip to content

Commit a531665

Browse files
committed
removed code that was previously commented out as it is no longer needed
1 parent 21ede84 commit a531665

7 files changed

Lines changed: 54 additions & 301 deletions

File tree

task-tracker-plugin/src/main/kotlin/org/jetbrains/research/ml/tasktracker/models/PaneText.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ import kotlinx.serialization.Serializable
55
@Serializable
66
data class SurveyPaneText(
77
val pin: String,
8-
// val year: String,
9-
// val experience: String,
10-
// val difficulty: String,
11-
// val years: String,
12-
// val months: String,
138
val startSession: String,
149
val programmingLanguage: String
1510
)

task-tracker-plugin/src/main/kotlin/org/jetbrains/research/ml/tasktracker/tracking/LoggedData.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,13 @@ abstract class LoggedData<T, S> {
2323

2424
enum class UiLoggedDataHeader(val header: String) {
2525
PIN("program"),
26-
// YEAR("year"),
27-
// PROGRAM_EXPERIENCE_YEARS("programExperienceYears"),
28-
// PROGRAM_EXPERIENCE_MONTHS("programExperienceMonths"),
29-
// DIFFICULTY("difficulty"),
3026
CHOSEN_TASK("chosenTask"),
3127
PROGRAMMING_LANGUAGE("programmingLanguage")
3228
}
3329

3430
object UiLoggedData : LoggedData<Unit, String>() {
3531
override val loggedDataGetters: List<LoggedDataGetter<Unit, String>> = arrayListOf(
3632
LoggedDataGetter(UiLoggedDataHeader.PIN.header) { SurveyUiData.pin.uiValue.toString() },
37-
// LoggedDataGetter(UiLoggedDataHeader.YEAR.header) { SurveyUiData.year.toString() },
38-
// LoggedDataGetter(UiLoggedDataHeader.PROGRAM_EXPERIENCE_YEARS.header) { SurveyUiData.peYears.uiValue.toString() },
39-
// LoggedDataGetter(UiLoggedDataHeader.PROGRAM_EXPERIENCE_MONTHS.header) { SurveyUiData.peMonths.uiValue.toString() },
40-
// LoggedDataGetter(UiLoggedDataHeader.DIFFICULTY.header) {SurveyUiData.difficulty.toString() },
4133
LoggedDataGetter(UiLoggedDataHeader.CHOSEN_TASK.header) { TaskChoosingUiData.chosenTask.toString() },
4234
LoggedDataGetter(UiLoggedDataHeader.PROGRAMMING_LANGUAGE.header) { SurveyUiData.programmingLanguage.toString() }
4335
)

task-tracker-plugin/src/main/kotlin/org/jetbrains/research/ml/tasktracker/ui/panes/SurveyPane.kt

Lines changed: 0 additions & 238 deletions
Original file line numberDiff line numberDiff line change
@@ -38,30 +38,6 @@ interface SurveyPin : Consumer<Int> {
3838
}
3939
}
4040

41-
//interface YearNotifier : Consumer<Int> {
42-
// companion object {
43-
// val YEAR_TOPIC = Topic.create("YEAR change", YearNotifier::class.java)
44-
// }
45-
//}
46-
47-
//interface PeYearsNotifier : Consumer<Int> {
48-
// companion object {
49-
// val PE_YEARS_TOPIC = Topic.create("program experience years change", PeYearsNotifier::class.java)
50-
// }
51-
//}
52-
//
53-
//interface PeMonthsNotifier : Consumer<Int> {
54-
// companion object {
55-
// val PE_MONTHS_TOPIC = Topic.create("program experience months change", PeMonthsNotifier::class.java)
56-
// }
57-
//}
58-
59-
//interface DifficultyNotifier : Consumer<Int> {
60-
// companion object {
61-
// val DIFFICULTY_TOPIC = Topic.create("difficulty change", DifficultyNotifier::class.java)
62-
// }
63-
//}
64-
6541
interface CountryComparatorNotifier : Consumer<Comparator<Country>> {
6642
companion object {
6743
val COUNTRY_COMPARATOR_TOPIC = Topic.create("country list change", CountryComparatorNotifier::class.java)
@@ -80,33 +56,6 @@ object SurveyUiData : LanguagePaneUiData() {
8056
private val programmingLanguages: List<Language> = PluginServer.programmingLanguages
8157

8258
val pin = UiField(-1, SurveyPin.PIN_NOTIFIER, StoredInfoHandler.getIntStoredField(UiLoggedDataHeader.PIN, -1))
83-
// val year = ListedUiField(
84-
// // TODO: Change genders to years. This needs to be done in both the server and plugin
85-
// genders,
86-
// -1,
87-
// YearNotifier.YEAR_TOPIC,
88-
// initValue = StoredInfoHandler.getIndexByStoredKey(UiLoggedDataHeader.YEAR, genders, -1)
89-
// )
90-
// val peYears = UiField(
91-
// -1,
92-
// PeYearsNotifier.PE_YEARS_TOPIC,
93-
// StoredInfoHandler.getIntStoredField(UiLoggedDataHeader.PROGRAM_EXPERIENCE_YEARS, -1)
94-
//
95-
// )
96-
// val peMonths = UiField(
97-
// -1,
98-
// PeMonthsNotifier.PE_MONTHS_TOPIC,
99-
// StoredInfoHandler.getIntStoredField(UiLoggedDataHeader.PROGRAM_EXPERIENCE_MONTHS, -1),
100-
// false
101-
// )
102-
// val difficulty = ListedUiField(
103-
// difficulties,
104-
// -1,
105-
// DifficultyNotifier.DIFFICULTY_TOPIC,
106-
// compareBy { c -> c.translation.getOrDefault(language.currentValue, "") },
107-
// CountryComparatorNotifier.COUNTRY_COMPARATOR_TOPIC,
108-
// StoredInfoHandler.getIndexByStoredKey(UiLoggedDataHeader.DIFFICULTY, difficulties, -1)
109-
// )
11059
val programmingLanguage = ListedUiField(
11160
programmingLanguages,
11261
0,
@@ -116,11 +65,6 @@ object SurveyUiData : LanguagePaneUiData() {
11665

11766
override fun getData() = listOf(
11867
pin,
119-
// year,
120-
// peYears,
121-
// peMonths,
122-
// difficulty,
123-
// programmingLanguage,
12468
language
12569
)
12670
}
@@ -134,68 +78,6 @@ class SurveyController(project: Project, scale: Double, fxPanel: JFXPanel, id: I
13478
@FXML
13579
private lateinit var pinTextField: TextField
13680

137-
// Gender
138-
// @FXML
139-
// private lateinit var yearLabel: Label
140-
//
141-
// @FXML
142-
// private lateinit var yearGroup: ToggleGroup
143-
//
144-
// @FXML
145-
// private lateinit var year1: RadioButton
146-
//
147-
// @FXML
148-
// private lateinit var year2: RadioButton
149-
//
150-
// @FXML
151-
// private lateinit var year3: RadioButton
152-
//
153-
// @FXML
154-
// private lateinit var year4: RadioButton
155-
//
156-
// @FXML
157-
// private lateinit var year5: RadioButton
158-
//
159-
// @FXML
160-
// private lateinit var year6: RadioButton
161-
//
162-
// @FXML
163-
// private lateinit var yearRadioButtons: List<RadioButton>
164-
165-
// Program Experience
166-
// @FXML
167-
// private lateinit var experienceLabel: Label
168-
//
169-
// @FXML
170-
// private lateinit var peYearsLabel: Label
171-
//
172-
// @FXML
173-
// private lateinit var peYearsTextField: TextField
174-
//
175-
// @FXML
176-
// private lateinit var peMonthsHBox: HBox
177-
//
178-
// @FXML
179-
// private lateinit var peMonthsLabel: Label
180-
//
181-
// @FXML
182-
// private lateinit var peMonthsTextField: TextField
183-
184-
// Country
185-
// @FXML
186-
// private lateinit var difficultyLabel: Label
187-
//
188-
// @FXML
189-
// private lateinit var difficultyComboBox: ComboBox<Country>
190-
// private lateinit var difficultyObservableList: ObservableList<Country>
191-
192-
// Programming language
193-
// @FXML
194-
// private lateinit var programmingLanguageLabel: Label
195-
//
196-
// @FXML
197-
// private lateinit var programmingLanguageComboBox: ComboBox<String>
198-
19981
// StartWorking
20082
@FXML
20183
private lateinit var startWorkingButton: Button
@@ -224,11 +106,6 @@ class SurveyController(project: Project, scale: Double, fxPanel: JFXPanel, id: I
224106
mainPane.styleProperty().bind(Bindings.concat("-fx-font-size: ${scale}px;"))
225107
scalePolygons(arrayListOf(orangePolygon, bluePolygon))
226108
initPin()
227-
// initYear()
228-
// initPeYears()
229-
// initPeMonths()
230-
// initDifficulty()
231-
// initProgrammingLanguage()
232109
initStartWorkingButton()
233110
makeTranslatable()
234111
super.initialize(url, resource)
@@ -251,110 +128,6 @@ class SurveyController(project: Project, scale: Double, fxPanel: JFXPanel, id: I
251128
})
252129
}
253130

254-
// private fun initYear() {
255-
// yearRadioButtons = listOf(year1, year2, year3, year4, year5, year6)
256-
// val gendersSize = paneUiData.year.dataList.size
257-
// yearRadioButtons.forEachIndexed { i, rb -> rb.isVisible = i < gendersSize }
258-
//
259-
// yearGroup.selectedToggleProperty().addListener { _, _, new ->
260-
// paneUiData.year.uiValue = yearRadioButtons.indexOf(new)
261-
// }
262-
// subscribe(YearNotifier.YEAR_TOPIC, object : YearNotifier {
263-
// override fun accept(newGenderIndex: Int) {
264-
// if (paneUiData.year.isValid(newGenderIndex)) {
265-
// yearGroup.selectToggle(yearRadioButtons[newGenderIndex])
266-
// startWorkingButton.isDisable = paneUiData.anyRequiredDataDefault()
267-
// }
268-
// }
269-
// })
270-
// }
271-
272-
// private fun initPeYears() {
273-
// peYearsTextField.addIntegerFormatter(regexFilter("0|[1-9][0-9]{0,1}"))
274-
// peYearsTextField.textProperty().addListener { _, _, new ->
275-
// paneUiData.peYears.uiValue = new.toIntOrNull() ?: paneUiData.peYears.defaultValue
276-
// }
277-
// subscribe(PeYearsNotifier.PE_YEARS_TOPIC, object : PeYearsNotifier {
278-
// override fun accept(newPeYears: Int) {
279-
// peYearsTextField.text = newPeYears.toString()
280-
// val isPeMonthsRequired =
281-
// !paneUiData.peYears.isUiValueDefault && newPeYears < PE_YEARS_NUMBER_TO_SHOW_MONTHS
282-
// paneUiData.peMonths.isRequired = isPeMonthsRequired
283-
// peMonthsHBox.isVisible = isPeMonthsRequired
284-
// if (!isPeMonthsRequired) {
285-
// paneUiData.peMonths.uiValue = paneUiData.peMonths.defaultValue
286-
// }
287-
// startWorkingButton.isDisable = paneUiData.anyRequiredDataDefault()
288-
// }
289-
// })
290-
// }
291-
//
292-
// private fun initPeMonths() {
293-
// peMonthsHBox.isVisible = paneUiData.peMonths.isRequired
294-
// peMonthsTextField.addIntegerFormatter(regexFilter("[0-9]|1[01]"))
295-
// peMonthsTextField.textProperty().addListener { _, old, new ->
296-
// paneUiData.peMonths.uiValue = new.toIntOrNull() ?: paneUiData.peMonths.defaultValue
297-
// }
298-
// subscribe(PeMonthsNotifier.PE_MONTHS_TOPIC, object : PeMonthsNotifier {
299-
// override fun accept(newPeMonths: Int) {
300-
// peMonthsTextField.text = newPeMonths.toString()
301-
// startWorkingButton.isDisable = paneUiData.anyRequiredDataDefault()
302-
// }
303-
// })
304-
// }
305-
306-
// private fun initDifficulty() {
307-
//// Todo: make it autocomplete https://stackoverflow.com/questions/19924852/autocomplete-combobox-in-javafx
308-
// difficultyObservableList = FXCollections.observableList(paneUiData.difficulty.dataList)
309-
// difficultyComboBox.items = difficultyObservableList
310-
//
311-
// val cellFactory = Callback<ListView<Country>, ListCell<Country>> {
312-
// object : ListCell<Country>() {
313-
// override fun updateItem(item: Country?, empty: Boolean) {
314-
// super.updateItem(item, empty)
315-
// if (item == null || empty) {
316-
// graphic = null;
317-
// } else {
318-
// text = item.translation.getOrDefault(LanguagePaneUiData.language.currentValue, "")
319-
// }
320-
// }
321-
// }
322-
// }
323-
//
324-
// difficultyComboBox.buttonCell = cellFactory.call(null)
325-
// difficultyComboBox.cellFactory = cellFactory
326-
//
327-
// difficultyComboBox.selectionModel.selectedItemProperty().addListener { _ ->
328-
// paneUiData.difficulty.uiValue = difficultyComboBox.selectionModel.selectedIndex
329-
// }
330-
// subscribe(DifficultyNotifier.DIFFICULTY_TOPIC, object : DifficultyNotifier {
331-
// override fun accept(newCountryIndex: Int) {
332-
// difficultyComboBox.selectionModel.select(newCountryIndex)
333-
// startWorkingButton.isDisable = paneUiData.anyRequiredDataDefault()
334-
// }
335-
// })
336-
//
337-
// subscribe(CountryComparatorNotifier.COUNTRY_COMPARATOR_TOPIC, object : CountryComparatorNotifier {
338-
// override fun accept(newComparator: Comparator<Country>) {
339-
// difficultyComboBox.items = difficultyObservableList.sorted(newComparator)
340-
// }
341-
// })
342-
// }
343-
344-
// private fun initProgrammingLanguage() {
345-
// programmingLanguageComboBox.items = FXCollections.observableList(paneUiData.programmingLanguage.dataList.map { it.key })
346-
//
347-
// programmingLanguageComboBox.selectionModel.selectedItemProperty().addListener { _ ->
348-
// paneUiData.programmingLanguage.uiValue = programmingLanguageComboBox.selectionModel.selectedIndex
349-
// }
350-
// subscribe(ProgrammingLanguageNotifier.PROGRAMMING_LANGUAGE_TOPIC, object : ProgrammingLanguageNotifier {
351-
// override fun accept(newLanguageIndex: Int) {
352-
// programmingLanguageComboBox.selectionModel.select(newLanguageIndex)
353-
// startWorkingButton.isDisable = paneUiData.anyRequiredDataDefault()
354-
// }
355-
// })
356-
// }
357-
358131
private fun initStartWorkingButton() {
359132
startWorkingButton.onMouseClicked {
360133
ApplicationManager.getApplication().invokeLater {
@@ -373,19 +146,8 @@ class SurveyController(project: Project, scale: Double, fxPanel: JFXPanel, id: I
373146
val surveyPaneText = translations?.get(newLanguage)
374147
surveyPaneText?.let {
375148
pinLabel.text = it.pin
376-
// yearLabel.text = it.year
377-
// experienceLabel.text = it.experience
378-
// peYearsLabel.text = it.years
379-
// peMonthsLabel.text = it.months
380-
// difficultyLabel.text = it.difficulty
381149
startWorkingText.text = it.startSession
382-
// programmingLanguageLabel.text = it.programmingLanguage
383-
// paneUiData.difficulty.dataListComparator =
384-
// compareBy { c -> c.translation.getOrDefault(newLanguage, "") }
385150
}
386-
// yearRadioButtons.zip(paneUiData.year.dataList) { rb, g ->
387-
// rb.text = g.translation[newLanguage] ?: ""
388-
// }
389151
}
390152
})
391153
}

task-tracker-plugin/src/main/resources/org/jetbrains/research/ml/tasktracker/ui/panes/survey-ui-form.fxml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -38,47 +38,7 @@
3838
<Line fx:id="pinLine" endX="${123.0 * scale}" layoutX="${85.0 * scale}" layoutY="${25.0 * scale}" startX="${-87.0 * scale}" styleClass="line"/>
3939
</Pane>
4040
</HBox>
41-
<!-- <Label fx:id="yearLabel" layoutX="${30.0 * scale}" layoutY="${110.0 * scale}" styleClass="sanserif-bold-20">-->
42-
<!-- </Label>-->
43-
<!-- <RadioButton fx:id="year1" layoutX="${80.0 * scale}" layoutY="${150.0 * scale}" mnemonicParsing="false" prefHeight="${26.0 * scale}" prefWidth="${221.0 * scale}" styleClass="sanserif-16">-->
44-
<!-- <toggleGroup>-->
45-
<!-- <ToggleGroup fx:id="yearGroup" />-->
46-
<!-- </toggleGroup>-->
47-
<!-- </RadioButton>-->
48-
<!-- <RadioButton fx:id="year2" layoutX="${80.0 * scale}" layoutY="${190.0 * scale}" mnemonicParsing="false" prefHeight="${26.0 * scale}" prefWidth="${221.0 * scale}" styleClass="sanserif-16" toggleGroup="$genderGroup">-->
49-
<!-- </RadioButton>-->
50-
<!-- <RadioButton fx:id="year3" layoutX="${80.0 * scale}" layoutY="${230.0 * scale}" mnemonicParsing="false" prefHeight="${26.0 * scale}" prefWidth="${221.0 * scale}" styleClass="sanserif-16" toggleGroup="$genderGroup">-->
51-
<!-- </RadioButton>-->
52-
<!-- <RadioButton fx:id="year4" layoutX="${340.0 * scale}" layoutY="${150.0 * scale}" mnemonicParsing="false" prefHeight="${26.0 * scale}" prefWidth="${221.0 * scale}" styleClass="sanserif-16" toggleGroup="$genderGroup">-->
53-
<!-- </RadioButton>-->
54-
<!-- <RadioButton fx:id="year5" layoutX="${340.0 * scale}" layoutY="${190.0 * scale}" mnemonicParsing="false" prefHeight="${26.0 * scale}" prefWidth="${221.0 * scale}" styleClass="sanserif-16" toggleGroup="$genderGroup">-->
55-
<!-- </RadioButton>-->
56-
<!-- <RadioButton fx:id="year6" layoutX="${340.0 * scale}" layoutY="${230.0 * scale}" mnemonicParsing="false" prefHeight="${26.0 * scale}" prefWidth="${221.0 * scale}" styleClass="sanserif-16" toggleGroup="$genderGroup">-->
57-
<!-- </RadioButton>-->
58-
<!-- <Label fx:id="experienceLabel" layoutX="${25.0 * scale}" layoutY="${290.0 * scale}" styleClass="sanserif-bold-20">-->
59-
<!-- </Label>-->
60-
<!-- <HBox layoutX="${25.0 * scale}" layoutY="${330.0 * scale}" styleClass="h-box">-->
61-
<!-- <Label fx:id="peYearsLabel" styleClass="sanserif-16">-->
62-
<!-- </Label>-->
63-
<!-- <Pane prefHeight="${25.0 * scale}" prefWidth="${70.0 * scale}">-->
64-
<!-- <TextField fx:id="peYearsTextField" minHeight="-Infinity" minWidth="-Infinity" prefHeight="${25.0 * scale}" prefWidth="${70.0 * scale}" />-->
65-
<!-- <Line fx:id="peYearsLine" endX="${-17.0 * scale}" layoutX="${87.0 * scale}" layoutY="${22.0 * scale}" startX="${-87.0 * scale}" styleClass="line"/>-->
66-
<!-- </Pane>-->
67-
<!-- </HBox>-->
68-
<!-- <HBox fx:id="peMonthsHBox" layoutX="${301.0 * scale}" layoutY="${330.0 * scale}" styleClass="h-box">-->
69-
<!-- <Label fx:id="peMonthsLabel" styleClass="sanserif-16">-->
70-
<!-- </Label>-->
71-
<!-- <Pane prefHeight="${25.0 * scale}" prefWidth="${70.0 * scale}">-->
72-
<!-- <TextField fx:id="peMonthsTextField" minHeight="-Infinity" minWidth="-Infinity" prefHeight="${25.0 * scale}" prefWidth="${70.0 * scale}" />-->
73-
<!-- <Line fx:id="peMonthsLine" endX="${-17.0 * scale}" layoutX="${87.0 * scale}" layoutY="${22.0 * scale}" startX="${-87.0 * scale}" styleClass="line"/>-->
74-
<!-- </Pane>-->
75-
<!-- </HBox>-->
76-
<!-- <Label fx:id="difficultyLabel" layoutX="${25.0 * scale}" layoutY="${390.0 * scale}" styleClass="sanserif-bold-20">-->
77-
<!-- </Label>-->
78-
<!-- <ComboBox fx:id="difficultyComboBox" layoutX="${80.0 * scale}" layoutY="${440.0 * scale}" prefHeight="${20.0 * scale}" prefWidth="${396.0 * scale}" />-->
7941
<ComboBox fx:id="languageComboBox" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="${25.0 * scale}" prefWidth="${40.0 * scale}" layoutX="${510.0 * scale}" layoutY="${8.0 * scale}" styleClass="language" visibleRowCount="5" visible="false"/>
80-
<!-- <ComboBox fx:id="programmingLanguageComboBox" layoutX="${80.0 * scale}" layoutY="${550.0 * scale}" prefHeight="${20.0 * scale}" prefWidth="${396.0 * scale}" />-->
81-
<!-- <Label fx:id="programmingLanguageLabel" layoutX="${25.0 * scale}" layoutY="${500.0 * scale}" styleClass="sanserif-bold-20" text="programming language:" />-->
8242
<Button fx:id="startWorkingButton" layoutX="${440.0 * scale}" layoutY="${610.0 * scale}" mnemonicParsing="false" prefHeight="${93.0 * scale}" prefWidth="${93.0 * scale}">
8343
<graphic>
8444
<VBox alignment="TOP_CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="${106.0 * scale}" prefWidth="${122.0 * scale}" styleClass="v-box">

task-tracker-server/configs/task-tracker-sources/settings.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ const settings = {
66
'info': {
77
'surveyPane': {
88
'pin': 'Enter your survey PIN',
9-
// 'year': 'Year',
10-
// 'experience': 'Programming Experience',
11-
// 'difficulty': 'How difficult do you think unit testing your project is?',
12-
// 'years': 'Full years',
13-
// 'months': 'Months',
149
'startSession': 'Start the session',
1510
'programmingLanguage': 'Programming language'
1611
},

0 commit comments

Comments
 (0)