Conversation
| Object.keys(filters).forEach(filter => { | ||
| if (removed) return; | ||
| // console.log(filter) | ||
| // console.log(question[filter]) |
There was a problem hiding this comment.
Remove all console.log()
| def edit_questions(request): | ||
| if request.method == 'GET': | ||
| board_list = Board.objects.all().values_list('board', flat=True) | ||
| chapters = Chapter.objects.all().values_list('chapter_name', flat=True).distinct() |
There was a problem hiding this comment.
If you look at the way boards and grades are being queried for generating test papers, then subject, chapters and grade are referred using foreign key and not by using distinct(). Using distinct() will not allow changes to be mapped properly hence do not use it.
There was a problem hiding this comment.
In generation of test papers, the subjects and grades are queried based on the board name. Here, everything is queried as a whole, so I used distinct to not have repeating results, for example, a Science subject for both class 9 and 10, or a Science subject for ICSE and CBSE should be treated as one subject only, because we can use filters for class and board respectively, to get the desired category of questions
Also did not understand this
Using distinct() will not allow changes to be mapped properly hence do not use it.
Admin can now edit questions from the database. Filters can be applied while searching for the questions
Also, removed bug regarding duplicating of some fields. And added notification when question is successfully edited in the database
fd66c49 to
ae2c67c
Compare
Admin can now edit questions from the database. Filters can be applied
while searching for the questions