-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add feature to edit questions #61
base: master
Are you sure you want to change the base?
Conversation
Object.keys(filters).forEach(filter => { | ||
if (removed) return; | ||
// console.log(filter) | ||
// console.log(question[filter]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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