Skip to content

Commit

Permalink
fixed feedback mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Kroko-fant committed Dec 19, 2023
1 parent f57b1e8 commit 24f014c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
7 changes: 2 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,10 @@ tasks {
version.set(properties("pluginVersion").get())
changeNotes.set(
"""<p>
<h1>Added Todos for Tutors and easy Setup for Local Testing</h1>
<h1>Added a Feedbackmode for Tutors and easy Setup for Local Testing</h1>
<h2>Improvements</h2>
<ul>
<li>Updated dependencies for IntelliJ 2023.2.4</li>
<li>Local Tests for Students</li>
<li>Todos for Tutors</li>
<li>Feedbackmode for Students without a button</li>
</ul>
</p>"""
)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup=de.tum.www1.artemis.plugin.intellij
pluginName=orion
pluginRepositoryUrl=https://github.com/ls1intum/Orion
# SemVer format -> https://semver.org
pluginVersion=1.2.9
pluginVersion=1.2.10
# Last 2 digits of the year and the major version digit, 211-211.* equals (20)21.1.*
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=233
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class ArtemisClientConnector(private val project: Project) : JavaScriptConnector
override fun initIDEStateListeners() {
project.messageBus.connect().subscribe(INTELLIJ_STATE_TOPIC, object : OrionIntellijStateNotifier {
override fun openedExercise(opened: Long, currentView: ExerciseView) {
Thread.sleep(500)
executeJSFunction(JavaScriptFunction.ON_EXERCISE_OPENED, opened, currentView)
Thread.sleep(1000)
executeJSFunction(JavaScriptFunction.INITIALIZEFEEDBACK)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import de.tum.www1.orion.build.student.OrionStudentTestUtilService
import de.tum.www1.orion.connector.ide.OrionConnector
import de.tum.www1.orion.dto.Feedback
import de.tum.www1.orion.dto.ProgrammingExercise
import de.tum.www1.orion.exercise.assessment.OrionAssessmentService
import de.tum.www1.orion.exercise.OrionExerciseService
import de.tum.www1.orion.exercise.OrionFeedbackService
import de.tum.www1.orion.exercise.assessment.OrionAssessmentService
import de.tum.www1.orion.messaging.OrionIntellijStateNotifier
import de.tum.www1.orion.ui.browser.IBrowser
import de.tum.www1.orion.ui.util.notify
Expand Down Expand Up @@ -57,7 +57,7 @@ class OrionExerciseConnector(val project: Project) : OrionConnector(), IOrionExe
}

override fun initializeFeedback(feedbacks: String) {
val feedbackArray = gson().fromJson(feedback, Array<Feedback>::class.java)
val feedbackArray = gson().fromJson(feedbacks, Array<Feedback>::class.java)
initializeFeedbackForParticipations(feedbackArray)
}

Expand All @@ -70,7 +70,8 @@ class OrionExerciseConnector(val project: Project) : OrionConnector(), IOrionExe
}

override fun initializeHandlers(browser: IBrowser, queryInjector: JBCefJSQuery) {
val reactions = mapOf("editExercise" to { scanner: Scanner -> editExercise(scanner.nextAll()) },
val reactions = mapOf(
"editExercise" to { scanner: Scanner -> editExercise(scanner.nextAll()) },
"importParticipation" to { scanner: Scanner -> importParticipation(scanner.nextLine(), scanner.nextAll()) },
"assessExercise" to { scanner: Scanner -> assessExercise(scanner.nextAll()) },
"downloadSubmission" to { scanner: Scanner ->
Expand All @@ -92,7 +93,7 @@ class OrionExerciseConnector(val project: Project) : OrionConnector(), IOrionExe
initializeAssessment(scanner.nextLine().toLong(), scanner.nextAll())
},
"initializeTestRepository" to { scanner -> initializeTestRepository(scanner.nextAll()) },
"initializeFeedback" to { scanner -> initializeFeedback(scanner.nextAll()) }
"initializeFeedback" to { scanner -> initializeFeedback(scanner.nextAll()) },
)
addJavaHandler(browser, reactions)

Expand All @@ -106,7 +107,7 @@ class OrionExerciseConnector(val project: Project) : OrionConnector(), IOrionExe
),
"initializeAssessment" to listOf("submissionId", "feedback"),
"initializeTestRepository" to listOf("testRepository"),
"initializeFeedback" to listOf("feedbacks")
"initializeFeedback" to listOf("feedbacks"),
)
addLoadHandler(browser, queryInjector, parameterNames)
}
Expand Down

0 comments on commit 24f014c

Please sign in to comment.