File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/main/java/com/teamtreehouse/flashy/controllers Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 12
12
13
13
@ Controller
14
14
public class IndexController {
15
+ public static final int AMOUNT_TO_SHOW = 3 ;
15
16
private FlashCardService flashCardService ;
16
17
17
18
@ Autowired
@@ -22,12 +23,13 @@ public void setFlashCardService(FlashCardService flashCardService) {
22
23
@ RequestMapping ("/" )
23
24
public String index (Model model ) {
24
25
StringBuilder ctaBuilder = new StringBuilder ();
25
- List <FlashCard > cards = flashCardService .getRandomFlashCards (5 );
26
+ List <FlashCard > cards = flashCardService .getRandomFlashCards (AMOUNT_TO_SHOW );
26
27
ctaBuilder .append ("Refresh your memory about " );
27
28
for (FlashCard card : cards ) {
28
29
ctaBuilder .append (card .getTerm ());
29
30
if (card != cards .get (cards .size () - 1 )) {
30
31
ctaBuilder .append (", " );
32
+
31
33
}
32
34
}
33
35
ctaBuilder .append (" and " );
You can’t perform that action at this time.
0 commit comments