digital_electricity: tutorial: answer checking

Authored by rudranilbasu on Aug 7 2017, 8:04 PM.

Description

digital_electricity: tutorial: answer checking

Implemented checking of answers

  • component lists is now divided into two parts
    • inputComponentLists: The ones that should stay in the ListWidget
    • playAreaComponentList: The ones present in playArea
  • Added property wire[] in Dataset.qml containing properties from where a wire needs to be drawn and to which component
  • Added property "destructible" for a wire, which decides whether a wire can be erased or not by the user. A wire that is already drawn on the playArea in tutorial mode should not be erased by the user and thus the value is set to false in this case. For any other user-generated wire, the value is set to true
  • checkAnswer() function checks for the answer (returns true always as of now) and it is called whenever the value of the digital light is changed to 1 (or turned on) in tutorial mode
  • Implemented creation of wires in the playArea for the tutorial mode, by reading the wires[] array from the dataset and calling createWire() method after calculating the "from" and "to" values for the wire

Signed-off-by: Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>

Details

Committed
rudranilbasuAug 7 2017, 8:04 PM
Parents
R2:a7ead4d648b6: digital_electricity:Dataset:reduce level variables
Branches
Unknown
Tags
Unknown