#97, Hint controls for CHALLENGE Category lessons

This commit is contained in:
Jason White
2015-09-21 21:24:10 -04:00
parent e625c445c5
commit dc57827cfc
2 changed files with 7 additions and 9 deletions

View File

@ -9,6 +9,7 @@ import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.owasp.webgoat.lessons.AbstractLesson;
import org.owasp.webgoat.lessons.Category;
import org.owasp.webgoat.lessons.model.Hint;
import org.owasp.webgoat.session.WebSession;
import org.springframework.stereotype.Controller;
@ -40,11 +41,12 @@ public class HintService extends BaseService {
if (l == null) {
return listHints;
}
List<String> hints;
hints = l.getHintsPublic(ws);
List<String> hints = (l.getCategory().equals(Category.CHALLENGE)) ? null : l.getHintsPublic(ws);
if (hints == null) {
return listHints;
}
int idx = 0;
for (String h : hints) {
Hint hint = new Hint();