diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java index a0818a4..07717c5 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java @@ -39,7 +39,7 @@ public class GenerateRepositories { optionalCourse.ifPresent(course -> { course.setGithubOrganizationName("InitializerTesting"); try { - GithubManager manager = new GithubManager("andrewlalis", "scrubstub43"); + GithubManager manager = new GithubManager(course.getApiKey()); manager.generateStudentTeamRepository(course.getStudentTeams().get(0)); } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/model/Course.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/model/Course.java index 97a62f3..8c33111 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/model/Course.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/model/Course.java @@ -38,6 +38,12 @@ public class Course extends BasicEntity { @Column private String githubOrganizationName; + /** + * The API key that will be used for Github interaction with this organization. + */ + @Column + private String apiKey; + /** * The list of assignments this course contains. */ @@ -142,6 +148,14 @@ public class Course extends BasicEntity { this.githubOrganizationName = name; } + public String getApiKey() { + return this.apiKey; + } + + public void setApiKey(String key) { + this.apiKey = key; + } + public List getAssignments() { return assignments; } diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/team_importing/StudentTeamImporter.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/team_importing/StudentTeamImporter.java index 774991d..560b33b 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/team_importing/StudentTeamImporter.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/team_importing/StudentTeamImporter.java @@ -36,18 +36,8 @@ public class StudentTeamImporter { List studentEntries = extractStudentsFromRecords(records); - System.out.println("<<< Entries (" + studentEntries.size() + ") >>>"); - for (StudentRecordEntry entry : studentEntries) { - System.out.println(entry.toString()); - } - List studentTeams = generateTeamsFromStudentEntries(studentEntries, 0); - System.out.println("<<< Teams (" + studentTeams.size() + ") >>>"); - for (StudentTeam team : studentTeams) { - System.out.println("Team: " + team); - } - return studentTeams; } diff --git a/src/main/resources/templates/courses/create.html b/src/main/resources/templates/courses/create.html index a90b098..4751be5 100644 --- a/src/main/resources/templates/courses/create.html +++ b/src/main/resources/templates/courses/create.html @@ -11,11 +11,17 @@

- + + - + + - + + + + +