-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
169 additions
and
103 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
21 changes: 0 additions & 21 deletions
21
server/src/main/kotlin/fi/oph/kitu/generated/api/UserControllerApi.kt
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
server/src/main/kotlin/fi/oph/kitu/generated/model/YkiTutkintotarjonta.kt
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
server/src/main/kotlin/fi/oph/kitu/kielitesti/KotoRepository.kt
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,31 @@ | ||
package fi.oph.kitu.kielitesti | ||
|
||
import org.springframework.data.annotation.Id | ||
import org.springframework.data.repository.CrudRepository | ||
import org.springframework.stereotype.Repository | ||
import java.time.Instant | ||
|
||
data class KotoSuoritus( | ||
@Id | ||
val id: Int? = null, | ||
val first_name: String, | ||
val last_name: String, | ||
val oppija_oid: String, | ||
val email: String, | ||
val time_completed: Instant, | ||
val courseid: Int, | ||
val coursename: String, | ||
val luetun_ymmartaminen_result_system: Double, | ||
val luetun_ymmartaminen_result_teacher: Double, | ||
val kuullun_ymmartaminen_result_system: Double, | ||
val kuullun_ymmartaminen_result_teacher: Double, | ||
val puhe_result_system: Double, | ||
val puhe_result_teacher: Double, | ||
val kirjoittaminen_result_system: Double, | ||
val kirjottaminen_result_teacher: Double, | ||
val total_evaluation_teacher: String, | ||
val total_evaluation_system: String, | ||
) | ||
|
||
@Repository | ||
interface KotoRepository : CrudRepository<KotoSuoritus, Int> |
24 changes: 24 additions & 0 deletions
24
server/src/main/kotlin/fi/oph/kitu/kielitesti/KotoScheduledTasks.kt
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,24 @@ | ||
package fi.oph.kitu.kielitesti | ||
|
||
import com.github.kagkarlsson.scheduler.task.Task | ||
import com.github.kagkarlsson.scheduler.task.helper.Tasks | ||
import com.github.kagkarlsson.scheduler.task.schedule.Schedules | ||
import org.springframework.beans.factory.annotation.Value | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import java.time.Instant | ||
|
||
@Configuration | ||
@ConditionalOnProperty(name = ["kitu.kielitesti.scheduling.enabled"], matchIfMissing = false) | ||
class KotoScheduledTasks { | ||
@Value("\${kitu.kielitesti.scheduling.import.schedule}") | ||
lateinit var kielitestiImportSchedule: String | ||
|
||
@Bean | ||
fun dailyImportKotoSuoritukset(moodleService: MoodleService): Task<Instant> = | ||
Tasks | ||
.recurring("Kielitesti-import", Schedules.parseSchedule(kielitestiImportSchedule), Instant::class.java) | ||
.initialData(Instant.EPOCH) | ||
.executeStateful { taskInstance, _ -> moodleService.importSuoritukset(taskInstance.data) } | ||
} |
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
16 changes: 0 additions & 16 deletions
16
server/src/main/kotlin/fi/oph/kitu/kielitesti/UserController.kt
This file was deleted.
Oops, something went wrong.
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
5 changes: 5 additions & 0 deletions
5
server/src/main/resources/db/migration/V4__add_courseid_and_coursename_to_koto_suoritus.sql
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,5 @@ | ||
alter table koto_suoritus | ||
add column courseid int not null default (-1); | ||
|
||
alter table koto_suoritus | ||
add column coursename text not null default ''; |
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