Commit f499d8b5 authored by mathieso's avatar mathieso

Change some things.

parent 61fab997
# Installation # Installation
Installation Installation
exercises - fields on form out of orcer, many disabled.
- same for manage display
X - add new fields X - add new fields
- test on shared host - test on shared host
X - initial valuies of new config flags and shit. X - initial valuies of new config flags and shit.
Starter content - can't create paragraphs. Dead to me. Starter content
- can't create paragraphs when adding exercises due to class.
- class - start date MT
- description text format not selected.
- same for notes
# Badges
Hide in menu if there are none.
Hide block if there are none.
# Help
Help menu? What to do with it?
# Skilling config
After install, config form shows initials not required. Student submission asks for them.
Save config form, and it works, when checkbox is clear. Need to explicitly set
the value of the flag during install?
- changed code, did it work?
- check other config flag init code. Some things missing?
# Tokens # Tokens
...@@ -23,8 +51,20 @@ Students can see own history ...@@ -23,8 +51,20 @@ Students can see own history
# Exercises and f/b # Exercises and f/b
Test when exercise not on timeline, how shows for student when inserted.
Wrong icon for no submissions left. Check screen shot.
? Add multifield for exercises on due, even if just use first one. ? Add multifield for exercises on due, even if just use first one.
# RI interface
New row, initialize max subs to blank, not zero
Hit sort, max subs goes to undefined.
# Testing # Testing
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#} #}
{% if items %} {% if items %}
<nav role="navigation" class="skilling-book-children-container"> <nav role="navigation" class="skilling-book-children-container">
<header>{{ 'Inner lessons'|t }}</header> <header>{{ 'Lessons in this section'|t }}</header>
<ul> <ul>
{% for item in items %} {% for item in items %}
<li> <li>
......
...@@ -412,7 +412,7 @@ class MakeNodes { ...@@ -412,7 +412,7 @@ class MakeNodes {
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
* @throws \Drupal\Core\Entity\EntityStorageException * @throws \Drupal\Core\Entity\EntityStorageException
*/ */
public function makeEnrollmentNode(Node $class, User $user, array $classRoles) { public function makeEnrollmentNode(NodeInterface $class, User $user, array $classRoles) {
/** @var \Drupal\node\Entity\Node $node */ /** @var \Drupal\node\Entity\Node $node */
$node = NULL; $node = NULL;
$nodes = $this->entityTypeManager $nodes = $this->entityTypeManager
......
...@@ -777,7 +777,6 @@ $this->t('Word to search for: exogenous.') . "<br />\n ...@@ -777,7 +777,6 @@ $this->t('Word to search for: exogenous.') . "<br />\n
<br /> <br />
" . $this->t("Here is the Doom Song. Edit this page to see a token that's replaced by Gir's masterpiece.") . "<br /> " . $this->t("Here is the Doom Song. Edit this page to see a token that's replaced by Gir's masterpiece.") . "<br />
<br /> <br />
[skilling:doom-song]<br />
", ",
], ],
] ]
......
...@@ -233,30 +233,33 @@ class ExerciseTag extends SkillingCustomTagBase { ...@@ -233,30 +233,33 @@ class ExerciseTag extends SkillingCustomTagBase {
} }
} }
if (is_null($exerciseDue)) { if (is_null($exerciseDue)) {
throw new SkillingException( // Exercise not in class timeline.
Html::escape('Exer id not found: ' . $exercise->id()), __FILE__, __LINE__ $whenDueDisplay = -1;
); $isRequiredDisplay = NULL;
$exerciseMaxSubsDisplay = $this->currentClass->getDefaultMaxSubmissions();
} }
// Compute max submissions allowed. else {
$exerciseMaxSubs = $exerciseDue['maxSubs']; // Compute max submissions allowed.
if (is_null($exerciseMaxSubs)) { $exerciseMaxSubs = $exerciseDue['maxSubs'];
$exerciseMaxSubs = $this->currentClass->getDefaultMaxSubmissions(); if (is_null($exerciseMaxSubs)) {
$exerciseMaxSubs = $this->currentClass->getDefaultMaxSubmissions();
}
$exerciseMaxSubsDisplay =
is_null($exerciseMaxSubs)
? (string) $this->t('No limit')
: $exerciseMaxSubs;
// Compute is required display.
$isRequired = $exerciseDue['required'];
$isRequiredDisplay = $isRequired
? (string) $this->t('Yes')
: (string) $this->t('No');
// Compute when due.
$classStartDate = new DateTime($this->currentClass->getStartDate());
$dueDaysInterval = new DateInterval('P' . $exerciseDue['day'] . 'D');
$exerciseDueDate = clone $classStartDate;
$exerciseDueDate->add($dueDaysInterval);
$whenDueDisplay = $this->skillingUtilities->daysDiffNowString($exerciseDueDate);
} }
$exerciseMaxSubsDisplay =
is_null($exerciseMaxSubs)
? (string)$this->t('No limit')
: $exerciseMaxSubs;
// Compute is required display.
$isRequired = $exerciseDue['required'];
$isRequiredDisplay = $isRequired
? (string)$this->t('Yes')
: (string)$this->t('No');
// Compute when due.
$classStartDate = new DateTime($this->currentClass->getStartDate());
$dueDaysInterval = new DateInterval('P' . $exerciseDue['day'] . 'D');
$exerciseDueDate = clone $classStartDate;
$exerciseDueDate->add($dueDaysInterval);
$whenDueDisplay = $this->skillingUtilities->daysDiffNowString($exerciseDueDate);
} // End there is a current class. } // End there is a current class.
/* @noinspection PhpUndefinedFieldInspection */ /* @noinspection PhpUndefinedFieldInspection */
......
...@@ -18,7 +18,13 @@ ...@@ -18,7 +18,13 @@
<span <span
class="skilling-when-due" class="skilling-when-due"
title="{{ 'When is the exercise due?'|t }}" title="{{ 'When is the exercise due?'|t }}"
>{{ 'Due:'|t }} {{ due_date }}</span> >
{% if due_date == -1 %}
{{ 'Exercise not on timeline'|t }}
{% else %}
{{ 'Due:'|t }} {{ due_date }}
{% endif %}
</span>
{% endif %} {% endif %}
{% if required is not null %} {% if required is not null %}
<span <span
...@@ -26,11 +32,12 @@ ...@@ -26,11 +32,12 @@
title="{{ 'Is this exercise required?'|t }}" title="{{ 'Is this exercise required?'|t }}"
>{{ 'Required:'|t }} {{ required }}</span> >{{ 'Required:'|t }} {{ required }}</span>
{% endif %} {% endif %}
<br>
{% if max_subs is not null %} {% if max_subs is not null %}
<span <span
class="skilling-max-subs" class="skilling-max-subs"
title="{{ 'Number of tries you have to complete this exercise.'|t }}" title="{{ 'Number of tries you have to complete this exercise.'|t }}"
>{{ 'Maximum submissions:'|t }} {{ max_subs }}</span> >{{ 'Submissions limit:'|t }} {{ max_subs }}</span>
{% endif %} {% endif %}
{% if number_subs is not null %} {% if number_subs is not null %}
<span <span
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment