Skip to content

Lab1#17

Open
DaniilDomnin wants to merge 9 commits into
Rrenkens:mainfrom
DaniilDomnin:lab1
Open

Lab1#17
DaniilDomnin wants to merge 9 commits into
Rrenkens:mainfrom
DaniilDomnin:lab1

Conversation

@DaniilDomnin
Copy link
Copy Markdown

No description provided.

public static void main(String[] args) throws Exception {
Scanner in = new Scanner(System.in);
Map<String, Quiz> map = getQuizMap();
Quiz q = map.get("Text");
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.

Ученики открывают разработанное вами приложение и вводят в CLI название теста, без доступа к коду я никак не могу изменить тест.

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.

if (q.provideAnswer(answer) != Result.INCORRECT_INPUT) {
break;
}
answer = in.next();
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.

* @return завершен ли тест
*/
boolean isFinished() {
return incorrectCount + incorrectCount == taskCount;
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.

case WRONG -> incorrectCount++;
case INCORRECT_INPUT -> isNextTask = false;
}
return currentTask.validate(answer);
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.

Почему не res?

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.

if (!isFinished()) {
if (isNextTask) {
currentTask = taskGenerator.generate();
taskCount++;
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.

Зачем здесь taskCount++? Квиз никогда не завершится.

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.

* @return случайная задача из списка
*/
public Task generate() {
Collections.shuffle(this.tasks);
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.

Можно было бы 1 раз пошафлить и сохранять позицию.

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.

}

char GetCharSign (Operation sign) {
char sym = ' ';
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.

зачем? почему нельзя просто return '+'.

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.

Не понял, я по Operation еще нужный char знака

}
if (accessibleSigns.get(index) == Operation.MULTIPLICATION || (accessibleSigns.get(index) == Operation.DIVISION && pos == XPosition.RIGHT)) {
if (second_num < first_num) {
int tmp = first_num;
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.

swap

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.

Не нашел swap

first_num = maxNumber;
}

if (second_num % first_num != 0) {
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.

int second_num = ran.nextInt(minNumber, maxNumber + 1);
int index = ran.nextInt(0, accessibleSigns.size());
int answer = GenerateAnswer(first_num, second_num, accessibleSigns.get(index));
String string_answer = first_num + String.valueOf(GetCharSign(accessibleSigns.get(index))) + second_num + "=?";
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.

@Rrenkens
Copy link
Copy Markdown
Owner

Rrenkens commented Nov 25, 2022

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

  • -2.5 за Quiz. Ни один квиз не работает. Легко обнаруживается на этапе запуска.
  • -0.5 за невозможность менять квиз без кода.
  • -0.5 за все остальное.
  • -0.25 (тут должно быть -0.75, но ты хотя бы задумался об этом).

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

@Rrenkens Rrenkens added the question Further information is requested label Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants