@@ -4,6 +4,7 @@ import styled from "styled-components"
44import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
55import { faPencilAlt as icon } from "@fortawesome/free-solid-svg-icons"
66import { OutboundLink } from "gatsby-plugin-google-analytics"
7+ import { get } from "lodash"
78
89import {
910 fetchProgrammingExerciseDetails ,
@@ -68,6 +69,18 @@ const StyledDivider = styled(Divider)`
6869 margin: 1rem 16px !important;
6970`
7071
72+ const PointsWrapper = styled . span `
73+ float: right;
74+ color: #45484b;
75+ `
76+
77+ const Small = styled . div `
78+ p {
79+ font-size: 0.9rem;
80+ color: #333;
81+ }
82+ `
83+
7184class ProgrammingExercise extends React . Component {
7285 static contextType = LoginStateContext
7386
@@ -156,6 +169,8 @@ class ProgrammingExercise extends React.Component {
156169 return < div > Loading</ div >
157170 }
158171
172+ const points = get ( this . state , "exerciseDetails.available_points.length" )
173+
159174 return (
160175 < ProgrammingExerciseWrapper
161176 id = { normalizeExerciseId ( `programming-exercise-${ name } ` ) }
@@ -164,11 +179,32 @@ class ProgrammingExercise extends React.Component {
164179 < StyledIcon icon = { icon } size = "1x" />
165180 < HeaderMuted > Tehtävä: </ HeaderMuted >
166181 { name }
182+ { points && points > 1 && (
183+ < PointsWrapper > { points } pisteen tehtävä</ PointsWrapper >
184+ ) }
167185 </ Header >
168186 < Body >
169187 < div >
170188 { this . context . loggedIn ? (
171189 < div >
190+ { points && points > 1 && (
191+ < Small >
192+ < p >
193+ Huom! Voit saada keskeneräisestä ratkaisusta osan tehtävän
194+ pisteistä käyttämällä NetBeansin "submit"-nappia.
195+ Lisätietoa ohjelmointitehtävien palautusohjeissa:{ " " }
196+ < OutboundLink
197+ href = "https://materiaalit.github.io/tmc-asennus/netbeans/"
198+ rel = "noopener noreferrer"
199+ target = "_blank"
200+ >
201+ ohjeet tehtävien palauttamiseen
202+ </ OutboundLink >
203+ .
204+ </ p >
205+ < StyledDivider />
206+ </ Small >
207+ ) }
172208 { children }
173209 { this . state . exerciseDetails === null && (
174210 < div > Error loading exercise details</ div >
@@ -200,7 +236,7 @@ class ProgrammingExercise extends React.Component {
200236 { this . state . exerciseDetails && (
201237 < Fragment >
202238 < p >
203- Palauta tehtävä palvelimelle tarkistettavaksi Netbeans
239+ Palauta tehtävä palvelimelle tarkistettavaksi NetBeans
204240 ohjelmointiympäristössä:{ " " }
205241 < OutboundLink
206242 href = "https://materiaalit.github.io/tmc-asennus/netbeans/"
0 commit comments