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
6b13e2bb
Commit
6b13e2bb
authored
2 years ago
by
Rahul Bowade
Browse files
Options
Download
Patches
Plain Diff
Adding primaryCategory MCQ
parent
225dd3d0
rahul_bulk_upload_postgres
Gcloud_fix
Remove_unwantedCode_Gcloud_fix
bulk-upload-comptenecy-mapping
bulk-upload-excelsheet
bulk-upload-test_excel
bulk_upload
poc_bulk_upload
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
assessment-api/assessment-service/app/handlers/QuestionExcelParser.scala
+6
-3
...assessment-service/app/handlers/QuestionExcelParser.scala
with
6 additions
and
3 deletions
+6
-3
assessment-api/assessment-service/app/handlers/QuestionExcelParser.scala
+
6
−
3
View file @
6b13e2bb
...
...
@@ -6,15 +6,18 @@ import org.apache.poi.xssf.usermodel.{XSSFRow, XSSFWorkbook}
import
java.io.
{
File
,
FileInputStream
}
import
java.util
import
scala.collection.JavaConverters._
import
org.slf4j.
{
Logger
,
LoggerFactory
}
import
org.sunbird.cache.impl.RedisCache
object
QuestionExcelParser
{
private
val
logger
:
Logger
=
LoggerFactory
.
getLogger
(
RedisCache
.
getClass
.
getCanonicalName
)
def
getQuestions
(
file
:
File
)
=
{
try
{
val
workbook
=
new
XSSFWorkbook
(
new
FileInputStream
(
file
))
val
sheet
=
workbook
.
getSheetAt
(
0
)
logger
.
info
(
"Inside the getQuestions"
)
(
1
until
sheet
.
getPhysicalNumberOfRows
)
.
filter
(
rowNum
=>
{
val
oRow
=
Option
(
sheet
.
getRow
(
rowNum
))
...
...
@@ -39,7 +42,7 @@ object QuestionExcelParser {
defaultQuestion
.
put
(
"code"
,
"question"
)
defaultQuestion
.
put
(
"mimeType"
,
"application/vnd.sunbird.question"
)
defaultQuestion
.
put
(
"objectType"
,
"Question"
)
defaultQuestion
.
put
(
"primaryCategory"
,
"M
TF
Question"
)
defaultQuestion
.
put
(
"primaryCategory"
,
"M
CQ
Question"
)
defaultQuestion
.
put
(
"qType"
,
"MCQ"
)
defaultQuestion
.
put
(
"name"
,
"Question"
)
defaultQuestion
...
...
@@ -85,7 +88,7 @@ object QuestionExcelParser {
val
editorState
=
new
java
.
util
.
HashMap
().
asInstanceOf
[
java.util.Map
[
String
,
AnyRef
]]
editorState
.
put
(
"options"
,
options
)
editorState
.
put
(
"question"
,
questionText
)
logger
.
info
(
"Inside the parseQuestion"
)
question
.
put
(
"body"
,
questionText
)
question
.
put
(
"editorState"
,
editorState
)
question
...
...
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