Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
knowledge-platform
Commits
1eff0b0e
Commit
1eff0b0e
authored
2 years ago
by
Reshma Prasad
Browse files
Options
Download
Patches
Plain Diff
Commiting code for bulk upload of questions from excelsheet
parent
8c95d746
bulk-upload-excelsheet
Gcloud_fix
Remove_unwantedCode_Gcloud_fix
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
assessment-api/assessment-service/app/controllers/v4/QuestionController.scala
+6
-9
...sment-service/app/controllers/v4/QuestionController.scala
with
6 additions
and
9 deletions
+6
-9
assessment-api/assessment-service/app/controllers/v4/QuestionController.scala
+
6
−
9
View file @
1eff0b0e
...
...
@@ -3,7 +3,9 @@ package controllers.v4
import
akka.actor.
{
ActorRef
,
ActorSystem
}
import
controllers.BaseController
import
handlers.
{
CompetencyExcelParser
,
QuestionExcelParser
}
import
org.sunbird.common.dto.
{
Request
,
Response
,
ResponseHandler
}
import
org.slf4j.
{
Logger
,
LoggerFactory
}
import
org.sunbird.cache.impl.RedisCache
import
org.sunbird.common.dto.Response
import
org.sunbird.utils.AssessmentConstants
import
play.api.libs.json.Json
import
play.api.mvc.ControllerComponents
...
...
@@ -13,11 +15,6 @@ import javax.inject.{Inject, Named}
import
scala.collection.JavaConverters._
import
scala.concurrent.duration.Duration
import
scala.concurrent.
{
Await
,
ExecutionContext
,
Future
}
import
org.slf4j.
{
Logger
,
LoggerFactory
}
import
org.sunbird.cache.impl.RedisCache
import
play.mvc.Http.MultipartFormData.FilePart
import
java.util
class
QuestionController
@Inject
()(
@Named
(
ActorNames
.
QUESTION_ACTOR
)
questionActor
:
ActorRef
,
cc
:
ControllerComponents
,
actorSystem
:
ActorSystem
)(
implicit
exec
:
ExecutionContext
)
extends
BaseController
(
cc
)
{
...
...
@@ -161,7 +158,7 @@ class QuestionController @Inject()(@Named(ActorNames.QUESTION_ACTOR) questionAct
.
file
(
"file"
)
.
map
{
filePart
=>
val
absolutePath
=
filePart
.
ref
.
path
.
toAbsolutePath
val
fileName
:
String
=
filePart
.
filename
val
fileName
:
String
=
filePart
.
filename
QuestionExcelParser
.
getQuestions
(
fileName
,
absolutePath
.
toFile
)
}
logger
.
info
(
"questions after parsing "
+
questions
)
...
...
@@ -193,8 +190,8 @@ class QuestionController @Inject()(@Named(ActorNames.QUESTION_ACTOR) questionAct
.
file
(
"file"
)
.
map
{
filePart
=>
val
absolutePath
=
filePart
.
ref
.
path
.
toAbsolutePath
println
(
"createFrameworkMappingData:= "
+
absolutePath
)
// CompetencyExcelParser.getExcelData(absolutePath.toFile)
println
(
"createFrameworkMappingData:= "
+
absolutePath
)
// CompetencyExcelParser.getExcelData(absolutePath.toFile)
CompetencyExcelParser
.
getCompetency
(
absolutePath
.
toFile
)
}
val
futures
=
competency
.
get
.
map
(
competncy
=>
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets