Skip to content

Lab 1#36

Open
shandomruffle wants to merge 18 commits into
Rrenkens:mainfrom
shandomruffle:lab-1
Open

Lab 1#36
shandomruffle wants to merge 18 commits into
Rrenkens:mainfrom
shandomruffle:lab-1

Conversation

@shandomruffle
Copy link
Copy Markdown

No description provided.

var gen = new PoolTaskGenerator(false,
new TextTask("Какая (по слухам) подработка у С*****ча?", "сборщик мусора"),
new TextTask("Как называется человек, убегающий от каннибала?", "фастфуд"),
new TextTask("Какой вид порно не могут снять бомжи?", "домашнее"),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сказали же захардкодить...

boolean interactionFinished = false;
while (!interactionFinished) {
var query = inputLineNormalized();
switch (query) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот если бы у меня не было кода, я бы не узнал об этом никак. Про help & exit точно.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

фикс, выводится хелпа с самого начала

Comment thread lab-01/by/toharrius/quizer/Main.java Outdated
default -> {
if (map.containsKey(query)) {
System.out.println("Starting quiz \"" + query + "\"!");
Quiz clone;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно дать более осмысленное название.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

фикс

Comment thread lab-01/by/toharrius/quizer/Quiz.java Outdated
* Оценка выставляется только в конце!
*/
public double getMark() {
return (double)getCorrectAnswerNumber() / getTotalAnswerNumber();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну так точно не должно быть. Оценка, которая является отношением количества правильных ответов к количеству всех вопросов.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

фикс

*/
GroupTaskGenerator(Iterable<TaskGenerator> generators) {
this.generators = new ArrayList<>();
for (var gen : generators) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Либо stream api, либо generators.forEach(this.generators::add).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

фикс

Collections.addAll(this.generators, generators);
}

public GroupTaskGenerator(TaskGenerator other, CopyParameter f) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Очень странно и костыльно.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да 🗿

this(allowDuplicate, Arrays.stream(tasks).collect(Collectors.toList()));
}

public PoolTaskGenerator(TaskGenerator other, CopyParameter f) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Аналогично

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗿

) {
this.pool = new ArrayList<>(tasks);
this.allowDuplicate = allowDuplicate;
if (!allowDuplicate) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут allowDuplicate должен проверить и на входе на одинаковые задачи.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

фикс

Comment thread lab-01/by/toharrius/quizer/Main.java Outdated
* значение - сам тест {@link by.toharrius.quizer.Quiz}
*/
private static @NotNull Map<String, Quiz> getQuizMap() {
var map = new HashMap<String, Quiz>();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно дать более осмысленное название.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

фикс

}
default MathOperation generateMathOperation() {
var r = ThreadLocalRandom.current();
int index = r.nextInt((int)getAllowed().stream().count());
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

чем тебя size() не устроил?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это для слабых

@Rrenkens
Copy link
Copy Markdown
Owner

Rrenkens commented Dec 4, 2022

Ну пока что такая оценка:

  • -0.075 за выдачу оценки. +
  • -0.075 за отсальные мелочи. +
  • -0.125 за неитуитивность интерфейса. Можно было в 120 строчке main выводить help, это бы исправило ситуацию. +
  • -1.25 за генерацию вопросов с делением на 0 и дробным ответом, который нельзя проверить (тут хотелось бы либо принятие ответов с precision либо не генерировать их.).

Допы:

  • +1 за EnumSet.
  • +1 за precision (но можно было и в ответе добавить).
  • +1 за nested class.
  • +0 за uml. По диаграмме не понятно отношение объектов и их взаимодействие.

В итоге 8.2. В остальном классная работа и хорошо, что подумал, что один и тот же тест, может быть вызван много раз. +3 за допы.

@Rrenkens Rrenkens added the question Further information is requested label Dec 4, 2022
@Rrenkens Rrenkens added wontfix This will not be worked on and removed question Further information is requested labels Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants