Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong value for "correct_answer" in sample Poll application #71

Open
depaege opened this issue Jul 30, 2024 · 0 comments
Open

Wrong value for "correct_answer" in sample Poll application #71

depaege opened this issue Jul 30, 2024 · 0 comments

Comments

@depaege
Copy link

depaege commented Jul 30, 2024

In the "Poll" sample application that is delivered with Apex, the following bug exists. If you create a new poll of type "Quiz", and you create a question of type "Pick many", and ensure that the first answer is not correct, the processing of your answers is wrong. It will mark your question as incorrect, while you may have given the correct response.
The reason is that, after creating your question, the value of "correct_answer" in table eba_qpoll_questions is wrong. It should not start with 2 comma's.

This issue is easily reproducable by doing:
select eba_qpoll_quiz.delim_answers('a','b','c',null,null,null,null,null,null,null,null,null) from dual; --OK -> ,a,b,c,
select eba_qpoll_quiz.delim_answers(null,'a','b','c',null,null,null,null,null,null,null,null) from dual; --NOK -> ,,a,b,c,

This can be fixed in package eba_qpoll_quiz.delim_answers by setting:

   if trim(p_answer_01) is not null then
      l_answers := l_answers || l_delim || trim(p_answer_01);
   end if;

and at the end:

l_answers := l_answers || l_delim;
Then the correct_answer will not start with 2 commas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant