This repository has been archived by the owner on May 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from echo-webkom/develop
Bedpres answers
- Loading branch information
Showing
16 changed files
with
362 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package no.uib.echo.schema | ||
|
||
import no.uib.echo.schema.Answer.answer | ||
import no.uib.echo.schema.Answer.question | ||
import org.jetbrains.exposed.sql.* | ||
import org.jetbrains.exposed.sql.transactions.transaction | ||
|
||
|
||
data class AnswerJson( | ||
val question: String, | ||
val answer: String | ||
) | ||
|
||
object Answer : Table() { | ||
val question: Column<String> = varchar("question", 50) | ||
val answer: Column<String> = varchar("answer", 50) | ||
val bedpresSlug: Column<String> = varchar("bedpres_slug", 50) references Bedpres.slug | ||
val registrationEmail: Column<String> = varchar("registration_email", 50) | ||
} | ||
|
||
fun selectQuestionsByEmailAndSlug(email: String, slug: String): List<AnswerJson> { | ||
val result = transaction { | ||
Answer.select { Answer.registrationEmail eq email and (Answer.bedpresSlug eq slug)}.toList() | ||
} | ||
|
||
return result.map { q -> AnswerJson(q[question], q[answer]) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package no.uib.echo.schema | ||
|
||
enum class Degree { | ||
DTEK, | ||
DSIK, | ||
DVIT, | ||
BINF, | ||
IMO, | ||
IKT, | ||
KOGNI, | ||
INF, | ||
PROG, | ||
ARMNINF, | ||
POST, | ||
MISC | ||
} | ||
|
||
val bachelors: List<Degree> = listOf(Degree.DTEK, Degree.DSIK, Degree.DVIT, Degree.BINF, Degree.IMO, Degree.IKT) | ||
val masters: List<Degree> = listOf(Degree.INF, Degree.PROG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.