Skip to content

Commit

Permalink
Rename free-practice-mode to free practice mode
Browse files Browse the repository at this point in the history
  • Loading branch information
HildoBijl committed May 14, 2024
1 parent c5512c4 commit 9ba3a73
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions frontend/public/locales/en/eduTools/pages/skillPage.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"notifications": {
"notPartOfCourse": {
"noRecommendation": "The skill you are currently practising is not part of the course <a>{course}</a>.",
"freePracticeRecommendation": "The skill you are currently practising is not part of the course <a>{course}</a>. If you want to practice for this course, it's best to use the <b>free-practice-mode</b>.",
"freePracticeRecommendation": "The skill you are currently practising is not part of the course <a>{course}</a>. If you want to practice for this course, it's best to use the <b>free practice mode</b>.",
"skillRecommendation": "The skill you are currently practising is not part of the course <a>{course}</a>. If you want to practice for this course, it's best to work on <b>{skill}</b>."
},
"alreadyMastered": {
"freePracticeRecommendation": "You have already sufficiently mastered this skill! It is more effective for the course <a>{course}</a> to use the <b>free-practice-mode</b>.",
"freePracticeRecommendation": "You have already sufficiently mastered this skill! It is more effective for the course <a>{course}</a> to use the <b>free practice mode</b>.",
"skillRecommendation": "You have already sufficiently mastered this skill! It is more effective for the course <a>{course}</a> if you practice <b>{skill}</b>."
},
"notMastered": {
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/ui/eduTools/course/components/SkillAdvice.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function SkillNotification() {
if (recommendation === undefined)
return <NotificationBar type="warning"><Translation entry="notifications.notPartOfCourse.noRecommendation">The skill you are currently practising is not part of the course <Link to={paths.course({ courseId })}>{{ course: translate(course.name, `${course.id}.name`, 'eduContent/courseInfo') }}</Link>.</Translation></NotificationBar>
if (recommendation === strFreePractice)
return <NotificationBar type="warning"><Translation entry="notifications.notPartOfCourse.freePracticeRecommendation">The skill you are currently practising is not part of the course <Link to={paths.course({ courseId })}>{{ course: translate(course.name, `${course.id}.name`, 'eduContent/courseInfo') }}</Link>. If you want to practice for this course, it's best to use the <Link to={paths.freePractice({ courseId })}>free-practice-mode</Link>.</Translation></NotificationBar>
return <NotificationBar type="warning"><Translation entry="notifications.notPartOfCourse.freePracticeRecommendation">The skill you are currently practising is not part of the course <Link to={paths.course({ courseId })}>{{ course: translate(course.name, `${course.id}.name`, 'eduContent/courseInfo') }}</Link>. If you want to practice for this course, it's best to use the <Link to={paths.freePractice({ courseId })}>free practice mode</Link>.</Translation></NotificationBar>
const recommendedSkill = skillTree[analysis.recommendation]
return <NotificationBar type="warning"><Translation entry="notifications.notPartOfCourse.skillRecommendation">The skill you are currently practising is not part of the course <Link to={paths.course({ courseId })}>{{ course: translate(course.name, `${course.id}.name`, 'eduContent/courseInfo') }}</Link>. If you want to practice for this course, it's best to work on <Link to={paths.courseSkill({ courseId, skillId: recommendedSkill.id })}>{{ skill: translate(recommendedSkill.name, `${recommendedSkill.id}.name`, 'eduContent/skillInfo') }}</Link>.</Translation></NotificationBar>
}
Expand All @@ -54,7 +54,7 @@ function SkillNotification() {

case 0: // This skill is already mastered. Show a recommendation.
if (recommendation === strFreePractice)
return <NotificationBar type="info"><Translation entry="notifications.alreadyMastered.freePracticeRecommendation">You have already sufficiently mastered this skill! It is more effective for the course <Link to={paths.course({ courseId })}>{{ course: translate(course.name, `${course.id}.name`, 'eduContent/courseInfo') }}</Link> to use the <Link to={paths.freePractice({ courseId })}>free-practice-mode</Link>.</Translation></NotificationBar>
return <NotificationBar type="info"><Translation entry="notifications.alreadyMastered.freePracticeRecommendation">You have already sufficiently mastered this skill! It is more effective for the course <Link to={paths.course({ courseId })}>{{ course: translate(course.name, `${course.id}.name`, 'eduContent/courseInfo') }}</Link> to use the <Link to={paths.freePractice({ courseId })}>free practice mode</Link>.</Translation></NotificationBar>
return <NotificationBar type="info"><Translation entry="notifications.alreadyMastered.skillRecommendation">You have already sufficiently mastered this skill! It is more effective for the course <Link to={paths.course({ courseId })}>{{ course: translate(course.name, `${course.id}.name`, 'eduContent/courseInfo') }}</Link> if you practice <Link to={paths.courseSkill({ courseId, skillId: recommendation })}>{{ skill: translate(skillTree[recommendation].name, `${recommendation}.name`, 'eduContent/skillInfo') }}</Link>.</Translation></NotificationBar>

case 1: // This skill is reasonable to practice. Don't show a warning.
Expand Down Expand Up @@ -221,8 +221,8 @@ export function useSkillAdvice() {

// There is a skillId. Check if it's OK to work on it.
switch (analysis.practiceNeeded[skillId]) {
case undefined: // This skill is not part of the course.
return {}
case undefined: // This skill is not part of the course. Give the general recommendation.
return { recommendation: analysis.recommendation }

case 0: // This skill is already mastered. Show a recommendation, ideally based on the current skill, but otherwise the general course recommendation.
return { type: 0, recommendation: findNextSkillToPractice(skillId, analysis.practiceNeeded) || analysis.recommendation }
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ui/eduTools/courses/courses.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ Object.keys(courses).forEach(key => {
courses[key].id = key
})

// Turn the goals array into an array of basic objects with weights. (Weights are used by the free-practice-mode.)
// Turn the goals array into an array of basic objects with weights. (Weights are used by the free practice mode.)
Object.values(courses).forEach(course => {
course.goals = course.goals.map(goal => {
if (typeof goal === 'string')
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ui/eduTools/skills/SkillPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function SkillPageForSkill({ skillId, freePracticeMode = false, onNewExer
if (!loadedForSkillId)
return <LoadingNote text={translate('Loading skill pages...', 'loadingNotes.loadingSkillPages', 'eduTools/pages/skillPage')} />

// When we need to filter tabs, like in the free-practice-mode, then do so.
// When we need to filter tabs, like in the free practice mode, then do so.
const freePracticeModeTabs = ['practice', 'formulas', 'references']
const pagesFiltered = freePracticeMode ? applyMapping(pages, (page, tab) => freePracticeModeTabs.includes(tab) ? page : undefined) : pages

Expand Down

0 comments on commit 9ba3a73

Please sign in to comment.