add css template exercise - refs #2681

pull/3016/head
Alex Aragón 6 years ago
parent 42f6987b74
commit 3f313fed90
  1. 16
      assets/css/scss/_base.scss
  2. 4
      main/exercise/exercise.php
  3. 83
      main/template/default/exercise/index.html.twig

@ -1313,7 +1313,21 @@ hr {
}
}
}
.list-exercise{
.list-group{
.list-group-item{
.description{
width:100%;
height:20px;
padding:0;
text-overflow:ellipsis;
overflow:hidden;
transition: all 1s;
box-sizing: border-box;
}
}
}
}
.main-question{
margin-bottom: 20px;
margin-top: 20px;

@ -805,13 +805,12 @@ if (!empty($exerciseList)) {
$listExercise['id'] = $row['id'];
$listExercise['title'] = $title;
$listExercise['description'] = $row['description'];
$listExercise['url'] = "overview.php?".api_get_cidreq().$mylpid.$mylpitemid.'&exerciseId='.$row['id'];
$listExercise['lp_blocked'] = $lp_blocked;
$listExercise['visibility'] = $visibility;
$listExercise['active'] = $row['active'];
$item = Display::tag('td', $url.' '.$session_img.$lp_blocked);
// Count number exercise - teacher
@ -1093,7 +1092,6 @@ if (!empty($exerciseList)) {
} else {
$number_of_questions = $rowi;
}
$listExercise['number_questions'] = $number_of_questions;
$item .= Display::tag('td', $number_of_questions);
} else {

@ -1,46 +1,49 @@
{% block content %}
{% autoescape false %}
<ul class="list-group list-group-flush">
{% for item in data %}
<li class="list-group-item">
<div class="row">
<div class="col-md-5">
<h5>
<img src="{{ 'quiz.png'|icon(22) }}">
<a href="{{ item.url }}">
{{ item.title }}
</a>
</h5>
{% if item.description %}
<div class="description">
{{ item.description }}
</div>
{% endif %}
</div>
<div class="col-md-5">
<p>{{ 'Percentage of completion'|trans }}</p>
{% if item.score %}
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: {{ item.score.percentage }}%" aria-valuenow="{{ item.score.percentage }}" aria-valuemin="0" aria-valuemax="100">
{{ item.score.percentage }}%
<div class="list-exercise">
<ul class="list-group list-group-flush">
{% for item in data %}
<li class="list-group-item">
<div class="row">
<div class="col-md-5">
<h5>
<img src="{{ 'quiz.png'|icon(22) }}">
<a href="{{ item.url }}">
{{ item.title }}
</a>
</h5>
{% if item.description %}
<div class="description">
{{ item.description }}
</div>
</div>
{% endif %}
</div>
<div class="col-md-2">
{% if is_teacher %}
{{ item.actions }}
{% else %}
<p>{{ 'Latest Attempt'|trans }}</p>
<ul class="score-list">
<li>{{ 'Score obtained'|trans }} : {{ item.score.score_obtained }}</li>
<li>{{ 'Total score'|trans }} : {{ item.score.total_score }}</li>
</ul>
{% endif %}
{% endif %}
</div>
<div class="col-md-5">
<strong>{{ 'Quantity Questions'|trans }}:</strong> {{ item.number_questions }}
<p>{{ 'Percentage of completion'|trans }}</p>
{% if item.score %}
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: {{ item.score.percentage }}%" aria-valuenow="{{ item.score.percentage }}" aria-valuemin="0" aria-valuemax="100">
{{ item.score.percentage }}%
</div>
</div>
{% endif %}
</div>
<div class="col-md-2">
{% if is_teacher %}
{{ item.actions }}
{% else %}
<p>{{ 'Latest Attempt'|trans }}</p>
<ul class="score-list">
<li>{{ 'Score obtained'|trans }} : {{ item.score.score_obtained }}</li>
<li>{{ 'Total score'|trans }} : {{ item.score.total_score }}</li>
</ul>
{% endif %}
</div>
</div>
</div>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
{% endautoescape %}
{% endblock %}
Loading…
Cancel
Save