Python Forum
I haven't a clue how to implement this logic
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I haven't a clue how to implement this logic
#3
My approach -
Define an Answer class, with the text of the answer, text to be displayed if chosen, flag as to whether this is the right or wrong answer, and flag as to whether this answer was chosen.
Define a Question class, containing the text of the question and containing 4 Answer class items

Instantiate and populate the 40 Answer items and 10 Question items.

Loop through, displaying each question and the text of each answer, asking user to respond. Do validity checks on the responses (if 1-4 don't allow 5 or Moose as responses). Flag the chosen Answer items

When complete, loop through again. If the chosen Answer item is correct, move on. If not, display the response text. During this loop (the grading loop) you can also keep a count of right and wrong answers and give a percent at the end.
Reply


Messages In This Thread
RE: I haven't a clue how to implement this logic - by jefsummers - Apr-02-2020, 11:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I have no clue what I am doing wrong here elroberto 4 1,463 Jun-18-2022, 08:56 PM
Last Post: deanhystad
  Right way to implement interfaces yossiy123 1 1,350 May-12-2022, 10:31 AM
Last Post: Gribouillis
  Can I get a clue about testing please? Mustey 8 3,788 Apr-12-2021, 04:45 PM
Last Post: Larz60+
  how can a variable change if I haven't changed it? niminim 5 3,207 Apr-07-2021, 06:57 PM
Last Post: niminim
Question best way to implement algorithm hamidze 3 2,328 Feb-27-2021, 07:10 PM
Last Post: hamidze
  Trying to implement Best of 3 logic in rock paper scissors game ShAhCh 5 3,494 May-11-2020, 04:31 PM
Last Post: ShAhCh
  Getting syntax error, no clue why KaynRyu 4 3,250 Mar-26-2019, 02:43 PM
Last Post: KaynRyu
  I have no clue whats wrong... Jack_03 1 2,889 Sep-28-2017, 05:36 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020