Browse Source

update ICard

rcmerci 4 years ago
parent
commit
5c739b102f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/main/frontend/extensions/srs.cljs

+ 4 - 1
src/main/frontend/extensions/srs.cljs

@@ -140,7 +140,8 @@
 
 ;;; ================================================================
 ;;; card protocol
-(defprotocol ICard)
+(defprotocol ICard
+  (card-type [this]))
 
 (defprotocol ICardShow
   ;; `show-phase-1' shows cards without hidden contents
@@ -154,6 +155,7 @@
 
 (deftype SidedCard [block]
   ICard
+  (card-type [this] :sided)
   ICardShow
   (show-phase-1 [this] block)
   (show-phase-2 [this]
@@ -161,6 +163,7 @@
 
 (deftype ClozeCard [block]
   ICard
+  (card-type [this] :cloze)
   ICardShow
   (show-phase-1 [this] block)
   (show-phase-2 [this]