-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
424 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/plugin/flashcard/Installation/Migrations/Version20231127105116.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Claroline\FlashcardBundle\Installation\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated migration based on mapping information: modify it with caution. | ||
* | ||
* Generation date: 2023/11/27 10:51:17 | ||
*/ | ||
final class Version20231127105116 extends AbstractMigration | ||
{ | ||
public function up(Schema $schema): void | ||
{ | ||
$this->addSql(' | ||
ALTER TABLE claro_flashcard_deck | ||
ADD showLeitnerRules TINYINT(1) NOT NULL | ||
'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
$this->addSql(' | ||
ALTER TABLE claro_flashcard_deck | ||
DROP showLeitnerRules | ||
'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,7 @@ Card.propTypes = { | |
actions: T.func, | ||
card: T.shape( | ||
CardTypes.propTypes | ||
).isRequired | ||
) | ||
} | ||
|
||
export { | ||
|
40 changes: 0 additions & 40 deletions
40
src/plugin/flashcard/Resources/modules/resources/flashcard/components/info.jsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/plugin/flashcard/Resources/modules/resources/flashcard/components/rules.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from 'react' | ||
import classes from 'classnames' | ||
import {PropTypes as T} from 'prop-types' | ||
|
||
import {trans} from '#/main/app/intl' | ||
import {getIcon, getRule} from '#/plugin/flashcard/resources/flashcard/utils' | ||
|
||
const SessionRule= props => { | ||
const icon = getIcon(props.index) | ||
const rule = getRule(props.index) | ||
|
||
let classList = ['icon-with-text-right'] | ||
if (props.index < props.session || (props.index === props.session && props.completed)) { | ||
classList.push('session-rule-done') | ||
} | ||
|
||
return ( | ||
<li className="session-rule"> | ||
<div className={classes(classList)}> | ||
{icon} | ||
</div> | ||
<div className=""> | ||
Session {props.index} : {trans('session_cards_start', {}, 'flashcard') + ' ' + rule}. | ||
</div> | ||
</li> | ||
) | ||
} | ||
|
||
SessionRule.propTypes = { | ||
session: T.number, | ||
rule: T.number, | ||
completed: T.bool, | ||
index: T.number | ||
} | ||
|
||
const LeitnerRules = (props) => ( | ||
<ul | ||
className="sessions-rules"> | ||
{Array.from({length: 7}, (_, index) => ( | ||
<SessionRule | ||
key={index} | ||
session={props.session} | ||
completed={props.completed} | ||
index={index + 1} | ||
/> | ||
))} | ||
</ul> | ||
) | ||
|
||
LeitnerRules.propTypes = { | ||
session: T.number, | ||
completed: T.bool | ||
} | ||
|
||
export { | ||
LeitnerRules | ||
} |
Oops, something went wrong.