minor changes and improving display issues

git-svn-id: http://webgoat.googlecode.com/svn/trunk/webgoat@362 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
brandon.devries
2008-08-12 17:36:30 +00:00
parent 775fdad7c4
commit a185de3fa0
9 changed files with 141 additions and 62 deletions

View File

@ -453,9 +453,7 @@ public class CreateDB
+ "ssn VARCHAR(12)," + "password VARCHAR(10)," + "title VARCHAR(20)," + "phone VARCHAR(13),"
+ "address1 VARCHAR(80)," + "address2 VARCHAR(80)," + "manager INT," + "start_date CHAR(8),"
+ "salary INT," + "ccn VARCHAR(30)," + "ccn_limit INT," + "email VARCHAR(30)," // reason
// for
// the
// recent write-up
// for the recent write-up
+ "disciplined_date CHAR(8)," // date of write up, NA otherwise
+ "disciplined_notes VARCHAR(60)," // reason for the recent write-up
+ "personal_description VARCHAR(60)" // We can be rude here

View File

@ -35,8 +35,16 @@ public class RandomLessonTracker extends LessonTracker
public void setStageComplete(String stage, boolean complete)
{
completed.put(stage, Boolean.valueOf(complete));
for (int i = 0; i < stages.length - 1; i++)
if (stages[i].equals(stage)) setStage(stages[i + 1]);
if (!complete) return;
int i = getStageNumber(stage);
if (i < stages.length - 1) setStage(stages[i + 1]);
}
public int getStageNumber(String stage)
{
for (int i = 0; i < stages.length; i++)
if (stages[i].equals(stage)) return i;
return -1;
}
public boolean hasCompleted(String stage)
@ -81,8 +89,14 @@ public class RandomLessonTracker extends LessonTracker
for (int i = 0; i < stages.length; i++)
{
if (hasCompleted(stages[i]))
{
lessonProperties.setProperty(screen.getTitle() + "." + stages[i] + ".completed", Boolean.TRUE
.toString());
}
else
{
lessonProperties.remove(screen.getTitle() + "." + stages[i] + ".completed");
}
}
lessonProperties.setProperty(screen.getTitle() + ".stage", getStage());
super.store(s, screen, user);

View File

@ -207,7 +207,7 @@ public abstract class Screen
public int getContentLength()
{
return content.toString().length();
return getContent().length();
}
/**
@ -224,7 +224,7 @@ public abstract class Screen
// otherwise we're doing way too much SSL encryption work
out.print(content.toString());
out.print(getContent());
}