Skip to content

Commit

Permalink
[Teacher][RC 1.11.2 / 34] Remove student view flag, bump version code (
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorNeedham authored Sep 23, 2020
1 parent da0ec39 commit da09f2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/teacher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {
defaultConfig {
minSdkVersion Versions.MIN_SDK
targetSdkVersion Versions.TARGET_SDK
versionCode = 33
versionCode = 34
versionName = '1.11.2'
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,20 @@ class CourseBrowserPresenter(val canvasContext: CanvasContext, val filter: (Tab,
onRefreshStarted()

mApiCalls = tryWeave {
val studentViewEnabled = RemoteConfigUtils.getBoolean(RemoteConfigParam.STUDENT_VIEW_ENABLED_TEACHER) == true

// Check to see if we should show the student view tab - skip if Student View isn't enabled
val canUseStudentView = if (studentViewEnabled)
awaitApiResponse<CanvasContextPermission> {
val canUseStudentView = awaitApiResponse<CanvasContextPermission> {
CourseManager.getCoursePermissions(
canvasContext.id,
emptyList(),
it,
true
)
} else null
}

val tabs = awaitApi<List<Tab>> { TabManager.getTabs(canvasContext, it, forceNetwork) }
.filter { !(it.isExternal && it.isHidden) } // We don't want to list external tools that are hidden
.toMutableList().apply {
if (studentViewEnabled && canUseStudentView?.isSuccessful == true && canUseStudentView.body()?.canUseStudentView == true)
if (canUseStudentView.isSuccessful && canUseStudentView.body()?.canUseStudentView == true)
// Add extra tab for the student view and make sure it's at the very end of the list
add(Tab(tabId = Tab.STUDENT_VIEW, position = 1000))
}.toList() // Turn back into a non-mutable list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ enum class RemoteConfigParam(val rc_name: String, val safeValueAsString: String)
QR_LOGIN_ENABLED("qr_login_enabled", "true"),
QR_LOGIN_ENABLED_TEACHER("qr_login_enabled_teacher", "false"),
QR_PAIR_OBSERVER_ENABLED("qr_pair_observer_enabled", "false"),
STUDENT_VIEW_ENABLED_TEACHER("student_view_enabled_teacher", "false"),
TEST_BOOL("test_bool", "false"),
TEST_FLOAT("test_float", "0f"),
TEST_LONG("test_long", "42"),
Expand Down

0 comments on commit da09f2e

Please sign in to comment.