Merge remote-tracking branch 'origin/master' into nightly
This commit is contained in:
commit
9ecaa1f72d
@ -0,0 +1 @@
|
|||||||
|
- [Improvement] Users will now have the access to graded field in course_blocks table with this change which indicates if course unit is graded or not. (by @Faraz32123)
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE course_blocks
|
||||||
|
ADD COLUMN graded String DEFAULT 'false';
|
||||||
@ -42,13 +42,14 @@ def import_course(course_key):
|
|||||||
print("======================", course_id, course.display_name)
|
print("======================", course_id, course.display_name)
|
||||||
values = [
|
values = [
|
||||||
sql_format(
|
sql_format(
|
||||||
"('{}', '{}', '{}', '{}', '{}', '{}')",
|
"('{}', '{}', '{}', '{}', '{}', '{}', '{}')",
|
||||||
course_id,
|
course_id,
|
||||||
str(child.location),
|
str(child.location),
|
||||||
child.location.block_id,
|
child.location.block_id,
|
||||||
str(position),
|
str(position),
|
||||||
child.display_name or "N/A",
|
child.display_name or "N/A",
|
||||||
full_name,
|
full_name,
|
||||||
|
"true" if child.graded else "false",
|
||||||
)
|
)
|
||||||
for position, (child, full_name) in enumerate(iter_course_blocks(course))
|
for position, (child, full_name) in enumerate(iter_course_blocks(course))
|
||||||
]
|
]
|
||||||
@ -63,7 +64,7 @@ def import_course(course_key):
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
insert_query = sql_format(
|
insert_query = sql_format(
|
||||||
"INSERT INTO course_blocks (course_id, block_key, block_id, position, display_name, full_name) VALUES "
|
"INSERT INTO course_blocks (course_id, block_key, block_id, position, display_name, full_name, graded) VALUES "
|
||||||
)
|
)
|
||||||
insert_query += ", ".join(values)
|
insert_query += ", ".join(values)
|
||||||
make_query(insert_query)
|
make_query(insert_query)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user